1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-05 18:30:50 +01: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:
Patrick Bellasi 2015-11-16 17:40:46 +00:00
parent f46057f836
commit 701e6adf7a

View File

@ -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
)