dumpstack.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (C) 1991, 1992 Linus Torvalds
  3. * Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs
  4. */
  5. #ifndef DUMPSTACK_H
  6. #define DUMPSTACK_H
  7. #ifdef CONFIG_X86_32
  8. #define STACKSLOTS_PER_LINE 8
  9. #define get_bp(bp) asm("movl %%ebp, %0" : "=r" (bp) :)
  10. #else
  11. #define STACKSLOTS_PER_LINE 4
  12. #define get_bp(bp) asm("movq %%rbp, %0" : "=r" (bp) :)
  13. #endif
  14. extern unsigned long
  15. print_context_stack(struct thread_info *tinfo,
  16. unsigned long *stack, unsigned long bp,
  17. const struct stacktrace_ops *ops, void *data,
  18. unsigned long *end);
  19. extern void
  20. show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
  21. unsigned long *stack, unsigned long bp, char *log_lvl);
  22. extern void
  23. show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
  24. unsigned long *sp, unsigned long bp, char *log_lvl);
  25. extern unsigned int code_bytes;
  26. extern int kstack_depth_to_print;
  27. /* The form of the top of the frame on the stack */
  28. struct stack_frame {
  29. struct stack_frame *next_frame;
  30. unsigned long return_address;
  31. };
  32. #endif