aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@srostedt@redhat.com>2008-05-12 15:20:49 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 14:55:55 -0400
commit6fb44b717c10ecf37beaaebd312f3afa93fed714 (patch)
treea86ec44e761ac9ea2cae992fb6351cbfbea434ac /kernel/trace/trace.c
parent2a2cc8f7c4d0dfd75720867f7dc58d24f075edfc (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.c')
-rw-r--r--kernel/trace/trace.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index d041578affd0..9022c357032a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -641,8 +641,8 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags)
641} 641}
642 642
643notrace void 643notrace void
644__ftrace(struct trace_array *tr, struct trace_array_cpu *data, 644trace_function(struct trace_array *tr, struct trace_array_cpu *data,
645 unsigned long ip, unsigned long parent_ip, unsigned long flags) 645 unsigned long ip, unsigned long parent_ip, unsigned long flags)
646{ 646{
647 struct trace_entry *entry; 647 struct trace_entry *entry;
648 unsigned long irq_flags; 648 unsigned long irq_flags;
@@ -664,7 +664,7 @@ ftrace(struct trace_array *tr, struct trace_array_cpu *data,
664 unsigned long ip, unsigned long parent_ip, unsigned long flags) 664 unsigned long ip, unsigned long parent_ip, unsigned long flags)
665{ 665{
666 if (likely(!atomic_read(&data->disabled))) 666 if (likely(!atomic_read(&data->disabled)))
667 __ftrace(tr, data, ip, parent_ip, flags); 667 trace_function(tr, data, ip, parent_ip, flags);
668} 668}
669 669
670notrace void 670notrace void
@@ -730,7 +730,7 @@ function_trace_call(unsigned long ip, unsigned long parent_ip)
730 disabled = atomic_inc_return(&data->disabled); 730 disabled = atomic_inc_return(&data->disabled);
731 731
732 if (likely(disabled == 1)) 732 if (likely(disabled == 1))
733 __ftrace(tr, data, ip, parent_ip, flags); 733 trace_function(tr, data, ip, parent_ip, flags);
734 734
735 atomic_dec(&data->disabled); 735 atomic_dec(&data->disabled);
736 local_irq_restore(flags); 736 local_irq_restore(flags);