We can remove two pairs of #ifdefs by defining structures in a smarter way.
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
#define prof_exp stime
#define sched_exp sum_exec_runtime
#define prof_exp stime
#define sched_exp sum_exec_runtime
-#ifdef CONFIG_SCHED_INFO
+#ifdef CONFIG_SCHED_INFO
/* cumulative counters */
unsigned long pcount; /* # of times run on this cpu */
unsigned long long run_delay; /* time spent waiting on a runqueue */
/* cumulative counters */
unsigned long pcount; /* # of times run on this cpu */
unsigned long long run_delay; /* time spent waiting on a runqueue */
/* timestamps */
unsigned long long last_arrival,/* when we last ran on a cpu */
last_queued; /* when we were last queued to run */
/* timestamps */
unsigned long long last_arrival,/* when we last ran on a cpu */
last_queued; /* when we were last queued to run */
#endif /* CONFIG_SCHED_INFO */
#endif /* CONFIG_SCHED_INFO */
/*
* Integer metrics need fixed point arithmetic, e.g., sched/fair
/*
* Integer metrics need fixed point arithmetic, e.g., sched/fair
unsigned long load_avg, util_avg;
};
unsigned long load_avg, util_avg;
};
-#ifdef CONFIG_SCHEDSTATS
struct sched_statistics {
struct sched_statistics {
+#ifdef CONFIG_SCHEDSTATS
u64 wait_start;
u64 wait_max;
u64 wait_count;
u64 wait_start;
u64 wait_max;
u64 wait_count;
u64 nr_wakeups_affine_attempts;
u64 nr_wakeups_passive;
u64 nr_wakeups_idle;
u64 nr_wakeups_affine_attempts;
u64 nr_wakeups_passive;
u64 nr_wakeups_idle;
struct sched_entity {
struct load_weight load; /* for load-balancing */
struct sched_entity {
struct load_weight load; /* for load-balancing */
-#ifdef CONFIG_SCHEDSTATS
struct sched_statistics statistics;
struct sched_statistics statistics;
#ifdef CONFIG_FAIR_GROUP_SCHED
int depth;
#ifdef CONFIG_FAIR_GROUP_SCHED
int depth;
int rcu_tasks_idle_cpu;
#endif /* #ifdef CONFIG_TASKS_RCU */
int rcu_tasks_idle_cpu;
#endif /* #ifdef CONFIG_TASKS_RCU */
-#ifdef CONFIG_SCHED_INFO
struct sched_info sched_info;
struct sched_info sched_info;
struct list_head tasks;
#ifdef CONFIG_SMP
struct list_head tasks;
#ifdef CONFIG_SMP