Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
douglas-raillard-arm committed Nov 13, 2023
1 parent 627de71 commit a54cef6
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions lisa/_kmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -2631,17 +2631,26 @@ def defined_events(self):
"""
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.
Expand Down

0 comments on commit a54cef6

Please sign in to comment.