diff options
author | Steven Rostedt <srostedt@srostedt@redhat.com> | 2008-05-12 15:20:49 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-23 14:55:55 -0400 |
commit | 6fb44b717c10ecf37beaaebd312f3afa93fed714 (patch) | |
tree | a86ec44e761ac9ea2cae992fb6351cbfbea434ac /kernel/trace/trace_sched_wakeup.c | |
parent | 2a2cc8f7c4d0dfd75720867f7dc58d24f075edfc (diff) |
ftrace: add trace_function api for other tracers to use
A new check was added in the ftrace function that wont trace if the CPU
trace buffer is disabled. Unfortunately, other tracers used ftrace() to
write to the buffer after they disabled it. The new disable check makes
these calls into a nop.
This patch changes the __ftrace that is called without the check into a
new api for the other tracers to use, called "trace_function". The other
tracers use this interface instead when the trace CPU buffer is already
disabled.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/trace/trace_sched_wakeup.c')
-rw-r--r-- | kernel/trace/trace_sched_wakeup.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c index b7df825c3af9..3549e4154f1f 100644 --- a/kernel/trace/trace_sched_wakeup.c +++ b/kernel/trace/trace_sched_wakeup.c | |||
@@ -85,7 +85,7 @@ wakeup_sched_switch(struct task_struct *prev, struct task_struct *next) | |||
85 | if (unlikely(!tracer_enabled || next != wakeup_task)) | 85 | if (unlikely(!tracer_enabled || next != wakeup_task)) |
86 | goto out_unlock; | 86 | goto out_unlock; |
87 | 87 | ||
88 | ftrace(tr, data, CALLER_ADDR1, CALLER_ADDR2, flags); | 88 | trace_function(tr, data, CALLER_ADDR1, CALLER_ADDR2, flags); |
89 | 89 | ||
90 | /* | 90 | /* |
91 | * usecs conversion is slow so we try to delay the conversion | 91 | * usecs conversion is slow so we try to delay the conversion |
@@ -192,7 +192,8 @@ wakeup_check_start(struct trace_array *tr, struct task_struct *p, | |||
192 | local_save_flags(flags); | 192 | local_save_flags(flags); |
193 | 193 | ||
194 | tr->data[wakeup_cpu]->preempt_timestamp = ftrace_now(cpu); | 194 | tr->data[wakeup_cpu]->preempt_timestamp = ftrace_now(cpu); |
195 | ftrace(tr, tr->data[wakeup_cpu], CALLER_ADDR1, CALLER_ADDR2, flags); | 195 | trace_function(tr, tr->data[wakeup_cpu], |
196 | CALLER_ADDR1, CALLER_ADDR2, flags); | ||
196 | 197 | ||
197 | out_locked: | 198 | out_locked: |
198 | spin_unlock(&wakeup_lock); | 199 | spin_unlock(&wakeup_lock); |