DEBUG: sched: add tracepoint for CPU load/util signals
authorJuri Lelli <juri.lelli@arm.com>
Mon, 9 Nov 2015 12:07:48 +0000 (12:07 +0000)
committerLeo Yan <leo.yan@linaro.org>
Tue, 10 May 2016 08:53:25 +0000 (16:53 +0800)
Signed-off-by: Juri Lelli <juri.lelli@arm.com>
include/trace/events/sched.h
kernel/sched/fair.c

index 99f3e648c197e5e528fe33d48aa12fee03a4b254..f58760c2f7128612ae42ecd554d91a35aa98071c 100644 (file)
@@ -629,6 +629,31 @@ TRACE_EVENT(sched_load_avg_task,
                  (u32)__entry->util_sum,
                  (u32)__entry->period_contrib)
 );
+
+/*
+ * Tracepoint for accounting sched averages for cpus.
+ */
+TRACE_EVENT(sched_load_avg_cpu,
+
+       TP_PROTO(int cpu, struct cfs_rq *cfs_rq),
+
+       TP_ARGS(cpu, cfs_rq),
+
+       TP_STRUCT__entry(
+               __field( int,   cpu                             )
+               __field( unsigned long, load_avg                )
+               __field( unsigned long, util_avg                )
+       ),
+
+       TP_fast_assign(
+               __entry->cpu                    = cpu;
+               __entry->load_avg               = cfs_rq->avg.load_avg;
+               __entry->util_avg               = cfs_rq->avg.util_avg;
+       ),
+
+       TP_printk("cpu=%d load_avg=%lu util_avg=%lu",
+                 __entry->cpu, __entry->load_avg, __entry->util_avg)
+);
 #endif /* _TRACE_SCHED_H */
 
 /* This part must be outside protection */
index 8cdb4e5592f9de63247151bf5b40253d15d89679..b5ea9ec335d841fde7a55cec16cb2bbf62ec4df6 100644 (file)
@@ -2734,6 +2734,7 @@ static inline void update_load_avg(struct sched_entity *se, int update_tg)
 
        if (entity_is_task(se))
                trace_sched_load_avg_task(task_of(se), &se->avg);
+       trace_sched_load_avg_cpu(cpu, cfs_rq);
 }
 
 static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se)