xref: /linux-6.15/include/linux/sched/debug.h (revision dd5bdaf2)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2b17b0153SIngo Molnar #ifndef _LINUX_SCHED_DEBUG_H
3b17b0153SIngo Molnar #define _LINUX_SCHED_DEBUG_H
4b17b0153SIngo Molnar 
5d3d1e320SIngo Molnar /*
6d3d1e320SIngo Molnar  * Various scheduler/task debugging interfaces:
7d3d1e320SIngo Molnar  */
8d3d1e320SIngo Molnar 
9d3d1e320SIngo Molnar struct task_struct;
1074dc3384SAleksa Sarai struct pid_namespace;
11d3d1e320SIngo Molnar 
12d3d1e320SIngo Molnar extern void dump_cpu_task(int cpu);
13d3d1e320SIngo Molnar 
14d3d1e320SIngo Molnar /*
15d3d1e320SIngo Molnar  * Only dump TASK_* tasks. (0 for all tasks)
16d3d1e320SIngo Molnar  */
17*2f064a59SPeter Zijlstra extern void show_state_filter(unsigned int state_filter);
18d3d1e320SIngo Molnar 
show_state(void)19d3d1e320SIngo Molnar static inline void show_state(void)
20d3d1e320SIngo Molnar {
21d3d1e320SIngo Molnar 	show_state_filter(0);
22d3d1e320SIngo Molnar }
23d3d1e320SIngo Molnar 
24d3d1e320SIngo Molnar struct pt_regs;
25d3d1e320SIngo Molnar 
26d3d1e320SIngo Molnar extern void show_regs(struct pt_regs *);
27d3d1e320SIngo Molnar 
28d3d1e320SIngo Molnar /*
29d3d1e320SIngo Molnar  * TASK is a pointer to the task whose backtrace we want to see (or NULL for current
30d3d1e320SIngo Molnar  * task), SP is the stack pointer of the first frame that should be shown in the back
31d3d1e320SIngo Molnar  * trace (or NULL if the entire call-chain of the task should be shown).
32d3d1e320SIngo Molnar  */
339cb8f069SDmitry Safonov extern void show_stack(struct task_struct *task, unsigned long *sp,
34ab34b46dSDmitry Safonov 		       const char *loglvl);
35d3d1e320SIngo Molnar 
36d3d1e320SIngo Molnar extern void sched_show_task(struct task_struct *p);
37d3d1e320SIngo Molnar 
38d3d1e320SIngo Molnar struct seq_file;
3974dc3384SAleksa Sarai extern void proc_sched_show_task(struct task_struct *p,
4074dc3384SAleksa Sarai 				 struct pid_namespace *ns, struct seq_file *m);
41d3d1e320SIngo Molnar extern void proc_sched_set_task(struct task_struct *p);
42d3d1e320SIngo Molnar 
43d3d1e320SIngo Molnar /* Attach to any functions which should be ignored in wchan output. */
4433def849SJoe Perches #define __sched		__section(".sched.text")
45d3d1e320SIngo Molnar 
46d3d1e320SIngo Molnar /* Linker adds these: start and end of __sched functions */
47d3d1e320SIngo Molnar extern char __sched_text_start[], __sched_text_end[];
48d3d1e320SIngo Molnar 
49d3d1e320SIngo Molnar /* Is this address in the __sched functions? */
50d3d1e320SIngo Molnar extern int in_sched_functions(unsigned long addr);
51d3d1e320SIngo Molnar 
52b17b0153SIngo Molnar #endif /* _LINUX_SCHED_DEBUG_H */
53