aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 396fda034e3f..16892121cb7c 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -532,6 +532,13 @@ int register_tracer(struct tracer *type)
532 } 532 }
533 533
534#ifdef CONFIG_FTRACE_STARTUP_TEST 534#ifdef CONFIG_FTRACE_STARTUP_TEST
535 /*
536 * When this gets called we hold the BKL which means that preemption
537 * is disabled. Various trace selftests however need to disable
538 * and enable preemption for successful tests. So we drop the BKL here
539 * and grab it after the tests again.
540 */
541 unlock_kernel();
535 if (type->selftest) { 542 if (type->selftest) {
536 struct tracer *saved_tracer = current_trace; 543 struct tracer *saved_tracer = current_trace;
537 struct trace_array *tr = &global_trace; 544 struct trace_array *tr = &global_trace;
@@ -562,6 +569,7 @@ int register_tracer(struct tracer *type)
562 } 569 }
563 printk(KERN_CONT "PASSED\n"); 570 printk(KERN_CONT "PASSED\n");
564 } 571 }
572 lock_kernel();
565#endif 573#endif
566 574
567 type->next = trace_types; 575 type->next = trace_types;