From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsVx2-00039r-PC for qemu-devel@nongnu.org; Thu, 14 Sep 2017 11:21:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dsVww-0006eZ-Qr for qemu-devel@nongnu.org; Thu, 14 Sep 2017 11:21:12 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:53474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsVww-0006e8-Fy for qemu-devel@nongnu.org; Thu, 14 Sep 2017 11:21:06 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <150505986682.19604.11937392314067517230.stgit@frigg.lan> <150506107741.19604.8328467942268087647.stgit@frigg.lan> <3fb9d3ac-db86-2ff7-d6e1-988982d1eb18@linaro.org> Date: Thu, 14 Sep 2017 18:20:56 +0300 In-Reply-To: <3fb9d3ac-db86-2ff7-d6e1-988982d1eb18@linaro.org> (Richard Henderson's message of "Wed, 13 Sep 2017 10:34:05 -0700") Message-ID: <8760clpaqv.fsf@frigg.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 5/7] trace: Add event "guest_bbl_after" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, Paolo Bonzini , Richard Henderson , Stefan Hajnoczi , Peter Crosthwaite Richard Henderson writes: > On 09/10/2017 09:31 AM, Llu=C3=ADs Vilanova wrote: >> +void translator__gen_goto_tb(TCGContext *ctx) >> +{ >> + if (ctx->disas.in_guest_code && >> + (TRACE_GUEST_BBL_AFTER_ENABLED)) { >> + if (ctx->disas.inline_label =3D=3D NULL) { >> + ctx->disas.inline_label =3D gen_new_inline_label(); >> + } >> + gen_set_inline_point(ctx->disas.inline_label); >> + /* disable next exit_tb */ >> + ctx->disas.seen_goto_tb =3D true; >> + } >> +} >> + >> +void translator__gen_exit_tb(TCGContext *ctx) >> +{ >> + if (ctx->disas.in_guest_code && !ctx->disas.seen_goto_tb && >> + (TRACE_GUEST_BBL_AFTER_ENABLED)) { >> + if (ctx->disas.inline_label =3D=3D NULL) { >> + ctx->disas.inline_label =3D gen_new_inline_label(); >> + } >> + gen_set_inline_point(ctx->disas.inline_label); >> + /* enable next exit_tb */ >> + ctx->disas.seen_goto_tb =3D false; >> + } >> +} > I don't understand why you wouldn't just modify tcg_gen_goto_tb and > tcg_gen_exit_tb instead. I prefer to keep all generic translation-related tracing on a single file, = where it is easier to reason about. Cheers, Lluis