From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK7Oi-0000SG-Mx for qemu-devel@nongnu.org; Fri, 15 Jan 2016 11:38:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aK7Oe-0004Wk-LP for qemu-devel@nongnu.org; Fri, 15 Jan 2016 11:38:48 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:58121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK7Od-0004Wa-Uq for qemu-devel@nongnu.org; Fri, 15 Jan 2016 11:38:44 -0500 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Fri, 15 Jan 2016 17:38:42 +0100 Message-Id: <145287592254.11400.6186375064145174040.stgit@localhost> In-Reply-To: <145287587081.11400.4178335509020334684.stgit@localhost> References: <145287587081.11400.4178335509020334684.stgit@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v4 9/9] 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 acaa963..42f3b1c 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()),