From patchwork Wed May 5 09:22:59 2021 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: 431155 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp328753jao; Wed, 5 May 2021 02:29:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtzgVSUKyARsepzrNEnD2NNd303KREkat5+Ln7qWFe2Vfoa+l7EOOCfdjK1M4nIRgm88hB X-Received: by 2002:a02:caa3:: with SMTP id e3mr28060830jap.57.1620206959552; Wed, 05 May 2021 02:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620206959; cv=none; d=google.com; s=arc-20160816; b=t9PUYB7zmDJDm9Jc7llAuaI9x4QtB6B+Kxvihu60wsVDG9tj4Cy6VoExeVP+fyDl2k DBqW0UmZ5NHBBV2BSV7dSZLyTfXsVnsChxoqqPSeu6ytWZV5B1YzFNWBw7Mkt1Kv9TdT JfZmGztx+X4Ar7RUIfokog0Xf5aVCJqLDc7gXsxBUff8G77QLtj3AFjViVT1xPcV84AE nggI08tRtOlPyIU3BNcdiwBorQwgIrJrlief7ftprVLhNyqv7WS8P3f0PmyD818nbf8N AUsRvR37XoFVGQ+aQ4r7E0SAlqp6FF31CIXaX+hF2BDKsH9a8su/ThU6y7h9S7VT7xHq OlXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=pzxmZD4B0lAUAH8sN7d3Ghe+Y5XcNwSkO4kOPPQi1iI=; b=fHkXDuF/47te0ITqPPBjXwE7tgZmPJuQwm7/K2gcRDhDaMizz/WhSf94BVGTu4lRFX g2IxwJ0919Z26Lh0aD5cNBCilpNLca40YrgiLzBrTNolXxGC7noBqXD/2PpiWeP5rNLl BPQ5dw6AcCdpWgmqBRKMQDq0RFR+biQ+JDUHJhl+O7U2Pt8D8KNgPRpVqhKTPzDeQclI woabapJ5ZB1hFNv4m2L078oBGwPxZI2Dn/UIG0d8HMIN4IKc4geINDd3EC07yswC8Is2 HdC//vpuTUPbxvDhwVzKbBNtfT84t36mAQsTRWN2DTHMJcCwmIsPUBl4ecV0rOPyLLsE rOpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=t1EZxG0K; 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=fail (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 e10si13925432jaq.25.2021.05.05.02.29.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 May 2021 02:29:19 -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=fail header.i=@linaro.org header.s=google header.b=t1EZxG0K; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDqJ-0004bH-1B for patch@linaro.org; Wed, 05 May 2021 05:29:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leDkX-0000vP-M6 for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:22 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:56177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leDkP-0005BA-Bf for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:21 -0400 Received: by mail-wm1-x330.google.com with SMTP id i128so974538wma.5 for ; Wed, 05 May 2021 02:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pzxmZD4B0lAUAH8sN7d3Ghe+Y5XcNwSkO4kOPPQi1iI=; b=t1EZxG0Kl7tkdZSzFCP0uMUFnfkTaFbuymR9dzujn3bMHkACC5jCW9WcMz0u8fnsuM nJngLqz53vTPL/YJTU09S0UrQF5Ejc2cPMz0j4gq+CWXRfQM7OYw4r/+8WKKusY+12XG rAjTJJYmhNyoT4UZujcLswiNcfZLWg7aBFxE2img1h1DwC/43zE08GUf2D87uR6LcLxz 8ix6SaeNo5eYpqrnPBp7BxJ/BoqAFS8QfxME8tHpe3BjSPaoOvsmHEwt12nDKF3RnQuw tRYrA60I4QgqOiKg+yihypAVl4WnaWJ0NpLh2Fy8aVO3oDc/R41W7T1TJk3eqGCSWEiB ltsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pzxmZD4B0lAUAH8sN7d3Ghe+Y5XcNwSkO4kOPPQi1iI=; b=gx+5HMJ7LdQJhNU6yi2JzK8rmoCEt5bijy7Fo2bG0UubhFMtc+2EKlF5quHGWTdxRo OolL+SpgULoVKPi5g72K3MyZcDNFfwzoC8tuxhiQwF/X6ErXf/4hhtfK9bw2VvzLAc8p fOoZi0SIItEcxh+y7QwADGlTe91yl1ECE/UtKYsNUpVLcJc7HH0xlFEE8wekvoQMdvl1 XYtHLh+Wp+CHdkKvO6loxkwa25KbcGARvae4bVX/dkOokbmek1ZvMwaD1xdqeQlOkRO8 N1aIREOFinCby+MBWAuYRyzTsx+AlZwroBTbEo8OK3xnN5RNe+eYOVTv+m00LLlJtKyf tAxQ== X-Gm-Message-State: AOAM532PAlnSL4c+fiwnrw7HPfeayU9Dso9m/XlYWPa65Bs1qHKK6DGp DejcfbIKPwuhxTout57wE54q1w== X-Received: by 2002:a1c:6646:: with SMTP id a67mr8705560wmc.11.1620206591236; Wed, 05 May 2021 02:23:11 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 61sm20282645wrm.52.2021.05.05.02.23.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 02:23:08 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 75B7E1FF93; Wed, 5 May 2021 10:23:00 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 7/7] tcg: add trace events for [exit|goto]_tb and goto_ptr Date: Wed, 5 May 2021 10:22:59 +0100 Message-Id: <20210505092259.8202-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505092259.8202-1-alex.bennee@linaro.org> References: <20210505092259.8202-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , minyihh@uci.edu, robhenry@microsoft.com, vilanova@imperial.ac.uk, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, mohamad.gebai@gmail.com, kuhn.chenqun@huawei.com, matheus.ferst@eldorado.org.br Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These are generic trace points in common helper functions used by all front ends. They mainly serve as additional in-tree examples of TCG trace points and can be used to compare and contrast with getting similar information from the TCG plugins. Signed-off-by: Alex Bennée --- tcg/tcg-op.c | 8 ++++++++ trace-events | 12 ++++++++++++ 2 files changed, 20 insertions(+) -- 2.20.1 diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 70475773f4..46b00f6e9b 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -2687,6 +2687,8 @@ void tcg_gen_exit_tb(const TranslationBlock *tb, unsigned idx) tcg_debug_assert(idx == TB_EXIT_REQUESTED); } + trace_exit_tb_tcg(val & ~TB_EXIT_MASK, val & TB_EXIT_MASK); + plugin_gen_disable_mem_helpers(); tcg_gen_op1i(INDEX_op_exit_tb, val); } @@ -2703,6 +2705,9 @@ void tcg_gen_goto_tb(unsigned idx) plugin_gen_disable_mem_helpers(); /* When not chaining, we simply fall through to the "fallback" exit. */ if (!qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { + + trace_goto_tb_tcg(idx); + tcg_gen_op1i(INDEX_op_goto_tb, idx); } } @@ -2715,6 +2720,9 @@ void tcg_gen_lookup_and_goto_ptr(void) plugin_gen_disable_mem_helpers(); ptr = tcg_temp_new_ptr(); gen_helper_lookup_tb_ptr(ptr, cpu_env); + + trace_goto_ptr_tcg(ptr); + tcg_gen_op1i(INDEX_op_goto_ptr, tcgv_ptr_arg(ptr)); tcg_temp_free_ptr(ptr); } else { diff --git a/trace-events b/trace-events index ac7cef9335..1fcb8c4dda 100644 --- a/trace-events +++ b/trace-events @@ -136,6 +136,18 @@ vcpu guest_cpu_reset(void) # Targets: TCG(all) vcpu tcg guest_mem_before(TCGv vaddr, uint16_t info) "info=%d", "vaddr=0x%016"PRIx64" info=%d" +# Mode: user, softmmu +# Targets: TCG(all) +tcg exit_tb(uint64_t ptr, uint64_t idx) "tb=0x%016"PRIx64"/%"PRId64"", "tb=0x%016"PRIx64"/%"PRId64"" + +# Mode: user, softmmu +# Targets: TCG(all) +tcg goto_tb(uint64_t idx) "idx=%"PRId64"", "idx=%"PRId64"" + +# Mode: user, softmmu +# Targets: TCG(all) +tcg goto_ptr(TCGv_ptr ptr) "", "ptr=%p" + # include/user/syscall-trace.h # @num: System call number.