stacktrace.h 1.4 KB
Newer Older
H
H. Peter Anvin 已提交
1 2
#ifndef _ASM_X86_STACKTRACE_H
#define _ASM_X86_STACKTRACE_H
3

4 5
extern int kstack_depth_to_print;

6 7
int x86_is_stack_id(int id, char *name);

8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
struct thread_info;
struct stacktrace_ops;

typedef unsigned long (*walk_stack_t)(struct thread_info *tinfo,
				      unsigned long *stack,
				      unsigned long bp,
				      const struct stacktrace_ops *ops,
				      void *data,
				      unsigned long *end,
				      int *graph);

extern unsigned long
print_context_stack(struct thread_info *tinfo,
		    unsigned long *stack, unsigned long bp,
		    const struct stacktrace_ops *ops, void *data,
		    unsigned long *end, int *graph);

25 26 27 28 29 30
extern unsigned long
print_context_stack_bp(struct thread_info *tinfo,
		       unsigned long *stack, unsigned long bp,
		       const struct stacktrace_ops *ops, void *data,
		       unsigned long *end, int *graph);

31 32 33 34 35 36
/* Generic stack tracer with callbacks */

struct stacktrace_ops {
	void (*warning)(void *data, char *msg);
	/* msg must contain %s for the symbol */
	void (*warning_symbol)(void *data, char *msg, unsigned long symbol);
37
	void (*address)(void *data, unsigned long address, int reliable);
38 39
	/* On negative return stop dumping */
	int (*stack)(void *data, char *name);
40
	walk_stack_t	walk_stack;
41 42
};

43 44
void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
		unsigned long *stack, unsigned long bp,
J
Jan Beulich 已提交
45
		const struct stacktrace_ops *ops, void *data);
46

H
H. Peter Anvin 已提交
47
#endif /* _ASM_X86_STACKTRACE_H */