Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / kernel / trace / trace.c
index ae6fa2d1cdf7dd75dd7e9aa4cfb66bcb32192315..4d79485b3237597a3657b3f2b98b4fca1f40d3a6 100644 (file)
@@ -6216,10 +6216,15 @@ __init static int tracer_alloc_buffers(void)
 
        trace_init_cmdlines();
 
-       register_tracer(&nop_trace);
-
+       /*
+        * register_tracer() might reference current_trace, so it
+        * needs to be set before we register anything. This is
+        * just a bootstrap of current_trace anyway.
+        */
        global_trace.current_trace = &nop_trace;
 
+       register_tracer(&nop_trace);
+
        /* All seems OK, enable tracing */
        tracing_disabled = 0;