From a54cef66b9a084c92b62f6aa77192a66c65b0ac9 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Mon, 13 Nov 2023 11:22:32 +0000 Subject: [PATCH] WIP --- lisa/_kmod.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/lisa/_kmod.py b/lisa/_kmod.py index 9f320d4fd..a92145758 100644 --- a/lisa/_kmod.py +++ b/lisa/_kmod.py @@ -2631,17 +2631,26 @@ class FtraceDynamicKmod(DynamicKmod): """ Ftrace events defined in that module. """ - def parse(name): - return re.match(r'__event_(.*)', name) - - events = set( - m.group(1) - for m in map( - parse, - self._get_symbols('_ftrace_events') + def from_section(section): + def parse(name): + return re.match(r'__event_(.*)', name) + + events = set( + m.group(1) + for m in map( + parse, + self._get_symbols(section) + ) + if m ) - if m - ) + return events + + try: + events = from_section('_ftrace_events') + except KeyError: + # Some android kernels seem to strip the _ftrace_events section, so + # we widen the scope to all symbols defined in the module. + events = from_section(None) # Ensure that the possible_events() implementation is indeed a superset # of the events actually defined. -- GitLab