From a7cfd28bd0f6cdf5097e52a52262c06f4cb1015a Mon Sep 17 00:00:00 2001 From: Patrick Bellasi Date: Mon, 16 Nov 2015 17:45:33 +0000 Subject: [PATCH] ftrace: force report CPU frequencies at trace start and stop When the cpufreq module is loaded, quite likely we want to run experiments which involve an analysis of frequencies transitions. However, if during an experiment there are not cpu_frequency events, the generated trace does not allows to know at which frequency the experiment has been executed. This happens for example when we are running at constant frequency or just because the workload is not generating a variable capacity request in the system. This path ensure the a "cpu_frequency" events is always generated at the beginning and at the end of a collected trace. This support is required for example to properly plot CPUs frequencies event when there are not CPUFreq generated changes of OPP. Signed-off-by: Patrick Bellasi --- devlib/trace/ftrace.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/devlib/trace/ftrace.py b/devlib/trace/ftrace.py index 871cc89..2973e0b 100644 --- a/devlib/trace/ftrace.py +++ b/devlib/trace/ftrace.py @@ -101,8 +101,14 @@ class FtraceCollector(TraceCollector): if self.automark: self.mark_start() 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): + if 'cpufreq' in self.target.modules: + self.logger.debug('Trace CPUFreq frequencies') + self.target.cpufreq.trace_frequencies() self.stop_time = time.time() if self.automark: self.mark_stop()