X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lttng_ivc%2Futils%2Fruntime.py;fp=lttng_ivc%2Futils%2Fruntime.py;h=a89c23bf6c283a5b882870ad20bd5e159fcf27b5;hb=9f2ed0478c3db6da8767485fa13678162d36f3bf;hp=ac19e107b8db88ea70fc9b55ed483ec68a06ab25;hpb=6aa98db5836fd75fff696f8d894455693ef6001a;p=deliverable%2Flttng-ivc.git diff --git a/lttng_ivc/utils/runtime.py b/lttng_ivc/utils/runtime.py index ac19e10..a89c23b 100644 --- a/lttng_ivc/utils/runtime.py +++ b/lttng_ivc/utils/runtime.py @@ -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