diff options
author | davide <davide@FreeBSD.org> | 2013-03-04 15:03:52 +0000 |
---|---|---|
committer | davide <davide@FreeBSD.org> | 2013-03-04 15:03:52 +0000 |
commit | 2ca848c3f6d41f466c5bacf9f67c57da0c0764e2 (patch) | |
tree | 90526da6b761b5ff2ccdcd8b17ab3dcab520ba98 /sys/kern/kern_timeout.c | |
parent | c3613bbf4032390e36e11642abe61f25bb32be80 (diff) | |
download | FreeBSD-src-2ca848c3f6d41f466c5bacf9f67c57da0c0764e2.zip FreeBSD-src-2ca848c3f6d41f466c5bacf9f67c57da0c0764e2.tar.gz |
Fix build with DIAGNOSTIC/CALLOUT_PROFILING options turned on.
Reported by: kib, David Wolfskill <david at catwhisker dot org>
Pointy-hat to: davide
Diffstat (limited to 'sys/kern/kern_timeout.c')
-rw-r--r-- | sys/kern/kern_timeout.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 0787c01..26dc2d8 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -601,7 +601,7 @@ softclock_call_cc(struct callout *c, struct callout_cpu *cc, sbintime_t new_time; #endif #if defined(DIAGNOSTIC) || defined(CALLOUT_PROFILING) - sbintime_t bt1, bt2; + sbintime_t sbt1, sbt2; struct timespec ts2; static sbintime_t maxdt = 2 * SBT_1MS; /* 2 msec */ static timeout_t *lastfunc; @@ -655,7 +655,7 @@ softclock_call_cc(struct callout *c, struct callout_cpu *cc, CTR3(KTR_CALLOUT, "callout %p func %p arg %p", c, c_func, c_arg); } -#ifdef DIAGNOSTIC +#if defined(DIAGNOSTIC) || defined(CALLOUT_PROFILING) sbt1 = sbinuptime(); #endif THREAD_NO_SLEEPING(); @@ -663,17 +663,17 @@ softclock_call_cc(struct callout *c, struct callout_cpu *cc, c_func(c_arg); SDT_PROBE(callout_execute, kernel, , callout_end, c, 0, 0, 0, 0); THREAD_SLEEPING_OK(); -#ifdef DIAGNOSTIC - bt2 = sbinuptime(); - bt2 -= bt1; - if (bt2 > maxdt) { - if (lastfunc != c_func || bt2 > maxdt * 2) { - ts2 = sbttots(bt2); +#if defined(DIAGNOSTIC) || defined(CALLOUT_PROFILING) + sbt2 = sbinuptime(); + sbt2 -= sbt1; + if (sbt2 > maxdt) { + if (lastfunc != c_func || sbt2 > maxdt * 2) { + ts2 = sbttots(sbt2); printf( "Expensive timeout(9) function: %p(%p) %jd.%09ld s\n", c_func, c_arg, (intmax_t)ts2.tv_sec, ts2.tv_nsec); } - maxdt = bt2; + maxdt = sbt2; lastfunc = c_func; } #endif |