From patchwork Wed May 31 19:48:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 687287 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp1441497wru; Wed, 31 May 2023 12:48:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6CFgJckHDtjtIzoEh40ubI6oiE1yOWXYkIeRw+BCUr4K8nm5E1Bgv60aftxiBRGhIYK3VH X-Received: by 2002:a05:6214:e61:b0:625:aa49:c34b with SMTP id jz1-20020a0562140e6100b00625aa49c34bmr7065096qvb.63.1685562515570; Wed, 31 May 2023 12:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685562515; cv=none; d=google.com; s=arc-20160816; b=YMsT1Ig/TbNDcJ03xDc5yyZDjObR/gMnmvRmq92jf/JCaiSZmbPIyz4SHThbDj/uSY VY5mLaSkSdQWKGZAZ/NX7NOoM3EPtFRNNlTkl0cGUqhLiHk3c7pr1sy65lMo6WK7wqQt 0RAGvqYyH+mwXLxiSLYT7eaQ/1Z8lI8E+EmKMn2NLlx3sP/FsCIh2mlcZ248WOkEUtS4 cbWzxerbW92NhOfKmGJvB5AeMGQ1zBuv+cYiPLRpqxDyonU/8JOx7HpftZ3t4dd/nbHM sTT8trw0dsWCs97YPAVcjet6ckfweVDwlb7r7kjOycI6KNf2HAA/nHb9CrmEWOQhkIQo 6WWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=oi+seq7KnOXSMael//8077PMVV9G55+tWTDGQkzuYPg=; b=BH8y+Ed7PTI+rWFy4AUhNIMRA8X0eZWntUnhHH8Zny37ykEAWbhuki3GthL/4duPiH REx4tEY7khiWr5kSsKe4Zy+D1JBShgTC9nzI+gR9sCjruOfHpGSWIj/LCda7LhI3/9Qj jrWTv2tnU1CB7ICgfBcLWqNWAi0BM73v0s6ugBbgZ5h6gY+DAthboFFkd9xB7GHjKzW0 UlOnIPMPdpPEeld1jrtR1gWVvUceaGfkbs5F85Hg4OYz+24M2F8r3lCkzUsfRAjblzJC 7JO1gP813bd6I63EO4L4/Wvi3Jvs7LYxyufi8uZaFab0YKwbnsj9h8B5ko3kJcni08kk dpuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VyRASL2e; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id fn6-20020ad45d66000000b006272be53839si1748407qvb.295.2023.05.31.12.48.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 12:48:35 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VyRASL2e; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685562515; 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=oi+seq7KnOXSMael//8077PMVV9G55+tWTDGQkzuYPg=; b=VyRASL2eJ+GzDt1RF3ZZkMMjhAJO8mPDG5AkUcEUU0Ol1AGcmF6MYlZFxTkogXe88fzCNI irVLtHN/IemXTi6dr0VeHoN+qFZ1du6eg3H0Y94yNo3lK7jq18qKrvhzXy8qTFyBfNaguf nPPSH0IiqL5bG4fXDwik1PSEYo7MIzA= 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-588-aKQdpyQYOfSOFJIjJ2hEDg-1; Wed, 31 May 2023 15:48:31 -0400 X-MC-Unique: aKQdpyQYOfSOFJIjJ2hEDg-1 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 6996A28EA6F2; Wed, 31 May 2023 19:48:28 +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 56D4F40CFD47; Wed, 31 May 2023 19:48:28 +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 2822919465B9; Wed, 31 May 2023 19:48:28 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 524AF19465B7 for ; Wed, 31 May 2023 19:48:26 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 440CE40CFD47; Wed, 31 May 2023 19:48:26 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from localhost (unknown [10.39.192.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id B545040CFD46; Wed, 31 May 2023 19:48:25 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL 03/11] trace: remove vcpu_id from the TraceEvent structure Date: Wed, 31 May 2023 15:48:07 -0400 Message-Id: <20230531194815.1508961-4-stefanha@redhat.com> In-Reply-To: <20230531194815.1508961-1-stefanha@redhat.com> References: <20230531194815.1508961-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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 , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Greg Kurz , Markus Armbruster , Yanan Wang , Stefan Hajnoczi , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh , Richard Henderson 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: redhat.com From: Alex Bennée This does involve temporarily stubbing out some helper functions before we excise the rest of the code. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-id: 20230526165401.574474-4-alex.bennee@linaro.org Message-Id: <20230524133952.3971948-4-alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi --- 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)',