mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
ftrace: Expose FtraceCollector.available_events
Expose the list of events the kernel supports. Signed-off-by: Douglas RAILLARD <douglas.raillard@arm.com>
This commit is contained in:
parent
656da00d2a
commit
bbe3bb6adb
@ -125,9 +125,6 @@ class FtraceCollector(TraceCollector):
|
|||||||
self.target_binary = 'trace-cmd'
|
self.target_binary = 'trace-cmd'
|
||||||
|
|
||||||
# Validate required events to be traced
|
# Validate required events to be traced
|
||||||
available_events = self.target.execute(
|
|
||||||
'cat {}'.format(self.available_events_file),
|
|
||||||
as_root=True).splitlines()
|
|
||||||
selected_events = []
|
selected_events = []
|
||||||
for event in self.events:
|
for event in self.events:
|
||||||
# Convert globs supported by FTrace into valid regexp globs
|
# Convert globs supported by FTrace into valid regexp globs
|
||||||
@ -136,7 +133,7 @@ class FtraceCollector(TraceCollector):
|
|||||||
_event = '*' + event
|
_event = '*' + event
|
||||||
event_re = re.compile(_event.replace('*', '.*'))
|
event_re = re.compile(_event.replace('*', '.*'))
|
||||||
# Select events matching the required ones
|
# Select events matching the required ones
|
||||||
if not list(filter(event_re.match, available_events)):
|
if not list(filter(event_re.match, self.available_events)):
|
||||||
message = 'Event [{}] not available for tracing'.format(event)
|
message = 'Event [{}] not available for tracing'.format(event)
|
||||||
if strict:
|
if strict:
|
||||||
raise TargetStableError(message)
|
raise TargetStableError(message)
|
||||||
@ -189,6 +186,14 @@ class FtraceCollector(TraceCollector):
|
|||||||
"""
|
"""
|
||||||
return self.target.read_value(self.available_tracers_file).split(' ')
|
return self.target.read_value(self.available_tracers_file).split(' ')
|
||||||
|
|
||||||
|
@property
|
||||||
|
@memoized
|
||||||
|
def available_events(self):
|
||||||
|
"""
|
||||||
|
List of ftrace events supported by the target's kernel.
|
||||||
|
"""
|
||||||
|
return self.target.read_value(self.available_events_file).splitlines()
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
if self.buffer_size:
|
if self.buffer_size:
|
||||||
self._set_buffer_size()
|
self._set_buffer_size()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user