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

Commit bf6cd4d1 authored by Patrick Bellasi's avatar Patrick Bellasi Committed by Chris Redpath
Browse files

events: add tracepoint for find_best_target



Change-Id: I4c245ffacb207d7ea826c5763a426efe5399e0a2
Signed-off-by: default avatarPatrick Bellasi <patrick.bellasi@arm.com>
parent 5680f23f
Loading
Loading
Loading
Loading
+42 −0
Original line number Original line Diff line number Diff line
@@ -877,6 +877,48 @@ TRACE_EVENT(sched_boost_task,
		  __entry->margin)
		  __entry->margin)
);
);


/*
 * Tracepoint for find_best_target
 */
TRACE_EVENT(sched_find_best_target,

	TP_PROTO(struct task_struct *tsk, bool prefer_idle,
		unsigned long min_util, int start_cpu,
		int best_idle, int best_active, int target),

	TP_ARGS(tsk, prefer_idle, min_util, start_cpu,
		best_idle, best_active, target),

	TP_STRUCT__entry(
		__array( char,	comm,	TASK_COMM_LEN	)
		__field( pid_t,	pid			)
		__field( unsigned long,	min_util	)
		__field( bool,	prefer_idle		)
		__field( int,	start_cpu		)
		__field( int,	best_idle		)
		__field( int,	best_active		)
		__field( int,	target			)
	),

	TP_fast_assign(
		memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
		__entry->pid		= tsk->pid;
		__entry->min_util	= min_util;
		__entry->prefer_idle	= prefer_idle;
		__entry->start_cpu 	= start_cpu;
		__entry->best_idle	= best_idle;
		__entry->best_active	= best_active;
		__entry->target		= target;
	),

	TP_printk("pid=%d comm=%s prefer_idle=%d start_cpu=%d "
		  "best_idle=%d best_active=%d target=%d",
		__entry->pid, __entry->comm,
		__entry->prefer_idle, __entry->start_cpu,
		__entry->best_idle, __entry->best_active,
		__entry->target)
);

/*
/*
 * Tracepoint for accounting sched group energy
 * Tracepoint for accounting sched group energy
 */
 */
+10 −0
Original line number Original line Diff line number Diff line
@@ -6291,6 +6291,12 @@ static inline int find_best_target(struct task_struct *p, bool boosted, bool pre
				if (idle_cpu(i)) {
				if (idle_cpu(i)) {
					schedstat_inc(p, se.statistics.nr_wakeups_fbt_pref_idle);
					schedstat_inc(p, se.statistics.nr_wakeups_fbt_pref_idle);
					schedstat_inc(this_rq(), eas_stats.fbt_pref_idle);
					schedstat_inc(this_rq(), eas_stats.fbt_pref_idle);

					trace_sched_find_best_target(p,
							prefer_idle, min_util,
							cpu, best_idle_cpu,
							best_active_cpu, i);

					return i;
					return i;
				}
				}


@@ -6433,6 +6439,10 @@ static inline int find_best_target(struct task_struct *p, bool boosted, bool pre
			? best_active_cpu
			? best_active_cpu
			: best_idle_cpu;
			: best_idle_cpu;


	trace_sched_find_best_target(p, prefer_idle, min_util, cpu,
				     best_idle_cpu, best_active_cpu,
				     target_cpu);

	schedstat_inc(p, se.statistics.nr_wakeups_fbt_count);
	schedstat_inc(p, se.statistics.nr_wakeups_fbt_count);
	schedstat_inc(this_rq(), eas_stats.fbt_count);
	schedstat_inc(this_rq(), eas_stats.fbt_count);