aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/lockstat.h
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2015-07-18 00:22:00 +0000
committerMark Johnston <markj@FreeBSD.org>2015-07-18 00:22:00 +0000
commitefe8b26b82a7fc541e2f6a112ce34bf7a3d84973 (patch)
tree298c04314a37eabda9a60c929317ede1dd060c25 /sys/sys/lockstat.h
parenteacbeb2b95479a6088b30506f399dc48755408ba (diff)
downloadsrc-efe8b26b82a7fc541e2f6a112ce34bf7a3d84973.tar.gz
src-efe8b26b82a7fc541e2f6a112ce34bf7a3d84973.zip
Modify lockstat_nsecs() to just return unless lockstat probes are actually
enabled. The cost of a timecounter read can be quite significant, and the problem became more apparent after r284297, since that change resulted in a call to lockstat_nsecs() for each acquisition of an rwlock read lock. PR: 201642 Reviewed by: avg Tested by: Jason Unovitch MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D3073
Notes
Notes: svn path=/head/; revision=285663
Diffstat (limited to 'sys/sys/lockstat.h')
-rw-r--r--sys/sys/lockstat.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/lockstat.h b/sys/sys/lockstat.h
index 2a7853fb95bf..b550e8d27c34 100644
--- a/sys/sys/lockstat.h
+++ b/sys/sys/lockstat.h
@@ -154,6 +154,7 @@ typedef void (*lockstat_probe_func_t)(uint32_t, uintptr_t arg0, uintptr_t arg1,
uintptr_t arg2, uintptr_t arg3, uintptr_t arg4);
extern lockstat_probe_func_t lockstat_probe_func;
extern uint64_t lockstat_nsecs(void);
+extern int lockstat_enabled;
#ifdef KDTRACE_HOOKS
/*