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

Commit 8e45d941 authored by Patrick Bellasi's avatar Patrick Bellasi Committed by Dmitry Shmidt
Browse files

ANDROID: DEBUG: sched: add tracepoint for RD overutilized

parent 42503db7
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -912,6 +912,26 @@ TRACE_EVENT(sched_tune_filter,
		__entry->payoff, __entry->region)
);

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

	TP_PROTO(bool overutilized),

	TP_ARGS(overutilized),

	TP_STRUCT__entry(
		__field( bool,	overutilized	)
	),

	TP_fast_assign(
		__entry->overutilized	= overutilized;
	),

	TP_printk("overutilized=%d",
		__entry->overutilized ? 1 : 0)
);
#ifdef CONFIG_SCHED_WALT
struct rq;

+13 −4
Original line number Diff line number Diff line
@@ -4637,8 +4637,10 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
	if (!se) {
		walt_inc_cumulative_runnable_avg(rq, p);
		if (!task_new && !rq->rd->overutilized &&
		    cpu_overutilized(rq->cpu))
		    cpu_overutilized(rq->cpu)) {
			rq->rd->overutilized = true;
			trace_sched_overutilized(true);
		}

		/*
		 * We want to potentially trigger a freq switch
@@ -8190,14 +8192,19 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
			env->dst_rq->rd->overload = overload;

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

}

/**
 * check_asym_packing - Check to see if the group is packed into the
 *			sched doman.
@@ -9586,8 +9593,10 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
		task_tick_numa(rq, curr);

#ifdef CONFIG_SMP
	if (!rq->rd->overutilized && cpu_overutilized(task_cpu(curr)))
	if (!rq->rd->overutilized && cpu_overutilized(task_cpu(curr))) {
		rq->rd->overutilized = true;
		trace_sched_overutilized(true);
	}

	rq->misfit_task = !task_fits_max(curr, rq->cpu);
#endif