1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 10:10:46 +00:00

ftrace: Allow choosing clock source

trace-cmd start -C <clock> allows selecting the ftrace clock. Expose that in
FtraceCollector API.

Signed-off-by: Douglas RAILLARD <douglas.raillard@arm.com>
This commit is contained in:
Douglas RAILLARD 2019-10-31 16:20:53 +00:00 committed by Marc Bonnici
parent 4d1299d678
commit def235064b

View File

@ -63,6 +63,7 @@ class FtraceCollector(TraceCollector):
no_install=False, no_install=False,
strict=False, strict=False,
report_on_target=False, report_on_target=False,
trace_clock='local',
): ):
super(FtraceCollector, self).__init__(target) super(FtraceCollector, self).__init__(target)
self.events = events if events is not None else DEFAULT_EVENTS self.events = events if events is not None else DEFAULT_EVENTS
@ -83,6 +84,7 @@ class FtraceCollector(TraceCollector):
self.stop_time = None self.stop_time = None
self.event_string = None self.event_string = None
self.function_string = None self.function_string = None
self.trace_clock = trace_clock
self._reset_needed = True self._reset_needed = True
# pylint: disable=bad-whitespace # pylint: disable=bad-whitespace
@ -94,6 +96,7 @@ class FtraceCollector(TraceCollector):
self.function_profile_file = self.target.path.join(self.tracing_path, 'function_profile_enabled') self.function_profile_file = self.target.path.join(self.tracing_path, 'function_profile_enabled')
self.marker_file = self.target.path.join(self.tracing_path, 'trace_marker') self.marker_file = self.target.path.join(self.tracing_path, 'trace_marker')
self.ftrace_filter_file = self.target.path.join(self.tracing_path, 'set_ftrace_filter') self.ftrace_filter_file = self.target.path.join(self.tracing_path, 'set_ftrace_filter')
self.trace_clock_file = self.target.path.join(self.tracing_path, 'trace_clock')
self.host_binary = which('trace-cmd') self.host_binary = which('trace-cmd')
self.kernelshark = which('kernelshark') self.kernelshark = which('kernelshark')
@ -170,6 +173,8 @@ class FtraceCollector(TraceCollector):
self.start_time = time.time() self.start_time = time.time()
if self._reset_needed: if self._reset_needed:
self.reset() self.reset()
self.target.write_value(self.trace_clock_file, self.trace_clock, verify=False)
self.target.execute('{} start {}'.format(self.target_binary, self.event_string), self.target.execute('{} start {}'.format(self.target_binary, self.event_string),
as_root=True) as_root=True)
if self.automark: if self.automark: