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

Commit 7022c871 authored by Chris Redpath's avatar Chris Redpath
Browse files

ANDROID: trace/sched: Add tracepoint for sched_overutilized events



Change-Id: Ieb46736cb21fe58024c434cd678af0abb8b0d249
Signed-off-by: default avatarChris Redpath <chris.redpath@arm.com>
parent 159c14f0
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -852,6 +852,33 @@ TRACE_EVENT(sched_boost_task,
		  __entry->util,
		  __entry->margin)
);

/*
 * Tracepoint for system overutilized flag
 */
struct sched_domain;
TRACE_EVENT_CONDITION(sched_overutilized,

	TP_PROTO(struct sched_domain *sd, bool was_overutilized, bool overutilized),

	TP_ARGS(sd, was_overutilized, overutilized),

	TP_CONDITION(overutilized != was_overutilized),

	TP_STRUCT__entry(
		__field( bool,	overutilized	  )
		__array( char,  cpulist , 32      )
	),

	TP_fast_assign(
		__entry->overutilized	= overutilized;
		scnprintf(__entry->cpulist, sizeof(__entry->cpulist), "%*pbl", cpumask_pr_args(sched_domain_span(sd)));
	),

	TP_printk("overutilized=%d sd_span=%s",
		__entry->overutilized ? 1 : 0, __entry->cpulist)
);

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

+4 −0
Original line number Diff line number Diff line
@@ -4922,6 +4922,8 @@ static inline void hrtick_update(struct rq *rq)
#ifdef CONFIG_SMP
static bool cpu_overutilized(int cpu);

static unsigned long cpu_util(int cpu);

static bool sd_overutilized(struct sched_domain *sd)
{
	return sd->shared->overutilized;
@@ -4929,11 +4931,13 @@ static bool sd_overutilized(struct sched_domain *sd)

static void set_sd_overutilized(struct sched_domain *sd)
{
	trace_sched_overutilized(sd, sd->shared->overutilized, true);
	sd->shared->overutilized = true;
}

static void clear_sd_overutilized(struct sched_domain *sd)
{
	trace_sched_overutilized(sd, sd->shared->overutilized, false);
	sd->shared->overutilized = false;
}