debug.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_SCHED_DEBUG_H
  3. #define _LINUX_SCHED_DEBUG_H
  4. /*
  5. * Various scheduler/task debugging interfaces:
  6. */
  7. struct task_struct;
  8. struct pid_namespace;
  9. extern void dump_cpu_task(int cpu);
  10. /*
  11. * Only dump TASK_* tasks. (0 for all tasks)
  12. */
  13. extern void show_state_filter(unsigned long state_filter);
  14. static inline void show_state(void)
  15. {
  16. show_state_filter(0);
  17. }
  18. struct pt_regs;
  19. extern void show_regs(struct pt_regs *);
  20. /*
  21. * TASK is a pointer to the task whose backtrace we want to see (or NULL for current
  22. * task), SP is the stack pointer of the first frame that should be shown in the back
  23. * trace (or NULL if the entire call-chain of the task should be shown).
  24. */
  25. extern void show_stack(struct task_struct *task, unsigned long *sp);
  26. extern void sched_show_task(struct task_struct *p);
  27. #ifdef CONFIG_SCHED_DEBUG
  28. struct seq_file;
  29. extern void proc_sched_show_task(struct task_struct *p,
  30. struct pid_namespace *ns, struct seq_file *m);
  31. extern void proc_sched_set_task(struct task_struct *p);
  32. #endif
  33. /* Attach to any functions which should be ignored in wchan output. */
  34. #define __sched __attribute__((__section__(".sched.text")))
  35. /* Linker adds these: start and end of __sched functions */
  36. extern char __sched_text_start[], __sched_text_end[];
  37. /* Is this address in the __sched functions? */
  38. extern int in_sched_functions(unsigned long addr);
  39. #endif /* _LINUX_SCHED_DEBUG_H */