From nobody Sun May 12 23:11:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1682002960; cv=none; d=zohomail.com; s=zohoarc; b=AXtFkhKm2dSOyR2MnEVUyMdyKV+uBoM/w4Wh1didx+5xeA8aqN1XZJF/vzge5SAYOBYLUQzFl95BMrxECKQOWfvO3NuyyQDVmJ0fQzx4gfaqF5dxjJ7RsY4h+OAzpUsEPqBwugm1Qb72/EAH4djCjwgk4fO+CB0sBbmM+hFwq7M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682002960; 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=MTE4gF7XsZ9y5Na2NQaOlWvM5YSPdb/d1vz4kdTlojw=; b=HcJuVBn/LJH4G3Cfp1Lc+xVLjg7KNUda81svPAz/4XXaSgnc5I4Yqa8CzVnN3zrvlCUSkAJn3UVAIetdJP5AK/wXAVEZUegRO2X0n4bJzccHXtcs7l1J3+MLiPOx9T7yowmLiJx2f5WCVxiTkyxjc3W9N8/QHVu41poK4f+wPWc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168200296051931.312827141309867; Thu, 20 Apr 2023 08:02:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppVls-0003o0-33; Thu, 20 Apr 2023 11:00:28 -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 1ppVlg-0003ae-Rp for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:17 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppVle-00045g-Ea for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:16 -0400 Received: by mail-wm1-x32a.google.com with SMTP id iw7-20020a05600c54c700b003f16fce55b5so1304518wmb.0 for ; Thu, 20 Apr 2023 08:00:12 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p9-20020a1c7409000000b003f17ee3bdc3sm2196686wmc.42.2023.04.20.08.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 08:00:10 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0E5361FFB8; Thu, 20 Apr 2023 16:00:10 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682002811; x=1684594811; 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=MTE4gF7XsZ9y5Na2NQaOlWvM5YSPdb/d1vz4kdTlojw=; b=b+RSzvFiKnpyiN7mEZxxrNuGLWLzhRYc86gdP33870JrqbCDAK5vTMkejSXjBVN9ym aLkpyl87rbQ9L3h2KdXj0RJulTDO5EnVPrjhbbYRtScAE2DCrQk9rXxd4aPbQbHGHIOv BHipwgFUCerLOrkvxcMd/AlJJajzZcCxwScEZZmXfGIhvBzZgZKrW6HY5zJdUGz/weBI dpViOU5T6XYFVlQc8kMyCB+l2rjzUo0pvJ9GMQyHp5pOCCHhQwoBGgm6DPKuWrBm2HHu a0OU5Rev7s7JqBlx77hJI9tT8shjV2c1zCmvm7uB6R4qjEOxNNvjXEh5sX3NL6YQQxtD SS0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682002811; x=1684594811; 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=MTE4gF7XsZ9y5Na2NQaOlWvM5YSPdb/d1vz4kdTlojw=; b=gIw06o5AK6+oEmMcIsL3N4UoYgrajgfrCgHy7Pju+0zlLIYRUIOe2UpcfcgQUyt0w/ yRpxHxGLn5Tn+y8cJdMQgfT2CiOkRXsXEb6c1bJX206Y+AWGy0IhO6yfN9tUSAZDHy+u 5NloktJGyfSr8igg+Nl6WUiPMVWgwuc4xlqaU78X6+ex5w2C9zZq4uTxgh7GfeBYdR6s 7nLKfhQhrogT+kUgYaXJhI6V4K5HtOI+b7n4WcYxAPQAfX9u5q7jAYhqNU78PJU5L5A9 5TUkEUPP8f2AiCy7RiZ18J/iPw3CUt26/c9X2dou7tVxL3AARxDveX7ZXa6/h8rIW9du q/Xg== X-Gm-Message-State: AAQBX9cbnU/8jM0go/pjbDeeJtYbRnbS5hfc7j87rpHmhVePUINiHY1D do8Je/Lt58R5HXfTUK3g7CRcmw== X-Google-Smtp-Source: AKy350ZnYuDYbu5ILkjsXork1AZLIKAYHFqJ4yriYjlORTOS73jZsWAQZnrIKXPD42aZdA3DLMalMQ== X-Received: by 2002:a1c:ed18:0:b0:3ed:88f5:160a with SMTP id l24-20020a1ced18000000b003ed88f5160amr1555454wmh.11.1682002811019; Thu, 20 Apr 2023 08:00:11 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Michael Roth , Riku Voipio , Christian Schoenebeck , Yanan Wang , Greg Kurz , Richard Henderson , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Stefan Hajnoczi , Eric Blake , Markus Armbruster , Warner Losh , Paolo Bonzini , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 01/10] *-user: remove the guest_user_syscall tracepoints Date: Thu, 20 Apr 2023 16:00:00 +0100 Message-Id: <20230420150009.1675181-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420150009.1675181-1-alex.bennee@linaro.org> References: <20230420150009.1675181-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1682002962659100001 This is pure duplication now. Both bsd-user and linux-user have builtin strace support and we can also track syscalls via the plugins system. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Stefan Hajnoczi Reviewed-by: Warner Losh --- include/user/syscall-trace.h | 4 ---- bsd-user/freebsd/os-syscall.c | 2 -- trace-events | 19 ------------------- 3 files changed, 25 deletions(-) diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h index 90bda7631c..557f881a79 100644 --- a/include/user/syscall-trace.h +++ b/include/user/syscall-trace.h @@ -26,9 +26,6 @@ static inline void record_syscall_start(void *cpu, int nu= m, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8) { - trace_guest_user_syscall(cpu, num, - arg1, arg2, arg3, arg4, - arg5, arg6, arg7, arg8); qemu_plugin_vcpu_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); @@ -36,7 +33,6 @@ static inline void record_syscall_start(void *cpu, int nu= m, =20 static inline void record_syscall_return(void *cpu, int num, abi_long ret) { - trace_guest_user_syscall_ret(cpu, num, ret); qemu_plugin_vcpu_syscall_ret(cpu, num, ret); } =20 diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index c8f998ecec..b0ae43766f 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -531,7 +531,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi= _long arg1, CPUState *cpu =3D env_cpu(cpu_env); abi_long ret; =20 - trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6,= arg7, arg8); if (do_strace) { print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); } @@ -541,7 +540,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi= _long arg1, if (do_strace) { print_freebsd_syscall_ret(num, ret); } - trace_guest_user_syscall_ret(cpu, num, ret); =20 return ret; } diff --git a/trace-events b/trace-events index b6b84b175e..691c3533e4 100644 --- a/trace-events +++ b/trace-events @@ -85,22 +85,3 @@ vcpu guest_cpu_exit(void) # Targets: all vcpu guest_cpu_reset(void) =20 -# include/user/syscall-trace.h - -# @num: System call number. -# @arg*: System call argument value. -# -# Start executing a guest system call in syscall emulation mode. -# -# Mode: user -# Targets: TCG(all) -vcpu guest_user_syscall(uint64_t num, uint64_t arg1, uint64_t arg2, uint64= _t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6, uint64_t arg7, uint64= _t arg8) "num=3D0x%016"PRIx64" arg1=3D0x%016"PRIx64" arg2=3D0x%016"PRIx64" = arg3=3D0x%016"PRIx64" arg4=3D0x%016"PRIx64" arg5=3D0x%016"PRIx64" arg6=3D0x= %016"PRIx64" arg7=3D0x%016"PRIx64" arg8=3D0x%016"PRIx64 - -# @num: System call number. -# @ret: System call result value. -# -# Finish executing a guest system call in syscall emulation mode. -# -# Mode: user -# Targets: TCG(all) -vcpu guest_user_syscall_ret(uint64_t num, uint64_t ret) "num=3D0x%016"PRIx= 64" ret=3D0x%016"PRIx64 --=20 2.39.2 From nobody Sun May 12 23:11:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1682002849; cv=none; d=zohomail.com; s=zohoarc; b=bgMTBDfvHTONtJxaTaZQC477dWdPv8O4djAi3qGc6TFwt9DbiKqNZXQNhF9ooi9gJRmZPmannnhY1rkx8/DRcpwQFVOQmfpoeaXoanFhxY/Q5k2KkUyCbNcCMLuJfNV2qZgAE1u/jAGFa+8u1oKar23z/9sF9gtGsAuSimw2bKE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682002849; 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=BaYFv/GATacnspxitZxXqy32DjO2LBrHottpHojCTUU=; b=EF/a1GxCRFtB1cakC3lSDyoLF9M9nwynjbDD/G/X3bYRQxzo6LW3/r/WzuZj8UQ7kcDOXXnlRv/TFLji9tkFJHwDcH5OWrD3/NYRZHBfvOPFmy9omCk+tumeEpkxZT3hPuiXMR+X47r1TTUUybXbNawEuhia1SlpTX2MK5lZ+j8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682002849367913.2214023551176; Thu, 20 Apr 2023 08:00:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppVlq-0003kR-WC; Thu, 20 Apr 2023 11:00:27 -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 1ppVlk-0003dB-6r for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:21 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppVle-00046H-4s for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:19 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f0a80b686eso5049405e9.1 for ; Thu, 20 Apr 2023 08:00:13 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m7-20020adfe947000000b003011baf89b3sm2176230wrn.40.2023.04.20.08.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 08:00:11 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2E8431FFBA; Thu, 20 Apr 2023 16:00:10 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682002813; x=1684594813; 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=BaYFv/GATacnspxitZxXqy32DjO2LBrHottpHojCTUU=; b=fab1SFaKzW2HOaakn+2mXg5jcNE5tsUQ//PQY+SBl3xlP5qFyr5sYDhh5+5q/I926A ArZL0sR+CrrwKb4pT6nXc9ojPszq0sSVe7I0HtFEevTpGp+Lc9o3Kgisfsl/DtUrP05p SuKmfrcj1hyCAP5yUyyu4k3YCpaMLn2lKyRhgTSZXcUHYSnUDZPFugQF+bNOp1sbn+NG OgHrvC5KtJR0/rjJrZjAQ1AaFkZOQcWUFnzCDJurEvVV5++w2uGM5aFvbjnF/uN5Frh+ hLtqd5FZmqPJ5hikvt3L2sU2QJ8qe3yej+DWdJgvAoHHl97jXXnNcx7kBjW9v/eczDVD z6sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682002813; x=1684594813; 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=BaYFv/GATacnspxitZxXqy32DjO2LBrHottpHojCTUU=; b=GuCoX2g+OiO8aVTYa7zKY4Ovcs6M6Vnkju6ToAxZcJTfB3PcMx9xxZEyhz5Za2fc87 wlRL5qhGWtOitRLM3ZnR2jjLwvl0ouvkS62Hxox2L8AlqhCzilR/hUsFd6TSOPU6WEUe 3Tntrsz/goWbvSEv3A838rjFfeOITZzAM2O2EwpFQ5sQxtsPyvzWaWr75sn4PUwNJvBI cLmrf34/lholocbtpzjksuZ2jzgPIB7TRIA6RerYsCj5kb4WgxSZswmYLTFmf8K78TUE GDtwOIkj/3WninBD/BwagU85CqLUD+HegXZrNQN+YTxVhrflLgDkoAQ+wEPOt/sFaVv+ cvbA== X-Gm-Message-State: AAQBX9dMMLXcVtFoYNiV5LCxxFx/2tKWFKY1ukV8h71SFiRV+PWInchB Yw2OI446KsFrEj8JZ4IYThS98Q== X-Google-Smtp-Source: AKy350Ywow0Mh/pEwvTzr+jJ74Rlesehe+6MKmp1UfYvJ8+R8D3xNDIOVamLZIBRmNWXMex6LTDv2A== X-Received: by 2002:a5d:4488:0:b0:2ee:e47e:9014 with SMTP id j8-20020a5d4488000000b002eee47e9014mr1639487wrq.1.1682002812695; Thu, 20 Apr 2023 08:00:12 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Michael Roth , Riku Voipio , Christian Schoenebeck , Yanan Wang , Greg Kurz , Richard Henderson , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Stefan Hajnoczi , Eric Blake , Markus Armbruster , Warner Losh , Paolo Bonzini , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 02/10] trace-events: remove the remaining vcpu trace events Date: Thu, 20 Apr 2023 16:00:01 +0100 Message-Id: <20230420150009.1675181-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420150009.1675181-1-alex.bennee@linaro.org> References: <20230420150009.1675181-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1682002850881100001 While these are all in helper functions being designated vcpu events complicates the removal of the dynamic vcpu state code. TCG plugins allow you to instrument vcpu_[init|exit|idle]. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Stefan Hajnoczi --- hw/core/cpu-common.c | 2 -- trace/control-target.c | 1 - trace/control.c | 2 -- trace-events | 31 ------------------------------- 4 files changed, 36 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 5ccc3837b6..8373a500d2 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -112,8 +112,6 @@ void cpu_dump_state(CPUState *cpu, FILE *f, int flags) void cpu_reset(CPUState *cpu) { device_cold_reset(DEVICE(cpu)); - - trace_guest_cpu_reset(cpu); } =20 static void cpu_common_reset_hold(Object *obj) diff --git a/trace/control-target.c b/trace/control-target.c index 232c97a4a1..c6132f243f 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -145,5 +145,4 @@ void trace_init_vcpu(CPUState *vcpu) } } } - trace_guest_cpu_enter(vcpu); } diff --git a/trace/control.c b/trace/control.c index 6c77cc6318..d24af91004 100644 --- a/trace/control.c +++ b/trace/control.c @@ -277,8 +277,6 @@ void trace_fini_vcpu(CPUState *vcpu) TraceEventIter iter; TraceEvent *ev; =20 - trace_guest_cpu_exit(vcpu); - trace_event_iter_init_all(&iter); while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { if (trace_event_is_vcpu(ev) && diff --git a/trace-events b/trace-events index 691c3533e4..dd318ed1af 100644 --- a/trace-events +++ b/trace-events @@ -54,34 +54,3 @@ qmp_job_resume(void *job) "job %p" qmp_job_complete(void *job) "job %p" qmp_job_finalize(void *job) "job %p" qmp_job_dismiss(void *job) "job %p" - - -### Guest events, keep at bottom - - -## vCPU - -# trace/control-target.c - -# Hot-plug a new virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_enter(void) - -# trace/control.c - -# Hot-unplug a virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_exit(void) - -# hw/core/cpu.c - -# Reset the state of a virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_reset(void) - --=20 2.39.2 From nobody Sun May 12 23:11:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1682002867; cv=none; d=zohomail.com; s=zohoarc; b=ny2LpjKnDy8gOgT+pIpVLxNJSJV1ufb5FGsEkMgeRXa5oWfB6/QJkfqUx+JyB6yX/sgjOCqMZyblnKL0lpsMFrfM5kOslK47EHL0w9hiV35UMfzM/4K307hfEND70VtBZTX5tcQq2eWZ6X8q8DoWkKEeL327GtJ7dmObEafEc7M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682002867; 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=BfqPP/aIIIJD+g7lcqooxH2SGvq/IoBd6dFlJw1/MhY=; b=NJCgK08fhP1Jqeby6YUuf76Dh0o8kkIJgAs+T0kQ7NObDh9tSfQwy89swR98CBaBiKp/+YqN1sycHlQPFqxA/HPrSd50LhhNpWZrOtNZnorbXwwwCSpRrK8XrATjEReiIXbIBHR1nNOYNy/OOEdQ8BQF6dieB9JO4b1UBUhxWkc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682002867911635.8441536386727; Thu, 20 Apr 2023 08:01:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppVlj-0003an-Rl; Thu, 20 Apr 2023 11:00:21 -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 1ppVlf-0003aK-2V for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:15 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppVld-00045m-1K for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:14 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f17edbc15eso7191255e9.3 for ; Thu, 20 Apr 2023 08:00:12 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 21-20020a05600c22d500b003f17131952fsm2271778wmg.29.2023.04.20.08.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 08:00:11 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 51B5D1FFBB; Thu, 20 Apr 2023 16:00:10 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682002811; x=1684594811; 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=BfqPP/aIIIJD+g7lcqooxH2SGvq/IoBd6dFlJw1/MhY=; b=M5agqMM9+FEqotz3oloW5qYAjjEGS9SWvBTkrY3sHeiEOXU4cbiEXPO6mRHjOREpT4 jMSxeKw2Z1HU0pcSGrdbsJ+6glOJz17kDVxCL27BNxtQS/TsMfbE3CDQpjKq5NvHvJin t4+AuiAR7nim+wgNOcve0omTifomQ9j8C4yZ21NPvd0S4tv114QVeswAA+Q3EmyT2Ccs /f53PzQ8gNOYuwHKFxx6RLjQlz8U7UhKopFx+m2+T5wo3ZGOsVPPPk3RMZH+nBiiUbaH Ab514jrjM3MyCjxS9UyFX1CPo9TKunkEiTlXaKd4mKx82orWv6RZbLnZvTc33z+0LaLO c6YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682002811; x=1684594811; 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=BfqPP/aIIIJD+g7lcqooxH2SGvq/IoBd6dFlJw1/MhY=; b=N7/9EaStXoGn88LXr+gB64I3SrTxdtxDJzpwxt8Z8pOu36+fqis4ELfG6kQJmcaH9r iVm6TTSFb3ODA7X9oo0LcNfJkIwaIirNCg4UFBsAUWRS4SF81ukHJAIo9uiujBEhGeRN fn6aIGEpw5CEvMK7y5yLkO29YsJjOyyMEVjnUBoH1EilFYZKlSnuJKF+RzCfKfinKidB dsW1/8Yum5mGBXb2zb9sJwHZsb6T/ADqXJU/iakTMo/dSk+t+cQAAJi6I2M1soEpMAOY dTv9Bcw0AXieYJXbPCfbNeXuQCpNw1mcvpLbvmhUxSerYi5ijEh9zqoqgTB/8FQu4ECR zkPQ== X-Gm-Message-State: AAQBX9fflTqaIybHLG3fEX5p2soJGew8dl8aEiuJtmsugiWEBhQ5VwwP hDFnJEnuI4O+QiJYuzBmbrQr5Q== X-Google-Smtp-Source: AKy350Z2nEdkEb3KrSt/JM3+ZshCuPu7ATG9+u0kkJhrcU1oYtTpNVRt5+6306Wabx5V35SGWeHgWw== X-Received: by 2002:a5d:4c49:0:b0:2fb:f93f:b96 with SMTP id n9-20020a5d4c49000000b002fbf93f0b96mr1616098wrt.31.1682002811369; Thu, 20 Apr 2023 08:00:11 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Michael Roth , Riku Voipio , Christian Schoenebeck , Yanan Wang , Greg Kurz , Richard Henderson , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Stefan Hajnoczi , Eric Blake , Markus Armbruster , Warner Losh , Paolo Bonzini , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 03/10] trace: remove vcpu_id from the TraceEvent structure Date: Thu, 20 Apr 2023 16:00:02 +0100 Message-Id: <20230420150009.1675181-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420150009.1675181-1-alex.bennee@linaro.org> References: <20230420150009.1675181-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1682002869283100001 This does involve temporarily stubbing out some helper functions before we excise the rest of the code. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-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 *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 From nobody Sun May 12 23:11:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1682002912; cv=none; d=zohomail.com; s=zohoarc; b=A90NNYEYjoN6x5oSdIGg7IGcsmhmL3IQAHhqT5qavBq+ibUKWyWmZki8CyEibDIuweXNsVjm2w6VBx6d/Knwnifll5bz56IOAlK6ISwlEu2RSm9zSycT9z51acu+vT0gggKSor/Rvdv3WUU72lm3G/fM1s40FywXHmpBay4U1MM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682002912; 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=XyFxajlvcBm0zO8ecOyTw+g/FGP63C2N4hQK874T7uE=; b=cs2/vjOquxigHbI7wd8USESfmh12QbXtelJ1FvEHfY/jlNb7WGSC+QeORYXWdeujlhT1Rbz5HPv1Q4AVOkLgZAGgog/Za3K/l36j4ohUl+hs0tidXXO6Ba0H7jewCeDamm66tfE0U3xsLGsEXtzxeyJT6PApCXDtKb6Rf0Z5T1E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682002911910359.0032588297199; Thu, 20 Apr 2023 08:01:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppVlq-0003iy-61; Thu, 20 Apr 2023 11:00:26 -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 1ppVli-0003am-O7 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:19 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppVlg-00046d-DF for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:18 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f09b9ac51dso21898195e9.0 for ; Thu, 20 Apr 2023 08:00:14 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h18-20020a5d6892000000b002f9bfac5baesm2167452wru.47.2023.04.20.08.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 08:00:11 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6AAAB1FFBC; Thu, 20 Apr 2023 16:00:10 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682002812; x=1684594812; 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=XyFxajlvcBm0zO8ecOyTw+g/FGP63C2N4hQK874T7uE=; b=HTYs4vJSqiZf24P3dYs9GLUX7rPDvrW5WPOqmxuqdPvG1fWKOrtAaxW5iPa7udORhs b9i5AjwGRydqtXyPWl9l1WyifmFPrE1TjXWuUekXG/SN8k/lsLQ5Uj5GcEUNUtVa9FW+ 0b80Zk0fBA+xDaqshTQPl1qF4IiqLtUXsrO4V53O6119qoWh1HLapzhtkRgyt2LuH3tE DdadlKzxFf6zVwSaYnm4y2xuq1F3vSsNQ/jO/RscfUNPcQiOe8Y/ge/BadjmQ/80jgi6 2OphhvqWEvbM6/ygjcgKCfq2zVJiae0zpWjXYEg8QDUd1MjW3nPN8caRKzFc2nbHovN9 cCrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682002812; x=1684594812; 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=XyFxajlvcBm0zO8ecOyTw+g/FGP63C2N4hQK874T7uE=; b=V/3DRkYzwz5miUNH1tFq0B0/srA9NYJA5uEfTXqcGGCVBYeAz1msR4rDqCzyZ+A9o4 oMf0pY2unJYFVi7RNaRF4a+YkS1Z4QgFZJ9QmXYtabLyntKKTfOtdRYIt09sMI7QIfy3 2y1/LkhuzNWs6NPF/zJssURcVmvgIN/6ZcncpEx87eJPWzFEq9U5UdICPZJJWvxLi9rZ F3y0eg+U1UTK8HjneLgIOHi95m5R0K8+RZR9xEwUJ/iTl2CDDZiFyVu7FuvTQwl1QHYz eO9fsELiCpBrOaUibGwDU9k7CTcYxnKQnFm6utOYdYv7nH/jU/dTxuQeDMjIT3yxIKLe vPsw== X-Gm-Message-State: AAQBX9fSU651u0N8E/FcZUfzJBArfLuxxsqpy4wNEysispk6h3fJkikV YuTjthtay/ep7jk9Ciy9ha7hhQ== X-Google-Smtp-Source: AKy350Zf0HBI8PleKU98EpZmncQ5J8QaEw/N2bJXT93n6nPi8P1kI+jayRRIWg+lBHLQrOK36lSrHQ== X-Received: by 2002:adf:ce86:0:b0:2f0:2c3c:b858 with SMTP id r6-20020adfce86000000b002f02c3cb858mr4582129wrn.31.1682002812460; Thu, 20 Apr 2023 08:00:12 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Michael Roth , Riku Voipio , Christian Schoenebeck , Yanan Wang , Greg Kurz , Richard Henderson , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Stefan Hajnoczi , Eric Blake , Markus Armbruster , Warner Losh , Paolo Bonzini , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 04/10] scripts/qapi: document the tool that generated the file Date: Thu, 20 Apr 2023 16:00:03 +0100 Message-Id: <20230420150009.1675181-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420150009.1675181-1-alex.bennee@linaro.org> References: <20230420150009.1675181-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1682002920409100001 This makes it a little easier for developers to find where things where being generated. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Stefan Hajnoczi --- scripts/qapi/gen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index b5a8d03e8e..282f5091e3 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -161,7 +161,7 @@ def __init__(self, fname: str, blurb: str, pydoc: str): =20 def _top(self) -> str: return mcgen(''' -/* AUTOMATICALLY GENERATED, DO NOT MODIFY */ +/* AUTOMATICALLY GENERATED by QAPIGenC, DO NOT MODIFY */ =20 /* %(blurb)s @@ -194,7 +194,7 @@ def _bottom(self) -> str: =20 class QAPIGenTrace(QAPIGen): def _top(self) -> str: - return super()._top() + '# AUTOMATICALLY GENERATED, DO NOT MODIFY\= n\n' + return super()._top() + '# AUTOMATICALLY GENERATED by QAPIGenTrace= , DO NOT MODIFY\n\n' =20 =20 @contextmanager --=20 2.39.2 From nobody Sun May 12 23:11:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1682002902; cv=none; d=zohomail.com; s=zohoarc; b=XVPI0bYha+X6Ah2Un0md/RsWqbYixCcJAqiGHhczcPkwihvWhQxH0rD/44ESdAjRRL9x5cnb1OsGGeRmr9dO07dM+rfTXT8o7uqLPxMaJeffzJXYUaAxiNE/mlpFiBuUkDaBu7m9TP4fecvRJN5cWFCrCTL3KFmQQxyj+VEMULA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682002902; 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=7c0u+6tu/GA25VLPoFXf3gYwuh1yw4lMCNZi+OT6T50=; b=XMTvy4Kd54a3E7p8BnF5hd4dQO1SuZWNN90f8zrET1dvl2pVfk5HObFf9nGbRJomHnzSPRdOlF7jIpukujYCj7p+8XCUkiDbKA+QKTUdOLTrarNHb9B+InKcSXmXcpPx8W5u0lZ/3YE70A1yTY/GA03VejC1+dgfqR3T3I1E3A0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682002902354807.0740134792956; Thu, 20 Apr 2023 08:01:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppVlv-0003t4-1h; Thu, 20 Apr 2023 11:00:31 -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 1ppVlt-0003rY-MW for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:29 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppVle-00046f-SL for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:29 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-2f7a7f9667bso432212f8f.1 for ; Thu, 20 Apr 2023 08:00:14 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q13-20020adfcd8d000000b002d7a75a2c20sm2110041wrj.80.2023.04.20.08.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 08:00:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 82D7B1FFBD; Thu, 20 Apr 2023 16:00:10 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682002813; x=1684594813; 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=7c0u+6tu/GA25VLPoFXf3gYwuh1yw4lMCNZi+OT6T50=; b=Jlfv/8yKBbDTOyaR/7kh9FT64Lzji0y07XTUMtLuH5raeSVVEi/Uf1lE5Sy1YkSIoR OHrtkxuOi/qtlpN5q8vv2vyjWAMbWAL59GmdmAskqTtjbz8mrvaGtdbmfrskUiGSj7hD iREMFoWA8gr/Cga8ipE7xKLQK3TY1nx5f3Uwn9IW5v1xHhj1CLoZABHS+M0e50fojOAb Py8yPYgo7LlQm9vXxfP9Pl7PvaDvTASQxeS5CY0tTq+4NpliZnTvEhfc/0+cklg+AjTk M8+tntnj3P3If/crMUvSiIsW5VwRhJjuY7BR6eXAzY0ZJv0unbEVMG4CPxpB4aWCKgjl U0nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682002813; x=1684594813; 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=7c0u+6tu/GA25VLPoFXf3gYwuh1yw4lMCNZi+OT6T50=; b=YHlIt5LLilSnfq26NpyoogW5sDLMGd3VGV1JQ3LmSpmiXC2RjKSB25f0qtovoLgk88 EVR8NOcJmcTQRKfuG3k2xrVokTIQbpx1uaf4rwCoFy8/2LJzD8xavR1Uk+qOkCYh06JG 0mGFDiDWNVK5BYnxUamYm8f/97+7tCXidFDdlJPq0gqiSmFBr56NcDGrKmF6oBwdc1xO iLrtgg56fcGno/1CV76VwcCOmkpC+ZjHkykK/xVvXHUp46cHbkQUS52Mc4CxUyvSciJA Q2ODH5LNWZGGGkopPa0eQzf7aC96Sspkv3d4/z20H2GW6i44gNvgePzS3bNc6XH+MtNi EEvQ== X-Gm-Message-State: AAQBX9fDar8eXJqkvA7f1+jfwluSVus7jFo9K88Fk6WHmEbwIij2F2Ye axlTPZvvsbq2E+bUqjg1hTHMLw== X-Google-Smtp-Source: AKy350YqURsJwWsX/64PWxzpg0NTVeJPRwJwKeki/ZIuoKARQ//Qk99eaN8hbrW5Y8K2puw+sjJp4w== X-Received: by 2002:a5d:5442:0:b0:2f5:930:39b1 with SMTP id w2-20020a5d5442000000b002f5093039b1mr1546684wrv.38.1682002813492; Thu, 20 Apr 2023 08:00:13 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Michael Roth , Riku Voipio , Christian Schoenebeck , Yanan Wang , Greg Kurz , Richard Henderson , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Stefan Hajnoczi , Eric Blake , Markus Armbruster , Warner Losh , Paolo Bonzini , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 05/10] qapi: make the vcpu parameters deprecated for 8.1 Date: Thu, 20 Apr 2023 16:00:04 +0100 Message-Id: <20230420150009.1675181-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420150009.1675181-1-alex.bennee@linaro.org> References: <20230420150009.1675181-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x432.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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1682002903813100001 I don't think I can remove the parameters directly but certainly mark them as deprecated. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Stefan Hajnoczi --- qapi/trace.json | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/qapi/trace.json b/qapi/trace.json index 6c6982a587..74dd66ef4a 100644 --- a/qapi/trace.json +++ b/qapi/trace.json @@ -33,9 +33,9 @@ # # @name: Event name. # @state: Tracing state. -# @vcpu: Whether this is a per-vCPU event (since 2.7). +# @vcpu: Whether this is a per-vCPU event (deprecated since 8.1). # -# An event is per-vCPU if it has the "vcpu" property in the "trace-events" +# There are no longer any events with the "vcpu" property in the "trace-ev= ents" # files. # # Since: 2.2 @@ -49,19 +49,15 @@ # Query the state of events. # # @name: Event name pattern (case-sensitive glob). -# @vcpu: The vCPU to query (any by default; since 2.7). +# @vcpu: The vCPU to query (deprecated since 8.1). # # Returns: a list of @TraceEventInfo for the matching events # # An event is returned if: # # - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. # -# Therefore, if @vcpu is given, the operation will only match per= -vCPU events, -# returning their state on the specified vCPU. Special case: if @= name is an -# exact match, @vcpu is given and the event does not have the "vc= pu" property, -# an error is returned. +# There are no longer any per-vCPU events # # Since: 2.2 # @@ -84,16 +80,12 @@ # @name: Event name pattern (case-sensitive glob). # @enable: Whether to enable tracing. # @ignore-unavailable: Do not match unavailable events with @name. -# @vcpu: The vCPU to act upon (all by default; since 2.7). +# @vcpu: The vCPU to act upon (deprecated since 8.1). # # An event's state is modified if: -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. +# - its name matches the @name pattern # -# Therefore, if @vcpu is given, the operation will only match per-vCPU eve= nts, -# setting their state on the specified vCPU. Special case: if @name is an = exact -# match, @vcpu is given and the event does not have the "vcpu" property, an -# error is returned. +# There are no longer and per-vCPU events so specifying it will never matc= h. # # Since: 2.2 # --=20 2.39.2 From nobody Sun May 12 23:11:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1682002911; cv=none; d=zohomail.com; s=zohoarc; b=f+5+ESrl9OhdJbiB287ijmE7UHbKJiepIrBZHq9s3365kpMzQ/In7FnCGuYoa1UFrbsRJ6hHhKuP7XjGQiabQzZoL48nsFwFcNCyL9hWoTFz6sODD5aaENlqMnvNVQTq7eX3AB1LyHH8ichw0CGrRCQ6JIhTNybyyOK9Ium8POI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682002911; 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=nPbZSn5MhbbvzUtk/hZvGFSfCbaky9sMlqfgM1W+OWw=; b=G7Z/4+dD/fdCPEi6EJD8M5+A5W0fcxjZ1vh4peysWCxA2WOh6dbtjhHC6h89s2zMZk2DgcwAv1x3gVDt5joNqRLropla372UsjBKOPZdj/pxW1QKKwVeWvr8hUHjcG4HTE347lOARgX6zGqb7MeNbaNgE2ttJiqLoC8NBZoRbKQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682002911672865.1555933432512; Thu, 20 Apr 2023 08:01:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppVlw-0003tC-6D; Thu, 20 Apr 2023 11:00:32 -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 1ppVll-0003iY-W9 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:23 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppVlh-00047k-N8 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:21 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-2fa47de5b04so661570f8f.1 for ; Thu, 20 Apr 2023 08:00:17 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id i1-20020a05600011c100b002cff06039d7sm2155643wrx.39.2023.04.20.08.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 08:00:13 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B7BA51FFBE; Thu, 20 Apr 2023 16:00:10 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682002815; x=1684594815; 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=nPbZSn5MhbbvzUtk/hZvGFSfCbaky9sMlqfgM1W+OWw=; b=RtxPv6TsKuplhJN+z4xdmvasjsprv1RfJ44lvRIQE7ogOokAXfm5T14bW3Q1EYbZ8G huqEd69aUFF+T81o6OtCasCeE7emrCyg1CQI4y1VulZon3nOEo01tPFiyILDRCjQPIgS qpY9UP2lB67kJ5QHA2o0XUCl4DzSAKEFZ/AVkN7+/3Z9FHUwUc+bu0MpURO/01Wpbuu6 OuzJ/4b10sp7n/t1Tq7I7A2jWgBs856415+77+QfLpWszuxSx9Swx5ci3w9V68QlISBB c4VP0g+Uo8bd3attwSP3vtN72M9IIYoY1U5nB2qecLLhiPGZuYg+2xUgtwkTIl5pYchZ nLNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682002815; x=1684594815; 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=nPbZSn5MhbbvzUtk/hZvGFSfCbaky9sMlqfgM1W+OWw=; b=FiGDhHDmOxrlTVVO5Mx8YFnXSFI85XjHDIaKH5BbjrEXJ70RSCWahMwITPNGxFBnUT 5skCx9G+as6/4DxdcsxkYFx5O5utBgY6/COwzsYVPULI/zbFbywu4SiTV4Rf0mGQn1c/ Mzor5+86TT/mnQbiL3eDEAaR+QMWupkd2PznTmL3a/QiajGAu3N+3EFxwP83AlNel7Ys gjzfazUjYhBvWyvYjfuFsr+zm9rqu1l7pCQms7IuPMajhnn58SQpDXokdkgyo0xztEtJ NPqBcdfpRYXHeWinzvBpj/je+iVNx7h/XFjg5JqWb1Fjwvea1PYEtGoZuaAqwU3RRFer /gTw== X-Gm-Message-State: AAQBX9dE5Stsaccce1qfvzY/OFu5wSZbw+hQUi73+D48gWns9N95e5d0 5yrnSFZ7buA9EDeGb0GjkXAG7g== X-Google-Smtp-Source: AKy350Yl6c1ifwzwrwdloZUoUrIe2WCByB2tyS3zhxGuCZX65cgL+t2Dp/tvA3mfG0iQH5OfQQpR4A== X-Received: by 2002:adf:f1d2:0:b0:2e8:b9bb:f969 with SMTP id z18-20020adff1d2000000b002e8b9bbf969mr1514604wro.0.1682002815198; Thu, 20 Apr 2023 08:00:15 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Michael Roth , Riku Voipio , Christian Schoenebeck , Yanan Wang , Greg Kurz , Richard Henderson , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Stefan Hajnoczi , Eric Blake , Markus Armbruster , Warner Losh , Paolo Bonzini , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 06/10] trace: remove code that depends on setting vcpu Date: Thu, 20 Apr 2023 16:00:05 +0100 Message-Id: <20230420150009.1675181-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420150009.1675181-1-alex.bennee@linaro.org> References: <20230420150009.1675181-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1682002913500100003 Now we no longer have any events that are for vcpus we can start excising the code from the trace control. As the vcpu parameter is encoded as part of QMP we just stub out the has_vcpu/vcpu parameters rather than alter the API. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Stefan Hajnoczi --- trace/control-internal.h | 10 ---- trace/control-vcpu.h | 16 ------ trace/control.h | 48 ----------------- hw/core/cpu-common.c | 2 - stubs/trace-control.c | 13 ----- trace/control-target.c | 110 ++++----------------------------------- trace/control.c | 16 ------ trace/qmp.c | 74 +++----------------------- trace/trace-hmp-cmds.c | 17 +----- 9 files changed, 19 insertions(+), 287 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index 0178121720..8d818d359b 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -25,16 +25,6 @@ static inline uint32_t trace_event_get_id(TraceEvent *ev) return ev->id; } =20 -static inline uint32_t trace_event_get_vcpu_id(TraceEvent *ev) -{ - return 0; -} - -static inline bool trace_event_is_vcpu(TraceEvent *ev) -{ - return false; -} - static inline const char * trace_event_get_name(TraceEvent *ev) { assert(ev !=3D NULL); diff --git a/trace/control-vcpu.h b/trace/control-vcpu.h index 0f98ebe7b5..800fc5a219 100644 --- a/trace/control-vcpu.h +++ b/trace/control-vcpu.h @@ -30,13 +30,6 @@ trace_event_get_vcpu_state_dynamic_by_vcpu_id( \ vcpu, _ ## id ## _EVENT.vcpu_id)) =20 -/** - * trace_event_get_vcpu_state_dynamic: - * - * Get the dynamic tracing state of an event for the given vCPU. - */ -static bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu, TraceEvent = *ev); - #include "control-internal.h" =20 static inline bool @@ -51,13 +44,4 @@ trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *= vcpu, } } =20 -static inline bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu, - TraceEvent *ev) -{ - uint32_t vcpu_id; - assert(trace_event_is_vcpu(ev)); - vcpu_id =3D trace_event_get_vcpu_id(ev); - return trace_event_get_vcpu_state_dynamic_by_vcpu_id(vcpu, vcpu_id); -} - #endif diff --git a/trace/control.h b/trace/control.h index 23b8393b29..dfd209edd8 100644 --- a/trace/control.h +++ b/trace/control.h @@ -89,23 +89,6 @@ static bool trace_event_is_pattern(const char *str); */ static uint32_t trace_event_get_id(TraceEvent *ev); =20 -/** - * trace_event_get_vcpu_id: - * - * Get the per-vCPU identifier of an event. - * - * Special value #TRACE_VCPU_EVENT_NONE means the event is not vCPU-specif= ic - * (does not have the "vcpu" property). - */ -static uint32_t trace_event_get_vcpu_id(TraceEvent *ev); - -/** - * trace_event_is_vcpu: - * - * Whether this is a per-vCPU event. - */ -static bool trace_event_is_vcpu(TraceEvent *ev); - /** * trace_event_get_name: * @@ -172,21 +155,6 @@ static bool trace_event_get_state_dynamic(TraceEvent *= ev); */ void trace_event_set_state_dynamic(TraceEvent *ev, bool state); =20 -/** - * trace_event_set_vcpu_state_dynamic: - * - * Set the dynamic tracing state of an event for the given vCPU. - * - * Pre-condition: trace_event_get_vcpu_state_static(ev) =3D=3D true - * - * Note: Changes for execution-time events with the 'tcg' property will no= t be - * propagated until the next TB is executed (iff executing in TCG mo= de). - */ -void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, - TraceEvent *ev, bool state); - - - /** * trace_init_backends: * @@ -205,22 +173,6 @@ bool trace_init_backends(void); */ void trace_init_file(void); =20 -/** - * trace_init_vcpu: - * @vcpu: Added vCPU. - * - * Set initial dynamic event state for a hot-plugged vCPU. - */ -void trace_init_vcpu(CPUState *vcpu); - -/** - * trace_fini_vcpu: - * @vcpu: Removed vCPU. - * - * Disable dynamic event state for a hot-unplugged vCPU. - */ -void trace_fini_vcpu(CPUState *vcpu); - /** * trace_list_events: * @f: Where to send output. diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 8373a500d2..1ca48a15f6 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -209,7 +209,6 @@ static void cpu_common_realizefn(DeviceState *dev, Erro= r **errp) } =20 /* NOTE: latest generic point where the cpu is fully realized */ - trace_init_vcpu(cpu); } =20 static void cpu_common_unrealizefn(DeviceState *dev) @@ -217,7 +216,6 @@ static void cpu_common_unrealizefn(DeviceState *dev) CPUState *cpu =3D CPU(dev); =20 /* NOTE: latest generic point before the cpu is fully unrealized */ - trace_fini_vcpu(cpu); cpu_exec_unrealizefn(cpu); } =20 diff --git a/stubs/trace-control.c b/stubs/trace-control.c index 7f856e5c24..b428f34c87 100644 --- a/stubs/trace-control.c +++ b/stubs/trace-control.c @@ -36,16 +36,3 @@ void trace_event_set_state_dynamic(TraceEvent *ev, bool = state) } } } - -void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, - TraceEvent *ev, bool state) -{ - /* should never be called on non-target binaries */ - abort(); -} - -void trace_init_vcpu(CPUState *vcpu) -{ - /* should never be called on non-target binaries */ - abort(); -} diff --git a/trace/control-target.c b/trace/control-target.c index c6132f243f..1ae582af17 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -35,114 +35,22 @@ void trace_event_set_state_dynamic_init(TraceEvent *ev= , bool state) =20 void trace_event_set_state_dynamic(TraceEvent *ev, bool state) { - CPUState *vcpu; assert(trace_event_get_state_static(ev)); - if (trace_event_is_vcpu(ev) && likely(first_cpu !=3D NULL)) { - CPU_FOREACH(vcpu) { - trace_event_set_vcpu_state_dynamic(vcpu, ev, state); - } - } else { - /* - * Without the "vcpu" property, dstate can only be 1 or 0. With it= , we - * haven't instantiated any vCPU yet, so we will set a global state - * instead, and trace_init_vcpu will reconcile it afterwards. - */ - bool state_pre =3D *ev->dstate; - if (state_pre !=3D state) { - if (state) { - trace_events_enabled_count++; - *ev->dstate =3D 1; - } else { - trace_events_enabled_count--; - *ev->dstate =3D 0; - } - } - } -} =20 -static void trace_event_synchronize_vcpu_state_dynamic( - CPUState *vcpu, run_on_cpu_data ignored) -{ - bitmap_copy(vcpu->trace_dstate, vcpu->trace_dstate_delayed, - CPU_TRACE_DSTATE_MAX_EVENTS); - tcg_flush_jmp_cache(vcpu); -} - -void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, - TraceEvent *ev, bool state) -{ - uint32_t vcpu_id; - bool state_pre; - assert(trace_event_get_state_static(ev)); - assert(trace_event_is_vcpu(ev)); - vcpu_id =3D trace_event_get_vcpu_id(ev); - state_pre =3D test_bit(vcpu_id, vcpu->trace_dstate); + /* + * There is no longer a "vcpu" property, dstate can only be 1 or + * 0. With it, we haven't instantiated any vCPU yet, so we will + * set a global state instead, and trace_init_vcpu will reconcile + * it afterwards. + */ + bool state_pre =3D *ev->dstate; if (state_pre !=3D state) { if (state) { trace_events_enabled_count++; - set_bit(vcpu_id, vcpu->trace_dstate_delayed); - (*ev->dstate)++; + *ev->dstate =3D 1; } else { trace_events_enabled_count--; - clear_bit(vcpu_id, vcpu->trace_dstate_delayed); - (*ev->dstate)--; - } - if (vcpu->created) { - /* - * Delay changes until next TB; we want all TBs to be built fr= om a - * single set of dstate values to ensure consistency of genera= ted - * tracing code. - */ - async_run_on_cpu(vcpu, trace_event_synchronize_vcpu_state_dyna= mic, - RUN_ON_CPU_NULL); - } else { - trace_event_synchronize_vcpu_state_dynamic(vcpu, RUN_ON_CPU_NU= LL); - } - } -} - -static bool adding_first_cpu1(void) -{ - CPUState *cpu; - size_t count =3D 0; - CPU_FOREACH(cpu) { - count++; - if (count > 1) { - return false; - } - } - return true; -} - -static bool adding_first_cpu(void) -{ - bool res; - cpu_list_lock(); - res =3D adding_first_cpu1(); - cpu_list_unlock(); - return res; -} - -void trace_init_vcpu(CPUState *vcpu) -{ - TraceEventIter iter; - TraceEvent *ev; - trace_event_iter_init_all(&iter); - while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { - if (trace_event_is_vcpu(ev) && - trace_event_get_state_static(ev) && - trace_event_get_state_dynamic(ev)) { - if (adding_first_cpu()) { - /* check preconditions */ - assert(*ev->dstate =3D=3D 1); - /* disable early-init state ... */ - *ev->dstate =3D 0; - trace_events_enabled_count--; - /* ... and properly re-enable */ - trace_event_set_vcpu_state_dynamic(vcpu, ev, true); - } else { - trace_event_set_vcpu_state_dynamic(vcpu, ev, true); - } + *ev->dstate =3D 0; } } } diff --git a/trace/control.c b/trace/control.c index 5dfb609954..1a48a7e266 100644 --- a/trace/control.c +++ b/trace/control.c @@ -262,22 +262,6 @@ void trace_init_file(void) #endif } =20 -void trace_fini_vcpu(CPUState *vcpu) -{ - TraceEventIter iter; - TraceEvent *ev; - - trace_event_iter_init_all(&iter); - while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { - if (trace_event_is_vcpu(ev) && - trace_event_get_state_static(ev) && - trace_event_get_vcpu_state_dynamic(vcpu, ev)) { - /* must disable to affect the global counter */ - trace_event_set_vcpu_state_dynamic(vcpu, ev, false); - } - } -} - bool trace_init_backends(void) { #ifdef CONFIG_TRACE_SIMPLE diff --git a/trace/qmp.c b/trace/qmp.c index 3b4f4702b4..aa760f1fc4 100644 --- a/trace/qmp.c +++ b/trace/qmp.c @@ -13,20 +13,7 @@ #include "control-vcpu.h" =20 =20 -static CPUState *get_cpu(bool has_vcpu, int vcpu, Error **errp) -{ - if (has_vcpu) { - CPUState *cpu =3D qemu_get_cpu(vcpu); - if (cpu =3D=3D NULL) { - error_setg(errp, "invalid vCPU index %u", vcpu); - } - return cpu; - } else { - return NULL; - } -} - -static bool check_events(bool has_vcpu, bool ignore_unavailable, bool is_p= attern, +static bool check_events(bool ignore_unavailable, bool is_pattern, const char *name, Error **errp) { if (!is_pattern) { @@ -38,12 +25,6 @@ static bool check_events(bool has_vcpu, bool ignore_unav= ailable, bool is_pattern return false; } =20 - /* error for non-vcpu event */ - if (has_vcpu && !trace_event_is_vcpu(ev)) { - error_setg(errp, "event \"%s\" is not vCPU-specific", name); - return false; - } - /* error for unavailable event */ if (!ignore_unavailable && !trace_event_get_state_static(ev)) { error_setg(errp, "event \"%s\" is disabled", name); @@ -70,22 +51,13 @@ TraceEventInfoList *qmp_trace_event_get_state(const cha= r *name, bool has_vcpu, int64_t vcpu, Error **errp) { - Error *err =3D NULL; TraceEventInfoList *events =3D NULL; TraceEventIter iter; TraceEvent *ev; bool is_pattern =3D trace_event_is_pattern(name); - CPUState *cpu; - - /* Check provided vcpu */ - cpu =3D get_cpu(has_vcpu, vcpu, &err); - if (err) { - error_propagate(errp, err); - return NULL; - } =20 /* Check events */ - if (!check_events(has_vcpu, true, is_pattern, name, errp)) { + if (!check_events(true, is_pattern, name, errp)) { return NULL; } =20 @@ -93,33 +65,17 @@ TraceEventInfoList *qmp_trace_event_get_state(const cha= r *name, trace_event_iter_init_pattern(&iter, name); while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { TraceEventInfo *value; - bool is_vcpu =3D trace_event_is_vcpu(ev); - if (has_vcpu && !is_vcpu) { - continue; - } =20 value =3D g_new(TraceEventInfo, 1); - value->vcpu =3D is_vcpu; value->name =3D g_strdup(trace_event_get_name(ev)); =20 if (!trace_event_get_state_static(ev)) { value->state =3D TRACE_EVENT_STATE_UNAVAILABLE; } else { - if (has_vcpu) { - if (is_vcpu) { - if (trace_event_get_vcpu_state_dynamic(cpu, ev)) { - value->state =3D TRACE_EVENT_STATE_ENABLED; - } else { - value->state =3D TRACE_EVENT_STATE_DISABLED; - } - } - /* else: already skipped above */ + if (trace_event_get_state_dynamic(ev)) { + value->state =3D TRACE_EVENT_STATE_ENABLED; } else { - if (trace_event_get_state_dynamic(ev)) { - value->state =3D TRACE_EVENT_STATE_ENABLED; - } else { - value->state =3D TRACE_EVENT_STATE_DISABLED; - } + value->state =3D TRACE_EVENT_STATE_DISABLED; } } QAPI_LIST_PREPEND(events, value); @@ -133,21 +89,12 @@ void qmp_trace_event_set_state(const char *name, bool = enable, bool has_vcpu, int64_t vcpu, Error **errp) { - Error *err =3D NULL; TraceEventIter iter; TraceEvent *ev; bool is_pattern =3D trace_event_is_pattern(name); - CPUState *cpu; - - /* Check provided vcpu */ - cpu =3D get_cpu(has_vcpu, vcpu, &err); - if (err) { - error_propagate(errp, err); - return; - } =20 /* Check events */ - if (!check_events(has_vcpu, has_ignore_unavailable && ignore_unavailab= le, + if (!check_events(has_ignore_unavailable && ignore_unavailable, is_pattern, name, errp)) { return; } @@ -155,14 +102,9 @@ void qmp_trace_event_set_state(const char *name, bool = enable, /* Apply changes (all errors checked above) */ trace_event_iter_init_pattern(&iter, name); while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { - if (!trace_event_get_state_static(ev) || - (has_vcpu && !trace_event_is_vcpu(ev))) { + if (!trace_event_get_state_static(ev)) { continue; } - if (has_vcpu) { - trace_event_set_vcpu_state_dynamic(cpu, ev, enable); - } else { - trace_event_set_state_dynamic(ev, enable); - } + trace_event_set_state_dynamic(ev, enable); } } diff --git a/trace/trace-hmp-cmds.c b/trace/trace-hmp-cmds.c index 792876c34a..1d07672cb2 100644 --- a/trace/trace-hmp-cmds.c +++ b/trace/trace-hmp-cmds.c @@ -37,16 +37,9 @@ void hmp_trace_event(Monitor *mon, const QDict *qdict) { const char *tp_name =3D qdict_get_str(qdict, "name"); bool new_state =3D qdict_get_bool(qdict, "option"); - bool has_vcpu =3D qdict_haskey(qdict, "vcpu"); - int vcpu =3D qdict_get_try_int(qdict, "vcpu", 0); Error *local_err =3D NULL; =20 - if (vcpu < 0) { - monitor_printf(mon, "argument vcpu must be positive"); - return; - } - - qmp_trace_event_set_state(tp_name, new_state, true, true, has_vcpu, vc= pu, &local_err); + qmp_trace_event_set_state(tp_name, new_state, true, true, false, 0, &l= ocal_err); if (local_err) { error_report_err(local_err); } @@ -80,8 +73,6 @@ void hmp_trace_file(Monitor *mon, const QDict *qdict) void hmp_info_trace_events(Monitor *mon, const QDict *qdict) { const char *name =3D qdict_get_try_str(qdict, "name"); - bool has_vcpu =3D qdict_haskey(qdict, "vcpu"); - int vcpu =3D qdict_get_try_int(qdict, "vcpu", 0); TraceEventInfoList *events; TraceEventInfoList *elem; Error *local_err =3D NULL; @@ -89,12 +80,8 @@ void hmp_info_trace_events(Monitor *mon, const QDict *qd= ict) if (name =3D=3D NULL) { name =3D "*"; } - if (vcpu < 0) { - monitor_printf(mon, "argument vcpu must be positive"); - return; - } =20 - events =3D qmp_trace_event_get_state(name, has_vcpu, vcpu, &local_err); + events =3D qmp_trace_event_get_state(name, false, 0, &local_err); if (local_err) { error_report_err(local_err); return; --=20 2.39.2 From nobody Sun May 12 23:11:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1682002872; cv=none; d=zohomail.com; s=zohoarc; b=TM7yFKbLY7nz3uFTUgcmNEPV/BXoHtpH74fEsg+upn87Txl6S1tnolRbSdt/64rgS1jd8YUU5B63cZhIUGrvMDAG3goubT3m4z0fqrHpKBO4nAUBZzAvGe8Am6QA4avY64z2vKkqZEAW53fuPIipZlj5VSIZHoIGytD+GFDDdgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682002872; 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=qaSuTiuAyCSuCXfY55ffoyW7xvTS9JDADhViNRePirU=; b=G+BQAOmqPbo6srGxu+J16ff48HayU0wdwPaYr6PV9AhVYdq89HOOYkOfH1ZMdIHlk/1np1w5zkjRWzP2HeX95OJfAqNgSanN4JiK57p88qngrDxY7ITi7hadrbdVzSaP4ouROu7fDWhZ1+Sh4T5ygq1KWu3uhbacaMeG6s2CPYY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682002872525659.5320723896737; Thu, 20 Apr 2023 08:01:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppVln-0003iZ-RJ; Thu, 20 Apr 2023 11:00:24 -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 1ppVli-0003ah-HQ for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:19 -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 1ppVlg-00047M-4m for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:18 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f1728c2a57so7758145e9.0 for ; Thu, 20 Apr 2023 08:00:15 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b4-20020a05600010c400b002e45f6ffe63sm2185756wrx.26.2023.04.20.08.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 08:00:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D5CFE1FFBF; Thu, 20 Apr 2023 16:00:10 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682002815; x=1684594815; 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=qaSuTiuAyCSuCXfY55ffoyW7xvTS9JDADhViNRePirU=; b=QOquyBWdcgQam8dmHyjRGI2/Viwa5nGkClTRnjuc/sotcSeXj9u2Sy5+onN+zFjXvu WyrGoS/dnhpJEvmq+022SvqviStkuzpgw912yJdvOcPHvPTbe52jEp3kbF+VXDAdI7VB bz4zwQg66v0ogSdITzZncQRzSFW+s21iRmgxicBUDWL/6H6OnFvRNmvHCloSRPhN34Q8 1lSk1O76ZP8p/0TTnWKp4udHj8yuPelnSUXJPOdHVAXpYSUs0DNsAlkMk1RIIPYckZC6 r4Ngg60ggJszxt2/izS+bWxeCTX2ig1WqjnE+FlIc9utmirAxzXRzvTcpBlziyMJkQYT 9wog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682002815; x=1684594815; 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=qaSuTiuAyCSuCXfY55ffoyW7xvTS9JDADhViNRePirU=; b=TZG7Yu1+5KrT0Pug+h3AW9cvs4jpIPPE6A1DtEeSg/nIUrxzzjxj6QmNvt9fgj0sRO cbOVms86HjF98j5Qw6RmOVpqVvrLTjBTOhugdvwNqGRnFTxdm0K+TFiFvio3J33VK3Iy TykMwrWg1SJEOSNHVJaWg+ZnyoJKGpq2WjOKQSBttFoXLC1wT+yEtPVuF35KdHx9Y/67 BJAgFC5/aX2FndMAYDDujiJZPsDkzpoRYxiGH66eeAC7vEh0hRLP3FydMTUGvhWgC82I 8X5QZbWLJy+oAq7LB+NuCoI5vAjDsMvKnK9J3cehUucugkjxo5U81nqLlQ0zHECJ9NXl 9Blw== X-Gm-Message-State: AAQBX9fKoip1WKZits4Ynk+JMqbHGJnN5NZnBlFIZzbUW+MEJoiWICOa PFCv6Hv+FWT8G9znlnmoARtPEg== X-Google-Smtp-Source: AKy350Yuc8Sic0pnW5pHGi9dyijTmyIU00GYBoVpn129Yxn+b66NlKRxWK6falvuFtdwSbrw7S6W3Q== X-Received: by 2002:adf:ed07:0:b0:2f5:7079:599e with SMTP id a7-20020adfed07000000b002f57079599emr1456255wro.12.1682002814773; Thu, 20 Apr 2023 08:00:14 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Michael Roth , Riku Voipio , Christian Schoenebeck , Yanan Wang , Greg Kurz , Richard Henderson , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Stefan Hajnoczi , Eric Blake , Markus Armbruster , Warner Losh , Paolo Bonzini , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 07/10] trace: remove control-vcpu.h Date: Thu, 20 Apr 2023 16:00:06 +0100 Message-Id: <20230420150009.1675181-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420150009.1675181-1-alex.bennee@linaro.org> References: <20230420150009.1675181-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1682002878299100003 Now we no longer have vcpu controlled trace events we can excise the code that allows us to query its status. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi --- trace/control-vcpu.h | 47 ----------------------------------- trace/qmp.c | 2 +- scripts/tracetool/format/h.py | 5 +--- 3 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 trace/control-vcpu.h diff --git a/trace/control-vcpu.h b/trace/control-vcpu.h deleted file mode 100644 index 800fc5a219..0000000000 --- a/trace/control-vcpu.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Interface for configuring and controlling the state of tracing events. - * - * Copyright (C) 2011-2016 Llu=C3=ADs Vilanova - * - * This work is licensed under the terms of the GNU GPL, version 2 or late= r. - * See the COPYING file in the top-level directory. - */ - -#ifndef TRACE__CONTROL_VCPU_H -#define TRACE__CONTROL_VCPU_H - -#include "control.h" -#include "event-internal.h" -#include "hw/core/cpu.h" - -/** - * trace_event_get_vcpu_state: - * @vcpu: Target vCPU. - * @id: Event identifier name. - * - * Get the tracing state of an event (both static and dynamic) for the giv= en - * vCPU. - * - * If the event has the disabled property, the check will have no performa= nce - * impact. - */ -#define trace_event_get_vcpu_state(vcpu, id) \ - ((id ##_ENABLED) && \ - trace_event_get_vcpu_state_dynamic_by_vcpu_id( \ - vcpu, _ ## id ## _EVENT.vcpu_id)) - -#include "control-internal.h" - -static inline bool -trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *vcpu, - uint32_t vcpu_id) -{ - /* it's on fast path, avoid consistency checks (asserts) */ - if (unlikely(trace_events_enabled_count)) { - return test_bit(vcpu_id, vcpu->trace_dstate); - } else { - return false; - } -} - -#endif diff --git a/trace/qmp.c b/trace/qmp.c index aa760f1fc4..3e3971c6a8 100644 --- a/trace/qmp.c +++ b/trace/qmp.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qapi/qapi-commands-trace.h" -#include "control-vcpu.h" +#include "control.h" =20 =20 static bool check_events(bool ignore_unavailable, bool is_pattern, diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index 285d7b03a9..ea126b07ea 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -16,10 +16,7 @@ =20 =20 def generate(events, backend, group): - if group =3D=3D "root": - header =3D "trace/control-vcpu.h" - else: - header =3D "trace/control.h" + header =3D "trace/control.h" =20 out('/* This file is autogenerated by tracetool, do not edit. */', '', --=20 2.39.2 From nobody Sun May 12 23:11:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1682002945; cv=none; d=zohomail.com; s=zohoarc; b=BNKlSefNoJa9kyv/lSwUifbqzOsQ5VDH4xq5cW2ija3/PQHJQfs6D62xxZT7LqOtTCveQJYvPiHRvpv6wXG/UzcymO21dMRi9vpz+Jo+UNteHGBcGR5LbEc+W5p8GLLTv6T+eQL2SRuBzBxxhM8cP79WYJYeW++/pcIZOOTlCok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682002945; 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=o+S8P5nD9r5wISIuehnoH3JBCN6mmMvJpl0Y6icjAN4=; b=IwEapsPPDKfDBBi1CJYySeLky7A9CtavXjewl+lwmFQ8tEfbKIjrk2TYXbncHtW5pg52QttutzOd2u2gtthYjFXizwQ2LRyyKyXHvi29BJUMian6hQeNm6lQFoLlDMujZ9z6uxpv6WeqWuyxDHR1EUhXTMkepzVmFZw4ksbE7es= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682002945629644.2218810242379; Thu, 20 Apr 2023 08:02:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppVlt-0003rH-Nc; Thu, 20 Apr 2023 11:00:29 -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 1ppVlj-0003bU-QG for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:21 -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 1ppVlg-00046v-D5 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:19 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f18ece69dbso1883285e9.3 for ; Thu, 20 Apr 2023 08:00:14 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d18-20020a5d4f92000000b002c7163660a9sm2127563wru.105.2023.04.20.08.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 08:00:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0E78D1FFB7; Thu, 20 Apr 2023 16:00:11 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682002814; x=1684594814; 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=o+S8P5nD9r5wISIuehnoH3JBCN6mmMvJpl0Y6icjAN4=; b=CuHCW82G8825rbArpL15jxHwCmCL2QdTUdRUDiwLr9wPqxc1vBmgjPFmUoI19xOLZy d4No7Fcn/YvahvB0mQ3/0IZQqluNzQHbhTFjRHLsWvCABBCS4G1Z7jTwDaKkf934kdPA g7Auu5l1tsMrTZgMayzDquygIBgKO/9Nv0J8m1QiMO0iIPrScEoAzSk2X6n50NbyEQNv RUZvNVVFR17LSygd2IR/jEPCXg5AwgmXB50F8A3qcfiU5Bhg3J5ixvtbSzfIKfNt1yUX YC4fymGynTwqWCGNgGrgqfNF2bILADc9NaMK5efJ0KuSE079WI776f6wsSbWasRWugK2 12Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682002814; x=1684594814; 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=o+S8P5nD9r5wISIuehnoH3JBCN6mmMvJpl0Y6icjAN4=; b=UTzN949CHsp6XV/f80+Vs1AIq3FvOHNZc0N6SDLQG+tW4qeYW564WETIJJtxMTrBCU 0KITnytOeO5d2wlv7imJQHsS62WGvKqJyJhMU0M5PIiAG4uK2ciVWUThWHeuLOwWeUL+ xsOKKp7Yi1diTFbANHMGCprdkJtKff/6UwChnerh8sKmrEAiwLixu4p937AXK6N5q9D0 gp1BjIxv21qjO6ksuj7w2iAcbNirZ2JCWtVyRYwgDJfuwXv4W+mY05UY17uuhNLHOSG/ DK3bFrZ5dxOBCR+G+n3XFajr7j195AyyXTXjd4cqT5FPX84n4T8PavsekmufXI3IE9w2 GXww== X-Gm-Message-State: AAQBX9cGX+l3SlrO6TARf4IowX/v11qeq9ogbiRYCMqj7K4WiFPzaHJ/ EC0OS27dqeUbBG5Yg0siUkdvBA== X-Google-Smtp-Source: AKy350YwaEaylaPElo8Hyhsg4YbHdiV8UVY0tctTHQoJDXeMSTxefYvny17ZSgbauDV459ERFayXpQ== X-Received: by 2002:a5d:5102:0:b0:2d8:4e4:8ce3 with SMTP id s2-20020a5d5102000000b002d804e48ce3mr1550982wrt.4.1682002813907; Thu, 20 Apr 2023 08:00:13 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Michael Roth , Riku Voipio , Christian Schoenebeck , Yanan Wang , Greg Kurz , Richard Henderson , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Stefan Hajnoczi , Eric Blake , Markus Armbruster , Warner Losh , Paolo Bonzini , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 08/10] tcg: remove the final vestiges of dstate Date: Thu, 20 Apr 2023 16:00:07 +0100 Message-Id: <20230420150009.1675181-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420150009.1675181-1-alex.bennee@linaro.org> References: <20230420150009.1675181-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1682002951581100003 Now we no longer have dynamic state affecting things we can remove the additional fields in cpu.h and simplify the TB hash calculation. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1358 Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Stefan Hajnoczi --- accel/tcg/tb-hash.h | 6 +++--- include/exec/exec-all.h | 3 --- include/hw/core/cpu.h | 5 ----- accel/tcg/cpu-exec.c | 7 +------ accel/tcg/tb-maint.c | 5 ++--- accel/tcg/translate-all.c | 6 ------ 6 files changed, 6 insertions(+), 26 deletions(-) diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h index 83dc610e4c..1d19c69caa 100644 --- a/accel/tcg/tb-hash.h +++ b/accel/tcg/tb-hash.h @@ -61,10 +61,10 @@ static inline unsigned int tb_jmp_cache_hash_func(targe= t_ulong pc) #endif /* CONFIG_SOFTMMU */ =20 static inline -uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, uint32_t fl= ags, - uint32_t cf_mask, uint32_t trace_vcpu_dstate) +uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, + uint32_t flags, uint32_t cf_mask) { - return qemu_xxhash7(phys_pc, pc, flags, cf_mask, trace_vcpu_dstate); + return qemu_xxhash6(phys_pc, pc, flags, cf_mask); } =20 #endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index ecded1f112..3ee76af28b 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -548,9 +548,6 @@ struct TranslationBlock { #define CF_CLUSTER_MASK 0xff000000 /* Top 8 bits are cluster ID */ #define CF_CLUSTER_SHIFT 24 =20 - /* Per-vCPU dynamic tracing state used to generate this TB */ - uint32_t trace_vcpu_dstate; - /* * Above fields used for comparing */ diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 397fd3ac68..4b399643d0 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -262,7 +262,6 @@ typedef void (*run_on_cpu_func)(CPUState *cpu, run_on_c= pu_data data); struct qemu_work_item; =20 #define CPU_UNSET_NUMA_NODE_ID -1 -#define CPU_TRACE_DSTATE_MAX_EVENTS 32 =20 /** * CPUState: @@ -403,10 +402,6 @@ struct CPUState { /* Use by accel-block: CPU is executing an ioctl() */ QemuLockCnt in_ioctl_lock; =20 - /* Used for events with 'vcpu' and *without* the 'disabled' properties= */ - DECLARE_BITMAP(trace_dstate_delayed, CPU_TRACE_DSTATE_MAX_EVENTS); - DECLARE_BITMAP(trace_dstate, CPU_TRACE_DSTATE_MAX_EVENTS); - DECLARE_BITMAP(plugin_mask, QEMU_PLUGIN_EV_MAX); =20 #ifdef CONFIG_PLUGIN diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 8370c92c05..cd058619f5 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -175,7 +175,6 @@ struct tb_desc { tb_page_addr_t page_addr0; uint32_t flags; uint32_t cflags; - uint32_t trace_vcpu_dstate; }; =20 static bool tb_lookup_cmp(const void *p, const void *d) @@ -187,7 +186,6 @@ static bool tb_lookup_cmp(const void *p, const void *d) tb_page_addr0(tb) =3D=3D desc->page_addr0 && tb->cs_base =3D=3D desc->cs_base && tb->flags =3D=3D desc->flags && - tb->trace_vcpu_dstate =3D=3D desc->trace_vcpu_dstate && tb_cflags(tb) =3D=3D desc->cflags) { /* check next page if needed */ tb_page_addr_t tb_phys_page1 =3D tb_page_addr1(tb); @@ -228,7 +226,6 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu= , target_ulong pc, desc.cs_base =3D cs_base; desc.flags =3D flags; desc.cflags =3D cflags; - desc.trace_vcpu_dstate =3D *cpu->trace_dstate; desc.pc =3D pc; phys_pc =3D get_page_addr_code(desc.env, pc); if (phys_pc =3D=3D -1) { @@ -236,7 +233,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu= , target_ulong pc, } desc.page_addr0 =3D phys_pc; h =3D tb_hash_func(phys_pc, (cflags & CF_PCREL ? 0 : pc), - flags, cflags, *cpu->trace_dstate); + flags, cflags); return qht_lookup_custom(&tb_ctx.htable, &desc, h, tb_lookup_cmp); } =20 @@ -263,7 +260,6 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu= , target_ulong pc, jc->array[hash].pc =3D=3D pc && tb->cs_base =3D=3D cs_base && tb->flags =3D=3D flags && - tb->trace_vcpu_dstate =3D=3D *cpu->trace_dstate && tb_cflags(tb) =3D=3D cflags)) { return tb; } @@ -282,7 +278,6 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu= , target_ulong pc, tb->pc =3D=3D pc && tb->cs_base =3D=3D cs_base && tb->flags =3D=3D flags && - tb->trace_vcpu_dstate =3D=3D *cpu->trace_dstate && tb_cflags(tb) =3D=3D cflags)) { return tb; } diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index cb1f806f00..432a0cffdb 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -50,7 +50,6 @@ static bool tb_cmp(const void *ap, const void *bp) a->cs_base =3D=3D b->cs_base && a->flags =3D=3D b->flags && (tb_cflags(a) & ~CF_INVALID) =3D=3D (tb_cflags(b) & ~CF_INVALI= D) && - a->trace_vcpu_dstate =3D=3D b->trace_vcpu_dstate && tb_page_addr0(a) =3D=3D tb_page_addr0(b) && tb_page_addr1(a) =3D=3D tb_page_addr1(b)); } @@ -888,7 +887,7 @@ static void do_tb_phys_invalidate(TranslationBlock *tb,= bool rm_from_page_list) /* remove the TB from the hash list */ phys_pc =3D tb_page_addr0(tb); h =3D tb_hash_func(phys_pc, (orig_cflags & CF_PCREL ? 0 : tb->pc), - tb->flags, orig_cflags, tb->trace_vcpu_dstate); + tb->flags, orig_cflags); if (!qht_remove(&tb_ctx.htable, tb, h)) { return; } @@ -969,7 +968,7 @@ TranslationBlock *tb_link_page(TranslationBlock *tb, tb= _page_addr_t phys_pc, =20 /* add in the hash table */ h =3D tb_hash_func(phys_pc, (tb->cflags & CF_PCREL ? 0 : tb->pc), - tb->flags, tb->cflags, tb->trace_vcpu_dstate); + tb->flags, tb->cflags); qht_insert(&tb_ctx.htable, tb, h, &existing_tb); =20 /* remove TB from the page(s) if we couldn't insert it */ diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 5b13281119..2ea42970e1 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -65,11 +65,6 @@ #include "internal.h" #include "perf.h" =20 -/* Make sure all possible CPU event bits fit in tb->trace_vcpu_dstate */ -QEMU_BUILD_BUG_ON(CPU_TRACE_DSTATE_MAX_EVENTS > - sizeof_field(TranslationBlock, trace_vcpu_dstate) - * BITS_PER_BYTE); - TBContext tb_ctx; =20 /* Encode VAL as a signed leb128 sequence at P. @@ -348,7 +343,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu, tb->cs_base =3D cs_base; tb->flags =3D flags; tb->cflags =3D cflags; - tb->trace_vcpu_dstate =3D *cpu->trace_dstate; tb_set_page_addr0(tb, phys_pc); tb_set_page_addr1(tb, -1); tcg_ctx->gen_tb =3D tb; --=20 2.39.2 From nobody Sun May 12 23:11:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1682002895; cv=none; d=zohomail.com; s=zohoarc; b=TuExLYQiyO7sG59svv/hEesz50FKopY6PIl9gylIoAqkGLdIYCxThkG5KZvItQJQw2scUNdHPKRGdBy1eMr0C5/IdajJO1UAWfBPnG6Rjx9Yzk+anCLYjcf2nr0SyhASegbU9z4gp2pZYGCr+qt/qvTTN6Np6H8uWBIC+3f/auo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682002895; 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=0vImXH3xRyVec7BYB1TMv5cbFwkjyryrhb38Ec21rN4=; b=YgA8BdeBJK6JtpJuHQ398iZpNJ/9iv+5IbJMIr8TwWHaxSWBfguZRfz+2QiBNCFZkvB6HoDnAeDMGWDHBJ3K8hpaR7Zt5PqRwWet+p10UA4lqrfFiIg5PTqDXmRHbWoAUyxI04hE+Vjb4O6NlugEjm7emRtOxPfKGXnImvzeGQA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16820028955581003.8443111579494; Thu, 20 Apr 2023 08:01:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppVls-0003oe-AE; Thu, 20 Apr 2023 11:00:28 -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 1ppVli-0003ag-27 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:19 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppVlg-00046i-3D for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:17 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-2f95231618aso456256f8f.1 for ; Thu, 20 Apr 2023 08:00:14 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id w13-20020adff9cd000000b002cea9d931e6sm2146827wrr.78.2023.04.20.08.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 08:00:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 280F71FFB8; Thu, 20 Apr 2023 16:00:11 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682002813; x=1684594813; 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=0vImXH3xRyVec7BYB1TMv5cbFwkjyryrhb38Ec21rN4=; b=XRVFqBGN3LI8XVMOOsFnIJsBvm1j90DdXIA+uyWYufuY4e5oZubQRRJcn6OBYezico VByO1cMPbDQUuOpu2FOHyB7s2nF4CVv5zXTE9hjEs7gal1VrmQ8HzhK0DM3gj4J1ncUv Zh3CfwHm0617JHhb8L9vS18wAAIVO5lq1V0Quh5Csfno7QJZjLr0+CZpmPOOIuPg8HIk PBJVoVxVDSNjfIGz/1Zf6lLaH3d9YcHcd34+aK7f3ZRxh+ak0ok2Yz7sLYBIBbhAGKfB 4x1WNyOZCz0DtQfsDpQTyDScDe+eALFWb+DdOq2cemWyVVExjFTN8Tk3ueQQmD6H4MA1 6P4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682002813; x=1684594813; 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=0vImXH3xRyVec7BYB1TMv5cbFwkjyryrhb38Ec21rN4=; b=bDqnWvgybETDaWf/bQcR9JzFLHmE5dxFDmeQ7CkBiBgG6LJTsbf7NzWsdYZbixufxz 31vPQeV9eFpfBlIv1bDpDWyS2wN7XliBs6E5hWURrnavsuuaFD2TTgDYJ8qXolMS55Yr R1LyxS2RnOYIYlCpRcUsEyPFRKHQTCXBWlDUBbpscY18voekKyDLPD2DsFyTWGOdYd5U w2pRiQtZzDYkmRe0/WNuelne9voF6uqhoE/CGK+caS9MWnGWw2wrGBM5Zo/dQ2kdV504 izjEr7AsDoSjkiVHItgMppJscvpT5aWvx4EnxaHNDlt8RTtGgbJ5gN5r7NQqa2gbZcyd 6lHQ== X-Gm-Message-State: AAQBX9db4fgf0aMHLVWG1iECMmkSfwxprYavYNXmJBJm0ksL1r6n7bLF UipOgPq9rjfEleg/vDNuIr3f+w== X-Google-Smtp-Source: AKy350YGeZEB0UMhww2tbXnm2g3E84SuKMtyL0K2nQSBjyTYvOdQgZUMGPkJfh/yiQh1+Wbj3Qkjsg== X-Received: by 2002:a5d:6808:0:b0:2f5:d0f:744a with SMTP id w8-20020a5d6808000000b002f50d0f744amr1539559wru.12.1682002813697; Thu, 20 Apr 2023 08:00:13 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Michael Roth , Riku Voipio , Christian Schoenebeck , Yanan Wang , Greg Kurz , Richard Henderson , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Stefan Hajnoczi , Eric Blake , Markus Armbruster , Warner Losh , Paolo Bonzini , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 09/10] hw/9pfs: use qemu_xxhash4 Date: Thu, 20 Apr 2023 16:00:08 +0100 Message-Id: <20230420150009.1675181-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420150009.1675181-1-alex.bennee@linaro.org> References: <20230420150009.1675181-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1682002899037100003 No need to pass zeros as we have helpers that do that for us. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Christian Schoenebeck Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi --- hw/9pfs/9p.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 9621ec1341..9bf502c45f 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -741,12 +741,12 @@ static VariLenAffix affixForIndex(uint64_t index) /* creative abuse of tb_hash_func7, which is based on xxhash */ static uint32_t qpp_hash(QppEntry e) { - return qemu_xxhash7(e.ino_prefix, e.dev, 0, 0, 0); + return qemu_xxhash4(e.ino_prefix, e.dev); } =20 static uint32_t qpf_hash(QpfEntry e) { - return qemu_xxhash7(e.ino, e.dev, 0, 0, 0); + return qemu_xxhash4(e.ino, e.dev); } =20 static bool qpd_cmp_func(const void *obj, const void *userp) --=20 2.39.2 From nobody Sun May 12 23:11:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1682002954; cv=none; d=zohomail.com; s=zohoarc; b=SfI4nbMeX33BO2yOKfV9l5dhXZe/7iAOgcd8aoRNqzmP5rsuew87qQTBU+CsxRtPi5hNTpTPJ8+nD27GbCUQQFiDMs+6hTU45YJh2fklw0cwKgCiuczpEaiG7in3wcMzIz8I3LxfkkqU7l+1iW7uTmORdKBZeVUCaLGywiR/TAw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682002954; 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=2mUGdFeLesXixgZdR4dkifVgmw89yr/nJqMOkP0ydlI=; b=NYsea4CfYFFb5UqnexDI5BwEYaTnYtWP+uuf5OzbLe6j7FRu9NAi1KIZ6DEGw8/dhhdSc0DGtyP/rpaMtPOgRvFCgHsrB18/pOwoRaUayZxygCFwjE6lzy1rwA1lqvgJMatPRqJyWhgkjIjKkoBk4MI9OyxpJLxTq91WqEH74Q4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682002954789192.47276809446475; Thu, 20 Apr 2023 08:02:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppVls-0003qM-Vk; Thu, 20 Apr 2023 11:00:29 -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 1ppVlk-0003dA-71 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:21 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppVlg-00047W-I6 for qemu-devel@nongnu.org; Thu, 20 Apr 2023 11:00:19 -0400 Received: by mail-wm1-x32f.google.com with SMTP id he11-20020a05600c540b00b003ef6d684102so3204490wmb.3 for ; Thu, 20 Apr 2023 08:00:16 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id r3-20020a05600c35c300b003f1836c98b7sm3334870wmq.48.2023.04.20.08.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 08:00:13 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 428B31FFC0; Thu, 20 Apr 2023 16:00:11 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682002815; x=1684594815; 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=2mUGdFeLesXixgZdR4dkifVgmw89yr/nJqMOkP0ydlI=; b=Q9YAuYXcSydEZ7VVlWXZMKct4mjUM6fD40au3zTtI88VlqrXmktxXyF5zg3P0Sko0v SNapRdEd4veuK0oeO42R0L2zc+qLnqvIiPU3tv5L68CRJLQBMSyHD7iYP1sJLpPPIgF7 W0ce3WLYbAdNQX15apEycgNs3ACmGZZkz8mquxW+Eec4kMRZRtxnhX/uYpdGEu4Oqzqv dWLupWIAIPHWIQd/Ug2EzV+uxkMzK0iG5FmdMg3StR1BQU+XTf34jt6kiDATxjDshs+k bTZJVyUqhe6Om+VmPErVOVBToY5RPm6EyzCBgQtVDsdij8f+zeQ25s0H7SqWGj4PK5W7 ohIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682002815; x=1684594815; 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=2mUGdFeLesXixgZdR4dkifVgmw89yr/nJqMOkP0ydlI=; b=RpCQgy4/NXx0jZzYHXBmbHiJpXWcvdL+ikBJlGHrSZ/sZMgSVo7RbysyCa1OSHAOb/ yl+UGLcd3notU7VBJUGWmrZK0vSSbXcqvDuOlThXXGkbebcd7VZ2T1knl2hswjT/dIOv EsxAjpboiNxekh4ED8YgmuW+LKjEOLlApIf7TwUGoX+kxT2owvKWX++59OIjKyUgXQRs ULKOeVH0zcJxzyf/yaRBBeIJq2j+basJoGg1czZiVJWDGh7P6LIxakZca70kC+SlLTzY 80XG11H/MBU1jeBMAQaZBSWrJvGqiv0ezTrXd85UbcqVjo0ubgMe0JRdWityBf8OTvLz obWw== X-Gm-Message-State: AAQBX9elbEpfzPWYSqZ2yfeggxPG8PG25UBPvQM8+XWw23UmpBfUOdGV BvgMPPNoY5+GKBOdxD8/510FOA== X-Google-Smtp-Source: AKy350Z0eD/OUhdLLjwd9Cpdx9kVYMjL2F31BxGwY+28wAAZ0M66//CX+/x3de5XCXUpRy+yaztniw== X-Received: by 2002:a1c:7916:0:b0:3f1:72dc:8bae with SMTP id l22-20020a1c7916000000b003f172dc8baemr1625459wme.21.1682002815004; Thu, 20 Apr 2023 08:00:15 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Michael Roth , Riku Voipio , Christian Schoenebeck , Yanan Wang , Greg Kurz , Richard Henderson , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Stefan Hajnoczi , Eric Blake , Markus Armbruster , Warner Losh , Paolo Bonzini , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 10/10] xxhash: remove qemu_xxhash7 Date: Thu, 20 Apr 2023 16:00:09 +0100 Message-Id: <20230420150009.1675181-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420150009.1675181-1-alex.bennee@linaro.org> References: <20230420150009.1675181-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1682002960260100002 Now we no longer have users for qemu_xxhash7 we can drop an additional multiply and rol and make qemu_xxhash6 the implementation. Adjust the smaller hash functions accordingly. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi --- include/qemu/xxhash.h | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/include/qemu/xxhash.h b/include/qemu/xxhash.h index c2dcccadbf..bab7d4ca09 100644 --- a/include/qemu/xxhash.h +++ b/include/qemu/xxhash.h @@ -49,7 +49,7 @@ * contiguous in memory. */ static inline uint32_t -qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f, uint32_t g) +qemu_xxhash6(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f) { uint32_t v1 =3D QEMU_XXHASH_SEED + PRIME32_1 + PRIME32_2; uint32_t v2 =3D QEMU_XXHASH_SEED + PRIME32_2; @@ -86,9 +86,6 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32= _t f, uint32_t g) h32 +=3D f * PRIME32_3; h32 =3D rol32(h32, 17) * PRIME32_4; =20 - h32 +=3D g * PRIME32_3; - h32 =3D rol32(h32, 17) * PRIME32_4; - h32 ^=3D h32 >> 15; h32 *=3D PRIME32_2; h32 ^=3D h32 >> 13; @@ -100,23 +97,17 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uin= t32_t f, uint32_t g) =20 static inline uint32_t qemu_xxhash2(uint64_t ab) { - return qemu_xxhash7(ab, 0, 0, 0, 0); + return qemu_xxhash6(ab, 0, 0, 0); } =20 static inline uint32_t qemu_xxhash4(uint64_t ab, uint64_t cd) { - return qemu_xxhash7(ab, cd, 0, 0, 0); + return qemu_xxhash6(ab, cd, 0, 0); } =20 static inline uint32_t qemu_xxhash5(uint64_t ab, uint64_t cd, uint32_t e) { - return qemu_xxhash7(ab, cd, e, 0, 0); -} - -static inline uint32_t qemu_xxhash6(uint64_t ab, uint64_t cd, uint32_t e, - uint32_t f) -{ - return qemu_xxhash7(ab, cd, e, f, 0); + return qemu_xxhash6(ab, cd, e, 0); } =20 /* --=20 2.39.2