summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sx.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2009-03-15 08:03:54 +0000
committerjeff <jeff@FreeBSD.org>2009-03-15 08:03:54 +0000
commit9fedeedb8d3b7b5964f22521c2fa9bf23fcfa02d (patch)
treed7be9c96e5a5079b2c9fae273c6023bcf3781b8d /sys/kern/kern_sx.c
parentee1ec823f64df1e1cbfad16666bceeb4419bfa25 (diff)
downloadFreeBSD-src-9fedeedb8d3b7b5964f22521c2fa9bf23fcfa02d.zip
FreeBSD-src-9fedeedb8d3b7b5964f22521c2fa9bf23fcfa02d.tar.gz
- Wrap lock profiling state variables in #ifdef LOCK_PROFILING blocks.
Diffstat (limited to 'sys/kern/kern_sx.c')
-rw-r--r--sys/kern/kern_sx.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c
index e1e34ec..9a2c9a2 100644
--- a/sys/kern/kern_sx.c
+++ b/sys/kern/kern_sx.c
@@ -431,9 +431,12 @@ _sx_xlock_hard(struct sx *sx, uintptr_t tid, int opts, const char *file,
#ifdef ADAPTIVE_SX
volatile struct thread *owner;
#endif
- uint64_t waittime = 0;
uintptr_t x;
- int contested = 0, error = 0;
+#ifdef LOCK_PROFILING
+ uint64_t waittime = 0;
+ int contested = 0;
+#endif
+ int error = 0;
/* If we already hold an exclusive lock, then recurse. */
if (sx_xlocked(sx)) {
@@ -652,8 +655,10 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line)
#ifdef ADAPTIVE_SX
volatile struct thread *owner;
#endif
+#ifdef LOCK_PROFILING
uint64_t waittime = 0;
int contested = 0;
+#endif
uintptr_t x;
int error = 0;
OpenPOWER on IntegriCloud