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