Skip to content

Commit

Permalink
sched: Update sched_enq_deq_task ftrace event
Browse files Browse the repository at this point in the history
Extend sched_enq_deq_task ftrace event to record task's
runnable_avg_sum_scaled, runnable_avg_period and demand metrics. This
will be a valuable debug aid.

Change-Id: I8deda0df0105cf97a3178cded96473d541e0d78a
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
  • Loading branch information
Srivatsa Vaddagiri authored and Steve Muckle committed Jul 22, 2014
1 parent 94fd142 commit 8694768
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions include/trace/events/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ TRACE_EVENT(sched_enq_deq_task,
__field(unsigned int, nr_running )
__field(unsigned long, cpu_load )
__field(unsigned int, rt_nr_running )
#ifdef CONFIG_SCHED_FREQ_INPUT
__field(unsigned int, sum_scaled )
__field(unsigned int, period )
__field(unsigned int, demand )
#endif
),

TP_fast_assign(
Expand All @@ -79,13 +84,26 @@ TRACE_EVENT(sched_enq_deq_task,
__entry->nr_running = task_rq(p)->nr_running;
__entry->cpu_load = task_rq(p)->cpu_load[0];
__entry->rt_nr_running = task_rq(p)->rt.rt_nr_running;
#ifdef CONFIG_SCHED_FREQ_INPUT
__entry->sum_scaled = p->se.avg.runnable_avg_sum_scaled;
__entry->period = p->se.avg.runnable_avg_period;
__entry->demand = p->ravg.demand;
#endif
),

TP_printk("cpu=%d %s comm=%s pid=%d prio=%d nr_running=%u cpu_load=%lu rt_nr_running=%u",
__entry->cpu, __entry->enqueue ? "enqueue" : "dequeue",
TP_printk("cpu=%d %s comm=%s pid=%d prio=%d nr_running=%u cpu_load=%lu rt_nr_running=%u"
#ifdef CONFIG_SCHED_FREQ_INPUT
"sum_scaled=%u period=%u demand=%u"
#endif
, __entry->cpu,
__entry->enqueue ? "enqueue" : "dequeue",
__entry->comm, __entry->pid,
__entry->prio, __entry->nr_running,
__entry->cpu_load, __entry->rt_nr_running)
__entry->cpu_load, __entry->rt_nr_running
#ifdef CONFIG_SCHED_FREQ_INPUT
, __entry->sum_scaled, __entry->period, __entry->demand
#endif
)
);

/*
Expand Down

0 comments on commit 8694768

Please sign in to comment.