svn commit: r247793 - head/sys/kern

Davide Italiano davide at FreeBSD.org
Mon Mar 4 15:03:52 UTC 2013


Author: davide
Date: Mon Mar  4 15:03:52 2013
New Revision: 247793
URL: http://svnweb.freebsd.org/changeset/base/247793

Log:
  Fix build with DIAGNOSTIC/CALLOUT_PROFILING options turned on.
  
  Reported by:	kib, David Wolfskill <david at catwhisker dot org>
  Pointy-hat to:	davide

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==============================================================================
--- head/sys/kern/kern_timeout.c	Mon Mar  4 14:00:58 2013	(r247792)
+++ head/sys/kern/kern_timeout.c	Mon Mar  4 15:03:52 2013	(r247793)
@@ -601,7 +601,7 @@ softclock_call_cc(struct callout *c, str
 	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, str
 		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, str
 	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


More information about the svn-src-all mailing list