Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152991298
D3073.id7062.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3073.id7062.diff
View Options
Index: head/sys/cddl/dev/lockstat/lockstat.c
===================================================================
--- head/sys/cddl/dev/lockstat/lockstat.c
+++ head/sys/cddl/dev/lockstat/lockstat.c
@@ -159,6 +159,8 @@
ASSERT(!lockstat_probemap[probe->lsp_probe]);
+ lockstat_enabled++;
+
lockstat_probemap[probe->lsp_probe] = id;
#ifdef DOODAD
membar_producer();
@@ -182,6 +184,8 @@
ASSERT(lockstat_probemap[probe->lsp_probe]);
+ lockstat_enabled--;
+
lockstat_probemap[probe->lsp_probe] = 0;
#ifdef DOODAD
lockstat_hot_patch();
Index: head/sys/kern/kern_lockstat.c
===================================================================
--- head/sys/kern/kern_lockstat.c
+++ head/sys/kern/kern_lockstat.c
@@ -45,7 +45,7 @@
uint32_t lockstat_probemap[LS_NPROBES];
void (*lockstat_probe_func)(uint32_t, uintptr_t, uintptr_t,
uintptr_t, uintptr_t, uintptr_t);
-
+int lockstat_enabled = 0;
uint64_t
lockstat_nsecs(void)
@@ -53,6 +53,9 @@
struct bintime bt;
uint64_t ns;
+ if (!lockstat_enabled)
+ return (0);
+
binuptime(&bt);
ns = bt.sec * (uint64_t)1000000000;
ns += ((uint64_t)1000000000 * (uint32_t)(bt.frac >> 32)) >> 32;
Index: head/sys/sys/lockstat.h
===================================================================
--- head/sys/sys/lockstat.h
+++ head/sys/sys/lockstat.h
@@ -154,6 +154,7 @@
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
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 19, 12:32 PM (9 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31725735
Default Alt Text
D3073.id7062.diff (1 KB)
Attached To
Mode
D3073: lockstat: only fetch the uptime if probes are enabled
Attached
Detach File
Event Timeline
Log In to Comment