Merge tag 'staging-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[firefly-linux-kernel-4.4.55.git] / kernel / trace / trace.c
index a120f98c4112c15b5d6febf78674c00ec459e18d..5c38c81496ceb7d3b6b1e1aa457a2cf0c5752c52 100644 (file)
@@ -3187,10 +3187,10 @@ static int tracing_set_tracer(const char *buf)
        }
        destroy_trace_option_files(topts);
 
-       current_trace = t;
+       current_trace = &nop_trace;
 
-       topts = create_trace_option_files(current_trace);
-       if (current_trace->use_max_tr) {
+       topts = create_trace_option_files(t);
+       if (t->use_max_tr) {
                int cpu;
                /* we need to make per cpu buffer sizes equivalent */
                for_each_tracing_cpu(cpu) {
@@ -3210,6 +3210,7 @@ static int tracing_set_tracer(const char *buf)
                        goto out;
        }
 
+       current_trace = t;
        trace_branch_enable(tr);
  out:
        mutex_unlock(&trace_types_lock);