tracing/sched: add load balancer tracepoint
When doing performance analysis it can be useful to see exactly
what is going on with the load balancer - when it runs and why
exactly it may not be redistributing load.
This additional tracepoint will show the idle context of the
load balance operation (idle, not idle, newly idle), various
values from the load balancing operation, the final result,
and the new balance interval.
Change-Id: I9e5c97ae3878bea44e60d189ff3cec2275f2c75e
CRs-Fixed: 583754
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index adf0a04..6cf99b0 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4417,7 +4417,7 @@
int ld_moved, active_balance = 0;
struct sched_group *group;
unsigned long imbalance;
- struct rq *busiest;
+ struct rq *busiest = NULL;
unsigned long flags;
struct cpumask *cpus = __get_cpu_var(load_balance_tmpmask);
@@ -4586,6 +4586,10 @@
ld_moved = 0;
out:
+ trace_sched_load_balance(this_cpu, idle, *balance,
+ group ? group->cpumask[0] : 0,
+ busiest ? busiest->nr_running : 0, imbalance,
+ env.flags, ld_moved, sd->balance_interval);
return ld_moved;
}