qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] simpletrace: fix process() argument count
@ 2011-08-31 14:04 Stefan Hajnoczi
  0 siblings, 0 replies; only message in thread
From: Stefan Hajnoczi @ 2011-08-31 14:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi

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>
---
 scripts/simpletrace.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py
index 2ad5699..f55e5e6 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 = {}
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-31 14:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-31 14:04 [Qemu-devel] [PATCH] simpletrace: fix process() argument count Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).