From 0bc6484d58bd7f43fbf6fc87c7974910b698489c Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 4 Oct 2016 14:35:58 +0100 Subject: trace: pass trace-events to tracetool as a positional param MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of reading the contents of 'trace-events' from stdin, accept the filename as a positional parameter. This also allows for reading from multiple files, though this facility is not used at this time. Reviewed-by: Stefan Hajnoczi Reviewed-by: LluĂ­s Vilanova Signed-off-by: Daniel P. Berrange Message-id: 1475588159-30598-20-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/tracetool.py') diff --git a/scripts/tracetool.py b/scripts/tracetool.py index 6accbbff69..f66e767271 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -129,7 +129,10 @@ def main(args): if probe_prefix is None: probe_prefix = ".".join(["qemu", target_type, target_name]) - events = tracetool.read_events(sys.stdin) + if len(args) != 1: + error_opt("missing trace-events filepath") + with open(args[0], "r") as fh: + events = tracetool.read_events(fh) try: tracetool.generate(events, arg_format, arg_backends, -- cgit v1.2.1