2 #ifdef CONFIG_SCHEDSTATS
8 rq_sched_info_arrive(
struct rq *
rq,
unsigned long long delta)
11 rq->rq_sched_info.run_delay +=
delta;
12 rq->rq_sched_info.pcount++;
20 rq_sched_info_depart(
struct rq *rq,
unsigned long long delta)
23 rq->rq_cpu_time +=
delta;
27 rq_sched_info_dequeued(
struct rq *rq,
unsigned long long delta)
30 rq->rq_sched_info.run_delay +=
delta;
32 # define schedstat_inc(rq, field) do { (rq)->field++; } while (0)
33 # define schedstat_add(rq, field, amt) do { (rq)->field += (amt); } while (0)
34 # define schedstat_set(var, val) do { var = (val); } while (0)
37 rq_sched_info_arrive(
struct rq *rq,
unsigned long long delta)
40 rq_sched_info_dequeued(
struct rq *rq,
unsigned long long delta)
43 rq_sched_info_depart(
struct rq *rq,
unsigned long long delta)
45 # define schedstat_inc(rq, field) do { } while (0)
46 # define schedstat_add(rq, field, amt) do { } while (0)
47 # define schedstat_set(var, val) do { } while (0)
50 #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
53 t->sched_info.last_queued = 0;
64 unsigned long long now =
task_rq(t)->clock, delta = 0;
67 if (t->sched_info.last_queued)
68 delta = now - t->sched_info.last_queued;
70 t->sched_info.run_delay +=
delta;
72 rq_sched_info_dequeued(
task_rq(t), delta);
80 static void sched_info_arrive(
struct task_struct *t)
82 unsigned long long now =
task_rq(t)->clock, delta = 0;
84 if (t->sched_info.last_queued)
85 delta = now - t->sched_info.last_queued;
87 t->sched_info.run_delay +=
delta;
88 t->sched_info.last_arrival = now;
89 t->sched_info.pcount++;
91 rq_sched_info_arrive(
task_rq(t), delta);
102 if (!t->sched_info.last_queued)
103 t->sched_info.last_queued =
task_rq(t)->clock;
113 static inline void sched_info_depart(
struct task_struct *t)
115 unsigned long long delta =
task_rq(t)->clock -
116 t->sched_info.last_arrival;
118 rq_sched_info_depart(
task_rq(t), delta);
139 if (prev != rq->
idle)
140 sched_info_depart(prev);
142 if (next != rq->
idle)
143 sched_info_arrive(next);
149 __sched_info_switch(prev, next);
152 #define sched_info_queued(t) do { } while (0)
153 #define sched_info_reset_dequeued(t) do { } while (0)
154 #define sched_info_dequeued(t) do { } while (0)
155 #define sched_info_switch(t, next) do { } while (0)
174 static inline void account_group_user_time(
struct task_struct *tsk,
197 static inline void account_group_system_time(
struct task_struct *tsk,
220 static inline void account_group_exec_runtime(
struct task_struct *tsk,
221 unsigned long long ns)
229 cputimer->
cputime.sum_exec_runtime +=
ns;