trace/sched: add rq utilization signal for WALT
authorJuri Lelli <juri.lelli@arm.com>
Wed, 30 Nov 2016 11:09:42 +0000 (11:09 +0000)
committerAmit Pundir <amit.pundir@linaro.org>
Wed, 21 Jun 2017 11:07:20 +0000 (16:37 +0530)
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 <juri.lelli@arm.com>
include/trace/events/sched.h

index c18d8c89bd12f9ef174f15ae3fba028ad32c3596..1d758d18a1b7a91dbed27203870a6b218ffe88b6 100644 (file)
@@ -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
                )
 );