From 2d0ab5231c2b829559273104bba83461c805e63b Mon Sep 17 00:00:00 2001 From: Juri Lelli Date: Wed, 30 Nov 2016 11:09:42 +0000 Subject: [PATCH] trace/sched: add rq utilization signal for WALT It is useful to be able to check current capacity against rq utilization signal generated by WALT (to check how a cpufreq governor is behaving for example). Add rq utilization signal (same scale as capacity) to the walt_update_ task_ravg tracepoint. Change-Id: I9aae3884a741d23ac494bef80d2303f107f135ce Signed-off-by: Juri Lelli --- include/trace/events/sched.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index c18d8c89bd12..1d758d18a1b7 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -984,6 +984,7 @@ TRACE_EVENT(walt_update_task_ravg, __field( int, cpu ) __field( u64, cs ) __field( u64, ps ) + __field(unsigned long, util ) __field( u32, curr_window ) __field( u32, prev_window ) __field( u64, nt_cs ) @@ -1008,6 +1009,8 @@ TRACE_EVENT(walt_update_task_ravg, __entry->irqtime = irqtime; __entry->cs = rq->curr_runnable_sum; __entry->ps = rq->prev_runnable_sum; + __entry->util = rq->prev_runnable_sum << SCHED_LOAD_SHIFT; + do_div(__entry->util, walt_ravg_window); __entry->curr_window = p->ravg.curr_window; __entry->prev_window = p->ravg.prev_window; __entry->nt_cs = rq->nt_curr_runnable_sum; @@ -1016,16 +1019,15 @@ TRACE_EVENT(walt_update_task_ravg, ), TP_printk("wc %llu ws %llu delta %llu event %d cpu %d cur_freq %u cur_pid %d task %d (%s) ms %llu delta %llu demand %u sum %u irqtime %llu" - " cs %llu ps %llu cur_window %u prev_window %u nt_cs %llu nt_ps %llu active_wins %u" + " cs %llu ps %llu util %lu cur_window %u prev_window %u active_wins %u" , __entry->wallclock, __entry->win_start, __entry->delta, __entry->evt, __entry->cpu, __entry->cur_freq, __entry->cur_pid, __entry->pid, __entry->comm, __entry->mark_start, __entry->delta_m, __entry->demand, __entry->sum, __entry->irqtime, - __entry->cs, __entry->ps, + __entry->cs, __entry->ps, __entry->util, __entry->curr_window, __entry->prev_window, - __entry->nt_cs, __entry->nt_ps, __entry->active_windows ) ); -- 2.34.1