From patchwork Tue May 23 12:49:53 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: 684903 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1697573wrt; Tue, 23 May 2023 05:50:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ47cqxXVTq/2YlklwrRoI1BjnqtcYPN3zKBHkCwnQERL8TyPmjxpH/dMZj9S2PobcWREeVI X-Received: by 2002:a05:620a:c0e:b0:75b:23a1:417 with SMTP id l14-20020a05620a0c0e00b0075b23a10417mr3647699qki.45.1684846216890; Tue, 23 May 2023 05:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846216; cv=none; d=google.com; s=arc-20160816; b=0d6YN27V1NdCW9J1yV5bC7/1/HCVKoVGmyHTo+JgdKY96kenwyF0D/AhzBXTVQ28V+ 2yu7aAEWny8jL6oBknbnE11uJ+XQgS/+98Hl03iFgt3cIMztpKsejS7Hic942eJqO9+9 9CZTJhd1V6pKrWR6ZuVAQFIbUQuCd3eIlg8blJiaTmmBDx2d4XOZn/L6OZ9VCd9/hCQ/ hp8cMQCoTznTIx+4/v/HW7N6OsVGs6x5quyCTf948Xdq9PVE1Xfh3fkPVlrA5AvBk5Sk mftj31S1PpYcvCcKEzbnkuAzCjA6dnXofhDE1pArUkV7k9XQ9+vUez6tuQNbtWgvuclP 7IYw== 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=HZeDeOs74kMpCl0WPu+Un7MjTxZvQ9FLsLjn90uKHOo=; b=dDTRNbHHfOKuSvK6eM9DhU8dymn4KvaOj+XIlp9B2OaoFrheaifX2IziTmCVuFsQhu on415cunSnNiBAfqi9Lw7vVLf/Y0N5wpR10daMsaF1cwHsq/BeqIbehUycFpycXN0UHQ igsamllZXzRMRdJBja1TqCipwkmexWRZCk3bxuvkiJRoEW1oGOCBvNV4GEiO9t6FTxEH kIbHKCfNZwgaCtyRKC17tPzvHrI9+WrzpCdlnE4yu3TF2MriuuQ8V7d464T6sfRwEkUm oRYFojl2rv4wAQfuN6wrL/tXrgGW6KYcc/Vox64A+mFlnP5nMHI0CcUHoHpnqy5er/M5 DUUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PU6Yn4Qj; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 kl20-20020a056214519400b005ef5fcb69fesi4910897qvb.245.2023.05.23.05.50.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:16 -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=PU6Yn4Qj; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846216; 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=HZeDeOs74kMpCl0WPu+Un7MjTxZvQ9FLsLjn90uKHOo=; b=PU6Yn4QjRQddkHztMwe8wkfYsX4W0kqCDNYIAjV9xqiZ5fFUGHNCTeHiI2Wtlwxh/R5knH vRbjQuCLelB6RtplVylR6fDwTA2ChYyiwIwcX150hMZQgHtVAf9AWVGRXkDBPFLJshRNge PVWtqvmlG3xrkYs30x8keeLoypy11NQ= 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-6-oWq2ZEKUP2G-93d8P_Qj3A-1; Tue, 23 May 2023 08:50:15 -0400 X-MC-Unique: oWq2ZEKUP2G-93d8P_Qj3A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 99F0A280AA2B; Tue, 23 May 2023 12:50:12 +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 85BB0140EBB8; Tue, 23 May 2023 12:50:12 +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 3C0BB19459F1; Tue, 23 May 2023 12:50:07 +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-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BC5CC19465A0 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AFF6A140E95D; Tue, 23 May 2023 12:50:05 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7F50140E961 for ; Tue, 23 May 2023 12:50:05 +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 8C16F800159 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-654-rBkdjLcYPwqiOoAe0tRqjw-1; Tue, 23 May 2023 08:50:03 -0400 X-MC-Unique: rBkdjLcYPwqiOoAe0tRqjw-1 Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3093d10442aso4721046f8f.1 for ; Tue, 23 May 2023 05:50:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846202; x=1687438202; 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=HZeDeOs74kMpCl0WPu+Un7MjTxZvQ9FLsLjn90uKHOo=; b=NWcJZenKEW/GBCCXG60oQL09xVJrWYgsgNfs9RItfqDY844GrEcfszeQWuuR298GMp yG0fZiumaZB3fvhYQ7PsxJk6TmjzQS9RdjpCWNV6/9wCEJUOB664XikbUB7oiNtx9cSZ JnoJfQIejcc9Z/TGHWdvyFMF1kSXhcSmTNBZ4uqNak+wMFk37hSxaaL5QJPvrFfyCg/w Nl2ulyj5c3+PwvNrGlv0YtEFa8vMP9/mVPvWwkwOWVGLsXzqi/JLQObXWgPjWZI9U8af 4qpS+gnm4LibNFui6N/+u4QmUr2xItNaeQKmSerQQuzB1jPqz3iwww1/ukZ3i4dFDkXH pifQ== X-Gm-Message-State: AC+VfDzHEha2Ly3LH4tPCt2WSYliXQb6xOFxnewx0bLN6lceqH4kj7YF Hp+kPx8MFxGb7D5OwdeuC6nyLw== X-Received: by 2002:a5d:4fcc:0:b0:306:31e0:958 with SMTP id h12-20020a5d4fcc000000b0030631e00958mr9243256wrw.15.1684846202750; Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o10-20020a5d670a000000b0030903371ef9sm11095816wru.22.2023.05.23.05.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4D5901FFBE; Tue, 23 May 2023 13:50:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 03/10] trace: remove vcpu_id from the TraceEvent structure Date: Tue, 23 May 2023 13:49:53 +0100 Message-Id: <20230523125000.3674739-4-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-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.7 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_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.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 Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-4-alex.bennee@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20230505155336.137393-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 *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)',