aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/lockstat.h
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2017-02-17 14:05:57 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2017-02-17 14:05:57 +0000
commit57abbcd5ad527c7a5f6dc70ab7e03d821a32640c (patch)
tree94d3c4d74e9a933734aa8096661084fdb561e682 /sys/sys/lockstat.h
parentd98d2303788fd8b3d7c157ef74b6f1ca75b50082 (diff)
downloadsrc-57abbcd5ad527c7a5f6dc70ab7e03d821a32640c.tar.gz
src-57abbcd5ad527c7a5f6dc70ab7e03d821a32640c.zip
Make inline lockstat checks just inspect lockstat_enabled
There is no correctness issue and this lets the kernel just test one typically false variable.
Notes
Notes: svn path=/head/; revision=313874
Diffstat (limited to 'sys/sys/lockstat.h')
-rw-r--r--sys/sys/lockstat.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/sys/lockstat.h b/sys/sys/lockstat.h
index 6183bc7c9150..77294fb356af 100644
--- a/sys/sys/lockstat.h
+++ b/sys/sys/lockstat.h
@@ -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_object *);
#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 */