aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/stacktrace.h
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-12-16 23:40:33 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-17 03:56:19 -0500
commit61c1917f47f73c968e92d04d15370b1dc3ec4592 (patch)
treea20445bcaf484d270bd6cb8de5969702110af687 /arch/x86/include/asm/stacktrace.h
parent5b74ed4729ad2b2017453add68104a83206caefb (diff)
perf events, x86/stacktrace: Make stack walking optional
The current print_context_stack helper that does the stack walking job is good for usual stacktraces as it walks through all the stack and reports even addresses that look unreliable, which is nice when we don't have frame pointers for example. But we have users like perf that only require reliable stacktraces, and those may want a more adapted stack walker, so lets make this function a callback in stacktrace_ops that users can tune for their needs. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1261024834-5336-1-git-send-regression-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/stacktrace.h')
-rw-r--r--arch/x86/include/asm/stacktrace.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/include/asm/stacktrace.h b/arch/x86/include/asm/stacktrace.h
index cf86a5e73815..6c75151a3cca 100644
--- a/arch/x86/include/asm/stacktrace.h
+++ b/arch/x86/include/asm/stacktrace.h
@@ -5,6 +5,23 @@ extern int kstack_depth_to_print;
5 5
6int x86_is_stack_id(int id, char *name); 6int x86_is_stack_id(int id, char *name);
7 7
8struct thread_info;
9struct stacktrace_ops;
10
11typedef unsigned long (*walk_stack_t)(struct thread_info *tinfo,
12 unsigned long *stack,
13 unsigned long bp,
14 const struct stacktrace_ops *ops,
15 void *data,
16 unsigned long *end,
17 int *graph);
18
19extern unsigned long
20print_context_stack(struct thread_info *tinfo,
21 unsigned long *stack, unsigned long bp,
22 const struct stacktrace_ops *ops, void *data,
23 unsigned long *end, int *graph);
24
8/* Generic stack tracer with callbacks */ 25/* Generic stack tracer with callbacks */
9 26
10struct stacktrace_ops { 27struct stacktrace_ops {
@@ -14,6 +31,7 @@ struct stacktrace_ops {
14 void (*address)(void *data, unsigned long address, int reliable); 31 void (*address)(void *data, unsigned long address, int reliable);
15 /* On negative return stop dumping */ 32 /* On negative return stop dumping */
16 int (*stack)(void *data, char *name); 33 int (*stack)(void *data, char *name);
34 walk_stack_t walk_stack;
17}; 35};
18 36
19void dump_trace(struct task_struct *tsk, struct pt_regs *regs, 37void dump_trace(struct task_struct *tsk, struct pt_regs *regs,