stat.h 887 B

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_SCHED_STAT_H
  3. #define _LINUX_SCHED_STAT_H
  4. #include <linux/percpu.h>
  5. #include <linux/kconfig.h>
  6. /*
  7. * Various counters maintained by the scheduler and fork(),
  8. * exposed via /proc, sys.c or used by drivers via these APIs.
  9. *
  10. * ( Note that all these values are acquired without locking,
  11. * so they can only be relied on in narrow circumstances. )
  12. */
  13. extern unsigned long total_forks;
  14. extern int nr_threads;
  15. DECLARE_PER_CPU(unsigned long, process_counts);
  16. extern int nr_processes(void);
  17. extern unsigned int nr_running(void);
  18. extern bool single_task_running(void);
  19. extern unsigned int nr_iowait(void);
  20. extern unsigned int nr_iowait_cpu(int cpu);
  21. static inline int sched_info_on(void)
  22. {
  23. return IS_ENABLED(CONFIG_SCHED_INFO);
  24. }
  25. #ifdef CONFIG_SCHEDSTATS
  26. void force_schedstat_enabled(void);
  27. #endif
  28. #endif /* _LINUX_SCHED_STAT_H */