aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool.py
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2016-10-04 14:35:58 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2016-10-12 09:54:53 +0200
commit0bc6484d58bd7f43fbf6fc87c7974910b698489c (patch)
treeb5cd069048c78a7d813ad87e379963888979f8e4 /scripts/tracetool.py
parent9096b78a38a22963ca59bb16d54a772aa86d5159 (diff)
trace: pass trace-events to tracetool as a positional param
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 <stefanha@redhat.com> Reviewed-by: LluĂ­s Vilanova <vilanova@ac.upc.edu> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1475588159-30598-20-git-send-email-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts/tracetool.py')
-rwxr-xr-xscripts/tracetool.py5
1 files changed, 4 insertions, 1 deletions
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,