summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_clocksource.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_clocksource.c')
-rw-r--r--sys/kern/kern_clocksource.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sys/kern/kern_clocksource.c b/sys/kern/kern_clocksource.c
index 6fd40a8..33f21e9 100644
--- a/sys/kern/kern_clocksource.c
+++ b/sys/kern/kern_clocksource.c
@@ -732,12 +732,15 @@ cpu_startprofclock(void)
{
ET_LOCK();
- if (periodic) {
- configtimer(0);
- profiling = 1;
- configtimer(1);
+ if (profiling == 0) {
+ if (periodic) {
+ configtimer(0);
+ profiling = 1;
+ configtimer(1);
+ } else
+ profiling = 1;
} else
- profiling = 1;
+ profiling++;
ET_UNLOCK();
}
@@ -749,12 +752,15 @@ cpu_stopprofclock(void)
{
ET_LOCK();
- if (periodic) {
- configtimer(0);
+ if (profiling == 1) {
+ if (periodic) {
+ configtimer(0);
+ profiling = 0;
+ configtimer(1);
+ } else
profiling = 0;
- configtimer(1);
} else
- profiling = 0;
+ profiling--;
ET_UNLOCK();
}
OpenPOWER on IntegriCloud