From patchwork Wed May 3 09:17: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: 678831 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp948219wrs; Wed, 3 May 2023 02:18:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5qaQtdjgxp3VWPwveTsOO3CLXsg9RfpI5cW455Srim7Bf+kSlZN5Dg14MyZ58i4btmEoBC X-Received: by 2002:a05:6214:1949:b0:61b:6c88:4bd3 with SMTP id q9-20020a056214194900b0061b6c884bd3mr5842655qvk.47.1683105537484; Wed, 03 May 2023 02:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105537; cv=none; d=google.com; s=arc-20160816; b=rG/RHOAYth14jD3Kxn8gqOh8gwwtW6TrsKLTy45u8du9kRH0z61uVOX5XJ7dn9d56O QgXvNN+ieQ/Wviz+g7pb82hbSEDTljG/iHXiWT8url6oNyKbfX8M1YelmW495xAjehHI 9kjQawCD2gRgMNQxRgrqBgBlE7xdJfMZi+NQWoNJ5mXr0z04zl26mzDF283k4T9z5L19 4i58h0IyMbF7m1aXhOVnUP1zXk+kncp3f+53OA+Ow7MojRdArvKiZlQhZ2/fcMnbzBuI s5I7FVsF+tOghcZ7NxphflBwjcf4dwEfeiwLV7c1gLKs6BA3bmB5BS/UBTV/VEdwwHI2 0KQA== 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=MoOuAposOVouEiSDB7Zw3sg5pr2E0SeQOaNY822mSO8=; b=ya6s/uPnNE2cTR4zjeisA/GbCS4VkAUgyhCA+oh1Ks+NI81y8bmEW9+Ky0S5g4ZY/X jAq8BvPxCLHmrT/NrygDUZ5QD/ArMiH7+Xewa3rL+/Fza/2rttqxHbKk40Fzxv7DfSDz vhkmDT6UI21Tx9L/nMFrNC4RgWrr0RPpKeifFxwW8hOltyldepTMXo+wVxC0R37gwe+l e0Q2n6DyvmJxssr3NWMVzQsheIpJyBci2CQO3gxemMyvTeWa5zOqVAUiGA8gfW9A0Hdv bU8DPxm+7Z0jK7oOuPg89O0qBwhw8wcX1fMRB9S+ydkDGIcO5UJMqrfi51eOfFt/8cxf mciw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J5CE6X4S; 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 5-20020a0562140cc500b00614cc52b0d5si12764198qvx.534.2023.05.03.02.18.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 02:18:57 -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=J5CE6X4S; 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 1pu8cf-00031P-0Y; Wed, 03 May 2023 05:18: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 1pu8cd-0002r0-Co for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:03 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu8cZ-0000Le-Sc for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:03 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f182d745deso47653245e9.0 for ; Wed, 03 May 2023 02:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683105478; x=1685697478; 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=MoOuAposOVouEiSDB7Zw3sg5pr2E0SeQOaNY822mSO8=; b=J5CE6X4Slx73fHPIGYFRwQH6sp711m9/2KuhJJMew4oMdDODu8woFjVnflBzQpDUev d0KiOktoeDTjSCUSbLnzb5iLixq4aJ0W1n9SrjVxt8QgJDTjkwvfMqFVAfQgD/t8vnAc 94aTMVmVkPStg5e96Ip7dI1urt5nPvdVeXZaivz5m8V6sGheUtlvnuydmjAKSfjlTX3e l5Jl2DEUsGKi/veRgcqEnFRwZgJaBTkuGs+wMSbCO06UAaByMmRINVLzdTotWOPhQeow ZsH4KMAG5cRZLy4zMDiQRPr2KrDSMxB41BlwGqflP3wV/lVcjQqwrObyxwjogsXvXEPj dA2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105478; x=1685697478; 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=MoOuAposOVouEiSDB7Zw3sg5pr2E0SeQOaNY822mSO8=; b=Y75qiqsD1MgltICJoD7ziR1LM/idbug8bWYykoWRBw9c5o+TZyLBXqx7axmut9s1S5 ZdUANXJyLDa4c9J16iKC3v+xX35t4p8Uko6VloxQhnuian9a+1wIMHRVu5GpWt+LYE7h U2j9tGRLsISl7Ayg5D+/T0CirWL600LSOnfzBKSkPxE3Mi/ToBtVNszUhTO6KkmRfImd gY/APCcM3xPP0aYR7R1rUrLTnlad7ntygi3k0iwf0khffhJn6zDXqqqOorQmiSKgYUJm AdRWAPt2uP81uQ0CTmUDGx/KsxLeQUlEkzkwHw/DH+xGv86WO96bf/9yBzSAllQGNHDi 74yQ== X-Gm-Message-State: AC+VfDynM4mwH0CGpxhyLp7H+CZz9hqGit3KZwfa7KyuU9nMdnYjXI6M MzCZQm8qpGIKOP20G/haOMcuWQ== X-Received: by 2002:a7b:c8c4:0:b0:3f1:78d0:fc4e with SMTP id f4-20020a7bc8c4000000b003f178d0fc4emr14792000wml.32.1683105478099; Wed, 03 May 2023 02:17:58 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y6-20020a1c4b06000000b003f17e37ce60sm1231800wma.47.2023.05.03.02.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:17:57 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 17EBE1FFBC; Wed, 3 May 2023 10:17:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Riku Voipio , Yanan Wang , Eduardo Habkost , Greg Kurz , Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Schoenebeck , Richard Henderson , Eric Blake , Michael Roth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 01/10] *-user: remove the guest_user_syscall tracepoints Date: Wed, 3 May 2023 10:17:47 +0100 Message-Id: <20230503091756.1453057-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503091756.1453057-1-alex.bennee@linaro.org> References: <20230503091756.1453057-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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. Message-Id: <20230420150009.1675181-2-alex.bennee@linaro.org> Reviewed-by: Warner Losh Reviewed-by: Stefan Hajnoczi Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- 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 3 09:17:48 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: 678830 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp948218wrs; Wed, 3 May 2023 02:18:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6xUUpyszAaQjjns9CazAiG2xOIGKLoaKXk1TlqpeZ1sWR7jUtbmrvRsBklPX4oZI3Hf9d1 X-Received: by 2002:a05:622a:184:b0:3ee:8baf:29bf with SMTP id s4-20020a05622a018400b003ee8baf29bfmr30560342qtw.42.1683105537220; Wed, 03 May 2023 02:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105537; cv=none; d=google.com; s=arc-20160816; b=u7C80ZIfhA/sTCjNNT41/5i+PIjKfx69Sh9ZnVfDOm7FoJW/vJnzNhLD6+nZTvGreg IGv8SHEpZ+4GxTk3m755XjazDTSvSOFUagr5N8F5IYkR7HLEskMtIQs39YZzcyVtuQ7p OGrmbEqgnibSyHZwC33Rx4gN3pBdBmrhaWaGWoTyqr1gC49F8KHloGQS0DhrylPW4tp+ UZR9oRkkT1t5wj7UfwiZco3Whp0WL7e8Cl+EHv4jQg2pw46kYi49cqeFmOvXV3uvXaTp a2F6rdkwmhxqUW6zA7AIgC90ygVBNWekmielpFAt34UXpWZGQqyo6xn5u06+wenBYHse gDdw== 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=nnbuAda1HDg+mB6KFTRsN6PGn/CEDFiT2f/X2hh0Sns=; b=RsAvS+4TKBWeMKiqLCXTwJvhVj7rol9gD51newQjjzSqKJUpCUwK3YRT3BkiRMHZLX RgC9S34bScHFKyX2BK9lpIGlRKlocfTIvLly+87GbGX9o1WZjqsIXuL+QiB/GMu5nnrh WCH2bTeZe/hjFF4oDgcVHpczEqND5jCnNsQXqyQrxRwIwIIKUL5ug7RO+21g6T9b7N9g yqmSIIecN9vJET3DPLQouCm30i6yGqBVo8J7r9N4dpHuiwEShbKIYCs9QuS0AcvtoTOf /HBLJHHkCT7VONmqbX0ZcgnOQyvv/o8QhKqBsym06HFBDPTYgCzISB8vMY9jZczSYALK 4mxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VUC5w4cj; 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 b21-20020ac87fd5000000b003d4da60a9d5si17522699qtk.214.2023.05.03.02.18.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 02:18:57 -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=VUC5w4cj; 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 1pu8cg-00039w-Dq; Wed, 03 May 2023 05:18: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 1pu8cd-0002pM-7N for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:03 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu8cZ-0000Lg-Nr for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:02 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3f4000ec74aso1128305e9.3 for ; Wed, 03 May 2023 02:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683105478; x=1685697478; 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=nnbuAda1HDg+mB6KFTRsN6PGn/CEDFiT2f/X2hh0Sns=; b=VUC5w4cjKeJc1B27J+YmpdCgXgyEtAMYEQmCbJEk/v8PQn/oBBQc1tDTPFEIq+IySa caKAkBwES3iACXhuEmeDq3jI+bc9JLHtvY/LsyvrhbIw5tnFirv+FTvFR1wXPJTj3n28 CC8uQKzEL7C52GAd4oz7F48kiPKmg5UZKatMBnDRJuoehAe17wI2eFxrFF8dtRADY/ka Isa49DiWESgfSpk3KJZ1AQ29AaMRFfHQmoGnMt1C9gFLYdiGyYNRumorhq9mbK5eKWrl GqOlwhJSv0FwxmjmRzN5kIDlx92yMjfgxeON1pHeGEzTSzlTFxp8Ls8ChmiopV6Camp5 ev7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105478; x=1685697478; 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=nnbuAda1HDg+mB6KFTRsN6PGn/CEDFiT2f/X2hh0Sns=; b=JqOVAgDFR383Y8tx/DOrlOJt3C7NnCwG1isPaoAiDik8QagrkWOt0xwHWtxDOlO52d zHN0zvff1pn99bcbElMesvxJh9QnbpAawOLhELHV8DhkMlJkzhgWJS4BktYRA5vkxPdw zWXEJpVELGi+t5KmgS0gwM6r2+q6vwzo5miXauiTWBr3bPwt+HnusSg0DyTYFXE+nWMA kszog3NlbW/UaSFWs1E8RK59l8yHeEbdsYTB+wr0nsQXpVSKQN8ZAGhx6jZpSmwcDvC9 Ip/sETq28ginAvwvPcryQWfbYQLNm1A3ZWefftkzra5//i3nbJEAhv5Ifl6ID3/8AQhs /Sdg== X-Gm-Message-State: AC+VfDxHyisID2lM9a1YjflHAwK++TX5tV4w+mwEG3YbzUktTYWYiCjE sCanrJ2Y6/AhmTmGtpaeFP9rqw== X-Received: by 2002:a5d:44c4:0:b0:304:4460:11e7 with SMTP id z4-20020a5d44c4000000b00304446011e7mr13920851wrr.51.1683105478286; Wed, 03 May 2023 02:17:58 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id u4-20020a5d5144000000b00304ae802f02sm16415808wrt.66.2023.05.03.02.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:17:57 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 38EC11FFBF; Wed, 3 May 2023 10:17:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Riku Voipio , Yanan Wang , Eduardo Habkost , Greg Kurz , Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Schoenebeck , Richard Henderson , Eric Blake , Michael Roth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 02/10] trace-events: remove the remaining vcpu trace events Date: Wed, 3 May 2023 10:17:48 +0100 Message-Id: <20230503091756.1453057-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503091756.1453057-1-alex.bennee@linaro.org> References: <20230503091756.1453057-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.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 watch point. Message-Id: <20230420150009.1675181-3-alex.bennee@linaro.org> Reviewed-by: Stefan Hajnoczi Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v2 - keep cpu_reset tracepoint --- 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 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; - 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 3 09:17: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: 678827 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp947967wrs; Wed, 3 May 2023 02:18:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7dh8bpt0lh1tmGpDDitsmR0pjc/5XinKIQpzGC/0RVYdKk8zzXVCn9rIuC/B6SAqkDzCXS X-Received: by 2002:a05:6214:2247:b0:613:831f:9a23 with SMTP id c7-20020a056214224700b00613831f9a23mr10916318qvc.44.1683105495821; Wed, 03 May 2023 02:18:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105495; cv=none; d=google.com; s=arc-20160816; b=pZCNFxGdZngQJlEP9g5P613F0vDltlgqSazow1KXPy3SqR/xIDbK+UxNHChbNaVB/P Vp1oUgAhog4vHgnX9O/o12AdLlePNp4XMvWn/zZjyCMj5yagvOzWzZBVML5e/vPeqA0q Av+smHB+stlQ+Qq2Zad3Lg6LYPw5x9c9SNAWBe6wmESkgm6GLXZ1fsjFibUC03/wzYcz jnwJX6/qTyX3fkRc+SuxX1yNs1gG/6b73Hvy3SldXYlaiDrMWK4A2MG9iZq1Cji/TNvI 2RAHkhBmxbuBsphxvChQV6xiRquMb5uqxsVxj+DHqdhWBXAzEX4JEMPETwvrRKlTSlAr QtgA== 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=v/HuE8TvNTmsubCnSEhnzE79hC0IxWns0KAnAFa0T8o=; b=bBsoeORUns3Xh6qahucSuSPzd1oPIrNLl44tWZqrzVGLnp/zCJ+/cy2ip4aGuIywyH XJtm48o23BsvpNNIKKbuwIggVo7r6GHgTTR+A+6i5qhoyBRW+400RviKO+0Ic4AtDymN hMcCeRwFkKAfxjxfKS/2U0p28TvOH68SSJUw0cr2KLMnsV2FyiWJ91ZodQWuNjaTi00W 8024N4EW9OZ4Fwb5QA0TlTB4rhd9SE/u+NB3/J71eFmKs8yhNhIylAjT0924xeatoorh Fw6VilQHC5uKnBUMR2i+Qlo44ipy7zN8eO81JrFZnveFxobk+8IPSr2tdwFyFj08rqXy nb1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TbgIynk5; 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 i8-20020ad45c68000000b0061b6fd023cbsi801464qvh.574.2023.05.03.02.18.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 02:18: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=TbgIynk5; 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 1pu8cg-0003De-Vw; Wed, 03 May 2023 05:18: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 1pu8cd-0002qm-C8 for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:03 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu8ca-0000Lm-S5 for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:03 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f19a80a330so30534255e9.2 for ; Wed, 03 May 2023 02:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683105479; x=1685697479; 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=v/HuE8TvNTmsubCnSEhnzE79hC0IxWns0KAnAFa0T8o=; b=TbgIynk5A0rOnqyPo/BBrxvj4nyhLW774LA7Y7Z1NO8e5hOetfa2y2zuAoq46oKznO jBdBfEA4c3ut5QoDw6o7vJZ/vnUxe49z0OoGZHUtbqkya3yz7bPslzP3JktyQ9mc9QQf VyyiKUljDfTslzWvl0xG+VWB4sTmN4qxz+1InAqQy5xah55/LJI8H2fV643n4zKrJpCO 1s6QK+5AhX9c0LmlsQaNUZYMedipjBIfPYsCVLa6WU8M0Bco8VEPlcFXRaU574cl/lKQ wdor8ha6Hkm2mghMK7jDtpsHPvfdVxP10JsTvCI8Gvac9mOjyj/oH7gE7vWvI68i11lJ kUHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105479; x=1685697479; 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=v/HuE8TvNTmsubCnSEhnzE79hC0IxWns0KAnAFa0T8o=; b=QKTnZIPVbsk24J9V1gkSau8qXutqrMX1Bl4zL25UHvTlRPW6sPSCuaRLzcNXJUSjys l3rspa4IOndk6D3rP72NnbwV+N2I3SziaEzWFil4PbXPOGROjZJIIkyKwodkswsukXNZ rQHmDaS/c0mmnzaqvBrPMipXI0l11Pz2nx/E4wC+NK2LUBlgHGL482f39RvjvqZtew9c FjDT6wtAT+q3kaK9Y8nr681DCCxB7hyxrXggrxVRUH1FvbCCJgrnRJ7OsZbqJ3lFvSDo p3OOE1pi4sHLdEnneOceHbKfde2gnAAy371G+qwktQZQhk5fPIywIb3dULtj9OL+BUJ8 STQw== X-Gm-Message-State: AC+VfDzYGSxkHMe3xIHEHV5vlvtdIgu2bfyfJ+wd8kAJXyJMLRjnXTvm oFoQKRMDe8GNCET5O09FWVzsBw== X-Received: by 2002:a05:600c:2318:b0:3f1:72ec:400d with SMTP id 24-20020a05600c231800b003f172ec400dmr13534176wmo.33.1683105479081; Wed, 03 May 2023 02:17:59 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d19-20020a1c7313000000b003f17b91c3adsm1279404wmb.28.2023.05.03.02.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:17:57 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5A0991FFC0; Wed, 3 May 2023 10:17:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Riku Voipio , Yanan Wang , Eduardo Habkost , Greg Kurz , Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Schoenebeck , Richard Henderson , Eric Blake , Michael Roth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 03/10] trace: remove vcpu_id from the TraceEvent structure Date: Wed, 3 May 2023 10:17:49 +0100 Message-Id: <20230503091756.1453057-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503091756.1453057-1-alex.bennee@linaro.org> References: <20230503091756.1453057-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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. Message-Id: <20230420150009.1675181-4-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- 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 3 09:17: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: 678832 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp948254wrs; Wed, 3 May 2023 02:19:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4F0inEtIPFHgZJt28XOE36Nm8WGKUNwHW6rUUiwr3tPYw7eG1Ad7UJ2SZu7md3jydIDt5d X-Received: by 2002:a05:6214:c4c:b0:5ef:83cf:91c2 with SMTP id r12-20020a0562140c4c00b005ef83cf91c2mr10676471qvj.45.1683105544615; Wed, 03 May 2023 02:19:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105544; cv=none; d=google.com; s=arc-20160816; b=BTf75OCd25AkaUotl/vUSg8gOWkyLnB/zcnxd0VLHUeEfaEyPv8L5xeM22Bm6NKwsN U1kSwXlF2jqcegQrXnIcYfhq3Ji25p61fVv/gph/7Jms0+webHqcX4OHCJrQd5aW7360 sJtpL7CXwSYIa8MqnZGhsEfJCd+HONu41+hVQG1Dz0Ex7WbN81yfAK8XO+lTQK7/WGJR Zg3l/cejmQCoZU/vgNw+tZUbDPAsnUtaZ9NPYdS1Qm/Z64v3Kj9C7wTWLoQ7UnoRkRRf Jc8YZC4KtQFHlwv7XHn/ws5NB37GOzN4g+h5008aKr1Y8RpBMvkb2t6w25reXDDB6Zpw L1EA== 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=Z+2ARsKrUE4IDGgBP183cB95dxoDFN2S1gyD75E2rZs=; b=InjqMkGWGHZm4QXfU3oj6uA9yOmXMZbGp43hQU1qpqK+eN7DutaUVxgtqZz5+kMTIZ 77pyMqNDn7HNWS+5NXZ6r3DmU4wyFIR6JYiqxmk4q665EptG+LBmiE49li/HbVVo3Lez JoNXRKnwR23WyMsOhaPuhR3JK3AkLy3vOYfUnufBu9ww0HehM5lHYqNan+0nqHgEQ9WZ 73/voasE+6C8qhSlsqczVGcNUZT0w044Mj5RGfJpD26tBqgOAycOrNWin2T5XVtC4iub Hg4E1UDovghKwkoLqzGhxt0MtMJthk40pLN9ktNmb4BRoNIqGju8nX2cDc5c6mIDMm89 8NyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jhj03op2; 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 ow39-20020a05620a822700b0075137bfbeacsi6708039qkn.219.2023.05.03.02.19.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 02:19: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=jhj03op2; 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 1pu8ce-0002y2-Ai; Wed, 03 May 2023 05:18:04 -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 1pu8cd-0002o3-2m for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:03 -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 1pu8ca-0000Lq-RL for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:02 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3063afa2372so1369071f8f.0 for ; Wed, 03 May 2023 02:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683105479; x=1685697479; 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=Z+2ARsKrUE4IDGgBP183cB95dxoDFN2S1gyD75E2rZs=; b=jhj03op2h/snNh+exJmyTrSNN4Npp7WpHimKm9BFMp3XNtK6tMD9gpceZt4RDFnEAm NbWnzFZtVeL1cbyGGsZoK6ZDyNXNQsjV9EdCYfUXepMdz7yEmI2IlzIyMiJ9dzYyf/LT DBFo4yNfmQ+o3kl8zOF3jXPt6bzVtEnlI31yAgyyfyd6UIaTme1Zp9fYZLfdAgLJS88v cytUh+9gq3yJJblyiqd9vdX34vIo8qWGCWdwhPBnY9EtTVeiPwHIscFAKjJpq19BDCUX 6RijgNXUGfu4NO0Kzf+DsOcblISL5Ujg734MOBpUcChI7SqIOEm4knVgNmHyDPkGUset ylhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105479; x=1685697479; 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=Z+2ARsKrUE4IDGgBP183cB95dxoDFN2S1gyD75E2rZs=; b=AEFhcm1ljk1JHjD+9Sb7aJjnvdHZbO4wdcGONFfj+ltsRFhIRpqnIsC7WOg3fOPwjb mdUNOMTkNLauAXf+SuVjr/XQ8c8VjxShd80YwmC7EqB2w1L2cHDFhmALRxX5gpsX98lR EihrbC3Vfes2MqsDLbPxgxv5AM/ti8gH0HLtJj0UElCtM643daVU8W/o5GDG1bNPc1cQ GKvqh2vq1deM1jhKE4PpasQNzJrFTmx6KVVx99vmG/liCLFy7XRCoLig1Las65y9tX72 wEpa1jy1MH7SdLa8PpC1AhqzCDw/0QR/sAn7jGFIdcikd/5SWewobRKEFbVseH4YVlS2 o+QA== X-Gm-Message-State: AC+VfDxyLBfY7BVQwnLTr7QcEbmRbXTjVVvwkDHzO9nkQm8e/f0wLEv7 p2DL4XjZUPyF8QugTlqQl5zWcw== X-Received: by 2002:a5d:6a83:0:b0:2f3:e981:f183 with SMTP id s3-20020a5d6a83000000b002f3e981f183mr15789311wru.10.1683105479379; Wed, 03 May 2023 02:17:59 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id r3-20020adfda43000000b003047ae72b14sm24929980wrl.82.2023.05.03.02.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:17:58 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 70C1D1FFC1; Wed, 3 May 2023 10:17:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Riku Voipio , Yanan Wang , Eduardo Habkost , Greg Kurz , Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Schoenebeck , Richard Henderson , Eric Blake , Michael Roth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 04/10] scripts/qapi: document the tool that generated the file Date: Wed, 3 May 2023 10:17:50 +0100 Message-Id: <20230503091756.1453057-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503091756.1453057-1-alex.bennee@linaro.org> References: <20230503091756.1453057-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 This makes it a little easier for developers to find where things where being generated. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- 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 8f8f784f4a..e724507e1a 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -162,7 +162,7 @@ def __init__(self, fname: str, blurb: str, pydoc: str): def _top(self) -> str: return mcgen(''' -/* AUTOMATICALLY GENERATED, DO NOT MODIFY */ +/* AUTOMATICALLY GENERATED by QAPIGenC, DO NOT MODIFY */ /* %(blurb)s @@ -195,7 +195,7 @@ 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 QAPIGenTrace, DO NOT MODIFY\n\n' @contextmanager From patchwork Wed May 3 09:17: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: 678829 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp948181wrs; Wed, 3 May 2023 02:18:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7nI5+kinlLjTHuPFPku+A+XpKdcJGd4+SGdZLEdEIubmCuk1vgibQbEli3vpgP96nIQQxh X-Received: by 2002:ac8:5746:0:b0:3ef:5a4d:a755 with SMTP id 6-20020ac85746000000b003ef5a4da755mr28434857qtx.38.1683105531074; Wed, 03 May 2023 02:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105531; cv=none; d=google.com; s=arc-20160816; b=fhLEJMjnMOCwJ7xpy5hpZWarcLELjnEDWIRdcTy1+YE4qM3DnLyuh/AFrrJhJbHk1h 5wBbR5cBzVOYqbczyEsfrtAYHROcTR1LmmNP9DxpK2Dfocp9/GCKrQu+w8ktIDCLsVw/ /DdwhEXPn3ZnD7IpNYCYA8o/jW/s1vGtBWxMt3pGWi49TKmu2fdOxX47P/gLghp7cYDy 6HApAgaaUlxuuOZCj8BfaGxhIcmvznAspnYqEVy7s/hJSbyhMeDeB6w1A5E/T2rCqKEa 8p+6kUvMafQkQ+8fy86zz+wwBADE4bfiGk0oKdOOlAOK8XaFVvBfWeeZtJthA4yXoXy3 b4gw== 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=HhmcuF0/XnbOqyb1HjLMiE2Zylh3hHKPmhLHcsVGruI=; b=RLKpJRk/IHZa6a8ZvxlGfuAsplbrkG6az1UzVi/NkJL2XKtuBV5V+QcYN6HmGROzN5 YkRKiRujOicxA/0FyUJ/uRQbKqwqOCAmbuNAh/GswWEy40Y+h1QI+rydVS+ZXEBKwoZL jPY7KEtl5TdZAVsonpBR/v/l7A7GGMQfPK7tlq11hbMQBeZsHHHIKrR1vUDb0g0msXd9 zKVcXNeLcw8UUQTrm5V5dD8xFqkbsFqPfrqIaP6GSevgDMUXZR07s6sH2efbyU0hX4oc BaOw17hh+j1tIVn2Mk3UpInjKzIt3mmtGfTxrAQ5MGc3rJ625YFQ0s+lHuK9mqJDdL75 rDgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qLEp+nG1; 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 s4-20020a372c04000000b007495615363csi17616808qkh.466.2023.05.03.02.18.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 02:18:51 -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=qLEp+nG1; 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 1pu8ch-0003Jo-QD; Wed, 03 May 2023 05:18: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 1pu8ce-0002wt-4H for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:04 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu8cb-0000Lt-Lt for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:03 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-2f58125b957so4864440f8f.3 for ; Wed, 03 May 2023 02:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683105480; x=1685697480; 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=HhmcuF0/XnbOqyb1HjLMiE2Zylh3hHKPmhLHcsVGruI=; b=qLEp+nG1f3adaolUGZ6GSck6bsB3/e8KafzOWa7UzMgPRSBsU6B0jg8Pobyoy0X4ky EbnW/W59JcXvrVmBDDRs/JzGlBAYmnA+sPaMUOaNIVQlAiv886VoxDg8s5GcUF4X6ol8 70hSXHVoQR1HbyxDL0Opm/GePhPXsTLBgbCmpelh3vizn7a2lkHjAczFMhhhxUeG4JSU VlfNP+cw3ikIKl0DlzaXSRg2hx51Kg3R+DQ8QYZ2JOnV5BS/QlBqqXD3TNQO/gNr9Ijh MAc0xDUrR6kqrJode+ZFj6j3LfDeFgvzjO+q/KgiQl6BccVKHEG5e//WCSKmrRlTRg4U D36Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105480; x=1685697480; 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=HhmcuF0/XnbOqyb1HjLMiE2Zylh3hHKPmhLHcsVGruI=; b=RrSsECf20xW4JVHHqQkpxWiB1bKK+CJ675o2+vAtXEz+al9a54UE9bv5KEW3fj75xa p8K9HAU+ZvrefcILp7VTlF/X903++U+OjOjI3TzuZVCqPmPgxc25Zm/qLQb6SvPBWWCQ j5dp0VcZUOOPRaFfIjRCTLbWEUC2obJLi5A5YAjTmPPmi75M5un3Efn33H27tZvpqo49 gtodJWcY9KvpuAEwwJ+LW2AdaZYN+zdJQpDiyScyNWlphHmU+nZRNgD52EQb25YkCLnC dd9BOv1qog8urzDhjJ7TRaThHTqoC7iRUkmyt/SYMpX40ZlZxB9VGXJZ1GkY4byuympf cSnQ== X-Gm-Message-State: AC+VfDwCJoX9QPfNeZf5O2r+OZ8rjgg86Da3pFaO3bnRPVYeLoBZmVWH ADCwNMQw1RXEPdMFry/qwl+WVQ== X-Received: by 2002:adf:cc85:0:b0:306:34ae:6a16 with SMTP id p5-20020adfcc85000000b0030634ae6a16mr4304809wrj.35.1683105480039; Wed, 03 May 2023 02:18:00 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t15-20020adfe10f000000b00304832cd960sm23319951wrz.10.2023.05.03.02.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:17:59 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 88B951FFC2; Wed, 3 May 2023 10:17:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Riku Voipio , Yanan Wang , Eduardo Habkost , Greg Kurz , Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Schoenebeck , Richard Henderson , Eric Blake , Michael Roth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 05/10] qapi: make the vcpu parameters deprecated for 8.1 Date: Wed, 3 May 2023 10:17:51 +0100 Message-Id: <20230503091756.1453057-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503091756.1453057-1-alex.bennee@linaro.org> References: <20230503091756.1453057-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.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. Message-Id: <20230420150009.1675181-6-alex.bennee@linaro.org> Reviewed-by: Stefan Hajnoczi Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- qapi/trace.json | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/qapi/trace.json b/qapi/trace.json index f425d10764..de6b1681aa 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-events" # 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 "vcpu" property, -# an error is returned. +# There are no longer any per-vCPU events # # Since: 2.2 # @@ -84,17 +80,13 @@ # @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 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. +# There are no longer and per-vCPU events so specifying it will never match. # # Since: 2.2 # From patchwork Wed May 3 09:17:52 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: 678828 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp948041wrs; Wed, 3 May 2023 02:18:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5a5ENcNt/PehFotSnJ1v/j5vOHFd3KNkWMt9U4O5+08iM4nlblxa4EzkT7U404j5LGhzjP X-Received: by 2002:a05:6214:4113:b0:5ef:5894:f814 with SMTP id kc19-20020a056214411300b005ef5894f814mr7665770qvb.33.1683105510315; Wed, 03 May 2023 02:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105510; cv=none; d=google.com; s=arc-20160816; b=EL0cT3t691qnR4QZRB9gezpA0zg4n9NYLrF0G3AbeQbcMi5+tOiSPcU6uhr407MCcv 7+dLJXNmSb4Dr0kYRX7uIRgBHkIkToSlbxiWMjduxTuuRes5VrZxE3ey0m6MwR1ruFd5 xVZq2uzPwDBt5KqBn6f7RIFGd0uSwUMxLrF7pWQkQzfs+jnr135sb4eh4xj2izG/BqnP wWW+pQtpgMHPJmJ9of7B+L3fpz8LNP8WB9TiBQ+0/se3J1XKeIDTV2cqexZY+OO9dfHQ k4QnP/5gjRpFH0EV7WU2nYIxqrOTbrxTQc+ewRLIHeYGNHP6DJKQ14YO3QqH7zBvplzU GniQ== 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=ZQsGi60INw/0OukH3jlS0r0tU9G4mIe+6CYIPnGJyEQ=; b=JG34QfAAZMDpzE8qy808iZNFod8AAY0C8zQRuRV8r8EwepVtQmPr3u0cU/yZpMpEZW kDkN9x+kyQLnAulVqlP9prmaforXDWUvBkshBkwqHJoJVt3U3PysktyIpup8M1t+BUT0 qdd3TRkQRel/FEoO5ZC+QWOQX0iFJkXVnUekkuLVq5PvWXM+FlIsHCtdjlPBqjzqfTNQ 60GOhdkaMf5qxFt96vrD8KLMUXjmXvATKquv2xsQ3fm35ZRhBN/9bld3whE9icoL9jYR LDradz82vXUzkXFlaUmdLA2MfSfHZF23W+MHbyva/VTH2pGbPeAgIFsmA3gzdm5IAeql VaGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="xPI/4fQG"; 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 hf14-20020a0562140e8e00b005f604e3cddfsi17923617qvb.418.2023.05.03.02.18.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 02:18:30 -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="xPI/4fQG"; 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 1pu8ck-0003aM-66; Wed, 03 May 2023 05:18:10 -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 1pu8cf-00036s-Jr for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:05 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu8cc-0000M1-5S for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:05 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f3331f928cso30251555e9.2 for ; Wed, 03 May 2023 02:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683105480; x=1685697480; 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=ZQsGi60INw/0OukH3jlS0r0tU9G4mIe+6CYIPnGJyEQ=; b=xPI/4fQG3AzNrcZJoBRYy6vYkXHaogntnLp3nadPG9RBYDUVMTGLfLVOlGgkzA1T+/ wvtnqj1q3nCiJ86f19AcRgqoYDn1dmt7BRTHZhpsr6/tWxrtR/OZbZ1XW2jETSHz7cWj zpB4B0E3iUYMf1L3u+SQfR9MAq6aVl59l6UsyWBN/M/2I980/4IombU7lHW1IOWtvpRR D+F+pGq2fb4A6xTYbKfIGt1X4z7BNvqjHdydTqxtJX+QgkfwVIgFZOX66vAD0stZSTf0 bB4Ia+pFN0/MmUOSH83FTICwuaTCkppeNNCJ1HMiF4DEi3pQ/fLuPxmbfs9X3Jehcetw R1gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105480; x=1685697480; 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=ZQsGi60INw/0OukH3jlS0r0tU9G4mIe+6CYIPnGJyEQ=; b=ZVbekDGIZv9jTnc6Zc/EWt7D37bvHuJBNYAHK8bEQZ2JI9zJdTe2mzaO3GpeIxTbF2 ckLuXsXIyX5ecF/BO+NuDYMgcmGCbIdKyqmil2Wt9DyDaO9//4dHNVJBplLb/9Dt9Dd2 QIgKoHuIGZutLZtp4UP/vV3N3MkROMXSNQrMYK4ZNbGBr/1/4w+aQ4UY4tYpJTTWAj+j 8/Ro8NfwkyBxcrT5Tark3x9eQeXy2R1toHoi08WZ/3mB/Hi85zpZvQAHUJGZZTNO8Y4w aituYyYbhIpLYi+xPnYmlywOQH5+ZNTuaVmcsTNxfQxWGbU76+chDCk/z0UcTXbOx4yj 7SuQ== X-Gm-Message-State: AC+VfDxQhpG42THgneFqZUNQWkjxuKVUbHSM5XNuC6hgLwzMxhybyQU3 8P2EpPy8nyxGvEB8ZuX2G8gzeQ== X-Received: by 2002:a5d:554c:0:b0:2dc:c0da:409 with SMTP id g12-20020a5d554c000000b002dcc0da0409mr14428977wrw.27.1683105480246; Wed, 03 May 2023 02:18:00 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id w12-20020a5d680c000000b0030630120e56sm6591790wru.57.2023.05.03.02.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:17:59 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B4FB11FFC3; Wed, 3 May 2023 10:17:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Riku Voipio , Yanan Wang , Eduardo Habkost , Greg Kurz , Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Schoenebeck , Richard Henderson , Eric Blake , Michael Roth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 06/10] trace: remove code that depends on setting vcpu Date: Wed, 3 May 2023 10:17:52 +0100 Message-Id: <20230503091756.1453057-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503091756.1453057-1-alex.bennee@linaro.org> References: <20230503091756.1453057-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.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 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. Message-Id: <20230420150009.1675181-7-alex.bennee@linaro.org> Reviewed-by: Stefan Hajnoczi Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- 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; } -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 != 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)) -/** - * 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" static inline bool @@ -51,13 +44,4 @@ trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *vcpu, } } -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 = 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); -/** - * 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-specific - * (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); -/** - * 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) == true - * - * Note: Changes for execution-time events with the 'tcg' property will not be - * propagated until the next TB is executed (iff executing in TCG mode). - */ -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); -/** - * 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 951477a7fd..f4e51c8a1b 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -211,7 +211,6 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp) } /* NOTE: latest generic point where the cpu is fully realized */ - trace_init_vcpu(cpu); } static void cpu_common_unrealizefn(DeviceState *dev) @@ -219,7 +218,6 @@ static void cpu_common_unrealizefn(DeviceState *dev) CPUState *cpu = CPU(dev); /* NOTE: latest generic point before the cpu is fully unrealized */ - trace_fini_vcpu(cpu); cpu_exec_unrealizefn(cpu); } 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) 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 != 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 = *ev->dstate; - if (state_pre != state) { - if (state) { - trace_events_enabled_count++; - *ev->dstate = 1; - } else { - trace_events_enabled_count--; - *ev->dstate = 0; - } - } - } -} -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 = trace_event_get_vcpu_id(ev); - state_pre = 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 = *ev->dstate; if (state_pre != state) { if (state) { trace_events_enabled_count++; - set_bit(vcpu_id, vcpu->trace_dstate_delayed); - (*ev->dstate)++; + *ev->dstate = 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 from a - * single set of dstate values to ensure consistency of generated - * tracing code. - */ - async_run_on_cpu(vcpu, trace_event_synchronize_vcpu_state_dynamic, - RUN_ON_CPU_NULL); - } else { - trace_event_synchronize_vcpu_state_dynamic(vcpu, RUN_ON_CPU_NULL); - } - } -} - -static bool adding_first_cpu1(void) -{ - CPUState *cpu; - size_t count = 0; - CPU_FOREACH(cpu) { - count++; - if (count > 1) { - return false; - } - } - return true; -} - -static bool adding_first_cpu(void) -{ - bool res; - cpu_list_lock(); - res = 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 = trace_event_iter_next(&iter)) != 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 == 1); - /* disable early-init state ... */ - *ev->dstate = 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 = 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 } -void trace_fini_vcpu(CPUState *vcpu) -{ - TraceEventIter iter; - TraceEvent *ev; - - trace_event_iter_init_all(&iter); - while ((ev = trace_event_iter_next(&iter)) != 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" -static CPUState *get_cpu(bool has_vcpu, int vcpu, Error **errp) -{ - if (has_vcpu) { - CPUState *cpu = qemu_get_cpu(vcpu); - if (cpu == 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_pattern, +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_unavailable, bool is_pattern return false; } - /* 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 char *name, bool has_vcpu, int64_t vcpu, Error **errp) { - Error *err = NULL; TraceEventInfoList *events = NULL; TraceEventIter iter; TraceEvent *ev; bool is_pattern = trace_event_is_pattern(name); - CPUState *cpu; - - /* Check provided vcpu */ - cpu = get_cpu(has_vcpu, vcpu, &err); - if (err) { - error_propagate(errp, err); - return NULL; - } /* Check events */ - if (!check_events(has_vcpu, true, is_pattern, name, errp)) { + if (!check_events(true, is_pattern, name, errp)) { return NULL; } @@ -93,33 +65,17 @@ TraceEventInfoList *qmp_trace_event_get_state(const char *name, trace_event_iter_init_pattern(&iter, name); while ((ev = trace_event_iter_next(&iter)) != NULL) { TraceEventInfo *value; - bool is_vcpu = trace_event_is_vcpu(ev); - if (has_vcpu && !is_vcpu) { - continue; - } value = g_new(TraceEventInfo, 1); - value->vcpu = is_vcpu; value->name = g_strdup(trace_event_get_name(ev)); if (!trace_event_get_state_static(ev)) { value->state = TRACE_EVENT_STATE_UNAVAILABLE; } else { - if (has_vcpu) { - if (is_vcpu) { - if (trace_event_get_vcpu_state_dynamic(cpu, ev)) { - value->state = TRACE_EVENT_STATE_ENABLED; - } else { - value->state = TRACE_EVENT_STATE_DISABLED; - } - } - /* else: already skipped above */ + if (trace_event_get_state_dynamic(ev)) { + value->state = TRACE_EVENT_STATE_ENABLED; } else { - if (trace_event_get_state_dynamic(ev)) { - value->state = TRACE_EVENT_STATE_ENABLED; - } else { - value->state = TRACE_EVENT_STATE_DISABLED; - } + value->state = 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 = NULL; TraceEventIter iter; TraceEvent *ev; bool is_pattern = trace_event_is_pattern(name); - CPUState *cpu; - - /* Check provided vcpu */ - cpu = get_cpu(has_vcpu, vcpu, &err); - if (err) { - error_propagate(errp, err); - return; - } /* Check events */ - if (!check_events(has_vcpu, has_ignore_unavailable && ignore_unavailable, + 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 = trace_event_iter_next(&iter)) != 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 = qdict_get_str(qdict, "name"); bool new_state = qdict_get_bool(qdict, "option"); - bool has_vcpu = qdict_haskey(qdict, "vcpu"); - int vcpu = qdict_get_try_int(qdict, "vcpu", 0); Error *local_err = NULL; - 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, vcpu, &local_err); + qmp_trace_event_set_state(tp_name, new_state, true, true, false, 0, &local_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 = qdict_get_try_str(qdict, "name"); - bool has_vcpu = qdict_haskey(qdict, "vcpu"); - int vcpu = qdict_get_try_int(qdict, "vcpu", 0); TraceEventInfoList *events; TraceEventInfoList *elem; Error *local_err = NULL; @@ -89,12 +80,8 @@ void hmp_info_trace_events(Monitor *mon, const QDict *qdict) if (name == NULL) { name = "*"; } - if (vcpu < 0) { - monitor_printf(mon, "argument vcpu must be positive"); - return; - } - events = qmp_trace_event_get_state(name, has_vcpu, vcpu, &local_err); + events = qmp_trace_event_get_state(name, false, 0, &local_err); if (local_err) { error_report_err(local_err); return; From patchwork Wed May 3 09:17:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 678836 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp948395wrs; Wed, 3 May 2023 02:19:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/nmjlmP3pZXunSFVfC9y0S6kwqv2ThJ1GFQ5+eA9owiGWHLTmcmd2lkFKI8IE0TEquvZm X-Received: by 2002:a05:6214:f2a:b0:5e0:7ecb:8ffb with SMTP id iw10-20020a0562140f2a00b005e07ecb8ffbmr9590169qvb.8.1683105567865; Wed, 03 May 2023 02:19:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105567; cv=none; d=google.com; s=arc-20160816; b=ZapsTNcXPzz/Nrzc4ULP66wl8DtAQexb3B9nv5qn48R5OeZhomeak3HR6qq0aPGzzu GzvfzF7x/v4tS1sjdNuczE1uL+J5b/cnNeEB3YPnf5M9h57f6PEcuB6W4jnbsksis66r j/ciqJrTZm93mcdEofKuxcYkmmVvss0ve3DudcF2ETpzqKxdvIAmcCsBu36LTnycGKST xCrAqyXJtvbjn+ViuS9KOW+1Lx0ePE0skUx4AOsmowa1ghdu7rdpDgCcQi0sPFQ0erSp wkXmxPQs4Kq+fn9d8bnV7emeKgcR9f3A2bBvdQS/n8np5blh3TUyvx//PQgug/kz6HF5 aibA== 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=R0xmDVAIv0XD4yi7vmosoJPR2UzMLoDsipcZ6y9UWA8=; b=FpG93gVqumkOctR9MFxNG71YrdcdJSJiJJR/0FCgdFx2AdnALq4PSfpCmIYPSGz/fl /VwJo1ONJAduC7u2zSCUJnEKcYzHpikEYngaCCKoTVdUoSL6oOPUaCKieU6MMr6jYjA1 5eSeqAWEHD59qxFQZawKBAyfxP0+HWN3wnqg+wfD6Riy5fbyjrYq23+ETOrlrjrW70Um 8k73Ul+F88/HrAeqtz4zbDUDzGuBlEKF8jFXso56qJTwG4mcSyICcg9ttSR0KTcsKCx0 PpernMn7PsUQyHNSc0hCCJhSs+sIdamWowJAG5X7bKbrdSLUBjOs8u1tShtwTZeGtCoP d5pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KsPt7by+; 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 ge13-20020a05621427cd00b006164c1eab8fsi10841197qvb.266.2023.05.03.02.19.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 02:19:27 -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=KsPt7by+; 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 1pu8cl-0003nH-5m; Wed, 03 May 2023 05:18:11 -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 1pu8cf-00037v-Tq for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:05 -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 1pu8cd-0000Me-8v for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:05 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-30644c18072so202516f8f.2 for ; Wed, 03 May 2023 02:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683105481; x=1685697481; 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=R0xmDVAIv0XD4yi7vmosoJPR2UzMLoDsipcZ6y9UWA8=; b=KsPt7by+E7mfN4KvGnGlKmQjn+sBIvTGZnjVCFkDFPGs7bPHVZVQng2hhEtAAewZ1x iml+RaBoUkWouOs01zTFz/4qidPMmFd1FHk3Lkodo5bwONIivBmT7dciIBoEwRNcYhJW 4r0ea07TjUqZdvliL2G66AVU9wdztPXJyzqRzVpLqKoi7Va3JOdl51HL0uba1AYWRoSZ ERvkwaFnWuJ+zuXBoMs8pqNWdrYVR5xh9jwXKP6jG5cCag0t3Z7J+/x9ihBZLjQoDP64 g13t9WkjGx6IPDXD3gVYuefpnVRGa/FJ0rYlCXoPggxM+ImL5U0QXr5XNOtSD14G4P0W stiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105481; x=1685697481; 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=R0xmDVAIv0XD4yi7vmosoJPR2UzMLoDsipcZ6y9UWA8=; b=ZQhOBFjyJ4swLc7BWWGMWAjz8tCgOS46ovsm/J2zhUba4a8BrDV/J6VNCUmr7Sd7Qq RRtzsOiKDqff4Oz7tUcKWnqP32F2P9sNi0US1L8T2+vXh3MsIv0Q1QOloQ6N2F5VtKWK rjnkCO3JiI9Wcd4UKrCYZvO15w9t1pBRsrJFYcxb/rhTtYCbi3bqc4ZqaCVRnkjNMYJt Yk1rFpAhiAmusqSuSxkOUKC3QAZ7ClcOEFXu+j0Wp1ZItYT82Y57iVDYhNyhg10kc7mI UbuuD3MFonLrUNP+xBM1hsOGs/LnflVtwqPBAmVmHs8jSX3jIpZGlr9ejCJX/TXQ+obq iVUA== X-Gm-Message-State: AC+VfDzMpTeEek2OurCb2YIYjFkBxC23JqVJ3UTHd60T5oPUT/ULCTiP UyLhbmRMkd2iLI22wYgxR0fj7w== X-Received: by 2002:a5d:4d90:0:b0:305:e8db:37df with SMTP id b16-20020a5d4d90000000b00305e8db37dfmr9850355wru.22.1683105481339; Wed, 03 May 2023 02:18:01 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f12-20020a5d4dcc000000b0030630de6fbdsm6384679wru.13.2023.05.03.02.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:17:59 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D051F1FFC4; Wed, 3 May 2023 10:17:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Riku Voipio , Yanan Wang , Eduardo Habkost , Greg Kurz , Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Schoenebeck , Richard Henderson , Eric Blake , Michael Roth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 07/10] trace: remove control-vcpu.h Date: Wed, 3 May 2023 10:17:53 +0100 Message-Id: <20230503091756.1453057-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503091756.1453057-1-alex.bennee@linaro.org> References: <20230503091756.1453057-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 Now we no longer have vcpu controlled trace events we can excise the code that allows us to query its status. Message-Id: <20230420150009.1675181-8-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- 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 3 09:17:54 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: 678833 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp948261wrs; Wed, 3 May 2023 02:19:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5glWYave8wWMxqtd2hdsxW6QMViQI3ihCharHQyxbH0cFy7jKUjC5e7iXAJ3FO51QcDtBK X-Received: by 2002:a05:622a:15c3:b0:3e3:9117:66e8 with SMTP id d3-20020a05622a15c300b003e3911766e8mr32086676qty.35.1683105545181; Wed, 03 May 2023 02:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105545; cv=none; d=google.com; s=arc-20160816; b=Pvi+DEkADj1QsuuXVCSshD2igi5KlUjtf5gsIFQLNgrFmWVzO7x0HxAkSNUGo6YWlc 0vzVIux37SfaId6yXfMSYqq1YqBa/hjxw1Deh2SlvbkQjqqm5gTNru8pLnuBZU8/ciQs IKpZBjdpAwKIHncUXXEX5tw0oxi28PLn4vipn1goubaw5jhubD18pFTXxhdTxD7yI/4n moFg/s8a4nOdsf9yWV/h68QbGvvIwXuCx8eMpt+9vDuzv0tHKY/unXhtUve1PmspMWOf CN4smsejaI4LxOB/vfvCAh3nNuAneQAzuHp6cnzvGPI32IWDEnCUnR1DDW7y00GVExYW pDsg== 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=qJAOJ4EXHACimrdHAT+8NGgN7/duYCO4RM5TtjB7UUU=; b=Gs8HX23kmjHGltgzkp/wd+JYxATXKilbKveSAd1OqTudfmVOq3vCckkSaeJndUb8M6 ZIAU6urjGThI2koZmEBmMih2GfGnkIspFp0GpU+ekebhPnT6RQu1qBhB4ceRkx1kF3jR 60wF3vfalJwrLc5itgnWfPw4cxTflQYQBtNZYWKzykRKm0bcBSHqhi0VIksDeBYINTtR 6Ioot6Q2CSEDqDNFGuZIAKeKdAWFJZzp1FB/6r3po3ore9fcoJCe851tkkTR+jLq8hYQ 3/Nn4/JtWhB6tiu4umJvqMm1A0oOZxGS7pW3bAfs1OG5TSy0SXhzvlKSUK1hVAYZGAy9 BkUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NYAhGaNb; 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 k4-20020a05620a07e400b0074e0ba0853esi17790147qkk.533.2023.05.03.02.19.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 02:19:05 -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=NYAhGaNb; 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 1pu8ci-0003QX-Mq; Wed, 03 May 2023 05:18:08 -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 1pu8cf-00033h-1B for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:05 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu8cc-0000M6-2x for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:04 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f19323259dso48219755e9.3 for ; Wed, 03 May 2023 02:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683105480; x=1685697480; 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=qJAOJ4EXHACimrdHAT+8NGgN7/duYCO4RM5TtjB7UUU=; b=NYAhGaNbj7u6WLMN2Dp9jE+zf3B2g4FN+pn1KwMYHcGTvpeDUnEm3yGZq5zpWbAiAv 5gFpozX4d+gFZBsbfsDBCX6aVUNlYWvMKfB0iQDNvxdnrJj3yY4RFfkYwBxDGLexhr2w IGDd64GKrg6MvZVKLn2j4QM/IP92Frnw4ASKFhwUsNEDjMcPtvSMErqCLIh8aT3iQVTF Y8HH3gFi4u5zmDVh1wsFK1fGYspmxOYqiHxMlR79Mg4VbTLnrs2ouSKNM+Vso8bs2ki6 Wmr+tYxMDMpWsLNfRKTisYlRgVi9ks1BKFicDmuLd/KmgaHCyedtNrwXsJEZFxfg8YHG SqQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105480; x=1685697480; 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=qJAOJ4EXHACimrdHAT+8NGgN7/duYCO4RM5TtjB7UUU=; b=GE/PQHZeigXc9EMp/QRQi0+R9nAmAeszki4YY9lcSPTfXrJDau7g3Nix2r8w9tbCfp kdoXJpUWGx73kLCEPrcBV2GzFp4RY1J4ulhEbqDXI7BmXHhCFdZWV+AbZr0Ue2qTK5Qf SHcqgeTMCFQgJa5/SRxdvNvijiSyPRhXtJc4kVjdvFkX1x/5+32JAaiTZHLnpy8Z+1s/ pYvPCAcFIU8o2XGBI3mm+8em+vtzapuBBFQS1bp/qOT1FxbdeCR62jTcbdzII8upU5vf I3nqNLqg77ve1BAQrlmf9DVW8wH3agwPLwS6kA8BJvtqXUgnT/tryFjRImjIcIiyT6Ov +9Dg== X-Gm-Message-State: AC+VfDy0aU23Uq5hkfONGofBUrEJz1eruaj/rI+9o3prIC8ihKZg9pOU /ut9qnAAdeQM1/x7zzcqcrfMTw== X-Received: by 2002:a5d:5602:0:b0:306:32be:f0f8 with SMTP id l2-20020a5d5602000000b0030632bef0f8mr4992696wrv.20.1683105480522; Wed, 03 May 2023 02:18:00 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id f6-20020a5d6646000000b002f6dafef040sm33171644wrw.12.2023.05.03.02.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:17:59 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 008C11FFBB; Wed, 3 May 2023 10:17:58 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Riku Voipio , Yanan Wang , Eduardo Habkost , Greg Kurz , Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Schoenebeck , Richard Henderson , Eric Blake , Michael Roth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 08/10] tcg: remove the final vestiges of dstate Date: Wed, 3 May 2023 10:17:54 +0100 Message-Id: <20230503091756.1453057-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503091756.1453057-1-alex.bennee@linaro.org> References: <20230503091756.1453057-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.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. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1358 Message-Id: <20230420150009.1675181-9-alex.bennee@linaro.org> Reviewed-by: Stefan Hajnoczi Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- 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 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 - /* 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_cpu_data data); struct qemu_work_item; #define CPU_UNSET_NUMA_NODE_ID -1 -#define CPU_TRACE_DSTATE_MAX_EVENTS 32 /** * CPUState: @@ -403,10 +402,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 bc0e1c3299..973da2a434 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 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 == 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 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" -/* 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; /* Encode VAL as a signed leb128 sequence at P. @@ -348,7 +343,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 3 09:17:55 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: 678835 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp948343wrs; Wed, 3 May 2023 02:19:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6wWclyjbU2Q3pf3GUCaGzmmZdcADpTT1IkPPtdNaEkpICKCj/Q9Y6rRrmNO8mMvVqQgI5n X-Received: by 2002:a05:622a:1d6:b0:3ef:46b0:80e8 with SMTP id t22-20020a05622a01d600b003ef46b080e8mr32831562qtw.19.1683105555791; Wed, 03 May 2023 02:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105555; cv=none; d=google.com; s=arc-20160816; b=y6DJhNnw9aRSEScB9fwH/XpTgd5ygAiJaDQf4WQmYgfGSN/gZ6iX5sNPadqP7M+HgQ Y5Pj3rc/jeE2im9LnuOhd+KCefpfVCM80nHULUrwA/F594RwxiMQY5j5yMrJQ5ZB+X5A 0LssU5xASflg3rREEloeXSUnwXSRZgJMtWqw/zgo4ax1Ny2jd6xTdrgBTTcgzA0MS2L3 nrIjFLQuoJqjhUOdtwWfcxPdoXb+mMiV+ZeUDxtVZfDMNop+n2rypia+a/N/4OrHaDCF U8iLBlBcI7ukarzY90Vl/tGg4emfKZjmrav05qeri5bRUxwup7wPOUj2mNT4Z16q9zhY 0FhA== 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=SIbkDONpT/MgcuDaFYNVS9jJaHe0Is7g3tjeak7dyjM=; b=p7+oBDidPIlPC4s/4ZsTHnNn5vde3DTp+iDJ9ZRR1y/BFV5vYri4aw8OE/Lh+q7YXA 7NQBOf8mo/JhmhezgDDcmhbIDwb5hwEZXVNbQQ55ktSpAgisokZ6kD/EVKtAax0xJt4f 4RjQOaBBGIzsO7bv9Q5bn9pLWKDgHyiHh9jDVWF6cAY8zPfpE3qauYhh5VSz04RIBPXK yvEm2Jujs3B5/YhY28KRZ2b+1k+IvoUNqyKon+meU7kTN91ZzL2diSlT2pXa4eAYSlh+ haizyV2WKJf7rYCMC/neD098T4Gv/QoVc5wlwTLzFLyvmlW767uVZ+zpaVqlbQZkgYl9 HdvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oWZGqr1q; 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 r8-20020ac85c88000000b003ef6c09edcfsi14012192qta.384.2023.05.03.02.19.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 02:19: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=oWZGqr1q; 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 1pu8cj-0003WC-Jy; Wed, 03 May 2023 05:18:09 -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 1pu8cf-00036O-Gt for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:05 -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 1pu8cd-0000Mi-8f for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:05 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-306342d7668so1633000f8f.1 for ; Wed, 03 May 2023 02:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683105481; x=1685697481; 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=SIbkDONpT/MgcuDaFYNVS9jJaHe0Is7g3tjeak7dyjM=; b=oWZGqr1qhY1le/QYRV8tnYVx096uuF1L+dwFN2sbLHc1JoBFG1PyyfhX51xmUGgQ2i r3gW5jPAafMAagG9a6OBzDeQ8+3sKE8XCCG+wIwDcqPfWdhFecRAErJBUbYMYfNgtHxL 1A3auNvHvpkF7ewqegIuWijsYjIpGSuMcKnW6QS5HZkScgGuWnEVxT+hYm/seAT+XosB VXBdkRQQy+ocL5ghGfjMBtPEFNet7nELftQJaVboC7kz+0QuHdVcr9EXpUvS1yymwfjX 9IEUwIlg9uo4rzS2S2P4+zHLbvnJTTiC0ownfqZpLYEQTH1623FTUl2Zwji11yTUiuy8 CP+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105481; x=1685697481; 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=SIbkDONpT/MgcuDaFYNVS9jJaHe0Is7g3tjeak7dyjM=; b=JRLHdgemfoY2u6oFlGPaQNGXmV46e7h/eAtEAaP0A/HOEq4JKIovlHWOP+E2MjHe11 J4FSgVf0u93TbOWhmWWZtjMiKq9WHmQ7cXGS2PoLT+koGg0mGW+WIMZfjSvS3bu8D35j YIBQuUDcMZLuOaXLBkomzDDhKvNHPZSXJLEKXD+StvD82M24OGQ1JtVXhPVPc9JpKMaR PGB0VG/FW/oYOVGojxyLlQf3H8+fM9iWce5tKrBT0vAjUqzxBRDssStG2Rmk0rl6PZIu eCdzeM6ZRsVOXb/uW/y+E8YMIgm+g1TsPZ+KW7SvtRMFZF7iBHtCXcOh+Czc9pSvlOOK dq8Q== X-Gm-Message-State: AC+VfDyONZGOfonbyZbnlZHK/CWh+ZeQcYqnO8EkQFqtUPrSpCXkbt7U UaC1w/CNfYztFLWCEuUEo333kQ== X-Received: by 2002:a5d:4b50:0:b0:2fb:703d:1915 with SMTP id w16-20020a5d4b50000000b002fb703d1915mr14053322wrs.43.1683105481712; Wed, 03 May 2023 02:18:01 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d15-20020adfe84f000000b002fb60c7995esm33539437wrn.8.2023.05.03.02.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:17:59 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1850A1FFC5; Wed, 3 May 2023 10:17:58 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Riku Voipio , Yanan Wang , Eduardo Habkost , Greg Kurz , Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Schoenebeck , Richard Henderson , Eric Blake , Michael Roth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 09/10] hw/9pfs: use qemu_xxhash4 Date: Wed, 3 May 2023 10:17:55 +0100 Message-Id: <20230503091756.1453057-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503091756.1453057-1-alex.bennee@linaro.org> References: <20230503091756.1453057-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 No need to pass zeros as we have helpers that do that for us. Message-Id: <20230420150009.1675181-10-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Christian Schoenebeck Reviewed-by: Stefan Hajnoczi Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- 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); } 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) From patchwork Wed May 3 09:17:56 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: 678834 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp948276wrs; Wed, 3 May 2023 02:19:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7nexU8OMpnPGSpG6lrYcZ5wjsYmdY5FD6S0eS43iej9luKhJ8eveGvz7NVqiXnJGrxfw3+ X-Received: by 2002:a05:6214:27ec:b0:616:5042:816c with SMTP id jt12-20020a05621427ec00b006165042816cmr7324461qvb.33.1683105546947; Wed, 03 May 2023 02:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105546; cv=none; d=google.com; s=arc-20160816; b=H8iacR4RS39SWMqaFSYOOxOWcsu4YW59dlLLu3+kSVOH1EKmrOyZpHQT7bu/NFymoi P+8Wq87h/Hd9FM9CkpWxjXBDlXP+w++jVDvAlaaYekzfpRlakf3JXHHLixYqd85lQ9M1 sUQ/5oOrvW9vFxIcPKG/+eRNS1xgm4bhaLgB/vRv74pgmtmJ2JBddVPoes59CUxIH8pt 1kftQPOP4BcTzQ4pBPSY+X9zeu9AZEShYugauecnhIn/uhN6WytcqnNFawkYzyFdBq8g 7Q7hAUaoEjF6piLD8kLOIdeJ+5OnjVI0yM5Z5NW+11e7+k8rhTlAtfNjupoy9zWMQFyV gbIg== 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=WC01IUajOQVovgGje8S9D1xVOHkvVNHazKK2bsSkbgs=; b=ElrjRxSFDdBLwYgozn6Zn5MFBKw047sL3rlyyb9wGzeQLUMW1ciBdDi4W9QQrhCNjQ EM7z478g3BEvFJUA/mRVH8lop2vc2/OQ9qLwSf3cyuHazzob2FuWEn+ipJwuaaR4/dRt jLktphIuFEG8h+92u7p1qBISgx1q1iwxSYmtE3hHjCkb+PS9nKYg/LagJZhUETpOVD1G aTDg4KoF4SXcTZqhUKsEaTGDxmSiUzlnExlCUPweeN6icSiXmC2/D8TlOhyCHb+Sa7LI y+eJlZAXrBoHs8DvhZongVukKy55HIsLiijeA0QvpN+5s/y+GJU1ypCjXGo/oIC8geT8 fmEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WoBm1tBu; 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 bi28-20020a05620a319c00b0074e0900f273si18817624qkb.769.2023.05.03.02.19.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 02:19:06 -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=WoBm1tBu; 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 1pu8ci-0003Mk-8N; Wed, 03 May 2023 05:18:08 -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 1pu8ce-00032d-Qt for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:04 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu8cd-0000Mg-0w for qemu-devel@nongnu.org; Wed, 03 May 2023 05:18:04 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f315735514so15053895e9.1 for ; Wed, 03 May 2023 02:18:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683105481; x=1685697481; 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=WC01IUajOQVovgGje8S9D1xVOHkvVNHazKK2bsSkbgs=; b=WoBm1tBuYVLcFWmyFf/X/fgLa1BvNKPO5dsct1X4vwwZVr6MtR0miW3BSOdVoA01vE A4txyu0OM+RXD+POmUPjcntelipDxCPkAHVGBU6ZceSsESK8r80xuk2nJi5/pfz7wE4z vL/8WKJyPvBOeI0Ag9R4quQWC9crw/YlFtTNb/ZQFJvkwsv35YNLuB+6+g+j1DQn/man M13rhJs9C3Rxj9uumKnZNoDOVfzUMuKZQegQCvFyfGYWSqQsDuFlxRAggmtKTyiQpJOV Am73SV9Zu+1V86DlCdmfk9sg4ZZkxcw0eSijywEMEUqlVogs9r9LLNLmZdiqWdeb8xuC cCcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105481; x=1685697481; 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=WC01IUajOQVovgGje8S9D1xVOHkvVNHazKK2bsSkbgs=; b=ZBVm5QXapqjwNhyATBUKFsXXlIFMsJLgBut9uCq6AuurbthZs8nQS76QJKJRkTpxeC z/rwFelrLOfLOLN+bV7HS/3HeH0Y433Bcj38k67+q6y3QDEfadTpi8cISphE+hQFeu+g BEhmK7wdYC0Mt1q3lEUJYXotef/Xwc0aRtXlX1uk0N5ngIcOaaDVm/Q2cz1lOHW0XVvt ecQYAOWsdYnTabRHYUyp2iQA1JAtyAmMa9LCCYfAN+nx6AKaaaQUBXNH1CiRyqAfN63N flF09QqSpuMHq9iNs8y/Q65+VPEGsfATneMSqKMfgbBPjUqFQ28us/k8gxC9QRXG8j77 POlQ== X-Gm-Message-State: AC+VfDyHTU3VVvNy3CTwv0msAbY7p57nfIucdcB/g/+6rBhQLD5UsUsZ kEAABKyuMaNYQd/whSf/nzWjsw== X-Received: by 2002:a05:600c:1c21:b0:3f1:7371:86bb with SMTP id j33-20020a05600c1c2100b003f1737186bbmr846903wms.20.1683105481532; Wed, 03 May 2023 02:18:01 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t4-20020a7bc3c4000000b003f1745c7df3sm1271469wmj.23.2023.05.03.02.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:17:59 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2E8391FFC6; Wed, 3 May 2023 10:17:58 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Riku Voipio , Yanan Wang , Eduardo Habkost , Greg Kurz , Warner Losh , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Christian Schoenebeck , Richard Henderson , Eric Blake , Michael Roth , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 10/10] xxhash: remove qemu_xxhash7 Date: Wed, 3 May 2023 10:17:56 +0100 Message-Id: <20230503091756.1453057-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503091756.1453057-1-alex.bennee@linaro.org> References: <20230503091756.1453057-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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 users for qemu_xxhash7 we can drop an additional multiply and rol and make qemu_xxhash6 the implementation. Adjust the smaller hash functions accordingly. Message-Id: <20230420150009.1675181-11-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Signed-off-by: Alex Bennée --- 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 = QEMU_XXHASH_SEED + PRIME32_1 + PRIME32_2; uint32_t v2 = 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 += f * PRIME32_3; h32 = rol32(h32, 17) * PRIME32_4; - h32 += g * PRIME32_3; - h32 = rol32(h32, 17) * PRIME32_4; - h32 ^= h32 >> 15; h32 *= PRIME32_2; h32 ^= h32 >> 13; @@ -100,23 +97,17 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f, uint32_t g) static inline uint32_t qemu_xxhash2(uint64_t ab) { - return qemu_xxhash7(ab, 0, 0, 0, 0); + return qemu_xxhash6(ab, 0, 0, 0); } 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); } 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); } /*