Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6dfaed98 authored by Patrick Bellasi's avatar Patrick Bellasi Committed by Quentin Perret
Browse files

ANDROID: sched/events: Introduce overutilized trace event



Signed-off-by: default avatarPatrick Bellasi <patrick.bellasi@arm.com>
Signed-off-by: default avatarAndres Oportus <andresoportus@google.com>
(cherry picked from commit 8e45d941282039d5379f4e286e5bd0a2044e105c)
[ - Trivial cherry pick issues
  - Changed commit title for consistency ]
Signed-off-by: default avatarQuentin Perret <quentin.perret@arm.com>
Change-Id: I78fb5e82223558def0cf16105c233591cda81d5c
parent 3124a5b9
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -964,6 +964,27 @@ TRACE_EVENT(sched_boost_task,
		__entry->margin)
);

/*
 * Tracepoint for system overutilized flag
*/
TRACE_EVENT(sched_overutilized,

	TP_PROTO(int overutilized),

	TP_ARGS(overutilized),

	TP_STRUCT__entry(
		__field( int,  overutilized    )
	),

	TP_fast_assign(
		__entry->overutilized   = overutilized;
	),

	TP_printk("overutilized=%d",
		__entry->overutilized)
);

#endif /* CONFIG_SMP */
#endif /* _TRACE_SCHED_H */

+6 −1
Original line number Diff line number Diff line
@@ -5134,8 +5134,10 @@ static inline bool cpu_overutilized(int cpu)

static inline void update_overutilized_status(struct rq *rq)
{
	if (!READ_ONCE(rq->rd->overutilized) && cpu_overutilized(rq->cpu))
	if (!READ_ONCE(rq->rd->overutilized) && cpu_overutilized(rq->cpu)) {
		WRITE_ONCE(rq->rd->overutilized, SG_OVERUTILIZED);
		trace_sched_overutilized(1);
	}
}
#else
static inline void update_overutilized_status(struct rq *rq) { }
@@ -8961,9 +8963,12 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd

		/* Update over-utilization (tipping point, U >= 0) indicator */
		WRITE_ONCE(rd->overutilized, sg_status & SG_OVERUTILIZED);
		trace_sched_overutilized(!!(sg_status & SG_OVERUTILIZED));
	} else if (sg_status & SG_OVERUTILIZED) {
		WRITE_ONCE(env->dst_rq->rd->overutilized, SG_OVERUTILIZED);
		trace_sched_overutilized(1);
	}

}

/**