diff options
Diffstat (limited to 'freebsd/sys/sys/lockstat.h')
-rw-r--r-- | freebsd/sys/sys/lockstat.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/freebsd/sys/sys/lockstat.h b/freebsd/sys/sys/lockstat.h index 1fc79ffe..705f3bb5 100644 --- a/freebsd/sys/sys/lockstat.h +++ b/freebsd/sys/sys/lockstat.h @@ -68,7 +68,7 @@ SDT_PROBE_DECLARE(lockstat, , , thread__spin); #define LOCKSTAT_WRITER 0 #define LOCKSTAT_READER 1 -extern int lockstat_enabled; +extern volatile int lockstat_enabled; #ifdef KDTRACE_HOOKS @@ -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,6 +137,12 @@ 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 */ + #endif /* _KERNEL */ #endif /* _SYS_LOCKSTAT_H */ |