From patchwork Thu Mar 1 13:25:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harsh Prateek Bora X-Patchwork-Id: 144004 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 592A0B6EF1 for ; Fri, 2 Mar 2012 00:26:14 +1100 (EST) Received: from localhost ([::1]:48828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S361L-0002Pu-Kb for incoming@patchwork.ozlabs.org; Thu, 01 Mar 2012 08:26:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S361B-0002PG-Iw for qemu-devel@nongnu.org; Thu, 01 Mar 2012 08:26:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3614-0000Tq-1k for qemu-devel@nongnu.org; Thu, 01 Mar 2012 08:26:01 -0500 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:37581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3613-0000S1-7L for qemu-devel@nongnu.org; Thu, 01 Mar 2012 08:25:53 -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:47 +0530 Received: from d28relay03.in.ibm.com (9.184.220.60) by e28smtp04.in.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 1 Mar 2012 18:55:44 +0530 Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q21DPgMh4177958 for ; Thu, 1 Mar 2012 18:55:43 +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 q21DPfDK013206 for ; Fri, 2 Mar 2012 00:25:41 +1100 Received: from harshbora.in.ibm.com ([9.124.35.242]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q21DPfJk013178; Fri, 2 Mar 2012 00:25:41 +1100 From: Harsh Prateek Bora To: qemu-devel@nongnu.org Date: Thu, 1 Mar 2012 18:55:32 +0530 Message-Id: <1330608340-9515-7-git-send-email-harsh@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1.1 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 x-cbid: 12030113-5564-0000-0000-0000019F16A0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 122.248.162.4 Cc: stefanha@gmail.com, vilanova@ac.upc.edu, aneesh.kumar@linux.vnet.ibm.com Subject: [Qemu-devel] [RFC PATCH v5 06/14] 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 From: Lluís Vilanova 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 3502524..1cf5c8f 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -304,6 +304,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 @@ -325,6 +328,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. */' @@ -348,6 +354,8 @@ converters = { 'nop': { 'h': nop_h, 'c': nop_c, + 'd': dtrace_nop_d, + 'stap': dtrace_nop_stp, }, 'stderr': { @@ -498,17 +506,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__":