From nobody Fri May 3 12:51:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150471173813828.834567799828505; Wed, 6 Sep 2017 08:28:58 -0700 (PDT) Received: from localhost ([::1]:36720 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpcG9-0001aL-1y for importer@patchew.org; Wed, 06 Sep 2017 11:28:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpcEf-0000h8-VB for qemu-devel@nongnu.org; Wed, 06 Sep 2017 11:27:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpcEb-0000FY-64 for qemu-devel@nongnu.org; Wed, 06 Sep 2017 11:27:25 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:49193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpcEa-00009E-Qw for qemu-devel@nongnu.org; Wed, 06 Sep 2017 11:27:21 -0400 Received: from correu-2.ac.upc.es (correu-2.ac.upc.es [147.83.30.92]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id v86FRIcJ032741; Wed, 6 Sep 2017 17:27:18 +0200 Received: from localhost (unknown [132.68.137.228]) by correu-2.ac.upc.es (Postfix) with ESMTPSA id 96C7E126C; Wed, 6 Sep 2017 17:27:12 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Wed, 6 Sep 2017 18:27:10 +0300 Message-Id: <150471163020.18882.9386672218918089445.stgit@frigg.lan> X-Mailer: git-send-email 2.14.1 User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id v86FRIcJ032741 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 147.83.33.10 Subject: [Qemu-devel] [PATCH] trace: Immediately apply per-vCPU state changes if a vCPU is being created X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stefanha@gmail.com, Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Right now, function trace_event_set_vcpu_state_dynamic() asynchronously ena= bles events in the case a vCPU is executing TCG code. If the vCPU is being creat= ed this makes some events like "guest_cpu_enter" to not be traced. Signed-off-by: Llu=C3=ADs Vilanova Reviewed-by: Emilio G. Cota --- trace/control-target.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/trace/control-target.c b/trace/control-target.c index 4e36101997..0056da6a46 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -88,13 +88,18 @@ void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, clear_bit(vcpu_id, vcpu->trace_dstate_delayed); (*ev->dstate)--; } - /* - * Delay changes until next TB; we want all TBs to be built from a - * single set of dstate values to ensure consistency of generated - * tracing code. - */ - async_run_on_cpu(vcpu, trace_event_synchronize_vcpu_state_dynamic, - RUN_ON_CPU_NULL); + if (vcpu->created) { + /* + * Delay changes until next TB; we want all TBs to be built fr= om a + * single set of dstate values to ensure consistency of genera= ted + * tracing code. + */ + async_run_on_cpu(vcpu, trace_event_synchronize_vcpu_state_dyna= mic, + RUN_ON_CPU_NULL); + } else { + run_on_cpu_data ignored; + trace_event_synchronize_vcpu_state_dynamic(vcpu, ignored); + } } } =20