aboutsummaryrefslogtreecommitdiff
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2008-09-04 10:24:14 +0200
committerIngo Molnar <mingo@elte.hu>2008-10-14 10:36:45 +0200
commitf09ce573f57ddc35c67b39e51f34545877b30031 (patch)
tree776620a03aa55eecf5497b2a2a8027de6d819624 /kernel/trace/trace.c
parent5a90f577e5369a84b720ead42e621fcb1b8a8b21 (diff)
ftrace: make ftrace_printk usable with the other tracers
Currently ftrace_printk only works with the ftrace tracer, switch it to an iter_ctrl setting so we can make us of them with other tracers too. [rostedt@redhat.com: tweak to the disable condition] Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index d24101cfc42..8a00d6c5c0f 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -235,6 +235,7 @@ static const char *trace_options[] = {
"block",
"stacktrace",
"sched-tree",
+ "ftrace_printk",
NULL
};
@@ -3091,9 +3092,10 @@ static __init void tracer_init_debugfs(void)
int __ftrace_printk(unsigned long ip, const char *fmt, ...)
{
- struct trace_array *tr = &global_trace;
static DEFINE_SPINLOCK(trace_buf_lock);
static char trace_buf[TRACE_BUF_SIZE];
+
+ struct trace_array *tr = &global_trace;
struct trace_array_cpu *data;
struct trace_entry *entry;
unsigned long flags;
@@ -3101,7 +3103,7 @@ int __ftrace_printk(unsigned long ip, const char *fmt, ...)
va_list ap;
int cpu, len = 0, write, written = 0;
- if (likely(!ftrace_function_enabled))
+ if (!(trace_flags & TRACE_ITER_PRINTK) || !tr->ctrl || tracing_disabled)
return 0;
local_irq_save(flags);
@@ -3109,7 +3111,7 @@ int __ftrace_printk(unsigned long ip, const char *fmt, ...)
data = tr->data[cpu];
disabled = atomic_inc_return(&data->disabled);
- if (unlikely(disabled != 1 || !ftrace_function_enabled))
+ if (unlikely(disabled != 1))
goto out;
spin_lock(&trace_buf_lock);