From nobody Tue May 7 00:21:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1620206796; cv=none; d=zohomail.com; s=zohoarc; b=kvwldfMMtqqsmrSwF/yRm+OdH/X1WYaNRTJBtVbBXOmKRqHFaQq2L0jpXWubg+gKb6rorgVKWsrgyD1lylAYXUm/oQfQTZfmbwkGCQDoWN7BDE+ah/olwxKilnSNbiEYRHI8V4pc9dtsHJ8RokYpBvC1/z2oIDD0m+ZDiMXIPa0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620206796; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CQ8679cFYPFRKCt5xKP0d5J4rP4I/8eL7P8Ydf6Ygrc=; b=AqE3QWlQX1AQ+iClt21lgtm6XReF0IM9RjW08tgCVrgLFms1izc1okD+39zkFHUYXXRYz7a+TIquVI+qdx23eCLfRnAz3+nEPRJxc1btW3CZSBEAYMnDM+c9RHWGhIq1UHqMJe0AWFf5BoCzyIXyh6lB8nAVIfdLhlmCbdyI//4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16202067964381017.8943586756822; Wed, 5 May 2021 02:26:36 -0700 (PDT) Received: from localhost ([::1]:36838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDnf-0002xs-B2 for importer@patchew.org; Wed, 05 May 2021 05:26:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leDkQ-0000ru-S7 for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:15 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:36830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leDkJ-00058T-Mc for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:12 -0400 Received: by mail-wm1-x333.google.com with SMTP id l24-20020a7bc4580000b029014ac3b80020so2991083wmi.1 for ; Wed, 05 May 2021 02:23:06 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c15sm19212753wrr.3.2021.05.05.02.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 02:23:00 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DBDA71FF87; Wed, 5 May 2021 10:22:59 +0100 (BST) 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=CQ8679cFYPFRKCt5xKP0d5J4rP4I/8eL7P8Ydf6Ygrc=; b=wIOIhpeRlnuvzo+stWllXWq7BKZFMNPUGyIigHtKCeVdRzFCvdjkuHJGZtsInNHJ9d CdfcbyVBYL5gbvUq+IkyNPFpGA6nY0fVgszNGrnz1Bg5gi8yP32tjpk/Zg48giCmeMqW SODq5wpoxHmJsxEl2v8FthPvTxq6o2YxfYAm5ARVZMCZXIWPuSLJ2mNxSlwG2BKNY3w8 HRTE1C7L61jmSssy2dc2oQyAvbLIqmOuuakb4d+QpfAnfdnYXtNueaXQRY1jZsV47Xb1 BCLFpl8hJa22MtvcAGOdPmKgE/U4hPro8XRvSTMEf98iANGZovyuN+hP0WoBItOmFn17 /N2A== 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=CQ8679cFYPFRKCt5xKP0d5J4rP4I/8eL7P8Ydf6Ygrc=; b=OaleXpDnvI6RKNRr30gQqMz1OJL8f0Q5KjOgSaUZSC+mEVoVEm95b0e297CHNojWbI kGQNfcQxUiryfMbqewgc/mWJkkOlrMoLoCQXRfKo6gL1JkMqwdekLfGLJoUYhsBnTLrb n345o1Ex3E/lPqx21TI0JhtfNhnX4eai0qQWE8VeBzCm9ODtQ2/3YVumiOYLL78xZJA7 dIAFpuGR98Ox2vNnFPRaGDtWWe0BfuGvoQdtSMWrDkLHGi/ixBnh97TJp+CZDoRWwqYR BnQixcWstzN+FZV4dNeOjrLF36RPhQGFV2YELe2hccf1XrtIY6oOpsSTKVLMdO2HEGyo 6G8g== X-Gm-Message-State: AOAM532qrtu1OEZdjuHi+LuNG904Vq/NvpiRsM0Y0LBGv3oYgzurGpRK vxXe9OKq+8idjvOAWZYR05G6tw== X-Google-Smtp-Source: ABdhPJzV78qEZBe0CVJsVPNpV/S197CDRHFjY2HO83fl4/+PooANSgZY89DGjh16BmeWL50/R0F2Zw== X-Received: by 2002:a1c:731a:: with SMTP id d26mr9070351wmb.36.1620206585443; Wed, 05 May 2021 02:23:05 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 1/7] plugins: Update qemu-plugins.symbols to match qemu-plugins.h Date: Wed, 5 May 2021 10:22:53 +0100 Message-Id: <20210505092259.8202-2-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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=20Benn=C3=A9e?= , 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, Yonggang Luo Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Yonggang Luo Reorder the function symbols that consistence with qemu-plugins.h Signed-off-by: Yonggang Luo Signed-off-by: Alex Benn=C3=A9e Message-Id: <20210318185555.434-2-luoyonggang@gmail.com> --- plugins/qemu-plugins.symbols | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols index 4bdb381f48..a0ac1df62a 100644 --- a/plugins/qemu-plugins.symbols +++ b/plugins/qemu-plugins.symbols @@ -5,35 +5,34 @@ qemu_plugin_register_vcpu_exit_cb; qemu_plugin_register_vcpu_idle_cb; qemu_plugin_register_vcpu_resume_cb; - qemu_plugin_register_vcpu_insn_exec_cb; - qemu_plugin_register_vcpu_insn_exec_inline; - qemu_plugin_register_vcpu_mem_cb; - qemu_plugin_register_vcpu_mem_haddr_cb; - qemu_plugin_register_vcpu_mem_inline; - qemu_plugin_ram_addr_from_host; qemu_plugin_register_vcpu_tb_trans_cb; qemu_plugin_register_vcpu_tb_exec_cb; qemu_plugin_register_vcpu_tb_exec_inline; - qemu_plugin_register_flush_cb; - qemu_plugin_register_vcpu_syscall_cb; - qemu_plugin_register_vcpu_syscall_ret_cb; - qemu_plugin_register_atexit_cb; + qemu_plugin_register_vcpu_insn_exec_cb; + qemu_plugin_register_vcpu_insn_exec_inline; qemu_plugin_tb_n_insns; - qemu_plugin_tb_get_insn; qemu_plugin_tb_vaddr; + qemu_plugin_tb_get_insn; qemu_plugin_insn_data; qemu_plugin_insn_size; qemu_plugin_insn_vaddr; qemu_plugin_insn_haddr; - qemu_plugin_insn_disas; qemu_plugin_mem_size_shift; qemu_plugin_mem_is_sign_extended; qemu_plugin_mem_is_big_endian; qemu_plugin_mem_is_store; qemu_plugin_get_hwaddr; qemu_plugin_hwaddr_is_io; - qemu_plugin_hwaddr_to_raddr; + qemu_plugin_hwaddr_phys_addr; + qemu_plugin_hwaddr_device_name; + qemu_plugin_register_vcpu_mem_cb; + qemu_plugin_register_vcpu_mem_inline; + qemu_plugin_register_vcpu_syscall_cb; + qemu_plugin_register_vcpu_syscall_ret_cb; + qemu_plugin_insn_disas; qemu_plugin_vcpu_for_each; + qemu_plugin_register_flush_cb; + qemu_plugin_register_atexit_cb; qemu_plugin_n_vcpus; qemu_plugin_n_max_vcpus; qemu_plugin_outs; --=20 2.20.1 From nobody Tue May 7 00:21:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1620207141; cv=none; d=zohomail.com; s=zohoarc; b=NW+uBzb4M3pA8SQ9SrevRQn5XbIt5kaDhhfsQsh4TrnYxqrgmFdYjo2hn13XdPTYcP6uOe4aZJKXVMeZbKUlA4SpuI12quuqzhzS4OpDvABL1/Eps96uGppV1ciF+xR3gD30Zy7pVCSBSn6S4J02KKruq/Kg7G+CO2rgladSD1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620207141; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LZutPtgpTaHldKZk578MIAzGwCkCBrqhiKcMaWSBcng=; b=P4M3tHL/zlVJ1fiCgkoCTWJGb43Ec1V9yFiZWa7Cd8gQvvSUGOcRTgJcVmEukiznjfv292DKR8WBup+Bt1t/FParPa4AIUejzjkcF5EaHteZlStJp/Gavxt7zGgyz3ZfjjvvFt/6ZkmkGUDLcSD76o8U5ODOEbjTtMs8vVQ6j5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620207141123784.0788231607836; Wed, 5 May 2021 02:32:21 -0700 (PDT) Received: from localhost ([::1]:51238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDtD-0000d8-Rx for importer@patchew.org; Wed, 05 May 2021 05:32:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leDkX-0000v3-3R for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:22 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:40633) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leDkJ-00056x-NZ for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:19 -0400 Received: by mail-wr1-x433.google.com with SMTP id d4so1018950wru.7 for ; Wed, 05 May 2021 02:23:04 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b8sm19307077wrx.15.2021.05.05.02.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 02:23:00 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F24E81FF8C; Wed, 5 May 2021 10:22:59 +0100 (BST) 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=LZutPtgpTaHldKZk578MIAzGwCkCBrqhiKcMaWSBcng=; b=TiFI+UyGZ7w1cyvlAinQVZaEUeY9HCRwQaJXkTgqrMH+3X6hASYTeXshyLEmC0ivr0 GdaRL5SW6M3hIGQj7W6aHu2IDD/a7rGjkQgcOw0Sk4Uo85SREAFWZ27fQ8HNsHJcKXIc weyj1A8oDlpFI2mUUkKeVcyp8S1G3NCH+v4yGFg8KC/bunPf/FCAE6Xrb2ar3lkmvPp6 KigP3FClwL/vDIAP9qbd/9FRAnN135odlZnkr54wf4gcpYjrDgSp4Uv+CX+PIa2SKCqA X/O3Mdg2g7zzyaWnaTIDDNSMHX7YlLwDMz3H8r2+GZYAHEV7h83qREmu4p+gdtMg8ufL rPww== 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=LZutPtgpTaHldKZk578MIAzGwCkCBrqhiKcMaWSBcng=; b=GQM+JAm/D4AqjYzl6Zxma/7nZBFpi6rihlJMGQUQvEMZRnOhjn+1ri+3OHcZ59iVCp aUQbEq2lP/Np3QTIBx601j6Gl2gXtABfjOjlbHgRDvwf5LHRQEdMxQZ9goX6HgwUTuNn /jjfXX6UqYCgxoZZ7O5t3g7xVPeAu4qjxD+1zd6zxtOtqqWNlMtSZ9GDHlyS+4VZmy2s 0GPaDWMzomd/QhZpGVgW0GwnWhkXiFziDB5P9+/t/fZHDK6BEjJ3vGn8OcISs+M8VhFj vKHNcd6ljiyzd1rWYT/txsOzJ1ojLxDPKcs8znJuq+xvY1DdP0SGXXrD91Mzklx3dDcA yxKA== X-Gm-Message-State: AOAM533fhuT8jGa+dDWs6AbF8bZunOZlzNodtjJK9+s0D3qRhk/fry7H 5sKrrdvPOAG/2Aw/8wnlOZ8AbQ== X-Google-Smtp-Source: ABdhPJzXwfqJ+SGVkmBcw05TcjXmB0udbrBA5oECDFen+o6ShPGVfrwjJ1wJg1Yw2oQw7h4WO9p31A== X-Received: by 2002:adf:cd8c:: with SMTP id q12mr36770964wrj.328.1620206582722; Wed, 05 May 2021 02:23:02 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 2/7] plugins: Move all typedef and type declaration to the front of the qemu-plugin.h Date: Wed, 5 May 2021 10:22:54 +0100 Message-Id: <20210505092259.8202-3-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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=20Benn=C3=A9e?= , 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, Yonggang Luo Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Yonggang Luo Signed-off-by: Yonggang Luo Signed-off-by: Alex Benn=C3=A9e Message-Id: <20210318185555.434-3-luoyonggang@gmail.com> --- include/qemu/qemu-plugin.h | 187 ++++++++++++++++++------------------- 1 file changed, 92 insertions(+), 95 deletions(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 97cdfd7761..2cb17f3051 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -81,27 +81,6 @@ typedef struct qemu_info_t { }; } qemu_info_t; =20 -/** - * qemu_plugin_install() - Install a plugin - * @id: this plugin's opaque ID - * @info: a block describing some details about the guest - * @argc: number of arguments - * @argv: array of arguments (@argc elements) - * - * All plugins must export this symbol which is called when the plugin - * is first loaded. Calling qemu_plugin_uninstall() from this function - * is a bug. - * - * Note: @info is only live during the call. Copy any information we - * want to keep. @argv remains valid throughout the lifetime of the - * loaded plugin. - * - * Return: 0 on successful loading, !0 for an error. - */ -QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, - const qemu_info_t *info, - int argc, char **argv); - /** * typedef qemu_plugin_simple_cb_t - simple callback * @id: the unique qemu_plugin_id_t @@ -135,6 +114,98 @@ typedef void (*qemu_plugin_vcpu_simple_cb_t)(qemu_plug= in_id_t id, typedef void (*qemu_plugin_vcpu_udata_cb_t)(unsigned int vcpu_index, void *userdata); =20 +/** struct qemu_plugin_tb - Opaque handle for a translation block */ +struct qemu_plugin_tb; +/** struct qemu_plugin_insn - Opaque handle for a translated instruction */ +struct qemu_plugin_insn; + +/** + * enum qemu_plugin_cb_flags - type of callback + * + * @QEMU_PLUGIN_CB_NO_REGS: callback does not access the CPU's regs + * @QEMU_PLUGIN_CB_R_REGS: callback reads the CPU's regs + * @QEMU_PLUGIN_CB_RW_REGS: callback reads and writes the CPU's regs + * + * Note: currently unused, plugins cannot read or change system + * register state. + */ +enum qemu_plugin_cb_flags { + QEMU_PLUGIN_CB_NO_REGS, + QEMU_PLUGIN_CB_R_REGS, + QEMU_PLUGIN_CB_RW_REGS, +}; + +enum qemu_plugin_mem_rw { + QEMU_PLUGIN_MEM_R =3D 1, + QEMU_PLUGIN_MEM_W, + QEMU_PLUGIN_MEM_RW, +}; + +/** + * typedef qemu_plugin_vcpu_tb_trans_cb_t - translation callback + * @id: unique plugin id + * @tb: opaque handle used for querying and instrumenting a block. + */ +typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(qemu_plugin_id_t id, + struct qemu_plugin_tb *tb); + +/** + * enum qemu_plugin_op - describes an inline op + * + * @QEMU_PLUGIN_INLINE_ADD_U64: add an immediate value uint64_t + * + * Note: currently only a single inline op is supported. + */ + +enum qemu_plugin_op { + QEMU_PLUGIN_INLINE_ADD_U64, +}; + +/** + * typedef qemu_plugin_meminfo_t - opaque memory transaction handle + * + * This can be further queried using the qemu_plugin_mem_* query + * functions. + */ +typedef uint32_t qemu_plugin_meminfo_t; +/** struct qemu_plugin_hwaddr - opaque hw address handle */ +struct qemu_plugin_hwaddr; + +typedef void +(*qemu_plugin_vcpu_mem_cb_t)(unsigned int vcpu_index, + qemu_plugin_meminfo_t info, uint64_t vaddr, + void *userdata); + +typedef void +(*qemu_plugin_vcpu_syscall_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_in= dex, + int64_t num, uint64_t a1, uint64_t a2, + uint64_t a3, uint64_t a4, uint64_t a5, + uint64_t a6, uint64_t a7, uint64_t a8); +typedef void +(*qemu_plugin_vcpu_syscall_ret_cb_t)(qemu_plugin_id_t id, unsigned int vcp= u_idx, + int64_t num, int64_t ret); + +/** + * qemu_plugin_install() - Install a plugin + * @id: this plugin's opaque ID + * @info: a block describing some details about the guest + * @argc: number of arguments + * @argv: array of arguments (@argc elements) + * + * All plugins must export this symbol which is called when the plugin + * is first loaded. Calling qemu_plugin_uninstall() from this function + * is a bug. + * + * Note: @info is only live during the call. Copy any information we + * want to keep. @argv remains valid throughout the lifetime of the + * loaded plugin. + * + * Return: 0 on successful loading, !0 for an error. + */ +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv); + /** * qemu_plugin_uninstall() - Uninstall a plugin * @id: this plugin's opaque ID @@ -205,41 +276,6 @@ void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_= t id, void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); =20 -/** struct qemu_plugin_tb - Opaque handle for a translation block */ -struct qemu_plugin_tb; -/** struct qemu_plugin_insn - Opaque handle for a translated instruction */ -struct qemu_plugin_insn; - -/** - * enum qemu_plugin_cb_flags - type of callback - * - * @QEMU_PLUGIN_CB_NO_REGS: callback does not access the CPU's regs - * @QEMU_PLUGIN_CB_R_REGS: callback reads the CPU's regs - * @QEMU_PLUGIN_CB_RW_REGS: callback reads and writes the CPU's regs - * - * Note: currently unused, plugins cannot read or change system - * register state. - */ -enum qemu_plugin_cb_flags { - QEMU_PLUGIN_CB_NO_REGS, - QEMU_PLUGIN_CB_R_REGS, - QEMU_PLUGIN_CB_RW_REGS, -}; - -enum qemu_plugin_mem_rw { - QEMU_PLUGIN_MEM_R =3D 1, - QEMU_PLUGIN_MEM_W, - QEMU_PLUGIN_MEM_RW, -}; - -/** - * typedef qemu_plugin_vcpu_tb_trans_cb_t - translation callback - * @id: unique plugin id - * @tb: opaque handle used for querying and instrumenting a block. - */ -typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(qemu_plugin_id_t id, - struct qemu_plugin_tb *tb); - /** * qemu_plugin_register_vcpu_tb_trans_cb() - register a translate cb * @id: plugin ID @@ -269,18 +305,6 @@ void qemu_plugin_register_vcpu_tb_exec_cb(struct qemu_= plugin_tb *tb, enum qemu_plugin_cb_flags flags, void *userdata); =20 -/** - * enum qemu_plugin_op - describes an inline op - * - * @QEMU_PLUGIN_INLINE_ADD_U64: add an immediate value uint64_t - * - * Note: currently only a single inline op is supported. - */ - -enum qemu_plugin_op { - QEMU_PLUGIN_INLINE_ADD_U64, -}; - /** * qemu_plugin_register_vcpu_tb_exec_inline() - execution inline op * @tb: the opaque qemu_plugin_tb handle for the translation @@ -393,16 +417,6 @@ uint64_t qemu_plugin_insn_vaddr(const struct qemu_plug= in_insn *insn); */ void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn); =20 -/** - * typedef qemu_plugin_meminfo_t - opaque memory transaction handle - * - * This can be further queried using the qemu_plugin_mem_* query - * functions. - */ -typedef uint32_t qemu_plugin_meminfo_t; -/** struct qemu_plugin_hwaddr - opaque hw address handle */ -struct qemu_plugin_hwaddr; - /** * qemu_plugin_mem_size_shift() - get size of access * @info: opaque memory transaction handle @@ -480,11 +494,6 @@ uint64_t qemu_plugin_hwaddr_phys_addr(const struct qem= u_plugin_hwaddr *haddr); */ const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr= *h); =20 -typedef void -(*qemu_plugin_vcpu_mem_cb_t)(unsigned int vcpu_index, - qemu_plugin_meminfo_t info, uint64_t vaddr, - void *userdata); - void qemu_plugin_register_vcpu_mem_cb(struct qemu_plugin_insn *insn, qemu_plugin_vcpu_mem_cb_t cb, enum qemu_plugin_cb_flags flags, @@ -496,21 +505,9 @@ void qemu_plugin_register_vcpu_mem_inline(struct qemu_= plugin_insn *insn, enum qemu_plugin_op op, void *pt= r, uint64_t imm); =20 - - -typedef void -(*qemu_plugin_vcpu_syscall_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_in= dex, - int64_t num, uint64_t a1, uint64_t a2, - uint64_t a3, uint64_t a4, uint64_t a5, - uint64_t a6, uint64_t a7, uint64_t a8); - void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_syscall_cb_t cb= ); =20 -typedef void -(*qemu_plugin_vcpu_syscall_ret_cb_t)(qemu_plugin_id_t id, unsigned int vcp= u_idx, - int64_t num, int64_t ret); - void qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_syscall_ret_cb_t= cb); --=20 2.20.1 From nobody Tue May 7 00:21:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1620206763; cv=none; d=zohomail.com; s=zohoarc; b=g9FLvqx9BborsM9YiFVNIsH9sNFpWg5L3PFTDI0BkkrXtN/4zmeA61CGVVGlyhwbOSVvt8hXyaUQzHIENjNIKC79gIUp50U1XiPFlWuNjqoPZIQJmiyL+TZXfOGhwmqyVrV9Rxf00ae1kBo6i88Zzgov3zLq5Du8mwPwHGslv2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620206763; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ydPT0ztE2Bw0rnFw4k7WbHBh286HstrN5c/fEJLUTGA=; b=UlJ75PohPw6dzR55BPKsrJmQZO+C8AVNv92iHJSoH+l3hgIHO2lLQ7hxzeF1gU1xoeq64lEYuIHAox9XWX4L8WSTdztgxWDrnyVUlPyCb+AYlMB3/kPlsEqFzjrwTq5+9UEXvWaCsKWko35k9pBSd5CrqlajxCXMoEE99vjfjcg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620206763672719.9356183730365; Wed, 5 May 2021 02:26:03 -0700 (PDT) Received: from localhost ([::1]:35682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDn8-0002Ux-1L for importer@patchew.org; Wed, 05 May 2021 05:26:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leDkR-0000sk-Cz for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:15 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:45807) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leDkJ-00056l-Jp for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:15 -0400 Received: by mail-wm1-x32c.google.com with SMTP id s5-20020a7bc0c50000b0290147d0c21c51so691975wmh.4 for ; Wed, 05 May 2021 02:23:03 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f11sm5363048wmq.41.2021.05.05.02.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 02:23:00 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 149DE1FF8F; Wed, 5 May 2021 10:23:00 +0100 (BST) 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=ydPT0ztE2Bw0rnFw4k7WbHBh286HstrN5c/fEJLUTGA=; b=lw51i2KQmYSfL0VWNhGU3wOMQBgyQFZX0BgQM/hi01D5Y8+JpKHa0w1gxyt4Zt49YV FAMmIx/3na9aLo8darGgFiQCkHHPKy+ccM8ZrKsPPdYO6WqA8+2Bm3hRjTyEPECEQX+V 9Jh37+oraB6WniA23aTExmbQhqWe2Ejodaq+0sIuriQPsxxrzcFigGZvmL82G3siZHjB Blf2jNP6CbInfZPSOs0AuP9c4/2h9MyYR2AB9eHWpi4qVuQY6BNZvy3AN2oy2/pfp9UB 0RkBzmnJCAbd/DXZD9KXc4M2Zs+WQuEcPqJrJtdrYvGOsrZOvvX7gGdRuiWuvjKYPjIe rscQ== 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=ydPT0ztE2Bw0rnFw4k7WbHBh286HstrN5c/fEJLUTGA=; b=tyxcjE+j8GnWIWNd5UVF6nDIYLjrddD0/2EkPhplIYSBdpOho49fU+h6Yie5jpFsY1 aPlqENTdJItAR1EQgbcn7iVYliDDJFKZAp1irZO80VVQ2027LDPMFO6RLjoMRlYCSHxl D/p4w5FAqSdeIspcYk9YisuG3Hd50vhpPgw/ix72gCG9CnccZi0NR9Xr5h87MbdGTwmr hqkjeELrX7QWD26HibD6FEDFIqSd5//VcCL1RSLbnyPkYFjo8YH+CoNKgOeQWR/BjUL3 MaA2XjR+Zjudo5cLwQhgFuVVNEqbxmD+f3TtkP1tZP0WG/UGcUnyz8Ls8SNOj3k7XFLl XP/A== X-Gm-Message-State: AOAM532ZvmGvs/5ktCx59if1q3j/nsCjVZMILdYCW6Ff5A5bPaYy/ftg kfuFbpOxjPEuoX7xgwKA2DJ3LQ== X-Google-Smtp-Source: ABdhPJyCwdVIrdEerNQtPOGB5ST68y8ICf2cJFHLN2yY5rYVbYlen8oa8SXRtgGzTZvEBwdFZR+xIw== X-Received: by 2002:a1c:4302:: with SMTP id q2mr8887749wma.1.1620206581890; Wed, 05 May 2021 02:23:01 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 3/7] plugins/hotblocks: Properly freed the hash table values Date: Wed, 5 May 2021 10:22:55 +0100 Message-Id: <20210505092259.8202-4-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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 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=20Benn=C3=A9e?= , 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, Mahmoud Mandour , matheus.ferst@eldorado.org.br Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Mahmoud Mandour Freed the values stored in the hash table ``hotblocks`` returned by ``g_hash_table_get_values()`` by freeing the sorted list and destroyed the hash table afterward. Signed-off-by: Mahmoud Mandour Signed-off-by: Alex Benn=C3=A9e Message-Id: <20210422005043.3569-2-ma.mandourr@gmail.com> --- contrib/plugins/hotblocks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 4b08340143..64692c0670 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -68,10 +68,11 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) rec->insns, rec->exec_count); } =20 - g_list_free(it); + g_list_free_full(it, g_free); g_mutex_unlock(&lock); } =20 + g_hash_table_destroy(hotblocks); qemu_plugin_outs(report->str); } =20 --=20 2.20.1 From nobody Tue May 7 00:21:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1620206780; cv=none; d=zohomail.com; s=zohoarc; b=blik0Dw6Q19iO4qEZNLPEUVaA0YYm/JVIS4v0Kn3pok9L6QiKlg9ohlRMI1tfDOiaY9dVbCXx/fq9BJ9KQNARPRKs78LFxdMAzYw2RAwyknjSnj9IDAmgFym1H5A6J7zbt85Zzecln9e26GaZ8xzQ3xV9qVthgJkYqLG119mh2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620206780; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XOXXbFmKIzYlDZ6gGIuWNND3ouYEXltv7aZzivzNlxo=; b=mduIZ18jHEQgtp3l66K5DSmMpTtmgTrKR6pFgpH1Q3/XX1H/MfG2QeDLEkxUnW58vyqd5rNMm/bLvDeH1qC0VWMvea6zlvkTI6LI6tc2K7sANRuIGcXASImflzpli1zRRulIGWD1wfJ/wfh+dEHanrCfcBEROVR4JEVLuiMfWvs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620206780340868.8173579225848; Wed, 5 May 2021 02:26:20 -0700 (PDT) Received: from localhost ([::1]:36460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDnP-0002oL-B3 for importer@patchew.org; Wed, 05 May 2021 05:26:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leDkR-0000sr-FT for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:16 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:55252) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leDkL-000590-Cw for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:15 -0400 Received: by mail-wm1-x334.google.com with SMTP id o127so980599wmo.4 for ; Wed, 05 May 2021 02:23:08 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o13sm4335362wmh.34.2021.05.05.02.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 02:23:00 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2B5D11FF90; Wed, 5 May 2021 10:23:00 +0100 (BST) 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=XOXXbFmKIzYlDZ6gGIuWNND3ouYEXltv7aZzivzNlxo=; b=lZQaQ31DtmHH3Nv+Tffdkue0yQmcHhmQkKipg0uXJqlrWKUHT8p5Yb01grtmWLYsi0 hfbrk6QDyG03MB8Oj77xXg2GwQS6RZzS6W6U0SAynHTx5kYiyvnh3xpZCuJgGBAtBYr8 7u266fmne/7hN43dvSuCWYgfUZ2qiQcR4kA09manT0YOt1RMVCBVA4O5rObqD4WuFOmi Dc+QzywvYbNqAnJC4sNd10dswGCALIZXprcSahVlxCl8BMFv2ghV+yddtLnh53D6FRZD yqmWFucqPrOD4jkY4vov2hU9DZbhSND2uiGnlTGxkGVfMVRskK0Sxlb9mmH9ESze1Th2 BX2Q== 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=XOXXbFmKIzYlDZ6gGIuWNND3ouYEXltv7aZzivzNlxo=; b=d3mUjvk4mQd8XSmUJA3eUlYSnyYUCJNKrFzsmS0lXjAW6MaVZhObMSByAj2O1LZTSQ xh48KFf+xE+0ElwPrznVlzri9A5CRfWbNiAgoXUywDDatOUBydiQjNjpjivz63sIqssG G3n8le8NZKPCD/Yc81pPrhUogHeI7tg2xI3YTnULnVz6jGk7RMAOazUi+JYFm8WSR2We fK5clikmwU/1Jk+CNaZszaXRC4uvcG0PBG1bCPrIyA+lkFtfdlNeUXP3eX8estUyMXwJ PVS/8Faa09+TYy3daoWCPO8GCpLh/bq0AZJ8oaMCYB1ky/zTgUz4TgkNkMGOc0fk7q9X y2WQ== X-Gm-Message-State: AOAM5337p3PuT3N3OXsgIQ4lTGN/Tw81ictnYax739iIu9w6WQuWFVGc v96KhywZQc5ZeS+wqsJWx3ZzUQ== X-Google-Smtp-Source: ABdhPJx81BFahmoruKwtYyzySQ0OUECmYtdxRR7z4wHC2vvyDd9L/LZA0VY8VRmYTqk9o8qRLHrpjw== X-Received: by 2002:a7b:c24a:: with SMTP id b10mr8896908wmj.157.1620206587379; Wed, 05 May 2021 02:23:07 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 4/7] plugins/hotpages: Properly freed the hash table values Date: Wed, 5 May 2021 10:22:56 +0100 Message-Id: <20210505092259.8202-5-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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=20Benn=C3=A9e?= , 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, Mahmoud Mandour , matheus.ferst@eldorado.org.br Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Mahmoud Mandour Allocated ``pages`` hash table through ``g_hash_table_new_full`` to add a freeing function & destroyed the hash table on exit. Signed-off-by: Mahmoud Mandour Signed-off-by: Alex Benn=C3=A9e Message-Id: <20210422005043.3569-3-ma.mandourr@gmail.com> --- contrib/plugins/hotpages.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/plugins/hotpages.c b/contrib/plugins/hotpages.c index bf53267532..9cf7f02c77 100644 --- a/contrib/plugins/hotpages.c +++ b/contrib/plugins/hotpages.c @@ -97,13 +97,14 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) g_list_free(it); } =20 + g_hash_table_destroy(pages); qemu_plugin_outs(report->str); } =20 static void plugin_init(void) { page_mask =3D (page_size - 1); - pages =3D g_hash_table_new(NULL, g_direct_equal); + pages =3D g_hash_table_new_full(NULL, g_direct_equal, NULL, g_free); } =20 static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t memin= fo, --=20 2.20.1 From nobody Tue May 7 00:21:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1620206652; cv=none; d=zohomail.com; s=zohoarc; b=aAJ+xi2UI1qI9890R5scll3lbPly3fdaZ4K8d2aMjKKZ91q6Zkom/1PXSgP39ArgTyLqceyisXqvWAUd/cfKbnFOFTMXs2SMEJiObrO7adVPC926graNulpMnjkK0Q3+Ks/xjbll0fuoXwBIDIeOVuDLnlgHjqsPOTuJP5EuV0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620206652; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=djikfsvzpevIoT9ZhL//tIh35KLunxCT5zbeziHmb1o=; b=YL+CHER11AgVGHXRyAwQ+jOtwQV+aLkd1DnDR8LN9K5ZSCXSN4uckRssgWl36Ho1Q76fRW48yk3gLHQCPlb0X/yOVzxsGPG05SnNkBHVP4pAjPQxef+hejFzmk31N1yUlt6Fq4f+3v9P82xynYxNyak2leOh59RKWgog0k2TEXo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1620206652296821.0717300630441; Wed, 5 May 2021 02:24:12 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-586-j3lnVknGNsGGuRw8HG6HQQ-1; Wed, 05 May 2021 05:24:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 60C4910CE781; Wed, 5 May 2021 09:24:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 874495D6D1; Wed, 5 May 2021 09:24:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EAAFF180B465; Wed, 5 May 2021 09:23:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1459NG7T017842 for ; Wed, 5 May 2021 05:23:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id BFC5A2172F1D; Wed, 5 May 2021 09:23:16 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B4DF92172F35 for ; Wed, 5 May 2021 09:23:13 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A355E8339BF for ; Wed, 5 May 2021 09:23:13 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-0kqZs0mUM7K3nB0zBo8xgw-1; Wed, 05 May 2021 05:23:11 -0400 Received: by mail-wm1-f47.google.com with SMTP id b11-20020a7bc24b0000b0290148da0694ffso2984607wmj.2 for ; Wed, 05 May 2021 02:23:11 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f7sm19374075wrg.34.2021.05.05.02.23.02 (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 455AD1FF91; Wed, 5 May 2021 10:23:00 +0100 (BST) X-MC-Unique: j3lnVknGNsGGuRw8HG6HQQ-1 X-MC-Unique: 0kqZs0mUM7K3nB0zBo8xgw-1 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=djikfsvzpevIoT9ZhL//tIh35KLunxCT5zbeziHmb1o=; b=MMLEJLwreSdqP1dR77Gq01N61Okc5/8Uh5KGvjZjCjx1sgYBRNd+GlGRecT4OpKr2P J4mzwTi6gR7vrjEc8I2153eXKyEDxSKeIYtuoThPgNXy0x28lxhJQg1SGRX4jRv5Y8Qv q8LhRRCKGVK3IFBPWFLSRzOzC0xmi6TywdR8NOz51W4qGYWEG2E31o5pD3V0mFTCtWLD KUrFIslmlfu+w/pfNxR3lbal8/8oeeqS+wpzuzYTHG4mvSUDy6xUjvWM/aix47nWLDmY GXxBVPJbqlWMaU04+zYaD/mOGkaIEUke/BeGPeGGBa9fL9O10B4neLhu3qNHt09tCyGa 96Uw== X-Gm-Message-State: AOAM53216ZniVpFDazo3KfRyf6jH1A8ckaTuo0VzOAs5TQcb2sYVBak4 EKv0qQI1ACO2CHmqmcNJhlB6pw== X-Google-Smtp-Source: ABdhPJx1SHeNu3qDX2ml4vSmvFrnfK6rpiSfO2qJFMtTFjB64mkVkqqNWsmTziDB3/gbffAYXlMbog== X-Received: by 2002:a7b:c119:: with SMTP id w25mr8482662wmi.87.1620206590380; Wed, 05 May 2021 02:23:10 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 5/7] docs: mark intention to deprecate TCG tracing functionality Date: Wed, 5 May 2021 10:22:57 +0100 Message-Id: <20210505092259.8202-6-alex.bennee@linaro.org> In-Reply-To: <20210505092259.8202-1-alex.bennee@linaro.org> References: <20210505092259.8202-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: "reviewer:Incompatible changes" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , 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 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Currently attempts to add a new TCG trace events results in failures to build. Previous discussions have suggested maybe it's time to mark the feature as deprecated and push people towards using plugins. Signed-off-by: Alex Benn=C3=A9e Cc: Luis Vilanova Cc: Stefan Hajnoczi --- docs/devel/tcg-plugins.rst | 2 ++ docs/devel/tracing.rst | 7 +++++++ docs/system/deprecated.rst | 13 +++++++++++++ 3 files changed, 22 insertions(+) diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 18c6581d85..edf04e3091 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -3,6 +3,8 @@ Copyright (c) 2019, Linaro Limited Written by Emilio Cota and Alex Benn=C3=A9e =20 +.. _tcgplugin-ref: + =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D QEMU TCG Plugins =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst index ba83954899..6b0f46cd54 100644 --- a/docs/devel/tracing.rst +++ b/docs/devel/tracing.rst @@ -414,6 +414,13 @@ disabled, this check will have no performance impact. "tcg" ----- =20 +.. warning:: + The ability to add new TCG trace points relies on a having a good + understanding of the TCG internals. In the meantime TCG plugins + have been introduced which solve many of the same problems with + more of a focus on analysing guest code. See :ref:`tcgplugin-ref` + for more details. + Guest code generated by TCG can be traced by defining an event with the "t= cg" event property. Internally, this property generates two events: "_trans" to trace the event at translation time, and diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index 80cae86252..0c9d3c1e1e 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -312,6 +312,19 @@ The ``I7200`` guest CPU relies on the nanoMIPS ISA, wh= ich is deprecated (the ISA has never been upstreamed to a compiler toolchain). Therefore this CPU is also deprecated. =20 +TCG introspection features +-------------------------- + +TCG trace-events (since 6.1) +'''''''''''''''''''''''''''' + +The ability to add new TCG trace points has bit rotted and as the +feature can be replicated with TCG plugins it will be deprecated. If +any user is currently using this feature and needs help with +converting to using TCG plugins they should contact the qemu-devel +mailing list. + + Related binaries ---------------- =20 --=20 2.20.1 From nobody Tue May 7 00:21:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1620207269; cv=none; d=zohomail.com; s=zohoarc; b=eEXo2nWx5Yj4ev1jqZF8MPLzOUIn9KChZx686X++NL4iiRBvMIpOD54eEWDrS3bzQOxUPOLiN6OPHhiufSXVGWPbElrTKJLLvFb36E0oe0/1v6G9t8TUJiuIseO+x4ksRKz6kHMVIRlJ0w87UyuhdIkFZjY86Zha4dh5T5wxoX4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620207269; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+Rw6OGQrVJGw3XC/foHAisgB3VI31AwIvMNzYonwovA=; b=FyExksSpJ+jTX8R0JDokAiWfv7dbZKhIjxeOlNH9ag4dWMz4HxZH++lUcXpnUBvvHC2y5Ga8vgTdxbHF0ziIVATzCf1p8lJ98czS1uxiBI0Fey2u91CPtVUykCCVCsQYwrPHCJSMg6LXXbAvafGfXHMADKHneVlOp6oaBH05+vw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620207269201129.74548934918812; Wed, 5 May 2021 02:34:29 -0700 (PDT) Received: from localhost ([::1]:56298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDvH-0002hH-7G for importer@patchew.org; Wed, 05 May 2021 05:34:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leDka-0000wN-Hw for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:25 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:34579) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leDkQ-0005C0-TA for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:23 -0400 Received: by mail-wr1-x429.google.com with SMTP id t18so1038793wry.1 for ; Wed, 05 May 2021 02:23:14 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b10sm5999462wrr.27.2021.05.05.02.23.02 (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 5BC2A1FF92; Wed, 5 May 2021 10:23:00 +0100 (BST) 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=+Rw6OGQrVJGw3XC/foHAisgB3VI31AwIvMNzYonwovA=; b=qeP7/ybCYH1wzVDrDLRBnkTBwAV04Hs70pHEaHj7uqrFgdmecAOZZgFtVowmwGqM9P UlvWuwqkBshA89X+17IsKvfQiPJjXI4KZUl++XtkewE9VkKTe8ocmz4hRHP0mRbK7rbD Y69i+VX0scN5CUHPCa0mbRZLbv0ArjwKwu99QL9qij1fstlVr10CaUO5G68fwpAXcIsy PPwCq0JxQfshDEytFtygdMl/2pm/yrdeIaOOEX3lcq40grZWQsdnDHdtImJpafDsp3Bs T9IX02L6ZL6qcaHmqcVmF0KIPMV84RF5d61qlWWFiZ6v3/qcCaP9YDuT9rU6vuMKctoP o2Hg== 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=+Rw6OGQrVJGw3XC/foHAisgB3VI31AwIvMNzYonwovA=; b=OH60UETXE8Md1/r2KWfbBP4hRzieJVDyROIt6oThejKsjpwiXWIw+Rd3Yqcv4amdUS iEfaEOFw5rdbUUqbHeLrVGYiU/nk6cFaE7h/io9Z9Cu/1wPanYm4FSvjhhGzLb2l8Zu6 Hgu/c2P6sq/+HNQQPD5v6pafOmYyLSLhFnlE4HYp6slYPVqvVI05pJRnEEhZ6VxZ+AM9 t8O+v5CvIIKfa5j54KAaQTXwQH5jXVMcX7wUOtWILb7wiF1CIQCgKmWyH84sHAi+y8G6 e4X6O021TRg7GvX8REzyYtWWLCJ7FxXVHlk/1RPpiXDCoe/XzvJFMOSX/pShs5xTAoiF bo0g== X-Gm-Message-State: AOAM531c4Uzygn6YRklwZHzL0eW/vkJsc2eqhZqaecLMc2IRFgNCowAi Cbqfoj4IPQoF/GPLQ9EIzZ5Ziw== X-Google-Smtp-Source: ABdhPJxKBjIKFIRVICTt+T5dRPcjvNMkbMnutk59LWL9zch9eKlQOiQh/+VJ+6xRqpY4GxtgjijDgg== X-Received: by 2002:adf:8046:: with SMTP id 64mr36246315wrk.176.1620206593179; Wed, 05 May 2021 02:23:13 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 6/7] scripts/tracetool: don't barf validating TCG types Date: Wed, 5 May 2021 10:22:58 +0100 Message-Id: <20210505092259.8202-7-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.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=20Benn=C3=A9e?= , 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) TCG types will be transformed into the appropriate host types later on in the tool. For example adding the following trace point: tcg goto_ptr(TCGv_ptr ptr) "", "ptr=3D%p" would trigger: ValueError: Error at /home/alex/lsrc/qemu.git/./trace-events:149: Argumen= t type 'TCGv_ptr' is not allowed. Only standard C types and fixed size inte= ger types should be used. struct, union, and other complex pointer types sh= ould be declared as 'void *' Rather than expand ALLOWED_TYPES just directly handle TCGv types in validat= e_type. Fixes: 73ff061032 ("trace: only permit standard C types and fixed size inte= ger types") Signed-off-by: Alex Benn=C3=A9e Cc: Matheus Ferst Message-Id: <20210406165307.5993-1-alex.bennee@linaro.org> --- v2 - do workaround directly in validate_type --- scripts/tracetool/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 5bc94d95cf..ce5fd23191 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -87,10 +87,9 @@ def out(*lines, **kwargs): "ssize_t", "uintptr_t", "ptrdiff_t", - # Magic substitution is done by tracetool - "TCGv", ] =20 + def validate_type(name): bits =3D name.split(" ") for bit in bits: @@ -99,6 +98,10 @@ def validate_type(name): continue if bit =3D=3D "const": continue + # Magic substitution of TCGv types will be done later + # using tracetool.transform.TCG_2_HOST + if bit.startswith("TCGv") and bit !=3D "TCGv_vec": + continue if bit not in ALLOWED_TYPES: raise ValueError("Argument type '%s' is not allowed. " "Only standard C types and fixed size integer= " --=20 2.20.1 From nobody Tue May 7 00:21:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1620207006; cv=none; d=zohomail.com; s=zohoarc; b=Jh7iBvTvd4X42DkdWsCeffM2XkiYoRbAIfmmJNUcGL3Iq+F7MvPqEwYj4uwn9U4StTsy46gpSQ5A7cJCNjlNWlmxeBDv729SDdIXFN8qImtchO23X6rM0JPWk/qBJwkkvaBQZpr1zhKplJil6ZGmpbzEmo4wRd3wNxACbb6us0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620207006; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pzxmZD4B0lAUAH8sN7d3Ghe+Y5XcNwSkO4kOPPQi1iI=; b=BG5NRC93SAqXUV3uLJp/4sZrEUfca2eXjsod8u7Fh1r6UOL8noh1F9ms9EK/EBEtqTI9nfIPWXivXydXQWCeklBjjOTl7peE6FRHbS+rB7nDgsstUlgMfLt4phd0Hu+38Fr8xRlb5ptDG/FC5Ckl384U/YD3rF5TCu3GgIP5H9s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1620207006197543.0587700580858; Wed, 5 May 2021 02:30:06 -0700 (PDT) Received: from localhost ([::1]:44522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDr3-0006HI-77 for importer@patchew.org; Wed, 05 May 2021 05:30:05 -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) 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) 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-Google-Smtp-Source: ABdhPJwDQOPyfxu88Zpg/uD+cmrF7lOWMiDpMfZDMxMBCCR2TRDJixsoRkfUXwYzFlXy30chvV7iaA== X-Received: by 2002:a1c:6646:: with SMTP id a67mr8705560wmc.11.1620206591236; Wed, 05 May 2021 02:23:11 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::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=20Benn=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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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=C3=A9e --- tcg/tcg-op.c | 8 ++++++++ trace-events | 12 ++++++++++++ 2 files changed, 20 insertions(+) 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, unsi= gned idx) tcg_debug_assert(idx =3D=3D TB_EXIT_REQUESTED); } =20 + 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 =3D 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=3D%d", "vaddr= =3D0x%016"PRIx64" info=3D%d" =20 +# Mode: user, softmmu +# Targets: TCG(all) +tcg exit_tb(uint64_t ptr, uint64_t idx) "tb=3D0x%016"PRIx64"/%"PRId64"", "= tb=3D0x%016"PRIx64"/%"PRId64"" + +# Mode: user, softmmu +# Targets: TCG(all) +tcg goto_tb(uint64_t idx) "idx=3D%"PRId64"", "idx=3D%"PRId64"" + +# Mode: user, softmmu +# Targets: TCG(all) +tcg goto_ptr(TCGv_ptr ptr) "", "ptr=3D%p" + # include/user/syscall-trace.h =20 # @num: System call number. --=20 2.20.1