DEBUG: sched/fair: Fix missing sched_load_avg_cpu events
authorBrendan Jackman <brendan.jackman@arm.com>
Mon, 9 Jan 2017 17:20:11 +0000 (17:20 +0000)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 16 Jan 2017 09:33:08 +0000 (15:03 +0530)
update_cfs_rq_load_avg is called from update_blocked_averages without triggering
the sched_load_avg_cpu event. Move the event trigger to inside
update_cfs_rq_load_avg to avoid this missing event.

Change-Id: I6c4f66f687a644e4e7f798db122d28a8f5919b7b
Signed-off-by: Brendan Jackman <brendan.jackman@arm.com>
kernel/sched/fair.c

index 30d76a18ae1a7fe9c939f4501e9dea65aed3493b..ad1507e420e807d6f34809d9889a5cc3cc5226e4 100644 (file)
@@ -2757,6 +2757,8 @@ static inline int update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq)
        cfs_rq->load_last_update_time_copy = sa->last_update_time;
 #endif
 
+       trace_sched_load_avg_cpu(cpu_of(rq_of(cfs_rq)), cfs_rq);
+
        return decayed || removed;
 }
 
@@ -2780,7 +2782,6 @@ 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)