From nobody Wed May 8 04:38:27 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 1505062430471217.09570931563212; Sun, 10 Sep 2017 09:53:50 -0700 (PDT) Received: from localhost ([::1]:53632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr5UT-0006dZ-C3 for importer@patchew.org; Sun, 10 Sep 2017 12:53:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr5TS-0006HZ-F2 for qemu-devel@nongnu.org; Sun, 10 Sep 2017 12:52:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dr5TP-0008Cz-DI for qemu-devel@nongnu.org; Sun, 10 Sep 2017 12:52:46 -0400 Received: from roura.ac.upc.edu ([147.83.33.10]:55798 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr5TP-0008BN-1g for qemu-devel@nongnu.org; Sun, 10 Sep 2017 12:52:43 -0400 Received: from correu-1.ac.upc.es (correu-1.ac.upc.es [147.83.30.91]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id v8AGqf0g020930; Sun, 10 Sep 2017 18:52:41 +0200 Received: from localhost (unknown [132.68.137.153]) by correu-1.ac.upc.es (Postfix) with ESMTPSA id CF25F5FE; Sun, 10 Sep 2017 18:52:35 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Sun, 10 Sep 2017 19:52:34 +0300 Message-Id: <150506235457.23603.4968569384233027274.stgit@frigg.lan> X-Mailer: git-send-email 2.14.1 User-Agent: StGit/0.18 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 v8AGqf0g020930 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 v2] 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@redhat.com 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. Cora --- Changes in v2 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D * Use RUN_ON_CPU_NULL [Emilio G. Cota]. * Rebase on fcea73709b. --- trace/control-target.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/trace/control-target.c b/trace/control-target.c index 4e36101997..706b2cee9d 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -88,13 +88,17 @@ 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 { + trace_event_synchronize_vcpu_state_dynamic(vcpu, RUN_ON_CPU_NU= LL); + } } } =20