From patchwork Wed Aug 31 14:04:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 112554 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6C8E0B6F76 for ; Thu, 1 Sep 2011 00:05:23 +1000 (EST) Received: from localhost ([::1]:35049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QylPr-00051n-EX for incoming@patchwork.ozlabs.org; Wed, 31 Aug 2011 10:05:19 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QylPj-00051h-Eg for qemu-devel@nongnu.org; Wed, 31 Aug 2011 10:05:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QylPi-0008Dr-7P for qemu-devel@nongnu.org; Wed, 31 Aug 2011 10:05:11 -0400 Received: from mtagate1.uk.ibm.com ([194.196.100.161]:50442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QylPh-000886-Rx for qemu-devel@nongnu.org; Wed, 31 Aug 2011 10:05:10 -0400 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p7VE4tmo023241 for ; Wed, 31 Aug 2011 14:04:55 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p7VE4sak1376500 for ; Wed, 31 Aug 2011 15:04:55 +0100 Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p7VE4sph032744 for ; Wed, 31 Aug 2011 08:04:54 -0600 Received: from stefanha-thinkpad.ibm.com (frv13125.de.ibm.com [9.145.221.163]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p7VE4rRF032712; Wed, 31 Aug 2011 08:04:53 -0600 From: Stefan Hajnoczi To: Date: Wed, 31 Aug 2011 15:04:52 +0100 Message-Id: <1314799492-11066-1-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 194.196.100.161 Cc: Stefan Hajnoczi Subject: [Qemu-devel] [PATCH] simpletrace: fix process() argument count X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 = {}