aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2f43f1fb7de7..f751062d89a2 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -537,7 +537,7 @@ extern struct user_struct root_user;
537struct backing_dev_info; 537struct backing_dev_info;
538struct reclaim_state; 538struct reclaim_state;
539 539
540#ifdef CONFIG_SCHEDSTATS 540#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
541struct sched_info { 541struct sched_info {
542 /* cumulative counters */ 542 /* cumulative counters */
543 unsigned long cpu_time, /* time spent on the cpu */ 543 unsigned long cpu_time, /* time spent on the cpu */
@@ -548,9 +548,11 @@ struct sched_info {
548 unsigned long last_arrival, /* when we last ran on a cpu */ 548 unsigned long last_arrival, /* when we last ran on a cpu */
549 last_queued; /* when we were last queued to run */ 549 last_queued; /* when we were last queued to run */
550}; 550};
551#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */
551 552
553#ifdef CONFIG_SCHEDSTATS
552extern struct file_operations proc_schedstat_operations; 554extern struct file_operations proc_schedstat_operations;
553#endif 555#endif /* CONFIG_SCHEDSTATS */
554 556
555#ifdef CONFIG_TASK_DELAY_ACCT 557#ifdef CONFIG_TASK_DELAY_ACCT
556struct task_delay_info { 558struct task_delay_info {
@@ -580,7 +582,19 @@ struct task_delay_info {
580 u32 swapin_count; /* total count of the number of swapin block */ 582 u32 swapin_count; /* total count of the number of swapin block */
581 /* io operations performed */ 583 /* io operations performed */
582}; 584};
585#endif /* CONFIG_TASK_DELAY_ACCT */
586
587static inline int sched_info_on(void)
588{
589#ifdef CONFIG_SCHEDSTATS
590 return 1;
591#elif defined(CONFIG_TASK_DELAY_ACCT)
592 extern int delayacct_on;
593 return delayacct_on;
594#else
595 return 0;
583#endif 596#endif
597}
584 598
585enum idle_type 599enum idle_type
586{ 600{
@@ -777,7 +791,7 @@ struct task_struct {
777 cpumask_t cpus_allowed; 791 cpumask_t cpus_allowed;
778 unsigned int time_slice, first_time_slice; 792 unsigned int time_slice, first_time_slice;
779 793
780#ifdef CONFIG_SCHEDSTATS 794#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
781 struct sched_info sched_info; 795 struct sched_info sched_info;
782#endif 796#endif
783 797