From 5812adce63b4d528ead17410b9b9f1549e0e2ac9 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Wed, 7 Aug 2019 10:18:34 +0200 Subject: [PATCH] Add docstring and rename constant --- tracetools_launch/tracetools_launch/action.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tracetools_launch/tracetools_launch/action.py b/tracetools_launch/tracetools_launch/action.py index 46b1dcb..b103d93 100644 --- a/tracetools_launch/tracetools_launch/action.py +++ b/tracetools_launch/tracetools_launch/action.py @@ -39,7 +39,7 @@ class Trace(Action): PROFILE_LIB_NORMAL = 'liblttng-ust-cyg-profile.so' PROFILE_LIB_FAST = 'liblttng-ust-cyg-profile-fast.so' - PROFILE_PATTERN = '^lttng_ust_cyg_profile.*:func_.*' + PROFILE_EVENT_PATTERN = '^lttng_ust_cyg_profile.*:func_.*' def __init__( self, @@ -79,7 +79,8 @@ class Trace(Action): @classmethod def has_profiling_events(cls, events_ust: List[str]) -> bool: - matches = [re.match(cls.PROFILE_PATTERN, event_name) for event_name in events_ust] + """Check if the UST events list contains at least one profiling event.""" + matches = [re.match(cls.PROFILE_EVENT_PATTERN, event_name) for event_name in events_ust] return any(matches) @staticmethod