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)
committerAmit Pundir <amit.pundir@linaro.org>
Wed, 14 Sep 2016 09:28:22 +0000 (14:58 +0530)
Signed-off-by: Juri Lelli <juri.lelli@arm.com>
include/trace/events/sched.h
kernel/sched/fair.c

index cef05f0abea266424181252b3a88ca8f08811abb..5a8951cb4a10933ff97f96432bdab4a7ca6728e9 100644 (file)
@@ -678,6 +678,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 7b55cc0572882f72f49ac4967eb843c95ae2e557..7ca5003005d87cdd14318eabb84a9eece727f2a1 100644 (file)
@@ -2749,6 +2749,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)