diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-12-14 17:12:37 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-14 17:12:37 +0100 |
commit | 0087aabd6a3744c28114240776918f5d15e46b98 (patch) | |
tree | 8bf3ba7b3395490441722360d2872480f64cd694 /kernel | |
parent | Merge branch 'linus' into tracing/urgent (diff) | |
parent | tracing: Add stack trace to irqsoff tracer (diff) | |
download | linux-0087aabd6a3744c28114240776918f5d15e46b98.tar.xz linux-0087aabd6a3744c28114240776918f5d15e46b98.zip |
Merge branch 'tip/tracing/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/urgent
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace.c | 16 | ||||
-rw-r--r-- | kernel/trace/trace_irqsoff.c | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 05076008f371..bd7b969a729a 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1150,6 +1150,22 @@ void __trace_stack(struct trace_array *tr, unsigned long flags, int skip, __ftrace_trace_stack(tr->buffer, flags, skip, pc); } +/** + * trace_dump_stack - record a stack back trace in the trace buffer + */ +void trace_dump_stack(void) +{ + unsigned long flags; + + if (tracing_disabled || tracing_selftest_running) + return 0; + + local_save_flags(flags); + + /* skipping 3 traces, seems to get us at the caller of this function */ + __ftrace_trace_stack(global_trace.buffer, flags, 3, preempt_count()); +} + void ftrace_trace_userstack(struct ring_buffer *buffer, unsigned long flags, int pc) { diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c index 3aa7eaa2114c..2974bc7538c7 100644 --- a/kernel/trace/trace_irqsoff.c +++ b/kernel/trace/trace_irqsoff.c @@ -151,6 +151,8 @@ check_critical_timing(struct trace_array *tr, goto out_unlock; trace_function(tr, CALLER_ADDR0, parent_ip, flags, pc); + /* Skip 5 functions to get to the irq/preempt enable function */ + __trace_stack(tr, flags, 5, pc); if (data->critical_sequence != max_sequence) goto out_unlock; |