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

Commit 2d536329 authored by Joonwoo Park's avatar Joonwoo Park
Browse files

sched: update sched_task_load trace event



Add best_cpu and latency field to sched_task_load trace event.  The latency
field represents combined latency of update_task_ravg(), update_task_ravg()
and select_best_cpu() which is useful to analyze latency overhead of HMP
scheduler.

Change-Id: Ie6d777c918d0414d361d758490e3cd7d509f5837
Signed-off-by: default avatarJoonwoo Park <joonwoop@codeaurora.org>
parent f9aa8547
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -119,9 +119,9 @@ TRACE_EVENT(sched_enq_deq_task,
TRACE_EVENT(sched_task_load,

	TP_PROTO(struct task_struct *p, int boost, int reason,
		 int sync, int need_idle),
		 int sync, int need_idle, int best_cpu),

	TP_ARGS(p, boost, reason, sync, need_idle),
	TP_ARGS(p, boost, reason, sync, need_idle, best_cpu),

	TP_STRUCT__entry(
		__array(	char,	comm,	TASK_COMM_LEN	)
@@ -134,6 +134,8 @@ TRACE_EVENT(sched_task_load,
		__field(	int,	reason			)
		__field(	int,	sync			)
		__field(	int,	need_idle		)
		__field(	int,	best_cpu		)
		__field(	u64,	latency			)
	),

	TP_fast_assign(
@@ -147,12 +149,16 @@ TRACE_EVENT(sched_task_load,
		__entry->reason		= reason;
		__entry->sync		= sync;
		__entry->need_idle	= need_idle;
		__entry->best_cpu	= best_cpu;
		__entry->latency	= p->state == TASK_WAKING ?
					 sched_clock() - p->ravg.mark_start : 0;
	),

	TP_printk("%d (%s): sum=%u, sum_scaled=%u, period=%u demand=%u boost=%d reason=%d sync=%d, need_idle=%d",
	TP_printk("%d (%s): sum=%u, sum_scaled=%u, period=%u demand=%u boost=%d reason=%d sync=%d need_idle=%d best_cpu=%d latency=%llu",
		__entry->pid, __entry->comm, __entry->sum,
		__entry->sum_scaled, __entry->period, __entry->demand,
		__entry->boost, __entry->reason, __entry->sync, __entry->need_idle)
		__entry->boost, __entry->reason, __entry->sync,
		__entry->need_idle, __entry->best_cpu, __entry->latency)
);

TRACE_EVENT(sched_cpu_load,
+1 −1
Original line number Diff line number Diff line
@@ -3057,7 +3057,7 @@ static int select_best_cpu(struct task_struct *p, int target, int reason,
			best_cpu = best_sibling_cpu;
	}

	trace_sched_task_load(p, boost, reason, sync, need_idle);
	trace_sched_task_load(p, boost, reason, sync, need_idle, best_cpu);

	return best_cpu;
}