From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S361T-0002z4-ST for qemu-devel@nongnu.org; Thu, 01 Mar 2012 08:26:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3614-0000UT-8a for qemu-devel@nongnu.org; Thu, 01 Mar 2012 08:26:19 -0500 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:37576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3613-0000RM-IS for qemu-devel@nongnu.org; Thu, 01 Mar 2012 08:25:54 -0500 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 1 Mar 2012 18:55:46 +0530 Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q21DPfpZ2547750 for ; Thu, 1 Mar 2012 18:55:42 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q21DPfZV013190 for ; Fri, 2 Mar 2012 00:25:41 +1100 From: Harsh Prateek Bora Date: Thu, 1 Mar 2012 18:55:28 +0530 Message-Id: <1330608340-9515-3-git-send-email-harsh@linux.vnet.ibm.com> In-Reply-To: <1330608340-9515-1-git-send-email-harsh@linux.vnet.ibm.com> References: <1330608340-9515-1-git-send-email-harsh@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [RFC PATCH v5 02/14] trace: [tracetool] Do not rebuild event list in backend code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: stefanha@gmail.com, vilanova@ac.upc.edu, aneesh.kumar@linux.vnet.ibm.com From: Lluís Vilanova Signed-off-by: Lluís Vilanova Signed-off-by: Harsh Prateek Bora --- scripts/tracetool.py | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/tracetool.py b/scripts/tracetool.py index 079ec7a..274fa70 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -257,8 +257,7 @@ def ust_c(events): #undef inline #undef wmb #include "trace.h"''' - eventlist = list(events) - for event in eventlist: + for event in events: argnames = event.argnames if event.argc > 0: argnames = ', ' + event.argnames @@ -290,7 +289,7 @@ static void ust_%(name)s_probe(%(args)s) print ''' static void __attribute__((constructor)) trace_init(void) {''' - for event in eventlist: + for event in events: print ' register_trace_ust_%(name)s(ust_%(name)s_probe);' % { 'name': event.name } @@ -435,13 +434,15 @@ class Event(object): # Generator that yields Event objects given a trace-events file object def read_events(fobj): event_num = 0 + res = [] for line in fobj: if not line.strip(): continue if line.lstrip().startswith('#'): continue - yield Event(event_num, line) + res.append(Event(event_num, line)) event_num += 1 + return res binary = "" probeprefix = "" -- 1.7.1.1