Skip to content
Snippets Groups Projects
Commit 6aa066d3 authored by Tomasz Grabiec's avatar Tomasz Grabiec Committed by Pekka Enberg
Browse files

trace: make `trace extract` silent


The command runs GDB which is very chatty. This will spoil our clean
output of 'make check' once the tracing test is added. Let's hide GDB
output unless it fails or the tracefile is not created.

Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 1e53a52f
No related branches found
No related tags found
No related merge requests found
...@@ -213,8 +213,16 @@ def extract(args): ...@@ -213,8 +213,16 @@ def extract(args):
else: else:
elf_path = 'build/release/loader.elf' elf_path = 'build/release/loader.elf'
if (os.path.isfile(elf_path)): if os.path.isfile(elf_path):
sys.exit(os.system("gdb %s -batch -ex conn -ex \"osv trace save %s\"" % (elf_path, args.tracefile))) if os.path.exists(args.tracefile):
os.remove(args.tracefile)
assert(not os.path.exists(args.tracefile))
proc = subprocess.Popen(['gdb', elf_path, '-batch', '-ex', 'conn', '-ex', 'osv trace save ' + args.tracefile],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
_stdout, _ = proc.communicate()
if proc.returncode or not os.path.exists(args.tracefile):
print(_stdout)
sys.exit(1)
else: else:
print("error: %s not found" % (elf_path)) print("error: %s not found" % (elf_path))
sys.exit(1) sys.exit(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment