Add ld_preload capability to runtime.run()
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 26 Oct 2017 15:01:39 +0000 (11:01 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 26 Oct 2017 15:01:39 +0000 (11:01 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
lttng_ivc/utils/runtime.py

index ac19e107b8db88ea70fc9b55ed483ec68a06ab25..a89c23bf6c283a5b882870ad20bd5e159fcf27b5 100644 (file)
@@ -120,7 +120,7 @@ class Runtime(object):
         _logger.debug("Spawned sub pid: {} args: {} stdout: {} stderr{}".format(p.pid, p.args, out_path, err_path))
         return tmp_id
 
-    def run(self, command_line, cwd=None, check_return=True):
+    def run(self, command_line, cwd=None, check_return=True, ld_preload=""):
         """
         Run the command and return a tuple of a (CompletedProcess, stdout_path,
         stderr_path). The subprocess is already executed and returned. The
@@ -129,6 +129,10 @@ class Runtime(object):
         args = shlex.split(command_line)
         env = self.get_env()
 
+        if ld_preload:
+            env['LD_PRELOAD'] = ld_preload
+
+
         tmp_id = self._run_command_count
         self._run_command_count += 1
 
This page took 0.024248 seconds and 5 git commands to generate.