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

Commit 171db7dc authored by Quentin Perret's avatar Quentin Perret
Browse files

ANDROID: sched/events: Introduce find_best_target trace event



Adapated from the existing trace event from android-4.14.

Change-Id: I9785e692fb0af087c236906d7f47fed1b20690f5
Signed-off-by: default avatarQuentin Perret <quentin.perret@arm.com>
parent 8eb64d5f
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
@@ -779,6 +779,47 @@ TRACE_EVENT(sched_util_est_cpu,
		  __entry->util_avg,
		  __entry->util_est_enqueued)
);

/*
 * 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 best_idle, int best_active,
		 int target, int backup),

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

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

	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->best_idle      = best_idle;
		__entry->best_active    = best_active;
		__entry->target         = target;
		__entry->backup         = backup;
		),

	TP_printk("pid=%d comm=%s prefer_idle=%d "
		  "best_idle=%d best_active=%d target=%d backup=%d",
		  __entry->pid, __entry->comm, __entry->prefer_idle,
		  __entry->best_idle, __entry->best_active,
		  __entry->target, __entry->backup)
);
#endif /* CONFIG_SMP */
#endif /* _TRACE_SCHED_H */

+3 −0
Original line number Diff line number Diff line
@@ -6789,6 +6789,9 @@ static void find_best_target(struct sched_domain *sd, cpumask_t *cpus,
target:
		cpumask_set_cpu(target_cpu, cpus);
	}

	trace_sched_find_best_target(p, prefer_idle, min_util, best_idle_cpu,
			             best_active_cpu, target_cpu, backup_cpu);
}

/*