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

Commit 0b005590 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched: Fix legacy_freq argument in sched_get_task_cpu_cycles() tracepoint



The cpufreq based current frequency tracking is not supported in
the current code. Hence cpu_cur_freq() returns an incorrect value
which is printed as legacy_freq in sched_get_task_cpu_cycles()
trace point. Fix this by providing a new wrapper function
for current frequency based on arch_scale_freq_capacity().

Change-Id: Id9408d18392e17b657a4a807574bd1c57b482528
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent b31361a5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ TRACE_EVENT(sched_get_task_cpu_cycles,
		__entry->cycles		= cycles;
		__entry->exec_time	= exec_time;
		__entry->freq		= cpu_cycles_to_freq(cycles, exec_time);
		__entry->legacy_freq	= cpu_cur_freq(cpu);
		__entry->legacy_freq	= sched_cpu_legacy_freq(cpu);
		__entry->pid		= p->pid;
		memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
	),
+8 −0
Original line number Diff line number Diff line
@@ -229,6 +229,14 @@ static inline unsigned int cpu_cur_freq(int cpu)
	return cpu_rq(cpu)->cluster->cur_freq;
}

static inline unsigned int sched_cpu_legacy_freq(int cpu)
{
	unsigned long curr_cap = arch_scale_freq_capacity(NULL, cpu);

	return (curr_cap * (u64) cpu_rq(cpu)->cluster->max_freq) >>
		SCHED_CAPACITY_SHIFT;
}

static inline void
move_list(struct list_head *dst, struct list_head *src, bool sync_rcu)
{