From patchwork Wed May 24 13:39:45 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: 685343 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp257007wrt; Wed, 24 May 2023 06:40:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6RRyCwAp50qj8V/Tw5cDStHJoWs2K7xkz3zTKGbYjGS68S5qqU/zS8ny4qqruaFCv3FSzi X-Received: by 2002:a05:6214:413:b0:616:5f27:b96a with SMTP id z19-20020a056214041300b006165f27b96amr30455226qvx.27.1684935615593; Wed, 24 May 2023 06:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684935615; cv=none; d=google.com; s=arc-20160816; b=gvz/wwZbgh4aYWHGW9e8rTFWjj2LqmBSZ1V2+gX3lYQdYESDJ06bUdi/WXDOhp1rX0 lWuTQOGgW8C000tykeiVu2qbRi+q3I3PR6cbRHG2auipG2VD85sLA/HGEyZ2Q8oIYrtB AZ+w7fSFtPfuR68BJTuvOYUtgJJQtCM7jln+DlEjVZE5SMYPdfsC2tNa/jDQjzFsbFCI r9QiDbBmE6qqZH3byWzwnP4G+PG5I5yAHvOCbpxNdDlrCfPcOxLwc+gjxuvqJlK3MAP9 vOQmG+/4MkwpFubI/rSxnZAP58OMqfqCpXPXcilR+kMkd5DtZY+tJj8LI6pTVlQPDhDd 0SXQ== 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=rJVPWXx5AwD7VKV2U66DJQZzDYUvPoHQtuGdzv7YoHE=; b=TRlLmONtZ9D5ztTgnbCevQ//WuPppw3a8Qh7B/KAaQernLm72ILNLrScaxVUrKKM1E 1v+XVWvH0W3XmcEQ0WDrT/Sa/zpOdZZmOevyqHC9eVg0EkPOTf3hOpDnQCyAvbfczdCs mz41XFLa20QD6yIilxiAE86oWHK4G0G2uPPX2Vnmg0Ag+0MDc7V/L3PGKOJkPgUr6vss zzIEnsDBq6BE8ldje7fQfZGHoO61g/pMZFhChWZwTeCWfhou5bzXn/uX0JGXj7NtSUMd eEO0MZuO0HvDF3een9obbht+WpRtizHepAYFt+xN4A4zZc9ZNV25esxodwm4zU19BSE6 MMIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pIvUDWZQ; 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 jn1-20020ad45de1000000b005ef8b3a05c2si6448682qvb.285.2023.05.24.06.40.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 06:40: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=pIvUDWZQ; 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 1q1oig-0008D3-T5; Wed, 24 May 2023 09:40:02 -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 1q1oib-00083d-NP for qemu-devel@nongnu.org; Wed, 24 May 2023 09:39:57 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1oiZ-0003li-SK for qemu-devel@nongnu.org; Wed, 24 May 2023 09:39:57 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f427118644so11030715e9.0 for ; Wed, 24 May 2023 06:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684935594; x=1687527594; 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=rJVPWXx5AwD7VKV2U66DJQZzDYUvPoHQtuGdzv7YoHE=; b=pIvUDWZQ/qIiRJiIcW8j9SgR4sbdcWnkrEslmgC5waWteC/eMp3AdZOLig/iBqcQpe +inoKSdzEN9oak6hZUpQDZSswYcuiNZDYyDDbL33x3U7SRFwp0PD+q6dKj0oj1NzwG6d BJeGeUguanN1+bCmtbWtWadzlcP6gGbW1i6qzuFcKyo1cuyPOuGbuYKLp/HT6KM0H6AD CZkujUWV6C9g8jWR3UMceKXqXsNsTDIiakXQDF7lj7JDNk7aKsM1DrF9VyBBnlTXBC9J NmItsr6ztcyubTjmQrlptFu2417mZeQEMkuXOz3RiDVKXf9p/qR3RSxZHzmyq6xgZP+O fgVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684935594; x=1687527594; 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=rJVPWXx5AwD7VKV2U66DJQZzDYUvPoHQtuGdzv7YoHE=; b=HQcbPL3Zp+D/KAIiVZKJ+mo5DepDHy1ZdSNizfH3t00asWpYcqKrf5WxEMdz0+MIj1 cytyzFFts9bLRqoyaHFAXPfsW/UegdQZn4i/ChOM/FQc0EiT6eB9Zgpnk1kjgLQ4eC3y BPgITqx4W6YA1hqNlPn+YB3CkvqxfXAI+zJFUPdIGFp8TYHzhN/xoNG1M3761bXvp+S8 cDyWFmrdJm/GQ90JVTXC5kwKk/5eJdS1Y4yTcRdZO0x1l8yeDFC/VzdasRCbeMmUZHXG EXOxylnE+5L1mtd6ziOpLe95QCzQQTXEWfNnyW1zl1nuyuGNOez/j4dvGNfU2acaleLe EhXQ== X-Gm-Message-State: AC+VfDxBywnqFGWemnzILnaJ3avc1JHT2gZYjZxxHCjn7DMx/1qdlTzv XXRtE27LEYDg5W9KAOY81+a4oj7mxL1X7amsB2CQtw== X-Received: by 2002:a05:600c:20d:b0:3f6:735:69e7 with SMTP id 13-20020a05600c020d00b003f6073569e7mr6421168wmi.36.1684935594316; Wed, 24 May 2023 06:39:54 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id u2-20020a05600c210200b003f42314832fsm2379125wml.18.2023.05.24.06.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 06:39:54 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4CC371FFBE; Wed, 24 May 2023 14:39:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kyle Evans , libvir-list@redhat.com, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Greg Kurz , Eric Blake , Markus Armbruster , Warner Losh , Marcel Apfelbaum , Eduardo Habkost , Michael Roth , Richard Henderson , Christian Schoenebeck , Riku Voipio , Paolo Bonzini , Yanan Wang , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v5 03/10] trace: remove vcpu_id from the TraceEvent structure Date: Wed, 24 May 2023 14:39:45 +0100 Message-Id: <20230524133952.3971948-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524133952.3971948-1-alex.bennee@linaro.org> References: <20230524133952.3971948-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.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. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230523125000.3674739-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)',