summaryrefslogtreecommitdiff
path: root/kernel/trace/trace_sched_switch.c
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-05-22 11:49:22 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-26 22:51:49 +0200
commit41bc8144d02028133bcd1d545023c6f49e8b2411 (patch)
tree382a6bbd0560df129c27b490aca36404edd7b19a /kernel/trace/trace_sched_switch.c
parent41c52c0db9607e59f90da7da5309489fa06e887f (diff)
downloadlwn-41bc8144d02028133bcd1d545023c6f49e8b2411.tar.gz
lwn-41bc8144d02028133bcd1d545023c6f49e8b2411.zip
ftrace: fix up cmdline recording
The new work with converting the trace hooks over to markers broke the command line recording of ftrace. This patch fixes it again. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/trace/trace_sched_switch.c')
-rw-r--r--kernel/trace/trace_sched_switch.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c
index 798ec0dc863c..c16935d3bc5c 100644
--- a/kernel/trace/trace_sched_switch.c
+++ b/kernel/trace/trace_sched_switch.c
@@ -29,6 +29,9 @@ sched_switch_func(void *private, void *__rq, struct task_struct *prev,
long disabled;
int cpu;
+ tracing_record_cmdline(prev);
+ tracing_record_cmdline(next);
+
if (!tracer_enabled)
return;
@@ -63,8 +66,6 @@ sched_switch_callback(void *probe_data, void *call_data,
prev = va_arg(*args, typeof(prev));
next = va_arg(*args, typeof(next));
- tracing_record_cmdline(prev);
-
/*
* If tracer_switch_func only points to the local
* switch func, it still needs the ptr passed to it.
@@ -213,18 +214,26 @@ void tracing_stop_sched_switch(void)
tracing_sched_unregister();
}
+void tracing_start_cmdline_record(void)
+{
+ tracing_start_sched_switch();
+}
+
+void tracing_stop_cmdline_record(void)
+{
+ tracing_stop_sched_switch();
+}
+
static void start_sched_trace(struct trace_array *tr)
{
sched_switch_reset(tr);
- atomic_inc(&trace_record_cmdline_enabled);
tracer_enabled = 1;
- tracing_start_sched_switch();
+ tracing_start_cmdline_record();
}
static void stop_sched_trace(struct trace_array *tr)
{
- tracing_stop_sched_switch();
- atomic_dec(&trace_record_cmdline_enabled);
+ tracing_stop_cmdline_record();
tracer_enabled = 0;
}