From nobody Fri May 3 10:51:48 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 1505497285686559.9837845878789; Fri, 15 Sep 2017 10:41:25 -0700 (PDT) Received: from localhost ([::1]:54430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsucG-0004ZS-TC for importer@patchew.org; Fri, 15 Sep 2017 13:41:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsuaz-0003qv-KK for qemu-devel@nongnu.org; Fri, 15 Sep 2017 13:40:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dsuay-0005LM-IV for qemu-devel@nongnu.org; Fri, 15 Sep 2017 13:40:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49774) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dsuay-0005LE-CS for qemu-devel@nongnu.org; Fri, 15 Sep 2017 13:40:04 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 68C21C058EAA; Fri, 15 Sep 2017 17:40:03 +0000 (UTC) Received: from localhost (ovpn-117-224.ams2.redhat.com [10.36.117.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D3767E107; Fri, 15 Sep 2017 17:39:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 68C21C058EAA Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=stefanha@redhat.com From: Stefan Hajnoczi To: Date: Fri, 15 Sep 2017 18:39:50 +0100 Message-Id: <20170915173950.21404-2-stefanha@redhat.com> In-Reply-To: <20170915173950.21404-1-stefanha@redhat.com> References: <20170915173950.21404-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 15 Sep 2017 17:40:03 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/1] 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: Peter Maydell , =?UTF-8?q?Llu=C3=ADs=20Vilanova?= , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Llu=C3=ADs Vilanova 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 Message-id: 150525662577.19850.13767570977540117247.stgit@frigg.lan Signed-off-by: Stefan Hajnoczi --- 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 --=20 2.13.5