diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-28 15:21:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-28 15:21:10 -0500 |
commit | b0f4b285d7ed174804658539129a834270f4829a (patch) | |
tree | be7f8dca58075aba2c6a137fcfd4d44c5c333efc /arch/x86/kernel/dumpstack.c | |
parent | be9c5ae4eeec2e85527e95647348b8ea4eb25128 (diff) | |
parent | 5250d329e38cdf7580faeb9c53c17d3588d7d19c (diff) |
Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (241 commits)
sched, trace: update trace_sched_wakeup()
tracing/ftrace: don't trace on early stage of a secondary cpu boot, v3
Revert "x86: disable X86_PTRACE_BTS"
ring-buffer: prevent false positive warning
ring-buffer: fix dangling commit race
ftrace: enable format arguments checking
x86, bts: memory accounting
x86, bts: add fork and exit handling
ftrace: introduce tracing_reset_online_cpus() helper
tracing: fix warnings in kernel/trace/trace_sched_switch.c
tracing: fix warning in kernel/trace/trace.c
tracing/ring-buffer: remove unused ring_buffer size
trace: fix task state printout
ftrace: add not to regex on filtering functions
trace: better use of stack_trace_enabled for boot up code
trace: add a way to enable or disable the stack tracer
x86: entry_64 - introduce FTRACE_ frame macro v2
tracing/ftrace: add the printk-msg-only option
tracing/ftrace: use preempt_enable_no_resched_notrace in ring_buffer_time_stamp()
x86, bts: correctly report invalid bts records
...
Fixed up trivial conflict in scripts/recordmcount.pl due to SH bits
being already partly merged by the SH merge.
Diffstat (limited to 'arch/x86/kernel/dumpstack.c')
-rw-r--r-- | arch/x86/kernel/dumpstack.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 5962176dfabb..6b1f6f6f8661 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -30,6 +30,37 @@ void printk_address(unsigned long address, int reliable) | |||
30 | reliable ? "" : "? ", (void *) address); | 30 | reliable ? "" : "? ", (void *) address); |
31 | } | 31 | } |
32 | 32 | ||
33 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
34 | static void | ||
35 | print_ftrace_graph_addr(unsigned long addr, void *data, | ||
36 | const struct stacktrace_ops *ops, | ||
37 | struct thread_info *tinfo, int *graph) | ||
38 | { | ||
39 | struct task_struct *task = tinfo->task; | ||
40 | unsigned long ret_addr; | ||
41 | int index = task->curr_ret_stack; | ||
42 | |||
43 | if (addr != (unsigned long)return_to_handler) | ||
44 | return; | ||
45 | |||
46 | if (!task->ret_stack || index < *graph) | ||
47 | return; | ||
48 | |||
49 | index -= *graph; | ||
50 | ret_addr = task->ret_stack[index].ret; | ||
51 | |||
52 | ops->address(data, ret_addr, 1); | ||
53 | |||
54 | (*graph)++; | ||
55 | } | ||
56 | #else | ||
57 | static inline void | ||
58 | print_ftrace_graph_addr(unsigned long addr, void *data, | ||
59 | const struct stacktrace_ops *ops, | ||
60 | struct thread_info *tinfo, int *graph) | ||
61 | { } | ||
62 | #endif | ||
63 | |||
33 | /* | 64 | /* |
34 | * x86-64 can have up to three kernel stacks: | 65 | * x86-64 can have up to three kernel stacks: |
35 | * process stack | 66 | * process stack |
@@ -54,7 +85,7 @@ unsigned long | |||
54 | print_context_stack(struct thread_info *tinfo, | 85 | print_context_stack(struct thread_info *tinfo, |
55 | unsigned long *stack, unsigned long bp, | 86 | unsigned long *stack, unsigned long bp, |
56 | const struct stacktrace_ops *ops, void *data, | 87 | const struct stacktrace_ops *ops, void *data, |
57 | unsigned long *end) | 88 | unsigned long *end, int *graph) |
58 | { | 89 | { |
59 | struct stack_frame *frame = (struct stack_frame *)bp; | 90 | struct stack_frame *frame = (struct stack_frame *)bp; |
60 | 91 | ||
@@ -70,6 +101,7 @@ print_context_stack(struct thread_info *tinfo, | |||
70 | } else { | 101 | } else { |
71 | ops->address(data, addr, bp == 0); | 102 | ops->address(data, addr, bp == 0); |
72 | } | 103 | } |
104 | print_ftrace_graph_addr(addr, data, ops, tinfo, graph); | ||
73 | } | 105 | } |
74 | stack++; | 106 | stack++; |
75 | } | 107 | } |