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

ftrace: move file path definitions

All ftrace generated files are present under a common base folder.

This patch updates the FtraceCollector API to exposes just the common
base folder from where all the other paths can be generated.
This is a refactoring patch which makes it easier to add further attributes.

Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
This commit is contained in:
Patrick Bellasi 2016-01-26 14:59:53 +00:00
parent 51b7f01d36
commit bda7a16656

View File

@ -47,8 +47,7 @@ class FtraceCollector(TraceCollector):
events=None,
buffer_size=None,
buffer_size_step=1000,
buffer_size_file='/sys/kernel/debug/tracing/buffer_size_kb',
marker_file='/sys/kernel/debug/tracing/trace_marker',
tracing_path='/sys/kernel/debug/tracing',
automark=True,
autoreport=True,
autoview=False,
@ -58,8 +57,7 @@ class FtraceCollector(TraceCollector):
self.events = events if events is not None else DEFAULT_EVENTS
self.buffer_size = buffer_size
self.buffer_size_step = buffer_size_step
self.buffer_size_file = buffer_size_file
self.marker_file = marker_file
self.tracing_path = tracing_path
self.automark = automark
self.autoreport = autoreport
self.autoview = autoview
@ -71,6 +69,10 @@ class FtraceCollector(TraceCollector):
self.event_string = _build_trace_events(self.events)
self._reset_needed = True
# Setup tracing paths
self.buffer_size_file = self.target.path.join(self.tracing_path, 'buffer_size_kb')
self.marker_file = self.target.path.join(self.tracing_path, 'trace_marker')
self.host_binary = which('trace-cmd')
self.kernelshark = which('kernelshark')