Skip to contentSkip to conversation

tracing/ftrace: Fix a bug when switch current tracer

PATCH RESEND Superseded Frederic Weisbecker 1 participant 1 message Oct 22, 2008 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 tracing/ftrace: Fix a bug when switch current tracer

Fix a bug that made the sched_switch tracer unable to run if set as the current_tracer after the boot tracer.

---
 kernel/trace/trace_boot.c         |    4 ++--
 kernel/trace/trace_sched_switch.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
kernel/trace/trace_boot.c +2 -2
index 6bbc879..bd5046c 100644
@@ -37,9 +37,9 @@ void disable_boot_trace(void)
 		tracing_stop_cmdline_record();
 }
 
-void reset_boot_trace(struct trace_array *tr)
+static void reset_boot_trace(struct trace_array *tr)
 {
-	disable_boot_trace();
+	sched_switch_trace.reset(tr);
 }
 
 static void boot_trace_init(struct trace_array *tr)
(quoted diff) +0 -0

b/kernel/trace/trace_sched_switch.c
index 969953b..888944d 100644

kernel/trace/trace_sched_switch.c +1 -1
@@ -173,7 +173,7 @@ static void sched_switch_trace_init(struct trace_array *tr)
 
 static void sched_switch_trace_reset(struct trace_array *tr)
 {
-	if (tr->ctrl)
+	if (tr->ctrl && sched_ref)
 		stop_sched_trace(tr);
 }