1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

target: add option to invoke to redirect stderr

The stderr of a command is not propagated as part of the command
output. However, some workloads/commands write vital output to
stderr. For this reason, we add an option to invoke which redirects
stderr to stdout (redirect_stderr). This is disabled by default.
This commit is contained in:
Sascha Bischoff 2018-03-01 15:26:43 +00:00 committed by setrofim
parent 8f3dc05f97
commit 83e5ddfd1b

View File

@ -338,7 +338,7 @@ class Target(object):
return self.conn.background(command, stdout, stderr, as_root)
def invoke(self, binary, args=None, in_directory=None, on_cpus=None,
as_root=False, timeout=30):
redirect_stderr=False, as_root=False, timeout=30):
"""
Executes the specified binary under the specified conditions.
@ -369,6 +369,8 @@ class Target(object):
command = '{} taskset 0x{:x} {}'.format(self.busybox, on_cpus, command)
if in_directory:
command = 'cd {} && {}'.format(in_directory, command)
if redirect_stderr:
command = '{} 2>&1'.format(command)
return self.execute(command, as_root=as_root, timeout=timeout)
def background_invoke(self, binary, args=None, in_directory=None,