From patchwork Tue Mar 13 20:03:16 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: 146479 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 39CE6B6EE7 for ; Wed, 14 Mar 2012 07:24:19 +1100 (EST) Received: from localhost ([::1]:33844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7XxF-0004B6-G0 for incoming@patchwork.ozlabs.org; Tue, 13 Mar 2012 16:04:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7XwK-0002Ow-Ql for qemu-devel@nongnu.org; Tue, 13 Mar 2012 16:03:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7XwJ-0007yY-0g for qemu-devel@nongnu.org; Tue, 13 Mar 2012 16:03:24 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:38906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7XwI-0007y6-M4 for qemu-devel@nongnu.org; Tue, 13 Mar 2012 16:03:22 -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 q2DK3IlA023393; Tue, 13 Mar 2012 21:03:18 +0100 Received: from localhost (unknown [84.88.53.92]) by gw.ac.upc.edu (Postfix) with ESMTP id 580832D0018; Tue, 13 Mar 2012 21:03:17 +0100 (CET) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Tue, 13 Mar 2012 21:03:16 +0100 Message-Id: <20120313200316.24179.57107.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 q2DK3IlA023393 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 07/12] trace: [tracetool] Process the "disable" event property 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 Use different converters (depending on the 'disabled' property) regardless of the output format. Signed-off-by: LluĂ­s Vilanova Signed-off-by: Harsh Prateek Bora --- scripts/tracetool.py | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/scripts/tracetool.py b/scripts/tracetool.py index fa646bc..d7c04b4 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -290,6 +290,9 @@ def dtrace_d(events): print print '};' +def dtrace_nop_d(events): + pass + def dtrace_stp(events): for event in events: # Define prototype for probe arguments @@ -311,6 +314,9 @@ probe %(probeprefix)s.%(name)s = process("%(binary)s").mark("%(name)s") print '}' print +def dtrace_nop_stp(events): + pass + def trace_stap_begin(): print '/* This file is autogenerated by tracetool, do not edit. */' @@ -334,6 +340,8 @@ converters = { 'nop': { 'h': nop_h, 'c': nop_c, + 'd': dtrace_nop_d, + 'stap': dtrace_nop_stp, }, 'stderr': { @@ -483,17 +491,11 @@ def main(): if probeprefix == "": probeprefix = 'qemu.' + targettype + '.' + targetarch - disabled_events, enabled_events = [], [] - for e in read_events(sys.stdin): - if 'disable' in e.properties: - disabled_events.append(e) - else: - enabled_events.append(e) + events = read_events(sys.stdin) trace_gen[output]['begin']() - if output == 'h': # disabled events - converters['nop'][output](disabled_events) - converters[backend][output](enabled_events) + converters[backend][output]([ e for e in events if 'disable' not in e.properties ]) + converters['nop'][output]([ e for e in events if 'disable' in e.properties ]) trace_gen[output]['end']() if __name__ == "__main__":