blob: 35e89122a42f53191bdce81156417b305fe005ac [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 Weisbecker0406ca62009-07-01 21:02:09 +02006int x86_is_stack_id(int id, char *name);
7
Frederic Weisbecker61c19172009-12-17 05:40:33 +01008struct 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
Frederic Weisbecker06d65bd2009-12-17 05:40:34 +010025extern unsigned long
26print_context_stack_bp(struct thread_info *tinfo,
27 unsigned long *stack, unsigned long bp,
28 const struct stacktrace_ops *ops, void *data,
29 unsigned long *end, int *graph);
30
Andi Kleenc0b766f2006-09-26 10:52:34 +020031/* Generic stack tracer with callbacks */
32
33struct stacktrace_ops {
34 void (*warning)(void *data, char *msg);
35 /* msg must contain %s for the symbol */
36 void (*warning_symbol)(void *data, char *msg, unsigned long symbol);
Arjan van de Venbc850d62008-01-30 13:33:07 +010037 void (*address)(void *data, unsigned long address, int reliable);
Andi Kleenc0b766f2006-09-26 10:52:34 +020038 /* On negative return stop dumping */
39 int (*stack)(void *data, char *name);
Frederic Weisbecker61c19172009-12-17 05:40:33 +010040 walk_stack_t walk_stack;
Andi Kleenc0b766f2006-09-26 10:52:34 +020041};
42
Arjan van de Venbc850d62008-01-30 13:33:07 +010043void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
44 unsigned long *stack, unsigned long bp,
Jan Beulich9689ba82007-10-17 18:04:37 +020045 const struct stacktrace_ops *ops, void *data);
Andi Kleenc0b766f2006-09-26 10:52:34 +020046
H. Peter Anvin1965aae2008-10-22 22:26:29 -070047#endif /* _ASM_X86_STACKTRACE_H */