mirror of
https://github.com/ARM-software/devlib.git
synced 2025-09-09 21:41:53 +01:00
ftrace: Poke all CPUs for cpu_idle events before collecting trace
On some systems CPUs sometimes remain idle for several seconds. If a trace capture begins during one of these long idle periods, that CPU's idle state is unknown (in practice it is probably in its deepest available state from cpuidle's perspective but that can't be known for sure). The solution to the equivalent problem for cpufreq is to read the current frequencies from sysfs and inject artificial cpu_frequency events using trace_marker (see cpu_freq_trace_all_frequencies in bin/scripts/shutils.in). However we can't read the current idle state from sysfs. Instead, wake up each CPU by executing the "true" command on it via taskset.
This commit is contained in:
@@ -152,3 +152,9 @@ class Cpuidle(Module):
|
||||
for state in self.get_states(cpu):
|
||||
state.disable()
|
||||
|
||||
def perturb_cpus(self):
|
||||
"""
|
||||
Momentarily wake each CPU. Ensures cpu_idle events in trace file.
|
||||
"""
|
||||
output = self.target._execute_util('cpuidle_wake_all_cpus')
|
||||
print(output)
|
||||
|
Reference in New Issue
Block a user