mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
tracetool: add output filename command-line argument
The tracetool.py script writes to stdout. This means the output filename is not available to the script. Add the output filename to the command-line so that the script has access to the filename. This also simplifies the tracetool.py invocation. It's no longer necessary to use meson's custom_build(capture : true) to save output. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20200827142915.108730-2-stefanha@redhat.com>
This commit is contained in:
parent
6745c8a01f
commit
c05012a365
5 changed files with 33 additions and 24 deletions
|
@ -16,7 +16,7 @@ __email__ = "stefanha@redhat.com"
|
|||
import sys
|
||||
import getopt
|
||||
|
||||
from tracetool import error_write, out
|
||||
from tracetool import error_write, out, out_open
|
||||
import tracetool.backend
|
||||
import tracetool.format
|
||||
|
||||
|
@ -32,7 +32,7 @@ def error_opt(msg = None):
|
|||
format_descr = "\n".join([ " %-15s %s" % (n, d)
|
||||
for n,d in tracetool.format.get_list() ])
|
||||
error_write("""\
|
||||
Usage: %(script)s --format=<format> --backends=<backends> [<options>]
|
||||
Usage: %(script)s --format=<format> --backends=<backends> [<options>] <trace-events> ... <output>
|
||||
|
||||
Backends:
|
||||
%(backends)s
|
||||
|
@ -135,13 +135,15 @@ def main(args):
|
|||
if probe_prefix is None:
|
||||
probe_prefix = ".".join(["qemu", target_type, target_name])
|
||||
|
||||
if len(args) < 1:
|
||||
error_opt("missing trace-events filepath")
|
||||
if len(args) < 2:
|
||||
error_opt("missing trace-events and output filepaths")
|
||||
events = []
|
||||
for arg in args:
|
||||
for arg in args[:-1]:
|
||||
with open(arg, "r") as fh:
|
||||
events.extend(tracetool.read_events(fh, arg))
|
||||
|
||||
out_open(args[-1])
|
||||
|
||||
try:
|
||||
tracetool.generate(events, arg_group, arg_format, arg_backends,
|
||||
binary=binary, probe_prefix=probe_prefix)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue