From patchwork Tue Mar 13 20:02:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 146482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 59FD8B6EE8 for ; Wed, 14 Mar 2012 07:40:45 +1100 (EST) Received: from localhost ([::1]:59367 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7Xwm-0002mG-4w for incoming@patchwork.ozlabs.org; Tue, 13 Mar 2012 16:03:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7XwO-0002an-Qy for qemu-devel@nongnu.org; Tue, 13 Mar 2012 16:03:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7Xvw-0007rl-J4 for qemu-devel@nongnu.org; Tue, 13 Mar 2012 16:03:28 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:38891) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7Xvw-0007rI-7w for qemu-devel@nongnu.org; Tue, 13 Mar 2012 16:03:00 -0400 Received: from gw.ac.upc.edu (gw.ac.upc.es [147.83.30.3]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id q2DK2tEf023370; Tue, 13 Mar 2012 21:02:55 +0100 Received: from localhost (unknown [84.88.53.92]) by gw.ac.upc.edu (Postfix) with ESMTP id DD4F02D0019; Tue, 13 Mar 2012 21:02:54 +0100 (CET) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Tue, 13 Mar 2012 21:02:54 +0100 Message-Id: <20120313200253.24179.20037.stgit@ginnungagap.bsc.es> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <20120313200235.24179.63987.stgit@ginnungagap.bsc.es> References: <20120313200235.24179.63987.stgit@ginnungagap.bsc.es> User-Agent: StGit/0.16 MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id q2DK2tEf023370 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 147.83.33.10 Cc: stefanha@gmail.com, harsh@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH 03/12] trace: [tracetool] Do not rebuild event list in backend code 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 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 26a4c43..71ef16c 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -240,8 +240,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 @@ -273,7 +272,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 } @@ -417,13 +416,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 = ""