From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Tue, 13 Mar 2012 21:03:16 +0100 Message-Id: <20120313200316.24179.57107.stgit@ginnungagap.bsc.es> In-Reply-To: <20120313200235.24179.63987.stgit@ginnungagap.bsc.es> References: <20120313200235.24179.63987.stgit@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 07/12] trace: [tracetool] Process the "disable" event property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: stefanha@gmail.com, harsh@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com Use different converters (depending on the 'disabled' property) regardles= s of the output format. Signed-off-by: Llu=C3=ADs 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 '};' =20 +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 =3D process("%(binary)= s").mark("%(name)s") print '}' print =20 +def dtrace_nop_stp(events): + pass + def trace_stap_begin(): print '/* This file is autogenerated by tracetool, do not edit. */' =20 @@ -334,6 +340,8 @@ converters =3D { 'nop': { 'h': nop_h, 'c': nop_c, + 'd': dtrace_nop_d, + 'stap': dtrace_nop_stp, }, =20 'stderr': { @@ -483,17 +491,11 @@ def main(): if probeprefix =3D=3D "": probeprefix =3D 'qemu.' + targettype + '.' + targetarch =20 - disabled_events, enabled_events =3D [], [] - for e in read_events(sys.stdin): - if 'disable' in e.properties: - disabled_events.append(e) - else: - enabled_events.append(e) + events =3D read_events(sys.stdin) =20 trace_gen[output]['begin']() - if output =3D=3D '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.prop= erties ]) trace_gen[output]['end']() =20 if __name__ =3D=3D "__main__":