diff options
| author | Srivatsa Vaddagiri <vatsa@codeaurora.org> | 2014-03-31 18:10:21 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 19:59:09 -0700 |
| commit | 1bea4eae335b554359c67b2321093bf52abd9538 (patch) | |
| tree | cc73163aa648c17123823f3c69771cbd6e2d69bd /kernel | |
| parent | 47d2c533b247c7c1903f61a4b67b9664a3162b7d (diff) | |
sched: Add additional ftrace events
This patch adds two ftrace events:
sched_task_load -> records information of a task, such as scaled demand
sched_cpu_load -> records information of a cpu, such as nr_running,
nr_big_tasks etc
This will be useful to debug HMP related task placement decisions by
scheduler.
Change-Id: If91587149bcd9bed157b5d2bfdecc3c3bf6652ff
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sched/fair.c | 9 | ||||
| -rw-r--r-- | kernel/sched/sched.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e5518b0ddab7..d0cd0a8afe63 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2735,6 +2735,11 @@ static int select_best_cpu(struct task_struct *p, int target) int cpu_cost, min_cost = INT_MAX; int small_task = is_small_task(p); + trace_sched_task_load(p); + for_each_online_cpu(i) + trace_sched_cpu_load(cpu_rq(i), idle_cpu(i), + mostly_idle_cpu(i), power_cost(p, i)); + /* provide bias for prev_cpu */ if (!small_task && mostly_idle_cpu(prev_cpu) && task_will_fit(p, prev_cpu)) { @@ -6968,6 +6973,10 @@ static inline void update_sg_lb_stats(struct lb_env *env, for_each_cpu_and(i, sched_group_cpus(group), env->cpus) { struct rq *rq = cpu_rq(i); + trace_sched_cpu_load(cpu_rq(i), idle_cpu(i), + mostly_idle_cpu(i), + power_cost(NULL, i)); + /* Bias balancing toward cpus of our domain */ if (local_group) load = target_load(i, load_idx); diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 965db5c8437b..01aa57b070f1 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1009,6 +1009,8 @@ static inline void dec_nr_big_small_task(struct rq *rq, struct task_struct *p) { } +#define trace_sched_cpu_load(...) + #endif /* CONFIG_SCHED_HMP */ #ifdef CONFIG_CGROUP_SCHED |
