mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
Merge pull request #4 from derkling/cpufreq-tracing
Add support to properly trace CPUs frequencies
This commit is contained in:
commit
d4c8b0f222
@ -363,3 +363,16 @@ class CpufreqModule(Module):
|
|||||||
"done"\
|
"done"\
|
||||||
.format(governor), as_root=True)
|
.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
|
||||||
|
)
|
||||||
|
|
||||||
|
@ -101,8 +101,14 @@ class FtraceCollector(TraceCollector):
|
|||||||
if self.automark:
|
if self.automark:
|
||||||
self.mark_start()
|
self.mark_start()
|
||||||
self.target.execute('{} start {}'.format(self.target_binary, self.event_string), as_root=True)
|
self.target.execute('{} start {}'.format(self.target_binary, self.event_string), as_root=True)
|
||||||
|
if 'cpufreq' in self.target.modules:
|
||||||
|
self.logger.debug('Trace CPUFreq frequencies')
|
||||||
|
self.target.cpufreq.trace_frequencies()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
if 'cpufreq' in self.target.modules:
|
||||||
|
self.logger.debug('Trace CPUFreq frequencies')
|
||||||
|
self.target.cpufreq.trace_frequencies()
|
||||||
self.stop_time = time.time()
|
self.stop_time = time.time()
|
||||||
if self.automark:
|
if self.automark:
|
||||||
self.mark_stop()
|
self.mark_stop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user