From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1H6A-0008Kr-QP for qemu-devel@nongnu.org; Tue, 24 Nov 2015 12:09:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1H67-0006Rf-EC for qemu-devel@nongnu.org; Tue, 24 Nov 2015 12:09:46 -0500 Received: from roura.ac.upc.edu ([147.83.33.10]:50179 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1H66-0006RV-Uh for qemu-devel@nongnu.org; Tue, 24 Nov 2015 12:09:43 -0500 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Tue, 24 Nov 2015 18:09:42 +0100 Message-Id: <144838498184.3052.14379438606911783414.stgit@localhost> In-Reply-To: <144838492534.3052.2948919558518613064.stgit@localhost> References: <144838492534.3052.2948919558518613064.stgit@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v2 10/10] trace: [tcg] Generate TCG code to trace guest events on a per-vCPU basis List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Eduardo Habkost , Stefan Hajnoczi Events with the 'tcg' and 'vcpu' properties will: * Trace the translation-time event ('*_trans'). * Generate TCG code to call a function that traces the execution-time event ('*_exec') iff the event is enabled for that vCPU. Signed-off-by: Llu=C3=ADs Vilanova --- scripts/tracetool/format/tcg_h.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/tracetool/format/tcg_h.py b/scripts/tracetool/format= /tcg_h.py index 222002c..2ecfc53 100644 --- a/scripts/tracetool/format/tcg_h.py +++ b/scripts/tracetool/format/tcg_h.py @@ -32,7 +32,7 @@ def generate(events, backend): =20 for e in events: # just keep one of them - if "tcg-trans" not in e.properties: + if "tcg-exec" not in e.properties: continue =20 # get the original event definition @@ -52,7 +52,11 @@ def generate(events, backend): =20 if "disable" not in e.properties: out(' %(name_trans)s(%(argnames_trans)s);', - ' gen_helper_%(name_exec)s(%(argnames_exec)s);', + ' if (%(cond)s) {', + ' gen_helper_%(name_exec)s(%(argnames_exec)s);', + ' }', + cond=3D'trace_event_get_cpu_state(_cpu, TRACE_%s)' % e.e= vent_exec.name.upper() + if "vcpu" in e.properties else "true", name_trans=3De.event_trans.api(e.QEMU_TRACE), name_exec=3De.event_exec.api(e.QEMU_TRACE), argnames_trans=3D", ".join(e.event_trans.args.names()),