svn commit: r313874 - head/sys/sys

Mateusz Guzik mjg at FreeBSD.org
Fri Feb 17 14:05:58 UTC 2017


Author: mjg
Date: Fri Feb 17 14:05:57 2017
New Revision: 313874
URL: https://svnweb.freebsd.org/changeset/base/313874

Log:
  Make inline lockstat checks just inspect lockstat_enabled
  
  There is no correctness issue and this lets the kernel just test one typically
  false variable.

Modified:
  head/sys/sys/lockstat.h

Modified: head/sys/sys/lockstat.h
==============================================================================
--- head/sys/sys/lockstat.h	Fri Feb 17 13:49:46 2017	(r313873)
+++ head/sys/sys/lockstat.h	Fri Feb 17 14:05:57 2017	(r313874)
@@ -107,6 +107,13 @@ extern int lockstat_enabled;
 	LOCKSTAT_RECORD1(probe, lp, a);					\
 } while (0)
 
+#ifndef LOCK_PROFILING
+#define	LOCKSTAT_PROFILE_ENABLED(probe)		__predict_false(lockstat_enabled)
+#define	LOCKSTAT_OOL_PROFILE_ENABLED(probe)	LOCKSTAT_PROFILE_ENABLED(probe)
+#else
+#define	LOCKSTAT_OOL_PROFILE_ENABLED(probe)	1
+#endif
+
 struct lock_object;
 uint64_t lockstat_nsecs(struct lock_object *);
 
@@ -130,16 +137,12 @@ uint64_t lockstat_nsecs(struct lock_obje
 #define	LOCKSTAT_PROFILE_RELEASE_RWLOCK(probe, lp, a)  			\
 	LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp)
 
-#endif /* !KDTRACE_HOOKS */
-
 #ifndef LOCK_PROFILING
-#define	LOCKSTAT_PROFILE_ENABLED(probe)					\
-	SDT_PROBE_ENABLED(lockstat, , , probe)
-#define	LOCKSTAT_OOL_PROFILE_ENABLED(probe)				\
-	SDT_PROBE_ENABLED(lockstat, , , probe)
-#else
-#define	LOCKSTAT_OOL_PROFILE_ENABLED(probe)	1
+#define	LOCKSTAT_PROFILE_ENABLED(probe)		0
 #endif
+#define	LOCKSTAT_OOL_PROFILE_ENABLED(probe)	1
+
+#endif /* !KDTRACE_HOOKS */
 
 #endif /* _KERNEL */
 #endif /* _SYS_LOCKSTAT_H */


More information about the svn-src-head mailing list