mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
cpufreq: add method to trace current frequencies
This patch add a method which allows to inject into a trace a "cpu_frequency" event for each CPU reporting the current frequency the CPU is running at. Such a method could be useful to force report CPUs frequency into a trace file, for example at tracing start and stop, thus allowing to know always at which frequency an experiment has been executed. Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
This commit is contained in:
parent
f46057f836
commit
701e6adf7a
@ -363,3 +363,16 @@ class CpufreqModule(Module):
|
||||
"done"\
|
||||
.format(governor), as_root=True)
|
||||
|
||||
def trace_frequencies(self):
|
||||
"""
|
||||
Report current frequencies on trace file
|
||||
"""
|
||||
self.target.execute(
|
||||
'FREQS=$(cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq); '
|
||||
'CPU=0; for F in $FREQS; do '
|
||||
' echo "cpu_frequency: state=$F cpu_id=$CPU" > /sys/kernel/debug/tracing/trace_marker; '
|
||||
' let CPU++; '
|
||||
'done',
|
||||
as_root=True
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user