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

Commit e85e73f1 authored by Syed Rameez Mustafa's avatar Syed Rameez Mustafa
Browse files

sched: Add C-state tracking to the sched_cpu_load trace event



C-state information is used by the scheduler for small task placement
decisions. Track this information in the sched_cpu_load trace event.
Also add the trace event in best_small_task_cpu(). This will help
better understand small task placement decisions.

Change-Id: Ife5f05bba59f85c968fab999bd13b9fb6b1c184e
Signed-off-by: default avatarSyed Rameez Mustafa <rameezmustafa@codeaurora.org>
parent a7692d8d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ TRACE_EVENT(sched_cpu_load,
		__field(unsigned int, cur_freq			)
		__field(unsigned int, max_freq			)
		__field(unsigned int, power_cost		)
		__field(	 int, cstate			)
	),

	TP_fast_assign(
@@ -183,14 +184,15 @@ TRACE_EVENT(sched_cpu_load,
		__entry->cur_freq		= rq->cur_freq;
		__entry->max_freq		= rq->max_freq;
		__entry->power_cost		= power_cost;
		__entry->cstate			= rq->cstate;
	),

	TP_printk("cpu %u idle %d mostly_idle %d nr_run %u nr_big %u nr_small %u lsf %u capacity %u cr_avg %llu fcur %u fmax %u power_cost %u",
	TP_printk("cpu %u idle %d mostly_idle %d nr_run %u nr_big %u nr_small %u lsf %u capacity %u cr_avg %llu fcur %u fmax %u power_cost %u cstate %d",
	__entry->cpu, __entry->idle, __entry->mostly_idle, __entry->nr_running,
	__entry->nr_big_tasks, __entry->nr_small_tasks,
	__entry->load_scale_factor, __entry->capacity,
	__entry->cumulative_runnable_avg, __entry->cur_freq, __entry->max_freq,
	__entry->power_cost)
	__entry->power_cost, __entry->cstate)
);

TRACE_EVENT(sched_set_boost,
+4 −0
Original line number Diff line number Diff line
@@ -1657,6 +1657,10 @@ static int best_small_task_cpu(struct task_struct *p)
	/* Take a first pass to find the lowest power cost CPU. This
	   will avoid a potential O(n^2) search */
	for_each_cpu(i, &search_cpus) {

		trace_sched_cpu_load(cpu_rq(i), idle_cpu(i),
				     mostly_idle_cpu(i), power_cost(p, i));

		cpu_cost = power_cost(p, i);
		if (cpu_cost < min_cost) {
			min_cost = cpu_cost;