提交 d8e8ef4e 编写于 作者: S Stefan Hajnoczi

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: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
上级 47f08d7a
......@@ -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 = {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册