summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2011-08-25 18:03:49 +0100
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2011-09-01 10:34:54 +0100
commit59c70c9ddb98378741c76c8b8359520d3510e8e2 (patch)
treed1809770bf4eccaaab19f9d6b02d1f2fdcffef72
parent0db706b976af95e78bb9d90c7016f0b48ebfc084 (diff)
downloadqemu-59c70c9ddb98378741c76c8b8359520d3510e8e2.tar.gz
qemu-59c70c9ddb98378741c76c8b8359520d3510e8e2.tar.bz2
qemu-59c70c9ddb98378741c76c8b8359520d3510e8e2.zip
simpletrace: fix process() argument count
The simpletrace.process() function invokes analyzer methods with the wrong number of arguments if a timestamp should be included. This patch fixes the issue so that trace analysis scripts can make use of timestamps. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-rwxr-xr-xscripts/simpletrace.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py
index 2ad56998ee..f55e5e63f9 100755
--- a/scripts/simpletrace.py
+++ b/scripts/simpletrace.py
@@ -102,10 +102,10 @@ def process(events, log, analyzer):
fn_argcount = len(inspect.getargspec(fn)[0]) - 1
if fn_argcount == event_argcount + 1:
# Include timestamp as first argument
- return lambda _, rec: fn(*rec[1:2 + fn_argcount])
+ return lambda _, rec: fn(*rec[1:2 + event_argcount])
else:
# Just arguments, no timestamp
- return lambda _, rec: fn(*rec[2:2 + fn_argcount])
+ return lambda _, rec: fn(*rec[2:2 + event_argcount])
analyzer.begin()
fn_cache = {}