From nobody Sun Dec 14 02:32:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1685120056; cv=none; d=zohomail.com; s=zohoarc; b=GXzC9563xPnaHwedd5C0xBU8LkNNNpDECvdbVUJ6VMwR4Wr+7kf/H3tlQJLz7S4Zj2n7QjOdBtqOwXFedRpuLZJTnBI2FeXEU6T8zTR6DvToSDPZSmkfyle2TsqGARBQOai/xMPsEPZtgBYPxCGGObWy1WyG5DAS7YWczJfEsYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685120056; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qF6P+UabTb5zcsOWvNlJLYRb6FGcez1HPmoDCjERVyo=; b=XLTrjUGmzu+voqPr0jAvSRrH6c5C1CVMcoTMDrVpsAPBbvzg1uoCSO95ufbkpsXoNqeqQj47KyhXeujGrC7xjU0B7GjL2GLykD5mmLJgaBbu5c+NFv3U86XQ92/EDP8cQuoDiJ2jo0y/QYqFPThV8csNcZ6jQQKd3sW7bob+Qcg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1685120056951747.7445932129979; Fri, 26 May 2023 09:54:16 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-303-fwLtZAKtMlSNeFEtVqzBcA-1; Fri, 26 May 2023 12:54:12 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A90E63C1411C; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94BC140CFD45; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 461F21946A46; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BBF2B1946A41 for ; Fri, 26 May 2023 16:54:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id ABF9AC154D3; Fri, 26 May 2023 16:54:07 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3B5FC154D1 for ; Fri, 26 May 2023 16:54:07 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 67EE3101A53B for ; Fri, 26 May 2023 16:54:07 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-98-9subThkpN9Ofa4AxXTy3rQ-1; Fri, 26 May 2023 12:54:05 -0400 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-30addbb1b14so294844f8f.2 for ; Fri, 26 May 2023 09:54:05 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o8-20020adfcf08000000b00306c5900c10sm5709524wrj.9.2023.05.26.09.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0ED491FFBB; Fri, 26 May 2023 17:54:03 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120056; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qF6P+UabTb5zcsOWvNlJLYRb6FGcez1HPmoDCjERVyo=; b=JdOK4PDa9+FRUqGkATs6+M0q7Bnj76RpZPnPcuPvv2/xxAtTqnAHYnEL6OpF2Z887whQgl LlB+xHdS5sV+EsXhOyyQ0zXlwl4IbEyIGDK6ysupldjA9xg6O3LyRuit/lCXUl/JAe5YpH bhUTewEA8kPKNqJIdza2JE/3cKmpD7E= X-MC-Unique: fwLtZAKtMlSNeFEtVqzBcA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 9subThkpN9Ofa4AxXTy3rQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120044; x=1687712044; 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=qF6P+UabTb5zcsOWvNlJLYRb6FGcez1HPmoDCjERVyo=; b=hRVZS9nKrZdJ+lT2LoyUJYkO1eTd8UamuguL1BQSAGW5ou350w3qQi5jL6Ffoj2GrM D4RwMmqb5DdMHy6Yzv/fkc4uYzLHh88+PTnRoYpUyCR+L5b9DutFyxHAGT8dMNGhl4ch Y5EeGfeb0+g8ENsaydyBzAAlul2Ip6lIUPBbUIjEhcPZ18drvM8Jlq7Z0m9Verumc0O9 PigZcIhxN9uR5GXI4iwNo2GCEqx0Ll37O5+KwLSeCxcr0eF0y+3pQVgvVVcIiM/8l2Sx +NrrdEvzJI38nVy/U2/B0PHNy+RIWfis7qfIIAdndUGLPyehcvOl59IsXG7/iRcrMpkJ 1iSw== X-Gm-Message-State: AC+VfDy4QmYfh59KDJw9WSyL3pMnq8uA4M2NrfGtl4kERusYeP3yt8vs kFoh4DyXLFCzO7mu8zpuTT2IeQ== X-Google-Smtp-Source: ACHHUZ4PXDq85fXL9gZfcVujUfStUjpTsjvsJlvzzkjGoVcKLyC1UT0Q97eMH663QquRp7nMrGhzBg== X-Received: by 2002:a5d:630c:0:b0:30a:d7a7:3db4 with SMTP id i12-20020a5d630c000000b0030ad7a73db4mr1595931wru.12.1685120044311; Fri, 26 May 2023 09:54:04 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 03/11] trace: remove vcpu_id from the TraceEvent structure Date: Fri, 26 May 2023 17:53:53 +0100 Message-Id: <20230526165401.574474-4-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685120058962100003 This does involve temporarily stubbing out some helper functions before we excise the rest of the code. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230524133952.3971948-4-alex.bennee@linaro.org> --- 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 *e= v) =20 static inline uint32_t trace_event_get_vcpu_id(TraceEvent *ev) { - return ev->vcpu_id; + return 0; } =20 static inline bool trace_event_is_vcpu(TraceEvent *ev) { - return ev->vcpu_id !=3D TRACE_VCPU_EVENT_NONE; + return false; } =20 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 =3D 0; events[i] !=3D NULL; i++) { events[i]->id =3D next_id++; - if (events[i]->vcpu_id =3D=3D TRACE_VCPU_EVENT_NONE) { - continue; - } - - if (likely(next_vcpu_id < CPU_TRACE_DSTATE_MAX_EVENTS)) { - events[i]->vcpu_id =3D next_vcpu_id++; - } else { - warn_report("too many vcpu trace events; dropping '%s'", - events[i]->name); - } } event_groups =3D g_renew(TraceEventGroup, event_groups, nevent_groups = + 1); event_groups[nevent_groups].events =3D 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)) =20 for e in events: - if "vcpu" in e.properties: - vcpu_id =3D 0 - else: - vcpu_id =3D "TRACE_VCPU_EVENT_NONE" out('TraceEvent %(event)s =3D {', ' .id =3D 0,', - ' .vcpu_id =3D %(vcpu_id)s,', ' .name =3D \"%(name)s\",', ' .sstate =3D %(sstate)s,', ' .dstate =3D &%(dstate)s ', '};', event =3D e.api(e.QEMU_EVENT), - vcpu_id =3D vcpu_id, name =3D e.name, sstate =3D "TRACE_%s_ENABLED" % e.name.upper(), dstate =3D 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): =20 out('}') =20 - # tracer wrapper with checks (per-vCPU tracing) - if "vcpu" in e.properties: - trace_cpu =3D next(iter(e.args))[1] - cond =3D "trace_event_get_vcpu_state(%(cpu)s,"\ - " TRACE_%(id)s)"\ - % dict( - cpu=3Dtrace_cpu, - id=3De.name.upper()) - else: - cond =3D "true" + cond =3D "true" =20 out('', 'static inline void %(api)s(%(args)s)', --=20 2.39.2