diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -461,9 +461,9 @@ u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; + uintptr_t state = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - uintptr_t state = 0; int doing_lockprof = 0; #endif @@ -473,12 +473,11 @@ goto out_lockstat; doing_lockprof = 1; all_time -= lockstat_nsecs(&rw->lock_object); - state = v; } + state = v; #endif #ifdef LOCK_PROFILING doing_lockprof = 1; - state = v; #endif if (SCHEDULER_STOPPED()) @@ -936,9 +935,9 @@ u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; + uintptr_t state = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - uintptr_t state = 0; int doing_lockprof = 0; #endif int extra_work = 0; @@ -955,13 +954,12 @@ extra_work = 1; doing_lockprof = 1; all_time -= lockstat_nsecs(&rw->lock_object); - state = v; } + state = v; #endif #ifdef LOCK_PROFILING extra_work = 1; doing_lockprof = 1; - state = v; #endif if (SCHEDULER_STOPPED()) diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -582,9 +582,9 @@ u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; + uintptr_t state = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - uintptr_t state = 0; int doing_lockprof = 0; #endif int extra_work = 0; @@ -600,13 +600,12 @@ extra_work = 1; doing_lockprof = 1; all_time -= lockstat_nsecs(&sx->lock_object); - state = x; } + state = x; #endif #ifdef LOCK_PROFILING extra_work = 1; doing_lockprof = 1; - state = x; #endif if (SCHEDULER_STOPPED()) @@ -1034,8 +1033,6 @@ u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; -#endif -#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) uintptr_t state = 0; #endif int extra_work __sdt_used = 0; @@ -1048,12 +1045,11 @@ goto out_lockstat; extra_work = 1; all_time -= lockstat_nsecs(&sx->lock_object); - state = x; } + state = x; #endif #ifdef LOCK_PROFILING extra_work = 1; - state = x; #endif if (SCHEDULER_STOPPED())