blob: 4dab78edbad9ff7315a8c30aebeb734f4e87da1e [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_STACKTRACE_H
2#define _ASM_X86_STACKTRACE_H
Andi Kleenc0b766f2006-09-26 10:52:34 +02003
Chuck Ebbert0741f4d2006-12-07 02:14:11 +01004extern int kstack_depth_to_print;
5
Frederic Weisbecker61c19172009-12-17 05:40:33 +01006struct thread_info;
7struct stacktrace_ops;
8
9typedef unsigned long (*walk_stack_t)(struct thread_info *tinfo,
10 unsigned long *stack,
11 unsigned long bp,
12 const struct stacktrace_ops *ops,
13 void *data,
14 unsigned long *end,
15 int *graph);
16
17extern unsigned long
18print_context_stack(struct thread_info *tinfo,
19 unsigned long *stack, unsigned long bp,
20 const struct stacktrace_ops *ops, void *data,
21 unsigned long *end, int *graph);
22
Frederic Weisbecker06d65bd2009-12-17 05:40:34 +010023extern unsigned long
24print_context_stack_bp(struct thread_info *tinfo,
25 unsigned long *stack, unsigned long bp,
26 const struct stacktrace_ops *ops, void *data,
27 unsigned long *end, int *graph);
28
Andi Kleenc0b766f2006-09-26 10:52:34 +020029/* Generic stack tracer with callbacks */
30
31struct stacktrace_ops {
32 void (*warning)(void *data, char *msg);
33 /* msg must contain %s for the symbol */
34 void (*warning_symbol)(void *data, char *msg, unsigned long symbol);
Arjan van de Venbc850d62008-01-30 13:33:07 +010035 void (*address)(void *data, unsigned long address, int reliable);
Andi Kleenc0b766f2006-09-26 10:52:34 +020036 /* On negative return stop dumping */
37 int (*stack)(void *data, char *name);
Frederic Weisbecker61c19172009-12-17 05:40:33 +010038 walk_stack_t walk_stack;
Andi Kleenc0b766f2006-09-26 10:52:34 +020039};
40
Arjan van de Venbc850d62008-01-30 13:33:07 +010041void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
42 unsigned long *stack, unsigned long bp,
Jan Beulich9689ba82007-10-17 18:04:37 +020043 const struct stacktrace_ops *ops, void *data);
Andi Kleenc0b766f2006-09-26 10:52:34 +020044
H. Peter Anvin1965aae2008-10-22 22:26:29 -070045#endif /* _ASM_X86_STACKTRACE_H */