FreeBSD Bugzilla – Attachment 158785 Details for
Bug 201517
Kernel hang on boot with KDTRACE_HOOKS enabled after r284998
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
suggested patch
lockstat_flag.diff (text/plain), 1.67 KB, created by
Mark Johnston
on 2015-07-15 03:56:23 UTC
(
hide
)
Description:
suggested patch
Filename:
MIME Type:
Creator:
Mark Johnston
Created:
2015-07-15 03:56:23 UTC
Size:
1.67 KB
patch
obsolete
>diff --git a/sys/cddl/dev/lockstat/lockstat.c b/sys/cddl/dev/lockstat/lockstat.c >index 71a8632..a6cabc8 100644 >--- a/sys/cddl/dev/lockstat/lockstat.c >+++ b/sys/cddl/dev/lockstat/lockstat.c >@@ -159,6 +159,8 @@ lockstat_enable(void *arg, dtrace_id_t id, void *parg) > > ASSERT(!lockstat_probemap[probe->lsp_probe]); > >+ lockstat_enabled++; >+ > lockstat_probemap[probe->lsp_probe] = id; > #ifdef DOODAD > membar_producer(); >@@ -182,6 +184,8 @@ lockstat_disable(void *arg, dtrace_id_t id, void *parg) > > ASSERT(lockstat_probemap[probe->lsp_probe]); > >+ lockstat_enabled--; >+ > lockstat_probemap[probe->lsp_probe] = 0; > #ifdef DOODAD > lockstat_hot_patch(); >diff --git a/sys/kern/kern_lockstat.c b/sys/kern/kern_lockstat.c >index 1c77312..eb7e177 100644 >--- a/sys/kern/kern_lockstat.c >+++ b/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 @@ lockstat_nsecs(void) > 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; >diff --git a/sys/sys/lockstat.h b/sys/sys/lockstat.h >index 2a7853f..b550e8d 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 > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 201517
: 158785