From f5a6b03b918e4082a2bed8b0848d2769920a975e Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Wed, 7 Aug 2019 10:16:43 +0200 Subject: [PATCH] Fix use of LD_PRELOAD action --- 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 d7e69f2..46b1dcb 100644 --- a/tracetools_launch/tracetools_launch/action.py +++ b/tracetools_launch/tracetools_launch/action.py @@ -102,12 +102,13 @@ class Trace(Action): return output_split[1].strip() def execute(self, context: LaunchContext) -> Optional[List[Action]]: - if self.__ld_preload_action is not None: - context.add_action(self.__ld_preload_action) # TODO make sure this is done as late as possible context.register_event_handler(OnShutdown(on_shutdown=self._destroy)) # TODO make sure this is done as early as possible self._setup() + if self.__ld_preload_action is not None: + return [self.__ld_preload_action] + return None def _setup(self) -> None: lttng.lttng_init(