Add trace point for sched_new_util, which is used for estimation CPU utilization plus task utilization for CPU selection.
Signed-off-by: Leo Yan leo.yan@linaro.org --- include/trace/events/sched.h | 25 +++++++++++++++++++++++++ kernel/sched/fair.c | 2 ++ 2 files changed, 27 insertions(+)
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index c50310a..a410e2b2 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -707,6 +707,31 @@ TRACE_EVENT(sched_load_avg_cpu, );
/* + * Tracepoint for CPU estimation util when wake up one task + */ +TRACE_EVENT(sched_new_util, + + TP_PROTO(int cpu, int util_wake, int new_util), + + TP_ARGS(cpu, util_wake, new_util), + + TP_STRUCT__entry( + __field( int, cpu ) + __field( int, util_wake ) + __field( int, new_util ) + ), + + TP_fast_assign( + __entry->cpu = cpu; + __entry->util_wake = util_wake; + __entry->new_util = new_util; + ), + + TP_printk("cpu=%d util_wake=%u new_util=%u", + __entry->cpu, __entry->util_wake, __entry->new_util) +); + +/* * Tracepoint for sched_tune_config settings */ TRACE_EVENT(sched_tune_config, diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9d8a6fd..e0b50ca 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5994,6 +5994,8 @@ static int energy_aware_wake_cpu(struct task_struct *p, int target, int sync) */ new_util = cpu_wake_util + task_util_boosted;
+ trace_sched_new_util(i, cpu_wake_util, new_util); + /* * Ensure minimum capacity to grant the required boost. * The target CPU can be already at a capacity level higher -- 1.9.1