Blame view

include/linux/stacktrace.h 1.45 KB
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  /* SPDX-License-Identifier: GPL-2.0 */
8637c0990   Ingo Molnar   [PATCH] lockdep: ...
2
3
  #ifndef __LINUX_STACKTRACE_H
  #define __LINUX_STACKTRACE_H
9a92a6ce6   Joonsoo Kim   stacktrace: intro...
4
  #include <linux/types.h>
897312bd2   Andrew Morton   include/linux/sta...
5
  struct task_struct;
9c0729dc8   Soeren Sandmann Pedersen   x86: Eliminate bp...
6
  struct pt_regs;
897312bd2   Andrew Morton   include/linux/sta...
7

8637c0990   Ingo Molnar   [PATCH] lockdep: ...
8
9
10
11
  #ifdef CONFIG_STACKTRACE
  struct stack_trace {
  	unsigned int nr_entries, max_entries;
  	unsigned long *entries;
5a1b3999d   Andi Kleen   [PATCH] x86: Some...
12
  	int skip;	/* input argument: How many entries to skip */
8637c0990   Ingo Molnar   [PATCH] lockdep: ...
13
  };
ab1b6f03a   Christoph Hellwig   simplify the stac...
14
  extern void save_stack_trace(struct stack_trace *trace);
395810627   Masami Hiramatsu   x86: Swap save_st...
15
16
  extern void save_stack_trace_regs(struct pt_regs *regs,
  				  struct stack_trace *trace);
9745512ce   Arjan van de Ven   sched: latencytop...
17
18
  extern void save_stack_trace_tsk(struct task_struct *tsk,
  				struct stack_trace *trace);
af085d908   Josh Poimboeuf   stacktrace/x86: a...
19
20
  extern int save_stack_trace_tsk_reliable(struct task_struct *tsk,
  					 struct stack_trace *trace);
8637c0990   Ingo Molnar   [PATCH] lockdep: ...
21
22
  
  extern void print_stack_trace(struct stack_trace *trace, int spaces);
9a92a6ce6   Joonsoo Kim   stacktrace: intro...
23
24
  extern int snprint_stack_trace(char *buf, size_t size,
  			struct stack_trace *trace, int spaces);
02b67518e   Török Edwin   tracing: add supp...
25

8d26487fd   Török Edwin   tracing/stack-tra...
26
  #ifdef CONFIG_USER_STACKTRACE_SUPPORT
02b67518e   Török Edwin   tracing: add supp...
27
28
29
30
  extern void save_stack_trace_user(struct stack_trace *trace);
  #else
  # define save_stack_trace_user(trace)              do { } while (0)
  #endif
af085d908   Josh Poimboeuf   stacktrace/x86: a...
31
  #else /* !CONFIG_STACKTRACE */
ab1b6f03a   Christoph Hellwig   simplify the stac...
32
  # define save_stack_trace(trace)			do { } while (0)
9745512ce   Arjan van de Ven   sched: latencytop...
33
  # define save_stack_trace_tsk(tsk, trace)		do { } while (0)
8d7c6a961   Török Edwin   tracing/stack-tra...
34
  # define save_stack_trace_user(trace)			do { } while (0)
3b5ad0797   Johannes Berg   stacktrace: fix h...
35
  # define print_stack_trace(trace, spaces)		do { } while (0)
9a92a6ce6   Joonsoo Kim   stacktrace: intro...
36
  # define snprint_stack_trace(buf, size, trace, spaces)	do { } while (0)
af085d908   Josh Poimboeuf   stacktrace/x86: a...
37
38
  # define save_stack_trace_tsk_reliable(tsk, trace)	({ -ENOSYS; })
  #endif /* CONFIG_STACKTRACE */
8637c0990   Ingo Molnar   [PATCH] lockdep: ...
39

af085d908   Josh Poimboeuf   stacktrace/x86: a...
40
  #endif /* __LINUX_STACKTRACE_H */