1#ifndef __LINUX_STACKTRACE_H 2#define __LINUX_STACKTRACE_H 3 4#include <linux/types.h> 5 6struct task_struct; 7struct pt_regs; 8 9#ifdef CONFIG_STACKTRACE 10struct stack_trace { 11 unsigned int nr_entries, max_entries; 12 unsigned long *entries; 13 int skip; /* input argument: How many entries to skip */ 14}; 15 16extern void save_stack_trace(struct stack_trace *trace); 17extern void save_stack_trace_regs(struct pt_regs *regs, 18 struct stack_trace *trace); 19extern void save_stack_trace_tsk(struct task_struct *tsk, 20 struct stack_trace *trace); 21 22extern void print_stack_trace(struct stack_trace *trace, int spaces); 23extern int snprint_stack_trace(char *buf, size_t size, 24 struct stack_trace *trace, int spaces); 25 26#ifdef CONFIG_USER_STACKTRACE_SUPPORT 27extern void save_stack_trace_user(struct stack_trace *trace); 28#else 29# define save_stack_trace_user(trace) do { } while (0) 30#endif 31 32#else 33# define save_stack_trace(trace) do { } while (0) 34# define save_stack_trace_tsk(tsk, trace) do { } while (0) 35# define save_stack_trace_user(trace) do { } while (0) 36# define print_stack_trace(trace, spaces) do { } while (0) 37# define snprint_stack_trace(buf, size, trace, spaces) do { } while (0) 38#endif 39 40#endif 41