From patchwork Wed May 3 09:17:49 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: 678827 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp947967wrs; Wed, 3 May 2023 02:18:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7dh8bpt0lh1tmGpDDitsmR0pjc/5XinKIQpzGC/0RVYdKk8zzXVCn9rIuC/B6SAqkDzCXS X-Received: by 2002:a05:6214:2247:b0:613:831f:9a23 with SMTP id c7-20020a056214224700b00613831f9a23mr10916318qvc.44.1683105495821; Wed, 03 May 2023 02:18:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105495; cv=none; d=google.com; s=arc-20160816; b=pZCNFxGdZngQJlEP9g5P613F0vDltlgqSazow1KXPy3SqR/xIDbK+UxNHChbNaVB/P Vp1oUgAhog4vHgnX9O/o12AdLlePNp4XMvWn/zZjyCMj5yagvOzWzZBVML5e/vPeqA0q Av+smHB+stlQ+Qq2Zad3Lg6LYPw5x9c9SNAWBe6wmESkgm6GLXZ1fsjFibUC03/wzYcz jnwJX6/qTyX3fkRc+SuxX1yNs1gG/6b73Hvy3SldXYlaiDrMWK4A2MG9iZq1Cji/TNvI 2RAHkhBmxbuBsphxvChQV6xiRquMb5uqxsVxj+DHqdhWBXAzEX4JEMPETwvrRKlTSlAr QtgA== 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=v/HuE8TvNTmsubCnSEhnzE79hC0IxWns0KAnAFa0T8o=; b=bBsoeORUns3Xh6qahucSuSPzd1oPIrNLl44tWZqrzVGLnp/zCJ+/cy2ip4aGuIywyH XJtm48o23BsvpNNIKKbuwIggVo7r6GHgTTR+A+6i5qhoyBRW+400RviKO+0Ic4AtDymN hMcCeRwFkKAfxjxfKS/2U0p28TvOH68SSJUw0cr2KLMnsV2FyiWJ91ZodQWuNjaTi00W 8024N4EW9OZ4Fwb5QA0TlTB4rhd9SE/u+NB3/J71eFmKs8yhNhIylAjT0924xeatoorh Fw6VilQHC5uKnBUMR2i+Qlo44ipy7zN8eO81JrFZnveFxobk+8IPSr2tdwFyFj08rqXy nb1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TbgIynk5; 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 i8-20020ad45c68000000b0061b6fd023cbsi801464qvh.574.2023.05.03.02.18.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 02:18:15 -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=TbgIynk5; 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 1pu8cg-0003De-Vw; Wed, 03 May 2023 05:18:07 -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 1pu8cd-0002qm-C8 for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:03 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu8ca-0000Lm-S5 for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:03 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f19a80a330so30534255e9.2 for ; Wed, 03 May 2023 02:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683105479; x=1685697479; 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=v/HuE8TvNTmsubCnSEhnzE79hC0IxWns0KAnAFa0T8o=; b=TbgIynk5A0rOnqyPo/BBrxvj4nyhLW774LA7Y7Z1NO8e5hOetfa2y2zuAoq46oKznO jBdBfEA4c3ut5QoDw6o7vJZ/vnUxe49z0OoGZHUtbqkya3yz7bPslzP3JktyQ9mc9QQf VyyiKUljDfTslzWvl0xG+VWB4sTmN4qxz+1InAqQy5xah55/LJI8H2fV643n4zKrJpCO 1s6QK+5AhX9c0LmlsQaNUZYMedipjBIfPYsCVLa6WU8M0Bco8VEPlcFXRaU574cl/lKQ wdor8ha6Hkm2mghMK7jDtpsHPvfdVxP10JsTvCI8Gvac9mOjyj/oH7gE7vWvI68i11lJ kUHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105479; x=1685697479; 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=v/HuE8TvNTmsubCnSEhnzE79hC0IxWns0KAnAFa0T8o=; b=QKTnZIPVbsk24J9V1gkSau8qXutqrMX1Bl4zL25UHvTlRPW6sPSCuaRLzcNXJUSjys l3rspa4IOndk6D3rP72NnbwV+N2I3SziaEzWFil4PbXPOGROjZJIIkyKwodkswsukXNZ rQHmDaS/c0mmnzaqvBrPMipXI0l11Pz2nx/E4wC+NK2LUBlgHGL482f39RvjvqZtew9c FjDT6wtAT+q3kaK9Y8nr681DCCxB7hyxrXggrxVRUH1FvbCCJgrnRJ7OsZbqJ3lFvSDo p3OOE1pi4sHLdEnneOceHbKfde2gnAAy371G+qwktQZQhk5fPIywIb3dULtj9OL+BUJ8 STQw== X-Gm-Message-State: AC+VfDzYGSxkHMe3xIHEHV5vlvtdIgu2bfyfJ+wd8kAJXyJMLRjnXTvm oFoQKRMDe8GNCET5O09FWVzsBw== X-Received: by 2002:a05:600c:2318:b0:3f1:72ec:400d with SMTP id 24-20020a05600c231800b003f172ec400dmr13534176wmo.33.1683105479081; Wed, 03 May 2023 02:17:59 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d19-20020a1c7313000000b003f17b91c3adsm1279404wmb.28.2023.05.03.02.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:17:57 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5A0991FFC0; Wed, 3 May 2023 10:17:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Riku Voipio , Yanan Wang , Eduardo Habkost , Greg Kurz , Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Schoenebeck , Richard Henderson , Eric Blake , Michael Roth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 03/10] trace: remove vcpu_id from the TraceEvent structure Date: Wed, 3 May 2023 10:17:49 +0100 Message-Id: <20230503091756.1453057-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503091756.1453057-1-alex.bennee@linaro.org> References: <20230503091756.1453057-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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 This does involve temporarily stubbing out some helper functions before we excise the rest of the code. Message-Id: <20230420150009.1675181-4-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- trace/control-internal.h | 4 ++-- trace/event-internal.h | 2 -- trace/control.c | 10 ---------- scripts/tracetool/format/c.py | 6 ------ scripts/tracetool/format/h.py | 11 +---------- 5 files changed, 3 insertions(+), 30 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index 8b2b50a7cf..0178121720 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -27,12 +27,12 @@ static inline uint32_t trace_event_get_id(TraceEvent *ev) static inline uint32_t trace_event_get_vcpu_id(TraceEvent *ev) { - return ev->vcpu_id; + return 0; } static inline bool trace_event_is_vcpu(TraceEvent *ev) { - return ev->vcpu_id != TRACE_VCPU_EVENT_NONE; + return false; } static inline const char * trace_event_get_name(TraceEvent *ev) diff --git a/trace/event-internal.h b/trace/event-internal.h index f63500b37e..0c24e01b52 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -19,7 +19,6 @@ /** * TraceEvent: * @id: Unique event identifier. - * @vcpu_id: Unique per-vCPU event identifier. * @name: Event name. * @sstate: Static tracing state. * @dstate: Dynamic tracing state @@ -33,7 +32,6 @@ */ typedef struct TraceEvent { uint32_t id; - uint32_t vcpu_id; const char * name; const bool sstate; uint16_t *dstate; diff --git a/trace/control.c b/trace/control.c index d24af91004..5dfb609954 100644 --- a/trace/control.c +++ b/trace/control.c @@ -68,16 +68,6 @@ void trace_event_register_group(TraceEvent **events) size_t i; for (i = 0; events[i] != NULL; i++) { events[i]->id = next_id++; - if (events[i]->vcpu_id == TRACE_VCPU_EVENT_NONE) { - continue; - } - - if (likely(next_vcpu_id < CPU_TRACE_DSTATE_MAX_EVENTS)) { - events[i]->vcpu_id = next_vcpu_id++; - } else { - warn_report("too many vcpu trace events; dropping '%s'", - events[i]->name); - } } event_groups = g_renew(TraceEventGroup, event_groups, nevent_groups + 1); event_groups[nevent_groups].events = events; diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index c390c1844a..69edf0d588 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -32,19 +32,13 @@ def generate(events, backend, group): out('uint16_t %s;' % e.api(e.QEMU_DSTATE)) for e in events: - if "vcpu" in e.properties: - vcpu_id = 0 - else: - vcpu_id = "TRACE_VCPU_EVENT_NONE" out('TraceEvent %(event)s = {', ' .id = 0,', - ' .vcpu_id = %(vcpu_id)s,', ' .name = \"%(name)s\",', ' .sstate = %(sstate)s,', ' .dstate = &%(dstate)s ', '};', event = e.api(e.QEMU_EVENT), - vcpu_id = vcpu_id, name = e.name, sstate = "TRACE_%s_ENABLED" % e.name.upper(), dstate = e.api(e.QEMU_DSTATE)) diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index e94f0be7da..285d7b03a9 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -74,16 +74,7 @@ def generate(events, backend, group): out('}') - # tracer wrapper with checks (per-vCPU tracing) - if "vcpu" in e.properties: - trace_cpu = next(iter(e.args))[1] - cond = "trace_event_get_vcpu_state(%(cpu)s,"\ - " TRACE_%(id)s)"\ - % dict( - cpu=trace_cpu, - id=e.name.upper()) - else: - cond = "true" + cond = "true" out('', 'static inline void %(api)s(%(args)s)',