Fix use of LD_PRELOAD action

This commit is contained in:
Christophe Bedard 2019-08-07 10:16:43 +02:00
parent cb3d22bf29
commit f5a6b03b91

View file

@ -102,12 +102,13 @@ class Trace(Action):
return output_split[1].strip() return output_split[1].strip()
def execute(self, context: LaunchContext) -> Optional[List[Action]]: 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 # TODO make sure this is done as late as possible
context.register_event_handler(OnShutdown(on_shutdown=self._destroy)) context.register_event_handler(OnShutdown(on_shutdown=self._destroy))
# TODO make sure this is done as early as possible # TODO make sure this is done as early as possible
self._setup() self._setup()
if self.__ld_preload_action is not None:
return [self.__ld_preload_action]
return None
def _setup(self) -> None: def _setup(self) -> None:
lttng.lttng_init( lttng.lttng_init(