aboutsummaryrefslogtreecommitdiff
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 396fda034e3..16892121cb7 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -532,6 +532,13 @@ int register_tracer(struct tracer *type)
}
#ifdef CONFIG_FTRACE_STARTUP_TEST
+ /*
+ * When this gets called we hold the BKL which means that preemption
+ * is disabled. Various trace selftests however need to disable
+ * and enable preemption for successful tests. So we drop the BKL here
+ * and grab it after the tests again.
+ */
+ unlock_kernel();
if (type->selftest) {
struct tracer *saved_tracer = current_trace;
struct trace_array *tr = &global_trace;
@@ -562,6 +569,7 @@ int register_tracer(struct tracer *type)
}
printk(KERN_CONT "PASSED\n");
}
+ lock_kernel();
#endif
type->next = trace_types;