From patchwork Wed May 24 13:39:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685353 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp257733wrt; Wed, 24 May 2023 06:41:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60V20sp+qQ0criMFyShX0eQieeJWbcoKVfXhM1weAuPVlRq2uJ7i5SmANNt3WzHzEisIJG X-Received: by 2002:ae9:e895:0:b0:75b:23a0:d9e5 with SMTP id a143-20020ae9e895000000b0075b23a0d9e5mr7087179qkg.59.1684935706357; Wed, 24 May 2023 06:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684935706; cv=none; d=google.com; s=arc-20160816; b=datEZAsoFMfjp9KWMl9Xmn/uObxKXx3nZ+T5FemQJG1gJ74sJglciBRuVKWUMOZTYd 2i4odZIv6HVxld/MGs2ic64La/IlGPnoI+aZ8bhqgkI9iaK0hjAcCg+IDGWDgfqOjrYN otx9qeuzt8srMSRD78nLQ8KdJ8RujNKSF/kMVeicu03mrx2LT8jsgKym1S1h9ImiaOY5 hXaXnDot8zdMxgv71miTrGZrRifSsY5/wbGEPmsGWAqJiNwTGUmZWoa403El62cFXtht Vb3MnVwN4WwrCLmElXc8TlokNmxHB9zKYSDtNNKW/XLCzOY3dLG+RfxaYBdvTM99AaRd tpFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VrRa3Xy6DTZtfJYVIdsX3CmIb/NP6vmSmbITjRkKdS4=; b=H4xyG5c3ccFwwZYNX/1rmwv0ezu7sv6/g7BGjkZwRpstXideMC95EvXTVzjyPTcB43 BWo0RZ90EqcwfTxbbFx2IzjZgHiWvjsSK7WO9fXcVd4/yKXdpMhCgN7HW+JRm5+MRrQ5 kTSIvZq7SQ+P0WuCmcv7wvU9rO8smCPBabiCdYUZKVISzlpJKqH6IIgtmx6qvx1XJEye yxwRjuHtGHLftzIF2Z40NERYZnygnSRuS8/rrZ70FV4vX7t4JJBMK3WLK6cthUB1KGLm sc3yrBezoBYd1HRo0JpX2/UZbQzwYG2qvIf1ZVU4fwqTlIlDIcCi9eA3NVcVr3PpeVxW cSEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ypc3l46t; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g13-20020a0562140acd00b005ef470bb7c8si6594832qvi.366.2023.05.24.06.41.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 06:41:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ypc3l46t; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1oil-0008S2-K9; Wed, 24 May 2023 09:40:07 -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 1q1oid-0008Ck-96 for qemu-devel@nongnu.org; Wed, 24 May 2023 09:40:01 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1oia-0003la-Jm for qemu-devel@nongnu.org; Wed, 24 May 2023 09:39:58 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3078cc99232so838672f8f.3 for ; Wed, 24 May 2023 06:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684935594; x=1687527594; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VrRa3Xy6DTZtfJYVIdsX3CmIb/NP6vmSmbITjRkKdS4=; b=Ypc3l46t2R84xQ8C/QGyYmD7k3C78NAyl6rI/RHp8QlQTDtQDvOcBQHZSN7jthuSWO qNZffMqnP+OX0BF7AB0ALSh96Zmi7YKc7kgZFtiRGmqDe+TUsPNF6w4a590r/3xBsVlf Ulk8mLzRV8pVAm5Iw1u5e3bplZWQMML7lmSNr3Bc/cmA1v4SGM5dVwF78kYXT5X/5jmb kZkzam2HSzIGq/SKgXe/Sb4lCzTfCA7WkpSmDR4fD1TlpAlymt/00HpvMZ/ZIGLJmx/j Wt5k21qDUyKtgmB8NGXyj0wKq6b/opaDdaz9za16llw1ATIqs9Pir/iL04slCJVKLOV1 39ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684935594; x=1687527594; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VrRa3Xy6DTZtfJYVIdsX3CmIb/NP6vmSmbITjRkKdS4=; b=jalPal/V8oDoW/ckhuBGT4/WdFxfn86Ct4UKcoL95OQhKzvD7lbwr0bu9cOS+zr6V7 NmEDUWuo4oNqgmgK+Lvj+44Tl6VUbv/INEKTwOkZ/WO6sO1j9WBVpl9NrbKwl0IfDxJc XFAJQpeqrNtN9LV4co7Pukn6nIZBdZvOePgwR3+RZeD8YhOOIeneADSiYhzt+btLkvoX YIHXgOeJUSMZRmFEJ3lWig+yt5X2Xjj4x3DXvaPV4Tz42/0ZkcdqeeNuXSjogl5MTS2O EguYVNCJtA5uvVjEnW5g3lV3xsp2GFcQ7MGhSgBP5WCr8MS4HBPOszyNpa4xQZ/Yodvn h5sA== X-Gm-Message-State: AC+VfDyVTVjcKcjUK2QC0tJRfyy5jl3F41hw1l8Yt+uImQhHs+YxAlJK nPZrhjqS8mpusnbQyT828QO5Lg== X-Received: by 2002:adf:ef42:0:b0:307:c0c4:108f with SMTP id c2-20020adfef42000000b00307c0c4108fmr13648871wrp.33.1684935593873; Wed, 24 May 2023 06:39:53 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p15-20020a5d458f000000b003090cb7a9e6sm14550611wrq.31.2023.05.24.06.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 06:39:53 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0ABB91FFBC; Wed, 24 May 2023 14:39:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kyle Evans , libvir-list@redhat.com, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Greg Kurz , Eric Blake , Markus Armbruster , Warner Losh , Marcel Apfelbaum , Eduardo Habkost , Michael Roth , Richard Henderson , Christian Schoenebeck , Riku Voipio , Paolo Bonzini , Yanan Wang , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v5 01/10] *-user: remove the guest_user_syscall tracepoints Date: Wed, 24 May 2023 14:39:43 +0100 Message-Id: <20230524133952.3971948-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524133952.3971948-1-alex.bennee@linaro.org> References: <20230524133952.3971948-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This is pure duplication now. Both bsd-user and linux-user have builtin strace support and we can also track syscalls via the plugins system. Reviewed-by: Warner Losh Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230523125000.3674739-2-alex.bennee@linaro.org> --- 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 num, 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 num, 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); } 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 = env_cpu(cpu_env); abi_long ret; - 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); 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) -# 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=0x%016"PRIx64" arg1=0x%016"PRIx64" arg2=0x%016"PRIx64" arg3=0x%016"PRIx64" arg4=0x%016"PRIx64" arg5=0x%016"PRIx64" arg6=0x%016"PRIx64" arg7=0x%016"PRIx64" arg8=0x%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=0x%016"PRIx64" ret=0x%016"PRIx64 From patchwork Wed May 24 13:39:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685348 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp257367wrt; Wed, 24 May 2023 06:41:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4CmUltwjDrx2Pb1WV5LCdjd6k9kiFrpN3p3wzVuBxa0q0ICvHgQD11DXG0s2OHwoQJpj/R X-Received: by 2002:ad4:5f0a:0:b0:625:87e4:1689 with SMTP id fo10-20020ad45f0a000000b0062587e41689mr11868946qvb.20.1684935660100; Wed, 24 May 2023 06:41:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684935660; cv=none; d=google.com; s=arc-20160816; b=huSxVhGwjHVRPge4y3hKsF9/JqoqGGiEGOvDyl6E2BY2Z3FbqPXibmBXM4TBu4D7gz NAYrDQfLtESceHzAdJNZaGB5WQU6x+5trEuK5rxloCbC2aNSIdh/KmQ6ZR67DMyhWt3B yGaKuJ6BVvKgOVZiA3blsVdkFFiwDMPOMryf+tTgSAOCevGjn6OBphldp4JlJ6yrQXaS 7t42+PrLOkFMmXQ/nEvay4rkstE/7L43J+i3KKQPFMbbuavISaeWOvLEhYHkSvx3//pk nlVVCFvZraRFfVxurfipiL7VZTRE3FzxnUJqCc/l/TbTsYz6Yui7aGsU4HNYZIcWnOEA NpYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=b5ff0sveshClrMNiLX5BqqtsMAT9oAoNb16IS+Sn9BA=; b=kgswZlx+op4B8i+0amJ677O9SxFEh2Frnl9xE4/vuof/t1FZklI0V1eqkD9Ou/bHw9 qBdeVKuqeb9Ok59uG60FE0xa144srQPD80MZEimys8uKDuvq02YbpoGtkGFmuM6W82uz 4Qnp/LYwc346T6hy90lsxK8L5FViMHK7zbZhU6acPswQOJBCmEt0VwttDaw3vGxH8gIZ GHW2fUSc3TU64NyiShG0RsJytMss/XgyN8I1tjrM77asJth9cFEYn7KZa8D9Tkmu6q3k 8Z8/Zal85oTHsVcuhL8nDb2K2ZfUCMxy1aMUMm6kpt+BO6puSSR4fCnv4aj8oxAMLPHc V8Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OfzewB13; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o2-20020ad45c82000000b0061b5abc8d64si6917727qvh.414.2023.05.24.06.40.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 06:41:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OfzewB13; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1oii-0008I8-Sb; Wed, 24 May 2023 09:40:05 -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 1q1oie-0008D9-DN for qemu-devel@nongnu.org; Wed, 24 May 2023 09:40:01 -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 1q1oia-0003m0-NJ for qemu-devel@nongnu.org; Wed, 24 May 2023 09:39:59 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f60ec45314so7774185e9.3 for ; Wed, 24 May 2023 06:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684935595; x=1687527595; 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=b5ff0sveshClrMNiLX5BqqtsMAT9oAoNb16IS+Sn9BA=; b=OfzewB13fnUOZVDiIm0/w8ZZnpqwUv6W6Ws4TeYehaZXCM7jEtv71WTvX80zn5haib HkoZGD1RdQXLrGD56Vxn6iteX+qYHGbkexFcQQ7wXKK7m7TeIic5x5omdm/pRF4UZ397 1j+TDVkZUmEodhE8rO6pr/P15I4vJgBLZ9iV8i+ANcoCEFKCFA74VOKLAGfaZpLvRbao HEYYpYVfgc7pMhtck9kRzHALUdII1orEY4abiXIZKk1V03Wo7sykAFZSr7fjvmcpFJev cw/5GVnZH+koA71zdL96vab/CNtIqGl4g/F/V390AsYRp9WXzAlR1DN0KFRDjhPxMk2E 7CXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684935595; x=1687527595; 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=b5ff0sveshClrMNiLX5BqqtsMAT9oAoNb16IS+Sn9BA=; b=cKHGADCwn98o0EurBiiXD0dzqIXyKtv+fcc0DgZ/nfKDqWd8pDIVZHuMnmaQfUbDFU 57yf8GbqZnA3H/tVODZjlcArnHWQSHUbJ5JZKb1N0+D/sjPoHpo2a1AbUbn+H2rrsj3g fyRoEKiatgZ53bYIiZgWaWg+4Y70x34RepwWtmH7kGS/BgtR+yMhaGk0b1hi6AEV8Ecj Y1ta9K1WMaUwxZhuBKRy5IUqGO1TXNSJXz3zCsXNzj3QKNfOOeTCVFSCIw84bw0WJ2kV XEUhgRUmf2GOvyiz2F43+Zv6aoUN7aO39AxSNYtlziyo4OyQM9jfTLqmcINHg8qQMU7W HcuQ== X-Gm-Message-State: AC+VfDz5c9RWsE1arLbBLpNl3VjkkJMBVJ67sgub7I0ffZOkIRusnKvn YnSdsLloyn9P4nOS35V6ludCqA== X-Received: by 2002:a1c:7415:0:b0:3f6:2ee:698e with SMTP id p21-20020a1c7415000000b003f602ee698emr7527691wmc.7.1684935595358; Wed, 24 May 2023 06:39:55 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f16-20020a7bcc10000000b003f60fb2addbsm2430703wmh.44.2023.05.24.06.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 06:39:54 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2BD681FFBD; Wed, 24 May 2023 14:39:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kyle Evans , libvir-list@redhat.com, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Greg Kurz , Eric Blake , Markus Armbruster , Warner Losh , Marcel Apfelbaum , Eduardo Habkost , Michael Roth , Richard Henderson , Christian Schoenebeck , Riku Voipio , Paolo Bonzini , Yanan Wang , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v5 02/10] trace-events: remove the remaining vcpu trace events Date: Wed, 24 May 2023 14:39:44 +0100 Message-Id: <20230524133952.3971948-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524133952.3971948-1-alex.bennee@linaro.org> References: <20230524133952.3971948-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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]. We rename cpu_reset and make it a normal trace point. Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230523125000.3674739-3-alex.bennee@linaro.org> --- hw/core/cpu-common.c | 4 ++-- trace/control-target.c | 1 - trace/control.c | 2 -- hw/core/trace-events | 3 +++ trace-events | 31 ------------------------------- 5 files changed, 5 insertions(+), 36 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 5ccc3837b6..951477a7fd 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -32,7 +32,7 @@ #include "sysemu/tcg.h" #include "hw/boards.h" #include "hw/qdev-properties.h" -#include "trace/trace-root.h" +#include "trace.h" #include "qemu/plugin.h" CPUState *cpu_by_arch_id(int64_t id) @@ -113,7 +113,7 @@ void cpu_reset(CPUState *cpu) { device_cold_reset(DEVICE(cpu)); - trace_guest_cpu_reset(cpu); + trace_cpu_reset(cpu->cpu_index); } static void cpu_common_reset_hold(Object *obj) diff --git a/trace/control-target.c b/trace/control-target.c index c0c1e2310a..a10752924b 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -144,5 +144,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; - trace_guest_cpu_exit(vcpu); - trace_event_iter_init_all(&iter); while ((ev = trace_event_iter_next(&iter)) != NULL) { if (trace_event_is_vcpu(ev) && diff --git a/hw/core/trace-events b/hw/core/trace-events index 56da55bd71..2cf085ac66 100644 --- a/hw/core/trace-events +++ b/hw/core/trace-events @@ -29,3 +29,6 @@ clock_set(const char *clk, uint64_t old, uint64_t new) "'%s', %"PRIu64"Hz->%"PRI clock_propagate(const char *clk) "'%s'" clock_update(const char *clk, const char *src, uint64_t hz, int cb) "'%s', src='%s', val=%"PRIu64"Hz cb=%d" clock_set_mul_div(const char *clk, uint32_t oldmul, uint32_t mul, uint32_t olddiv, uint32_t div) "'%s', mul: %u -> %u, div: %u -> %u" + +# cpu-common.c +cpu_reset(int cpu_index) "%d" 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) - From patchwork Wed May 24 13:39:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685343 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp257007wrt; Wed, 24 May 2023 06:40:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6RRyCwAp50qj8V/Tw5cDStHJoWs2K7xkz3zTKGbYjGS68S5qqU/zS8ny4qqruaFCv3FSzi X-Received: by 2002:a05:6214:413:b0:616:5f27:b96a with SMTP id z19-20020a056214041300b006165f27b96amr30455226qvx.27.1684935615593; Wed, 24 May 2023 06:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684935615; cv=none; d=google.com; s=arc-20160816; b=gvz/wwZbgh4aYWHGW9e8rTFWjj2LqmBSZ1V2+gX3lYQdYESDJ06bUdi/WXDOhp1rX0 lWuTQOGgW8C000tykeiVu2qbRi+q3I3PR6cbRHG2auipG2VD85sLA/HGEyZ2Q8oIYrtB AZ+w7fSFtPfuR68BJTuvOYUtgJJQtCM7jln+DlEjVZE5SMYPdfsC2tNa/jDQjzFsbFCI r9QiDbBmE6qqZH3byWzwnP4G+PG5I5yAHvOCbpxNdDlrCfPcOxLwc+gjxuvqJlK3MAP9 vOQmG+/4MkwpFubI/rSxnZAP58OMqfqCpXPXcilR+kMkd5DtZY+tJj8LI6pTVlQPDhDd 0SXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rJVPWXx5AwD7VKV2U66DJQZzDYUvPoHQtuGdzv7YoHE=; b=TRlLmONtZ9D5ztTgnbCevQ//WuPppw3a8Qh7B/KAaQernLm72ILNLrScaxVUrKKM1E 1v+XVWvH0W3XmcEQ0WDrT/Sa/zpOdZZmOevyqHC9eVg0EkPOTf3hOpDnQCyAvbfczdCs mz41XFLa20QD6yIilxiAE86oWHK4G0G2uPPX2Vnmg0Ag+0MDc7V/L3PGKOJkPgUr6vss zzIEnsDBq6BE8ldje7fQfZGHoO61g/pMZFhChWZwTeCWfhou5bzXn/uX0JGXj7NtSUMd eEO0MZuO0HvDF3een9obbht+WpRtizHepAYFt+xN4A4zZc9ZNV25esxodwm4zU19BSE6 MMIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pIvUDWZQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jn1-20020ad45de1000000b005ef8b3a05c2si6448682qvb.285.2023.05.24.06.40.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 06:40:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pIvUDWZQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1oig-0008D3-T5; Wed, 24 May 2023 09:40:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1oib-00083d-NP for qemu-devel@nongnu.org; Wed, 24 May 2023 09:39:57 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1oiZ-0003li-SK for qemu-devel@nongnu.org; Wed, 24 May 2023 09:39:57 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f427118644so11030715e9.0 for ; Wed, 24 May 2023 06:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684935594; x=1687527594; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rJVPWXx5AwD7VKV2U66DJQZzDYUvPoHQtuGdzv7YoHE=; b=pIvUDWZQ/qIiRJiIcW8j9SgR4sbdcWnkrEslmgC5waWteC/eMp3AdZOLig/iBqcQpe +inoKSdzEN9oak6hZUpQDZSswYcuiNZDYyDDbL33x3U7SRFwp0PD+q6dKj0oj1NzwG6d BJeGeUguanN1+bCmtbWtWadzlcP6gGbW1i6qzuFcKyo1cuyPOuGbuYKLp/HT6KM0H6AD CZkujUWV6C9g8jWR3UMceKXqXsNsTDIiakXQDF7lj7JDNk7aKsM1DrF9VyBBnlTXBC9J NmItsr6ztcyubTjmQrlptFu2417mZeQEMkuXOz3RiDVKXf9p/qR3RSxZHzmyq6xgZP+O fgVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684935594; x=1687527594; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rJVPWXx5AwD7VKV2U66DJQZzDYUvPoHQtuGdzv7YoHE=; b=HQcbPL3Zp+D/KAIiVZKJ+mo5DepDHy1ZdSNizfH3t00asWpYcqKrf5WxEMdz0+MIj1 cytyzFFts9bLRqoyaHFAXPfsW/UegdQZn4i/ChOM/FQc0EiT6eB9Zgpnk1kjgLQ4eC3y BPgITqx4W6YA1hqNlPn+YB3CkvqxfXAI+zJFUPdIGFp8TYHzhN/xoNG1M3761bXvp+S8 cDyWFmrdJm/GQ90JVTXC5kwKk/5eJdS1Y4yTcRdZO0x1l8yeDFC/VzdasRCbeMmUZHXG EXOxylnE+5L1mtd6ziOpLe95QCzQQTXEWfNnyW1zl1nuyuGNOez/j4dvGNfU2acaleLe EhXQ== X-Gm-Message-State: AC+VfDxBywnqFGWemnzILnaJ3avc1JHT2gZYjZxxHCjn7DMx/1qdlTzv XXRtE27LEYDg5W9KAOY81+a4oj7mxL1X7amsB2CQtw== X-Received: by 2002:a05:600c:20d:b0:3f6:735:69e7 with SMTP id 13-20020a05600c020d00b003f6073569e7mr6421168wmi.36.1684935594316; Wed, 24 May 2023 06:39:54 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id u2-20020a05600c210200b003f42314832fsm2379125wml.18.2023.05.24.06.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 06:39:54 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4CC371FFBE; Wed, 24 May 2023 14:39:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kyle Evans , libvir-list@redhat.com, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Greg Kurz , Eric Blake , Markus Armbruster , Warner Losh , Marcel Apfelbaum , Eduardo Habkost , Michael Roth , Richard Henderson , Christian Schoenebeck , Riku Voipio , Paolo Bonzini , Yanan Wang , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v5 03/10] trace: remove vcpu_id from the TraceEvent structure Date: Wed, 24 May 2023 14:39:45 +0100 Message-Id: <20230524133952.3971948-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524133952.3971948-1-alex.bennee@linaro.org> References: <20230524133952.3971948-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This does involve temporarily stubbing out some helper functions before we excise the rest of the code. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230523125000.3674739-4-alex.bennee@linaro.org> --- trace/control-internal.h | 4 ++-- trace/event-internal.h | 2 -- trace/control.c | 10 ---------- scripts/tracetool/format/c.py | 6 ------ scripts/tracetool/format/h.py | 11 +---------- 5 files changed, 3 insertions(+), 30 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index 8b2b50a7cf..0178121720 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -27,12 +27,12 @@ static inline uint32_t trace_event_get_id(TraceEvent *ev) static inline uint32_t trace_event_get_vcpu_id(TraceEvent *ev) { - return ev->vcpu_id; + return 0; } static inline bool trace_event_is_vcpu(TraceEvent *ev) { - return ev->vcpu_id != TRACE_VCPU_EVENT_NONE; + return false; } static inline const char * trace_event_get_name(TraceEvent *ev) diff --git a/trace/event-internal.h b/trace/event-internal.h index f63500b37e..0c24e01b52 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -19,7 +19,6 @@ /** * TraceEvent: * @id: Unique event identifier. - * @vcpu_id: Unique per-vCPU event identifier. * @name: Event name. * @sstate: Static tracing state. * @dstate: Dynamic tracing state @@ -33,7 +32,6 @@ */ typedef struct TraceEvent { uint32_t id; - uint32_t vcpu_id; const char * name; const bool sstate; uint16_t *dstate; diff --git a/trace/control.c b/trace/control.c index d24af91004..5dfb609954 100644 --- a/trace/control.c +++ b/trace/control.c @@ -68,16 +68,6 @@ void trace_event_register_group(TraceEvent **events) size_t i; for (i = 0; events[i] != NULL; i++) { events[i]->id = next_id++; - if (events[i]->vcpu_id == TRACE_VCPU_EVENT_NONE) { - continue; - } - - if (likely(next_vcpu_id < CPU_TRACE_DSTATE_MAX_EVENTS)) { - events[i]->vcpu_id = next_vcpu_id++; - } else { - warn_report("too many vcpu trace events; dropping '%s'", - events[i]->name); - } } event_groups = g_renew(TraceEventGroup, event_groups, nevent_groups + 1); event_groups[nevent_groups].events = events; diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index c390c1844a..69edf0d588 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -32,19 +32,13 @@ def generate(events, backend, group): out('uint16_t %s;' % e.api(e.QEMU_DSTATE)) for e in events: - if "vcpu" in e.properties: - vcpu_id = 0 - else: - vcpu_id = "TRACE_VCPU_EVENT_NONE" out('TraceEvent %(event)s = {', ' .id = 0,', - ' .vcpu_id = %(vcpu_id)s,', ' .name = \"%(name)s\",', ' .sstate = %(sstate)s,', ' .dstate = &%(dstate)s ', '};', event = e.api(e.QEMU_EVENT), - vcpu_id = vcpu_id, name = e.name, sstate = "TRACE_%s_ENABLED" % e.name.upper(), dstate = e.api(e.QEMU_DSTATE)) diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index e94f0be7da..285d7b03a9 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -74,16 +74,7 @@ def generate(events, backend, group): out('}') - # tracer wrapper with checks (per-vCPU tracing) - if "vcpu" in e.properties: - trace_cpu = next(iter(e.args))[1] - cond = "trace_event_get_vcpu_state(%(cpu)s,"\ - " TRACE_%(id)s)"\ - % dict( - cpu=trace_cpu, - id=e.name.upper()) - else: - cond = "true" + cond = "true" out('', 'static inline void %(api)s(%(args)s)', From patchwork Wed May 24 13:39:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685349 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp257411wrt; Wed, 24 May 2023 06:41:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5NXwdZrHvbGBEWeqtwZeWRkd2XTatSF4D9cyo/n3g7p7W9GgNYPZiMLJtECo6KSuTSIB/y X-Received: by 2002:ac8:7f92:0:b0:3e6:40f9:cf6c with SMTP id z18-20020ac87f92000000b003e640f9cf6cmr25060377qtj.28.1684935664656; Wed, 24 May 2023 06:41:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684935664; cv=none; d=google.com; s=arc-20160816; b=SAmuc1Ns+fqDttkLj0Q8f+HLZNSF2ToBJGnsh3QGGiMRM6wThCzJwWV+vODeDB5H2w L7/Ui+X3xKzMHkMz80jMH55bZM4RjlUFb3bYU6YFk+aFqsbu0HBPSW99Qj/4On38oOZa EvYVwzBE96MSSN1oJg9Sbp0xnoSbzTD7JlHmavki/aFmho8Lq4URctjCFTqYu1tyrjX+ H5f/YMA3kjjY1xDWQ74YgU2FnfZsGtSvMFT8r3gX9bCKQwyq1/sdLExRUajqP7FQb0jy XpfJiDmPSpDfxsG8Fu3VfyzxWg2vMUeSV0yJIb6ii8BLY+jVRVQaaFznt0fCvaAMmcwv Qevw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PoFcFHhtN//HYJuXe8yUkXS88yzA5U5AjAGE2C88aFE=; b=gI/rFk8ulgbKMVyCkdjeco3xnkla65Ui2is863EvhzEZiYD4WPFp38cMxpi6I8py4b E+3gVm/MUbMosZLW4v2efBlllpnUB8KszzyI7uMyzqDPIxkLJ6t5gIY+DQfPEPA5nIWM lqwYg8P2NS0rfNF1oR7gLJWWz2DGZaLnNGqQzxpXDGgawqXvZhLWSzoMll3Ben/gUQnB y+R3+jDvJwD8uujnzpEPsBFt3zNhcMzmbnKgp0TOK4Dn9+u6agYgLnghbt/KaVq4Jicu sUqQ6c7NJKHWLhPICtvHgrsraKYHbGSbHybympYcpSXSWsWy0T7uHGQ5aTD/Is8dO1ZL Ocxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LlL26Xbm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f21-20020ac859d5000000b003f52fa443besi6899185qtf.746.2023.05.24.06.41.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 06:41:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LlL26Xbm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1oik-0008OA-Kx; Wed, 24 May 2023 09:40:06 -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 1q1oie-0008D8-CM for qemu-devel@nongnu.org; Wed, 24 May 2023 09:40:01 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1oib-0003lx-Rc for qemu-devel@nongnu.org; Wed, 24 May 2023 09:39:59 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-30a892c45c4so574973f8f.3 for ; Wed, 24 May 2023 06:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684935595; x=1687527595; 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=PoFcFHhtN//HYJuXe8yUkXS88yzA5U5AjAGE2C88aFE=; b=LlL26XbmMqIfnVRJ7mQFf7knn5B5u2RUadIjfMQsOyXG6MbF6R+l2RnUtwGnS62/Vx F1sOBi4u4L3ioU94rOtWQPR82AOdW9UieLb35LxDtuUoEKr1/JhPTS5+V+hoQFJPZ6v/ NjzQ3xH3xLpXjrocmcscbKIjIsMlNTRlWl0LIKxyrPqJQDfe+CkIRjuU32slCAG4F08P 5rOq4p7kGJW35FiiG07axucTX1aa58DEj6agRcvMapLUIh1tWuz4/C6dH2S+77izOoCx pbqdwGdpuVBiQtDIQRuMgzOJfQzy2wkk1YPXvLGBN4p9oA7DmJ28jEqInumDapjGYPOg xWIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684935595; x=1687527595; 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=PoFcFHhtN//HYJuXe8yUkXS88yzA5U5AjAGE2C88aFE=; b=N/ZuIAO882Q/7oxZVjYUcYeqVrGlVfntTWrDw4vueh04Fzl0qkWUp/nYfWJkH/G57J no1dNF44Yr/2SlGw7WABIErKH/l9Nj1515AR74YsweJ4QZ4Hzp7Xt4X7IPx7wf0poHjC rdCRtUoWYsdOWGfMLDKh9fFhb3OSNrgGdqtJH8QMFYNqvhDub/mcsebhQgqDZjtbQkNg L3LIpn797YOkf4yBriMoCPxUnRj+A/NVehDkfEfX03sXN0qYJ4kAOEKuq8Rsxv8cbVYm zK/nzbrCJVr8cH5G2/Rux6td+b9Du/CKU/VUaQPc4QkViY6mPX4FyD3kfS8evtN6Q/9D velA== X-Gm-Message-State: AC+VfDxppzchonpyfw52SwVo9Gq3b+NRwYkj8hGFhZumSqzxgwCnt3Ab w5BSbj/N2rZv8e0omzDv78rclg== X-Received: by 2002:adf:e6cb:0:b0:2d1:3eb9:c3c2 with SMTP id y11-20020adfe6cb000000b002d13eb9c3c2mr12314606wrm.54.1684935595144; Wed, 24 May 2023 06:39:55 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p17-20020a5d4e11000000b003063772a55bsm14538281wrt.61.2023.05.24.06.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 06:39:54 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 64B031FFBF; Wed, 24 May 2023 14:39:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kyle Evans , libvir-list@redhat.com, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Greg Kurz , Eric Blake , Markus Armbruster , Warner Losh , Marcel Apfelbaum , Eduardo Habkost , Michael Roth , Richard Henderson , Christian Schoenebeck , Riku Voipio , Paolo Bonzini , Yanan Wang , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v5 04/10] scripts/qapi: document the tool that generated the file Date: Wed, 24 May 2023 14:39:46 +0100 Message-Id: <20230524133952.3971948-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524133952.3971948-1-alex.bennee@linaro.org> References: <20230524133952.3971948-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This makes it a little easier for developers to find where things where being generated. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230523125000.3674739-5-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster --- scripts/qapi/gen.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 8f8f784f4a..2ea27ef31c 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -13,6 +13,7 @@ from contextlib import contextmanager import os +import sys import re from typing import ( Dict, @@ -162,7 +163,7 @@ def __init__(self, fname: str, blurb: str, pydoc: str): def _top(self) -> str: return mcgen(''' -/* AUTOMATICALLY GENERATED, DO NOT MODIFY */ +/* AUTOMATICALLY GENERATED by %(tool)s DO NOT MODIFY */ /* %(blurb)s @@ -174,6 +175,7 @@ def _top(self) -> str: */ ''', + tool=str(os.path.basename(sys.argv[0])), blurb=self._blurb, copyright=self._copyright) def _bottom(self) -> str: @@ -195,7 +197,9 @@ def _bottom(self) -> str: class QAPIGenTrace(QAPIGen): def _top(self) -> str: - return super()._top() + '# AUTOMATICALLY GENERATED, DO NOT MODIFY\n\n' + return super()._top() + ( + '# AUTOMATICALLY GENERATED by ' + f"{os.path.basename(sys.argv[0])}, DO NOT MODIFY\n\n" ) @contextmanager From patchwork Wed May 24 13:39:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685350 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp257498wrt; Wed, 24 May 2023 06:41:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Q508it4jhz5YoWbzExlFuZ9JOvY8+xSq/h9u3WRZmse708rogSW+CnmbkiWhfoGuIDmyt X-Received: by 2002:a05:6214:29e9:b0:625:8b9a:b426 with SMTP id jv9-20020a05621429e900b006258b9ab426mr7697414qvb.46.1684935675606; Wed, 24 May 2023 06:41:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684935675; cv=none; d=google.com; s=arc-20160816; b=tmbwxiNrtKtqixy2zgseozRPcRVQ5wFj849l56/BMrh1Sns4iiTxcDUQS+bCVlVmbO bVqSoWw/sgwOauQb4KNW23p8mqoS3CL7KAnOYEW7E74F7ptP1wnEsNEnDcEeLn7pwUSj y/bRl8ryeKZFPrPQA8b2a/EOXwqoBIsVLVkJoVc+1K66RzN8lbrZ/e07vBokuOGyAi9g yx5oQUMjXIOfPBWJlrrqIvoqxfu9ws1lMgkOo3TZFdgOffjyZ0xZ53geCnvVEgPkUNs9 y5P4r3ymABFnoquComysCFBWopJcd57VU2RKYHkHUxseVPEbhMpnbbqnOt8k0CB1gG9C oEkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=o8t/+YNw/1eSOPZpziklGn9RfJ8rpI03v6Iz3JI+Nis=; b=YVdMBYUijvQZ+H1JI4iuEJRTvAh3oX4whq6xAZmhOdbu2KJ7MiPvvh4VUwa/3HBgH1 vV26Epln96dYBgOn5EuLvLNa+IHL+NRiWxeNbcQYd1gC5fIrNFcw574GNto/2QC8qXoT vSSAoXA4I1LXVDXeFdF4/msLe3YyjJuUSVvNueZQD8MSgvIsVyhByCskDlFRD8iiC4Nd 6VR3iRAWpKV6S7xg5lfJlM58ktWXHBSME8JuQ/SgOAJBxxdbxd7U/TgSqU/7xu+tDKHl jfNsE5OnwCArc1jrsWTi88p8mXDxUJsf/PgRAuyY1cK6587seZXtj67ZQyr4sDuuzYvh 8rSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="c7r/IPmz"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k6-20020ac85fc6000000b003ef49fe5460si6691286qta.765.2023.05.24.06.41.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 06:41:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="c7r/IPmz"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1oij-0008KL-SO; Wed, 24 May 2023 09:40:05 -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 1q1oie-0008DA-Dj for qemu-devel@nongnu.org; Wed, 24 May 2023 09:40:01 -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 1q1oib-0003m7-Rg for qemu-devel@nongnu.org; Wed, 24 May 2023 09:39:59 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3078a3f3b5fso853753f8f.0 for ; Wed, 24 May 2023 06:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684935596; x=1687527596; 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=o8t/+YNw/1eSOPZpziklGn9RfJ8rpI03v6Iz3JI+Nis=; b=c7r/IPmz4+dCI2ecMOxeIYY/cmrdZ0Ww4+tpx2GLjdV6yJ/zaBwYChz3kF1lRfksR8 zbTdA64H1xf8fI9rNnph1G3cysabyea57TSuTI4iRwYCzhVUmVojzxaDXweixWgjWWQu bLDrTzeLUoLzv+YbAW2/2a2YSoHNPvpGOj3p09mgbuvy5+f/bOxKphmtpBIo/fMW2Dzp cOw5Rbwh57is3ULKQmc8eI62IWI8tkPTUlgJ4GIKxdqKc1cT8JG9HyB8liS6G2OhdOnk 7oYFef9EQGZbQkckzPAklUwuQO46990P+ZetUZJ9ebod/JzcRdVtD6w9oIFhjSFOfEpz vQJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684935596; x=1687527596; 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=o8t/+YNw/1eSOPZpziklGn9RfJ8rpI03v6Iz3JI+Nis=; b=QLJ832G2iYayHFtMeTj5VUM7zWOiTK5gn0+tKqcFi/AU9aTMfHV0Z6Atxfe95jaZJV 1jKiE2bfQwzyGJu9CeEzRZXsiFFGwung+68boBQDYopdYa0fjVkPs072GlbIHzWSH1KY BPeZ8xNP8asrn4LdGNSMx4tPyz0OnY4NSTrBAhkwyy4B2bE6ZbE8OxfIFnfVuNtT4rJv oQk4/gdMJgduK7ucAjkjCVWeXUlgaVQ8d5J7eIdvLre3I8IH8hSkh/8TvbKvtX1ll6Ov laq6e/28Ck4h8NA7trNVcZu6k30rfZJL7bf4vC66xoSEboRttn47/JOB6amEEXnYVFrE VPjQ== X-Gm-Message-State: AC+VfDzrdfBnaazp3/5sZIexhEAgRGgSOkf6iC/Yc2p5oJbx3Si1YkX/ iYez+l5YQS4Ih4kB0/3JSk+NSA== X-Received: by 2002:a5d:6ace:0:b0:306:3945:65e9 with SMTP id u14-20020a5d6ace000000b00306394565e9mr13786975wrw.3.1684935596080; Wed, 24 May 2023 06:39:56 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y10-20020adff6ca000000b002f103ca90cdsm14555961wrp.101.2023.05.24.06.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 06:39:55 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7F1751FFC0; Wed, 24 May 2023 14:39:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kyle Evans , libvir-list@redhat.com, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Greg Kurz , Eric Blake , Markus Armbruster , Warner Losh , Marcel Apfelbaum , Eduardo Habkost , Michael Roth , Richard Henderson , Christian Schoenebeck , Riku Voipio , Paolo Bonzini , Yanan Wang , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v5 05/10] qapi: make the vcpu parameters deprecated for 8.1 Date: Wed, 24 May 2023 14:39:47 +0100 Message-Id: <20230524133952.3971948-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524133952.3971948-1-alex.bennee@linaro.org> References: <20230524133952.3971948-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org I don't think I can remove the parameters directly but certainly mark them as deprecated. Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230523125000.3674739-6-alex.bennee@linaro.org> --- v5 - reword match description - fix reference to return for set operation --- docs/about/deprecated.rst | 9 +++++++++ qapi/trace.json | 40 +++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index e934e0a13a..e44cde057f 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -254,6 +254,15 @@ it. Since all recent x86 hardware from the past >10 years is capable of the QEMU API (QAPI) events ---------------------- +``vcpu`` trace events (since 8.1) +''''''''''''''''''''''''''''''''' + +The ability to instrument QEMU helper functions with vcpu aware trace +points was removed in 7.0. However the QAPI still exposed the vcpu +parameter. This argument has now been deprecated and the remaining +used trace points converted to plain trace points selected just by +name. + ``MEM_UNPLUG_ERROR`` (since 6.2) '''''''''''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/qapi/trace.json b/qapi/trace.json index 6bf0af0946..e561f3d3da 100644 --- a/qapi/trace.json +++ b/qapi/trace.json @@ -37,13 +37,14 @@ # # @vcpu: Whether this is a per-vCPU event (since 2.7). # -# An event is per-vCPU if it has the "vcpu" property in the -# "trace-events" files. +# Features: +# @deprecated: Member @vcpu is deprecated, and always false. # # Since: 2.2 ## { 'struct': 'TraceEventInfo', - 'data': {'name': 'str', 'state': 'TraceEventState', 'vcpu': 'bool'} } + 'data': {'name': 'str', 'state': 'TraceEventState', + 'vcpu': { 'type': 'bool', 'features': ['deprecated'] } } } ## # @trace-event-get-state: @@ -52,19 +53,15 @@ # # @name: Event name pattern (case-sensitive glob). # -# @vcpu: The vCPU to query (any by default; since 2.7). +# @vcpu: The vCPU to query (since 2.7). # -# Returns: a list of @TraceEventInfo for the matching events -# -# An event is returned if: +# Features: +# @deprecated: Member @vcpu is deprecated, and always false. # -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. +# Returns: a list of @TraceEventInfo for the matching events # -# 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 "vcpu" property, an error is returned. +# An event is returned if its name matches the @name pattern +# (There are no longer any per-vCPU events). # # Since: 2.2 # @@ -75,7 +72,8 @@ # <- { "return": [ { "name": "qemu_memalign", "state": "disabled", "vcpu": false } ] } ## { 'command': 'trace-event-get-state', - 'data': {'name': 'str', '*vcpu': 'int'}, + 'data': {'name': 'str', + '*vcpu': {'type': 'int', 'features': ['deprecated'] } }, 'returns': ['TraceEventInfo'] } ## @@ -91,15 +89,11 @@ # # @vcpu: The vCPU to act upon (all by default; since 2.7). # -# An event's state is modified if: -# -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. +# Features: +# @deprecated: Member @vcpu is deprecated, and always false. # -# Therefore, if @vcpu is given, the operation will only match per-vCPU -# events, 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. +# An event is enabled if its name matches the @name pattern +# (There are no longer any per-vCPU events). # # Since: 2.2 # @@ -111,4 +105,4 @@ ## { 'command': 'trace-event-set-state', 'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool', - '*vcpu': 'int'} } + '*vcpu': {'type': 'int', 'features': ['deprecated'] } } } From patchwork Wed May 24 13:39:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685351 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp257531wrt; Wed, 24 May 2023 06:41:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70wPqFs5wQLe35C/p1E9RbWf/k/giBXSJvos9b7pNSOcbcRISkVwZ5dFW7I3XFPGHZdtNa X-Received: by 2002:a37:88b:0:b0:75b:23a1:44c with SMTP id 133-20020a37088b000000b0075b23a1044cmr6775662qki.18.1684935681564; Wed, 24 May 2023 06:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684935681; cv=none; d=google.com; s=arc-20160816; b=t3S30yHHWwRzsGQk+g7duEdviSUyoyikpZCrA9usypSSiITf0NERTSVWX2X0T74gNQ 9PzTJHm2HfsBCc9zOB9lWb8or1Fdtmx2ek2HkxAN9lcj9FEwLYO8mePrnCwyt3i0htNm kpH0MPOqGXnrI6diiwI+vhc5QRomLQP5HVEP6RdA1qbcv8iIwZUDFLwuAObXPw0GQuev glsozlNp6FRX+DEfLfCbMSZpNTHwPSnaqsVOaLT8WNVqE4TkDMjzd1rbj668fWKPvRvI OLz3L12b3OyDUG8s9E9d8F1oieWRCT3PD7mXa8SEWS6buy0LZOQ8K++CYHbzK1ToemqT oxzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YsEdqGbxU2y6FlYfEnNxap+gqqDYEIfE5No7MGGYe64=; b=eOnvR9Pp2gQ2YAoOWPSrR91pcVwVMIgj7ydkA4RwK69l5yflIb9uwmT0tWBiIDEHT4 uOAbphqClAYE2xxVHWlHHVQjOPt5glbm6AyaSr12Ln3ZB57DEMcml1/HIpD0+Gk3kRRE aac828aIIi2itc2HmpVUGB/LYkNr6K68C5UBab42s9xoUgH50J1we0Krf7E36/EYcfVH fZ88E/qpY1fxaGGwL1UUT9fB4Wy44EU/uzPXq0wIIFtpL5+3X2N4wpp6B7U1jGVHa/YP CqBhf/nAAHdhtdoH1o//H2dHgHjE1EKUGvMHRrj+Ulk69VV2zKCZKq3o8kAArz1lXeZg A5rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pR3ZMLwc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j5-20020a37c245000000b0074df9f1f2aasi6302177qkm.690.2023.05.24.06.41.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 06:41:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pR3ZMLwc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1oil-0008Qy-4Q; Wed, 24 May 2023 09:40:07 -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 1q1oie-0008DJ-Iu for qemu-devel@nongnu.org; Wed, 24 May 2023 09:40:01 -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 1q1oib-0003mD-TK for qemu-devel@nongnu.org; Wed, 24 May 2023 09:40:00 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-30aa1eb95a0so834598f8f.1 for ; Wed, 24 May 2023 06:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684935596; x=1687527596; 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=YsEdqGbxU2y6FlYfEnNxap+gqqDYEIfE5No7MGGYe64=; b=pR3ZMLwc9lG7RmWQe2PcalUtPoapOU3kGnJVEX+z2YOLLT7D4o786DcQ9UAGc9/vlG z+qcFSe+8oCii2PvR9s9SkBR6KRZfsAq+9sZQrCeASft8BPkDPnQn/DZ/85HSNIFC6jM yOzFESLA9CX4/XpXqlZz4eTM4vzeZDr6iv55Z1NIZlIE4EiIHHm/IH+fI2DoaLz1U2F7 07ybchdXOFyNoZ2/36cYSWQbbZwNyPa07mGyrx+NMKR18XTdIFuK24r9Zpgre+YgZvXQ TetVFITdcqAv7RmfdXb3hWOZnn0iJ2df/ydG8ltbNJZprPr1+vQZVef7qqG4Vornny96 A5pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684935596; x=1687527596; 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=YsEdqGbxU2y6FlYfEnNxap+gqqDYEIfE5No7MGGYe64=; b=RB51wzfnEhNPiqzA4LO/cMXAtNc8ajTJF5Zoi5TjYXIFxadke88eaEWrgz23w/mrd6 PW9kPzmVrjkgbdWVfPLPxkPENg5JBNWym127YToWyC9fz8cCCmo6TqNUOr3L5nHGzXyl mkht7JQujWMNqKHLkZmGEH/a57GLFguAWHTbhucPRl+OAuC2J9MQsN75SVMhySW6BEBy 7PVZdS2UatRtlR4MoXXPZLzoewtBqOWRQFiVu9csWRj3lNehIPmUGsPsl3EA+r9Z3XIn lqroqwkscUwpiWLr7KxrcUspd1YIJf3Ssh2279vn7Casl+ZTwM7yuwZ4ijEnfEB1ovAU 4ifQ== X-Gm-Message-State: AC+VfDxBqOoFoPOvAecGJO2AaSkdxC8p4Kz0KH2s+JaUy3F7XcVP4SDz uzUpSIy1JPG2/wmKqD7BCu/f4g== X-Received: by 2002:a5d:6748:0:b0:30a:9043:8f1d with SMTP id l8-20020a5d6748000000b0030a90438f1dmr7600798wrw.5.1684935596438; Wed, 24 May 2023 06:39:56 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n11-20020a7bcbcb000000b003f427cba193sm2347049wmi.41.2023.05.24.06.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 06:39:55 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CAA891FFC2; Wed, 24 May 2023 14:39:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kyle Evans , libvir-list@redhat.com, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Greg Kurz , Eric Blake , Markus Armbruster , Warner Losh , Marcel Apfelbaum , Eduardo Habkost , Michael Roth , Richard Henderson , Christian Schoenebeck , Riku Voipio , Paolo Bonzini , Yanan Wang , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v5 07/10] trace: remove control-vcpu.h Date: Wed, 24 May 2023 14:39:49 +0100 Message-Id: <20230524133952.3971948-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524133952.3971948-1-alex.bennee@linaro.org> References: <20230524133952.3971948-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Now we no longer have vcpu controlled trace events we can excise the code that allows us to query its status. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230523125000.3674739-8-alex.bennee@linaro.org> --- 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ís Vilanova - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * 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 given - * vCPU. - * - * If the event has the disabled property, the check will have no performance - * 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" 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 @@ def generate(events, backend, group): - if group == "root": - header = "trace/control-vcpu.h" - else: - header = "trace/control.h" + header = "trace/control.h" out('/* This file is autogenerated by tracetool, do not edit. */', '', From patchwork Wed May 24 13:39:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685344 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp257052wrt; Wed, 24 May 2023 06:40:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xImMzzgfpeHtenqR0UvX5pfoZ+DghIkV6LCyb9DmK6AdNg/fGRmHIgA8fKdGzxzLKJaVl X-Received: by 2002:a05:622a:1016:b0:3f5:3887:2229 with SMTP id d22-20020a05622a101600b003f538872229mr24411601qte.46.1684935621195; Wed, 24 May 2023 06:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684935621; cv=none; d=google.com; s=arc-20160816; b=PPwt5xcEeDCdiIdYrNzRzgWx/f0WkMdI5Po/uv6FxhofRX9w2lH7iDR7LJxQ4fMTY8 8OUnbF9ZjT+u7Cc/cWvq5NGz+zHmiEzZHfJh6SIg6JNzIlpcrCTjLOIHiVkNYzDAntJj hmOO/9szvio102YrcBkRBL/3D2xA+kHAPDSdey5eMiPQytp4xAMIGsRrTGK9bWPKhiey 5rdDCCdk10oEySOO0bJ8Sqvh0FlqwW1bQxU0qY4IV4c6v6+tFWbaySuqII7/Zu4zOMMj ZgECfSb1IcO6n9pY2PDpGbhXeNmiTh6SvAchZRBCQJc8kKt3ihf9LGSH+iC0pagwo0Fv Vr9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Vf5vMvJd6QybIQc+W49WDIXYJZVW9ms5IcI7jNXgGwg=; b=CfQHY3sak6qBoFT6JFwWp9lzNMCFlNjnx015+YpOdt4LUVvP5EJoIqTvIaekA3yj/5 neWyx4iWdfrjzzO0ZueK9k6M0/wn1KbOqe0FLP29zeDabAg6Ourdh5Q+Q1WkY96Vj/L1 Qj9JXhp03ilsJcpAeOiLV4qdwJuAXuQyzECNHiG32ULgrWKcCpbXAOqPtKLn/0xwuAsZ wblko6urGXPhSyPDz21n2LdkpzKifL6PJTgsIAeAvyymZNGH0bcgLbKsHzmgsOfl7X03 uLfGISW6f9/m47IsvmebGt3D15p2D/YFqJ+WTGN/ErQMMZDo/T2a6OSpMByXmg1swVN+ OwKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xKRtCPCx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u21-20020a05622a199500b003f5f8d4ac8bsi4881136qtc.268.2023.05.24.06.40.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 06:40:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xKRtCPCx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1oij-0008If-IW; Wed, 24 May 2023 09:40:05 -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 1q1oif-0008E8-9u for qemu-devel@nongnu.org; Wed, 24 May 2023 09:40:02 -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 1q1oic-0003mI-9n for qemu-devel@nongnu.org; Wed, 24 May 2023 09:40:00 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f61530506aso6138515e9.1 for ; Wed, 24 May 2023 06:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684935597; x=1687527597; 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=Vf5vMvJd6QybIQc+W49WDIXYJZVW9ms5IcI7jNXgGwg=; b=xKRtCPCxojjYhoi7r4UkuANBVozrRA85nVFKNDWHjyrpJBX+iG8fplVjlYWPD24h9X HfPbDurDQKKjfVfeu3WbC0uT+jgmQBXMuonvuoCokaT21B2BaVbts/kM79yNkctM5q4c iAIIRzjn3kmGd5w72x54Hxn7sUxhEeYO6oDjjF5lid0PC0vaFLaoXLMfH+JQa9ZRfIa5 F1IQQ+gfaL59af7QS6+wsG1PP/+cnIjWAbjWV0dDaD/1z3b/+WsPHe7ghoDsTnNnzjRw FF8PmeTUtjuCujzOArQbSmry+wl9a1vX0tDfpfBErMwbMhYRS+8ww6eKqWLklzJ4g2gK rtqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684935597; x=1687527597; 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=Vf5vMvJd6QybIQc+W49WDIXYJZVW9ms5IcI7jNXgGwg=; b=fYIiPuwMwmF0WjHbnX5vRQN5/w4VBFrm0cHDOiDMo3ZXrflsB5P1n19XvfjGw+tFfd +38yHWyJvWWwqKoSs7pzYm7dDujw3q1A88SX3J+vePXKDHNEqTGDia+rZPkRBBj4Dl8W EWCq0MWlPhDsGOaAsGoUMEG7BPahYnihn8uq8AC7IVCQADRxIva2X96KJfvTzwrNmrT/ yDnMjnUoR7cqabKRTr1Tss6kttXby1ACS+4UpLQDxfchpUv+jM8QZRMM1dZZ0kH1tgVC Wv9EVmRj0PIri34Jrxlvyv2biGbSHOobdb8SQHuC7//meCELwlRu6slM8mIvWiDH3RsQ Vtmg== X-Gm-Message-State: AC+VfDyt402dzr+7hz7J1pENRo1gGoC/oxK2U6WvS9ZYmxMYomHFXxaK vZLyLRwAe2VtbQ+qNzmUkQJH4Q== X-Received: by 2002:a7b:cb87:0:b0:3f6:41f:8e66 with SMTP id m7-20020a7bcb87000000b003f6041f8e66mr7957183wmi.5.1684935596845; Wed, 24 May 2023 06:39:56 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n11-20020a7bcbcb000000b003f427cba193sm2347053wmi.41.2023.05.24.06.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 06:39:55 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F00D81FFBC; Wed, 24 May 2023 14:39:53 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kyle Evans , libvir-list@redhat.com, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Greg Kurz , Eric Blake , Markus Armbruster , Warner Losh , Marcel Apfelbaum , Eduardo Habkost , Michael Roth , Richard Henderson , Christian Schoenebeck , Riku Voipio , Paolo Bonzini , Yanan Wang , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v5 08/10] tcg: remove the final vestiges of dstate Date: Wed, 24 May 2023 14:39:50 +0100 Message-Id: <20230524133952.3971948-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524133952.3971948-1-alex.bennee@linaro.org> References: <20230524133952.3971948-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Now we no longer have dynamic state affecting things we can remove the additional fields in cpu.h and simplify the TB hash calculation. For the benchmark: hyperfine -w 2 -m 20 \ "./arm-softmmu/qemu-system-arm -cpu cortex-a15 \ -machine type=virt,highmem=off \ -display none -m 2048 \ -serial mon:stdio \ -netdev user,id=unet,hostfwd=tcp::2222-:22 \ -device virtio-net-pci,netdev=unet \ -device virtio-scsi-pci \ -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf \ -device scsi-hd,drive=hd -smp 4 \ -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage \ -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' \ -snapshot" It has a marginal effect on runtime, before: Time (mean ± σ): 26.279 s ± 2.438 s [User: 41.113 s, System: 1.843 s] Range (min … max): 24.420 s … 32.565 s 20 runs after: Time (mean ± σ): 24.440 s ± 2.885 s [User: 34.474 s, System: 2.028 s] Range (min … max): 21.663 s … 29.937 s 20 runs Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1358 Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230523125000.3674739-9-alex.bennee@linaro.org> --- 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(target_ulong pc) #endif /* CONFIG_SOFTMMU */ static inline -uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, uint32_t flags, - 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); } #endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 4d2b151986..3b1b57f6ad 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -545,9 +545,6 @@ struct TranslationBlock { #define CF_CLUSTER_MASK 0xff000000 /* Top 8 bits are cluster ID */ #define CF_CLUSTER_SHIFT 24 - /* 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 39150cf8f8..383456d1b3 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -266,7 +266,6 @@ typedef void (*run_on_cpu_func)(CPUState *cpu, run_on_cpu_data data); struct qemu_work_item; #define CPU_UNSET_NUMA_NODE_ID -1 -#define CPU_TRACE_DSTATE_MAX_EVENTS 32 /** * CPUState: @@ -407,10 +406,6 @@ struct CPUState { /* Use by accel-block: CPU is executing an ioctl() */ QemuLockCnt in_ioctl_lock; - /* 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); #ifdef CONFIG_PLUGIN diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 0e741960da..4a1dce98ff 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; }; 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) == desc->page_addr0 && tb->cs_base == desc->cs_base && tb->flags == desc->flags && - tb->trace_vcpu_dstate == desc->trace_vcpu_dstate && tb_cflags(tb) == desc->cflags) { /* check next page if needed */ tb_page_addr_t tb_phys_page1 = tb_page_addr1(tb); @@ -228,7 +226,6 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, desc.cs_base = cs_base; desc.flags = flags; desc.cflags = cflags; - desc.trace_vcpu_dstate = *cpu->trace_dstate; desc.pc = pc; phys_pc = get_page_addr_code(desc.env, pc); if (phys_pc == -1) { @@ -236,7 +233,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, } desc.page_addr0 = phys_pc; h = 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); } @@ -263,7 +260,6 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, jc->array[hash].pc == pc && tb->cs_base == cs_base && tb->flags == flags && - tb->trace_vcpu_dstate == *cpu->trace_dstate && tb_cflags(tb) == cflags)) { return tb; } @@ -282,7 +278,6 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, tb->pc == pc && tb->cs_base == cs_base && tb->flags == flags && - tb->trace_vcpu_dstate == *cpu->trace_dstate && tb_cflags(tb) == cflags)) { return tb; } diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 991746f80f..bc1961ea55 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 == b->cs_base && a->flags == b->flags && (tb_cflags(a) & ~CF_INVALID) == (tb_cflags(b) & ~CF_INVALID) && - a->trace_vcpu_dstate == b->trace_vcpu_dstate && tb_page_addr0(a) == tb_page_addr0(b) && tb_page_addr1(a) == 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 = tb_page_addr0(tb); h = 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, /* add in the hash table */ h = 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); /* 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 c87648b99e..bf814b9e81 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -65,11 +65,6 @@ #include "internal.h" #include "perf.h" -/* 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; /* @@ -352,7 +347,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu, tb->cs_base = cs_base; tb->flags = flags; tb->cflags = cflags; - tb->trace_vcpu_dstate = *cpu->trace_dstate; tb_set_page_addr0(tb, phys_pc); tb_set_page_addr1(tb, -1); tcg_ctx->gen_tb = tb; From patchwork Wed May 24 13:39:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685352 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp257586wrt; Wed, 24 May 2023 06:41:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7JKxrn5FJEsUoc0QD4/MMGAjUjfrhsaSAj5up3HFZp4LylMTtOF2Hd6KZmDnVvNIm4LxPJ X-Received: by 2002:a05:620a:838d:b0:75b:23a0:e7a2 with SMTP id pb13-20020a05620a838d00b0075b23a0e7a2mr7938494qkn.3.1684935688931; Wed, 24 May 2023 06:41:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684935688; cv=none; d=google.com; s=arc-20160816; b=0gZhMMq0mWFQsml2/QveDuNmMfEw8881XuqZ3/g+BgJ+K3yImvegWQBKMR2HGwBM83 32L8008iSiouSbCmGNt7B1RpqFr0v1a5xdGjDLPNMJeoqvw5PmWJ3fDtMl0aztCZhE1R /dKg795Nqo9SQ8U7lh9Ip0nDsyAl5HksA+sgFrSg/HqhRlaUdzeV8dQpHxsJoBji+qmr 7RyHKsVScB00c5xyPObyMtL2TCgKvldU4xuzZoGRkHKe5YVjnZt2FY8BhxFivluOEHaM zzzo9PjPTbgr8F47E6F/kKNlr/EzUf9QfJpbwuCo1ED+0TyNjLoK+m/vg19OZaQoZ1vJ Ypfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qglgXO3384mpR0z3xJrO+Vr6cI8uX9097a2UR+OWg40=; b=V3cDFzTGd5Jz/XHPru+01zax97P65k4Iz0dPX+RPk5q5U+61TcaV6Btsl4GWH4AH6c WDB13tRkGTt6B49qLKjGoKQn+ZuDeP0ntTWrQwBJAwFRMn5m5cci9Oy4iAUCpJBvjv1U IxIKO2ZQ/xoD+IkSA/3GcWZmBYVrbFWXK6IxkS9O8Ilp60/HuYDXeSYH3smU41teMHNr JSdKnpiY7249kYAStHJM2xL+XBpYFhpHLnrOvK2GusjObMqK/cIBPr4TxM9nI+61yLBX YCbG93/gUmfjudYT3WBt7rT1yzbP65WFt5jpJG2jZgdI44hoeBDmGaRcBjW3kAVwxyh3 lOgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EFaTwHJq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w10-20020ae9e50a000000b0074cc66fe556si6001637qkf.725.2023.05.24.06.41.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 May 2023 06:41:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EFaTwHJq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1oik-0008NF-CK; Wed, 24 May 2023 09:40:06 -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 1q1oie-0008DB-ER for qemu-devel@nongnu.org; Wed, 24 May 2023 09:40:01 -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 1q1oib-0003m9-Sr for qemu-devel@nongnu.org; Wed, 24 May 2023 09:40:00 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3093a778089so578412f8f.1 for ; Wed, 24 May 2023 06:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684935596; x=1687527596; 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=qglgXO3384mpR0z3xJrO+Vr6cI8uX9097a2UR+OWg40=; b=EFaTwHJqn3YDbgs4WaTj7W02Z+GWi0caGdP4kAyhuhIdrc0Q6NbgdI4xvlASC3ah1Q 9kh1Q8BuST9pA2um+QIMSzPDePf5fQe9/q3lSNZVLH3mCEXbW6h5IEeEMzta7erF9h7h QU68nMwkg+Vvex9HOZVz1x+i8Xj6shSzWcJFEktxf56oybSpjpLtDdywlXZ5XE4KO8Bl DaodG/AONh6MhDngY2s8zE910t5bSUK8u8AnC/A8m+Fm1LX9qgzQnvmseuKgKiZFUwSu PFRbjRmNHXxpOAZ6lOF8Wv04jFwYhtKnZ5WpTUgNJqRJo0ulYuOZHPnij2E7bRxGXMCe dUtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684935596; x=1687527596; 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=qglgXO3384mpR0z3xJrO+Vr6cI8uX9097a2UR+OWg40=; b=UFbNMvzJTrKr1gGxALLSbu4Ax4OBfQIjNgoASS0QOwknwU1dQ/XO2ooRBu5bz/OimW DWa21GHsBVh2y0c1+xUTDzfJ6bMoWLWpVn0wHaoijdNwTOPQMgEHeI2zyf9sJ+IkyKkJ ClEG9I61fJ8+Zln/dlO/W9qlZtbizq6OrJGbWriQaIQYq9ZldmE289+uDGiznyUWJZJr mY3y+LaD4PU/h9z/gkc+m+aFvCMjB+lHMjMoNyntAM+Fi+lq6P3+zEi5fzor7/8Bl5Er Mhebs+LQVTsJfCNNqkN9drlkbcBcrshNMFDXWrweTC8EvhoGOnpFMZs95CV6Oz7Ym0Ky ipJw== X-Gm-Message-State: AC+VfDx7wmS8EPGTlTyEDE1ZtyLdKIASks/p7XhUT/FM3Jd/pGg4RlnW BWYFSUxETbLX4s0UyqZ8/NmI9w== X-Received: by 2002:a5d:4ace:0:b0:2f5:3fa1:6226 with SMTP id y14-20020a5d4ace000000b002f53fa16226mr13167144wrs.14.1684935596268; Wed, 24 May 2023 06:39:56 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c12-20020adfe70c000000b003078cd719ffsm14520773wrm.95.2023.05.24.06.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 06:39:55 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 125611FFC3; Wed, 24 May 2023 14:39:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kyle Evans , libvir-list@redhat.com, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Greg Kurz , Eric Blake , Markus Armbruster , Warner Losh , Marcel Apfelbaum , Eduardo Habkost , Michael Roth , Richard Henderson , Christian Schoenebeck , Riku Voipio , Paolo Bonzini , Yanan Wang , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v5 09/10] hw/9pfs: use qemu_xxhash4 Date: Wed, 24 May 2023 14:39:51 +0100 Message-Id: <20230524133952.3971948-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230524133952.3971948-1-alex.bennee@linaro.org> References: <20230524133952.3971948-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org No need to pass zeros as we have helpers that do that for us. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Christian Schoenebeck Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230523125000.3674739-10-alex.bennee@linaro.org> --- hw/9pfs/9p.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 9621ec1341..991645adca 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -738,15 +738,14 @@ static VariLenAffix affixForIndex(uint64_t index) return invertAffix(&prefix); /* convert prefix to suffix */ } -/* 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); } static uint32_t qpf_hash(QpfEntry e) { - return qemu_xxhash7(e.ino, e.dev, 0, 0, 0); + return qemu_xxhash4(e.ino, e.dev); } static bool qpd_cmp_func(const void *obj, const void *userp)