Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _LINUX_SCHED_STAT_H
0003 #define _LINUX_SCHED_STAT_H
0004 
0005 #include <linux/percpu.h>
0006 #include <linux/kconfig.h>
0007 
0008 /*
0009  * Various counters maintained by the scheduler and fork(),
0010  * exposed via /proc, sys.c or used by drivers via these APIs.
0011  *
0012  * ( Note that all these values are acquired without locking,
0013  *   so they can only be relied on in narrow circumstances. )
0014  */
0015 
0016 extern unsigned long total_forks;
0017 extern int nr_threads;
0018 DECLARE_PER_CPU(unsigned long, process_counts);
0019 extern int nr_processes(void);
0020 extern unsigned int nr_running(void);
0021 extern bool single_task_running(void);
0022 extern unsigned int nr_iowait(void);
0023 extern unsigned int nr_iowait_cpu(int cpu);
0024 
0025 static inline int sched_info_on(void)
0026 {
0027     return IS_ENABLED(CONFIG_SCHED_INFO);
0028 }
0029 
0030 #ifdef CONFIG_SCHEDSTATS
0031 void force_schedstat_enabled(void);
0032 #endif
0033 
0034 #endif /* _LINUX_SCHED_STAT_H */