aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/lockstat.h
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2018-02-17 12:07:09 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2018-02-17 12:07:09 +0000
commite4ccf57fdc5bfa5b6f5e362c738d2e0330ea25d8 (patch)
tree709485bb573f068509bbcb2810d84342648c1c21 /sys/sys/lockstat.h
parentad58e5e86c78c97275f1c47c75b66e20d6250144 (diff)
downloadsrc-e4ccf57fdc5bfa5b6f5e362c738d2e0330ea25d8.tar.gz
src-e4ccf57fdc5bfa5b6f5e362c738d2e0330ea25d8.zip
Undo LOCK_PROFILING pessimisation after r313454 and r313455
With the option used to compile the kernel both sx and rw shared ops would always go to the slow path which added avoidable overhead even when the facility is disabled. Furthermore the increased time spent doing uncontested shared lock acquire would be bogusly added to total wait time, somewhat skewing the results. Restore old behaviour of going there only when profiling is enabled. This change is a no-op for kernels without LOCK_PROFILING (which is the default).
Notes
Notes: svn path=/head/; revision=329451
Diffstat (limited to 'sys/sys/lockstat.h')
-rw-r--r--sys/sys/lockstat.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/sys/sys/lockstat.h b/sys/sys/lockstat.h
index 50747e89ccf4..6167a7d15e9a 100644
--- a/sys/sys/lockstat.h
+++ b/sys/sys/lockstat.h
@@ -109,12 +109,7 @@ extern volatile 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 *);
@@ -139,10 +134,7 @@ uint64_t lockstat_nsecs(struct lock_object *);
#define LOCKSTAT_PROFILE_RELEASE_RWLOCK(probe, lp, a) \
LOCKSTAT_PROFILE_RELEASE_LOCK(probe, lp)
-#ifndef LOCK_PROFILING
#define LOCKSTAT_PROFILE_ENABLED(probe) 0
-#endif
-#define LOCKSTAT_OOL_PROFILE_ENABLED(probe) 1
#endif /* !KDTRACE_HOOKS */