diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 7daf372e319a..0418e2650d41 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -641,13 +641,26 @@ void unregister_tracer(struct tracer *type) | |||
641 | mutex_unlock(&trace_types_lock); | 641 | mutex_unlock(&trace_types_lock); |
642 | } | 642 | } |
643 | 643 | ||
644 | void tracing_reset(struct trace_array *tr, int cpu) | 644 | static void __tracing_reset(struct trace_array *tr, int cpu) |
645 | { | 645 | { |
646 | ftrace_disable_cpu(); | 646 | ftrace_disable_cpu(); |
647 | ring_buffer_reset_cpu(tr->buffer, cpu); | 647 | ring_buffer_reset_cpu(tr->buffer, cpu); |
648 | ftrace_enable_cpu(); | 648 | ftrace_enable_cpu(); |
649 | } | 649 | } |
650 | 650 | ||
651 | void tracing_reset(struct trace_array *tr, int cpu) | ||
652 | { | ||
653 | struct ring_buffer *buffer = tr->buffer; | ||
654 | |||
655 | ring_buffer_record_disable(buffer); | ||
656 | |||
657 | /* Make sure all commits have finished */ | ||
658 | synchronize_sched(); | ||
659 | __tracing_reset(tr, cpu); | ||
660 | |||
661 | ring_buffer_record_enable(buffer); | ||
662 | } | ||
663 | |||
651 | void tracing_reset_online_cpus(struct trace_array *tr) | 664 | void tracing_reset_online_cpus(struct trace_array *tr) |
652 | { | 665 | { |
653 | struct ring_buffer *buffer = tr->buffer; | 666 | struct ring_buffer *buffer = tr->buffer; |
@@ -661,7 +674,7 @@ void tracing_reset_online_cpus(struct trace_array *tr) | |||
661 | tr->time_start = ftrace_now(tr->cpu); | 674 | tr->time_start = ftrace_now(tr->cpu); |
662 | 675 | ||
663 | for_each_online_cpu(cpu) | 676 | for_each_online_cpu(cpu) |
664 | tracing_reset(tr, cpu); | 677 | __tracing_reset(tr, cpu); |
665 | 678 | ||
666 | ring_buffer_record_enable(buffer); | 679 | ring_buffer_record_enable(buffer); |
667 | } | 680 | } |