From patchwork Fri May 5 15:53:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 679310 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp438062wrs; Fri, 5 May 2023 08:55:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ml3dPYzlvEp+Bs+C5ET8ujneeQ1B+yj9rbRNiAKiRWYLsIT/i81WpgWx0cXGamgJkGFmK X-Received: by 2002:a05:622a:148d:b0:3f0:daab:f24f with SMTP id t13-20020a05622a148d00b003f0daabf24fmr3020523qtx.68.1683302100692; Fri, 05 May 2023 08:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683302100; cv=none; d=google.com; s=arc-20160816; b=bPmL3f54/oQwKc3wJtgn/0Xg/vCo4KROakEZS9xW0WThsKhPEK052U7LvsV4ZViRen o3KDw9OydLG8XYIHIrwYwbyeK/uMx9Yr+zfFffwYggJsgD5CWeBZzUUyoplqEqX7L4eK exvxc5HIOmYOdVtumcMm3c46Zpu/Rk5UW8dx9Bdhgp/2aohbWi5+G8f7ExrWOtgfpqtJ JFnC+f3UKv0vzH16GY7ksgGDpXVlnwby2SQRbRKFih3ktl98s6VgJdUKPmcqCwO7z91q lL3RW9/stgh/pfY/egh1q/1t0di30uQtoRDdbFahdLy0hYSGy6c/jgeVIYNLxNOBJNpm FGHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fP88xWRTq0YOoukl2eZvLZM8OkmfjfHbQrJlI+FEzEo=; b=LZmlSPJHdyCVWbRddh8u+QxR6KF1hJNSsf6q/Dvb9D/FBqjIHCPJuJ2xatyogFBC4F IjY8BuU7PWnXsHSh3p30iuojH+TkWiiBBjSsdcjXJne8cyDjQrTJ2xr6Hi9uA/A2cOZN x5iGO1YkFBTInjdhvTSvK13/Bx5F/yudi3d6srt1gOVgSgcXnOzoV9P+HOJi5iuHPAnb Xgwo4dup+pmhZuuhRRz1J3PSbe2N6qGvtxRKoNQNpsz+SoS+4n3pl9bXUKeUJQyFuY4l v5D2sM5Uq9la3S2Th+YqVmgLZEJ6nOA+AbFYWZoasU6ItsAp+/mlV3VugHHhRp2R3FB6 QOCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UwtBDGfT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j15-20020a05622a038f00b003e8846087b6si683978qtx.367.2023.05.05.08.55.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 May 2023 08:55:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UwtBDGfT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puxkg-0003Mj-Or; Fri, 05 May 2023 11:53:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puxkc-0003Iq-PP for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:42 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puxka-0008D1-Cb for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:41 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f315712406so104946965e9.0 for ; Fri, 05 May 2023 08:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683302018; x=1685894018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fP88xWRTq0YOoukl2eZvLZM8OkmfjfHbQrJlI+FEzEo=; b=UwtBDGfT0wbs+Trr1+c1inCCOobVWyJzt1y02qHV6NALVzEY05Co3EOEDcq8NizorT ACZwJRuW3O4KBb7wcrBc5oxOwJdYEggQaSRdTrJ/NSL7V64XY9RHi/6CSh8JLhWW1x9I aWpCkiavVxTlic4xJuP3h6t51yRgzQVXKlSHfLLiSjD4pkIb/ojmqYLhiyapxXMKYQw9 LUtIc0XcR8xsIUfkEv3cyfHeFK6T2foljdtizEjBLYF4VSTex9U6gj0tXLppYpvQnGQ1 A5aPf8Zx/G/MFqKK4YAd3Y11gonRbzi4wCQSpJF0B9gjXzqwN5Bk0eT0grnjR+Kud8eH /A+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683302018; x=1685894018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fP88xWRTq0YOoukl2eZvLZM8OkmfjfHbQrJlI+FEzEo=; b=SSlvPXAYCfvVofc7NRVW+aBqlBo/Vwemho5JAQTaaMFXwjiruAtq7BA57jTvbxt0HQ nnBbBWkXESiLiiiU/3rg+9McH0xlijWUXVmVrGsWIryxVBpi2xHtvP+fy+jFLzC48IpQ K7JD8oWJK1IqcTYrnqr2rgnkvSfE7LNFYR2W75cdFIFxZjETm9b8IuhZg79STrK6aR2/ qUK1BUm60JKPENKYFKUvSArQjAJX4GlVOI8QkQFXltEQRhdf169I/t+rDNr9sFg8G0IG 8ZyXpQA/+MaSEc1YkmiCCVChqM/9SseceXJJZzi/183MzuB1ylU0THuVCSd0AqWBgdaB 8/tQ== X-Gm-Message-State: AC+VfDwdJm4R1SO92pH23JOM07Wo7J+2MmESnFcG9BpwrDDBgVzarWpk GVvJgS0+tvESi8ucJK6bYCtQSQ== X-Received: by 2002:a7b:c398:0:b0:3f2:5be3:cd6b with SMTP id s24-20020a7bc398000000b003f25be3cd6bmr1696914wmj.3.1683302018198; Fri, 05 May 2023 08:53:38 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id k12-20020a7bc40c000000b003f175b360e5sm8386081wmi.0.2023.05.05.08.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 08:53:37 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C85461FFBD; Fri, 5 May 2023 16:53:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Christian Schoenebeck , Michael Roth , Eric Blake , Paolo Bonzini , Greg Kurz , Eduardo Habkost , Yanan Wang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Kyle Evans , Warner Losh , Richard Henderson , Markus Armbruster , Riku Voipio , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v3 02/10] trace-events: remove the remaining vcpu trace events Date: Fri, 5 May 2023 16:53:28 +0100 Message-Id: <20230505155336.137393-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505155336.137393-1-alex.bennee@linaro.org> References: <20230505155336.137393-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org While these are all in helper functions being designated vcpu events complicates the removal of the dynamic vcpu state code. TCG plugins allow you to instrument vcpu_[init|exit|idle]. We rename cpu_reset and make it a normal trace point. Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230503091756.1453057-3-alex.bennee@linaro.org> --- v3 - s/watch/trace/ in commit msg --- hw/core/cpu-common.c | 4 ++-- trace/control-target.c | 1 - trace/control.c | 2 -- hw/core/trace-events | 3 +++ trace-events | 31 ------------------------------- 5 files changed, 5 insertions(+), 36 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 5ccc3837b6..951477a7fd 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -32,7 +32,7 @@ #include "sysemu/tcg.h" #include "hw/boards.h" #include "hw/qdev-properties.h" -#include "trace/trace-root.h" +#include "trace.h" #include "qemu/plugin.h" CPUState *cpu_by_arch_id(int64_t id) @@ -113,7 +113,7 @@ void cpu_reset(CPUState *cpu) { device_cold_reset(DEVICE(cpu)); - trace_guest_cpu_reset(cpu); + trace_cpu_reset(cpu->cpu_index); } static void cpu_common_reset_hold(Object *obj) diff --git a/trace/control-target.c b/trace/control-target.c index 232c97a4a1..c6132f243f 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -145,5 +145,4 @@ void trace_init_vcpu(CPUState *vcpu) } } } - trace_guest_cpu_enter(vcpu); } diff --git a/trace/control.c b/trace/control.c index 6c77cc6318..d24af91004 100644 --- a/trace/control.c +++ b/trace/control.c @@ -277,8 +277,6 @@ void trace_fini_vcpu(CPUState *vcpu) TraceEventIter iter; TraceEvent *ev; - trace_guest_cpu_exit(vcpu); - trace_event_iter_init_all(&iter); while ((ev = trace_event_iter_next(&iter)) != NULL) { if (trace_event_is_vcpu(ev) && diff --git a/hw/core/trace-events b/hw/core/trace-events index 56da55bd71..2cf085ac66 100644 --- a/hw/core/trace-events +++ b/hw/core/trace-events @@ -29,3 +29,6 @@ clock_set(const char *clk, uint64_t old, uint64_t new) "'%s', %"PRIu64"Hz->%"PRI clock_propagate(const char *clk) "'%s'" clock_update(const char *clk, const char *src, uint64_t hz, int cb) "'%s', src='%s', val=%"PRIu64"Hz cb=%d" clock_set_mul_div(const char *clk, uint32_t oldmul, uint32_t mul, uint32_t olddiv, uint32_t div) "'%s', mul: %u -> %u, div: %u -> %u" + +# cpu-common.c +cpu_reset(int cpu_index) "%d" diff --git a/trace-events b/trace-events index 691c3533e4..dd318ed1af 100644 --- a/trace-events +++ b/trace-events @@ -54,34 +54,3 @@ qmp_job_resume(void *job) "job %p" qmp_job_complete(void *job) "job %p" qmp_job_finalize(void *job) "job %p" qmp_job_dismiss(void *job) "job %p" - - -### Guest events, keep at bottom - - -## vCPU - -# trace/control-target.c - -# Hot-plug a new virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_enter(void) - -# trace/control.c - -# Hot-unplug a virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_exit(void) - -# hw/core/cpu.c - -# Reset the state of a virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_reset(void) -