mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
ftrace: disable tracing of functions not available in the target kernel
In general we could be interested to defined a common configuration to use across different kernels. Thus, for a given set of experiments, some functions can be present only on some kernels and not others. This patch updates the check for the availability of functions to profile by ensuring that we consider only functions available in the kernel in use in the target. In case of a function cannot be profiled in the target kernel we log a warning instead of raising an exception. Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
This commit is contained in:
parent
a8dfd2e744
commit
d7bbad3aac
@ -59,6 +59,7 @@ class FtraceCollector(TraceCollector):
|
||||
autoreport=True,
|
||||
autoview=False,
|
||||
no_install=False,
|
||||
strict=False,
|
||||
):
|
||||
super(FtraceCollector, self).__init__(target)
|
||||
self.events = events if events is not None else DEFAULT_EVENTS
|
||||
@ -75,7 +76,7 @@ class FtraceCollector(TraceCollector):
|
||||
self.start_time = None
|
||||
self.stop_time = None
|
||||
self.event_string = _build_trace_events(self.events)
|
||||
self.function_string = _build_trace_functions(self.functions)
|
||||
self.function_string = None
|
||||
self._reset_needed = True
|
||||
|
||||
# Setup tracing paths
|
||||
@ -111,9 +112,16 @@ class FtraceCollector(TraceCollector):
|
||||
# Validate required functions to be traced
|
||||
available_functions = self.target.execute(
|
||||
'cat {}'.format(self.available_functions_file)).splitlines()
|
||||
selected_functions = []
|
||||
for function in self.functions:
|
||||
if function not in available_functions:
|
||||
raise TargetError('Function [{}] not available for filtering'.format(function))
|
||||
message = 'Function [{}] not available for profiling'.format(function)
|
||||
if strict:
|
||||
raise TargetError(message)
|
||||
self.target.logger.warning(message)
|
||||
else:
|
||||
selected_functions.append(function)
|
||||
self.function_string = _build_trace_functions(selected_functions)
|
||||
|
||||
def reset(self):
|
||||
if self.buffer_size:
|
||||
|
Loading…
x
Reference in New Issue
Block a user