From patchwork Wed May 5 09:22:53 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: 431153 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp326773jao; Wed, 5 May 2021 02:25:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvyGagKIj5xvWdbVrcQSR0hPN3TT9ZmTNUOYsQej0wu1JXwTPmd00INrWc0fUDP2T5Gbap X-Received: by 2002:a6b:f10a:: with SMTP id e10mr621543iog.188.1620206749917; Wed, 05 May 2021 02:25:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620206749; cv=none; d=google.com; s=arc-20160816; b=JvJItc6zS046Vgj3RkE/r64fT7etFzXJrrg34lQJTX83f8GJTJRk9iq/BKTvD8hdva GmLzGZGIAxzlheoSngeVZIlCsO/xoqtmvus5CZc5p/qV2UEgvisfUplKQBIfVlZi67ZG wnYQM5J1J6jcGSM/DD/MYu+k8DvrDgsT6nQHdwUwjj7VkTWCuyIzI3L+YeWWvFRWH4Gf WD2v3zFtY0TA9oRGPI4Vskqi6X5x386tSIQDYoPxP6sgmVCoklqKOER07zed+ymi+VNk k4S4lkcokHo9u4t6a+H/y2P/9Kbc/gbR2/1eLjM9cHPFvhzo2DKLh/zTDidiw/nMPpx1 4fyg== 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=CQ8679cFYPFRKCt5xKP0d5J4rP4I/8eL7P8Ydf6Ygrc=; b=LxaO1ZbN8ysxBXK5Ts7AoM+h7Y0GkFgTB+qJjoi3QU93o1b18uukEwjMtdIKx8K3TC J7o6v7WZ83lFQn3G+lujU9OI9Lm8qZeTCBriJPM0koyJxD32ERf7cvvx4BX8cKUzM1R4 gmJ/4kAndwsTBLY/X9eqzwQCWyn/YCBfOm14RE0lRTv2bhrfFgfuIijyPJnGpM91bL/r 9lW/cV38DCPRu+FCaH11GVDIMJQ0Ywi2wgTaYGF7CwEqWODhXDx3fjpqyrVYEFd3hxZA SUqBljx8oiaNZ8vcTsw8qnAaEtp9o1V91XBgatF+9pGTPtdviMaY3sQ0Ru959K+irK/r Iphw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wIOIhpeR; 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 w26si18872871jao.65.2021.05.05.02.25.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 May 2021 02:25:49 -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=wIOIhpeR; 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]:33744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDmv-0001gj-Dw for patch@linaro.org; Wed, 05 May 2021 05:25:49 -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) 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-Received: by 2002:a1c:731a:: with SMTP id d26mr9070351wmb.36.1620206585443; Wed, 05 May 2021 02:23:05 -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) From: =?utf-8?q?Alex_Benn=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 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_Benn=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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Yonggang Luo Reorder the function symbols that consistence with qemu-plugins.h Signed-off-by: Yonggang Luo Signed-off-by: Alex Bennée Message-Id: <20210318185555.434-2-luoyonggang@gmail.com> --- plugins/qemu-plugins.symbols | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) -- 2.20.1 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; From patchwork Wed May 5 09:22:54 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: 431156 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp330281jao; Wed, 5 May 2021 02:31:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVwOBOP/BuFGCMFolC2mI7tar2fdLT7VLY8GuBjwBR3HzetF02QlmcaebGeSpJ4Hvc2CVc X-Received: by 2002:a05:620a:786:: with SMTP id 6mr22493352qka.196.1620207095106; Wed, 05 May 2021 02:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620207095; cv=none; d=google.com; s=arc-20160816; b=erXY1OVf6jq1H89zlidBVsooycqOCIHT9G3YNNVmBygTcTSiJ/1g4/pWeh4ykRiLtI gILDCKDdwsK43tobc9GhKuMUQXhvNLSpEJ4nrW+zG4/VLdkFjaFWcvZF0PLTw//46LEW TNJ0ZJxW9QdeIoKdrYGInkkdP7NsEPWeGTjW0qOsDdIwG9F2IVNw183uAnbQ2mK1e8F3 sqyDznxlMm2usDAquN/k1/6HyQOlIehuEOe1XoRm66f980hZX5kCC+sKgTnIdqece0kf 0JndtBGC7iW5JRC0q50RE504FLjf3yFBapX4/cJPTZJcHAU95ccwAIse7EmmxaXQBlEo QoVw== 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=LZutPtgpTaHldKZk578MIAzGwCkCBrqhiKcMaWSBcng=; b=RzWngB29AIcawMY8ATQkrA/tP8XA+l2CY7AJeb/nGDcB498GLfkGAB8YBG6BYI7E2X +kew+y/CCOFVQLbyuoCQxVpv3FBoPVdmAbmcec/fIRKcq5pTGTptjQRr5MhKmdqTIjR0 wALOh0yVDexQ5ruvJYj7NKSDCr3E3DwHFCvzTMoZhOxfoJxAkcQKozJqcdoIukwIrzVY VrRVIpwH/Ybtp3+Ip1gjNg/RQDyhc/5gf2Fi9UEBxSMK26egqWJk6jd5rTr5AQVwBQPx lYtiLh552kVgQpXbOLxkBhvpLdG5lGIiLZCKuvRg3+cbysvUp1mYbPZkyf2xrGRgMqxH qgSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TiFI+UyG; 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 y2si13086914qvo.82.2021.05.05.02.31.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 May 2021 02:31:35 -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=TiFI+UyG; 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]:47574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDsU-0007Vf-DI for patch@linaro.org; Wed, 05 May 2021 05:31:34 -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) 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-Received: by 2002:adf:cd8c:: with SMTP id q12mr36770964wrj.328.1620206582722; Wed, 05 May 2021 02:23:02 -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) From: =?utf-8?q?Alex_Benn=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 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_Benn=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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Yonggang Luo Signed-off-by: Yonggang Luo Signed-off-by: Alex Bennée Message-Id: <20210318185555.434-3-luoyonggang@gmail.com> --- include/qemu/qemu-plugin.h | 187 ++++++++++++++++++------------------- 1 file changed, 92 insertions(+), 95 deletions(-) -- 2.20.1 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; -/** - * 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_plugin_id_t id, typedef void (*qemu_plugin_vcpu_udata_cb_t)(unsigned int vcpu_index, void *userdata); +/** 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 = 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_index, + 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 vcpu_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); -/** 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 = 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); -/** - * 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_plugin_insn *insn); */ void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn); -/** - * 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 qemu_plugin_hwaddr *haddr); */ const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *h); -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 *ptr, uint64_t imm); - - -typedef void -(*qemu_plugin_vcpu_syscall_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_index, - 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); -typedef void -(*qemu_plugin_vcpu_syscall_ret_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_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); From patchwork Wed May 5 09:22:55 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: 431152 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp326504jao; Wed, 5 May 2021 02:25:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNQzXkk/5iK4LZEEhu++ryppVAEyUuiSCLU0vHNjrOeSJgBNnkRK+HPXC5MUxUMmtUbutQ X-Received: by 2002:a02:7348:: with SMTP id a8mr26838075jae.116.1620206723066; Wed, 05 May 2021 02:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620206723; cv=none; d=google.com; s=arc-20160816; b=BRXj/5fpImuC6p7qyoSPNpG7+m2kDQ031sMbs1endChabdtij8NswzOZ01yBeiICLq 0Xz9QV9/UdUBmzqgAYLI3R9SaAtuB3PbwLx2lJtIxNZMimHDbqJRiKjlSQJyOaM3pzfR NvRB+B/dmK2Tr8uOmiJRsnLCXCPkujPZbwOLyZ4lbvUgTCk7Z8ie9RV0XMxV27byktff TWy/py8CLpoDwz92KfnXeDGSp+9yuRRomUmRkiw6sTWFRoq7ufWX2UJeKG0C4eoYxlkD 45Tk9Rj7poq3c361ChEeIUe/68+tMrfBdlzMC/C8bCz7mMDtqFtQcPY1ETYqvgAffttz n0IA== 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=ydPT0ztE2Bw0rnFw4k7WbHBh286HstrN5c/fEJLUTGA=; b=Zg0JDpXuAy1BWkMozkV/s6Kdu4fFt/PExyijvTXwc9R2HCagIdNBnBk+T9AKKBkak6 RJLnY4Rtb/t6d/AP0VtrZsRy7U7nH/QVyqFciNxVg0M8AXoA2TSI9PeKkefMyYb/ONFX lxnUUFbov7NfnHBK7twF2yzy/q+ldoGe43vWWgbtib3adc2HWRJgkxQbutN84ZzZ7iQP gn/EUx087QG6UTpiIOGVQ0cgyC+B2wQiHMA620+uot6lAX1rQkystfoj8m+YsAfHKw7E /kxS4SJhzt4A3MKHN6aAu9MFsletDmDhNLgfTZIqKaeqPCTnQO7fo+ncULhAgYK8AA36 omHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lw51i2KQ; 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 u12si21404877ilm.67.2021.05.05.02.25.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 May 2021 02:25:23 -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=lw51i2KQ; 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]:60590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDmU-00010R-HG for patch@linaro.org; Wed, 05 May 2021 05:25:22 -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) 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-Received: by 2002:a1c:4302:: with SMTP id q2mr8887749wma.1.1620206581890; Wed, 05 May 2021 02:23:01 -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) From: =?utf-8?q?Alex_Benn=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 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_Benn=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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée Message-Id: <20210422005043.3569-2-ma.mandourr@gmail.com> --- contrib/plugins/hotblocks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.20.1 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); } - g_list_free(it); + g_list_free_full(it, g_free); g_mutex_unlock(&lock); } + g_hash_table_destroy(hotblocks); qemu_plugin_outs(report->str); } From patchwork Wed May 5 09:22:56 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: 431151 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp326341jao; Wed, 5 May 2021 02:25:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzruZd9lDkdopXrhw9EHjG+bGTU1k9ILFOOWRfR8x0Ym2Gawxc8y6Lu59X8G2VzOraLsJVO X-Received: by 2002:ad4:450a:: with SMTP id k10mr29875517qvu.58.1620206707093; Wed, 05 May 2021 02:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620206707; cv=none; d=google.com; s=arc-20160816; b=YXN3mKJvzMLtaGpYLFBgVAMEXZTdesJv+DVbHCcfulSv1wTHZSY24apJuQJFgptcOb rtLmEHKiIRjEyvkCH4qfnPxSuSwEDTachaq0iMaFMqkort2+8WwWOh6uNSqBh2J7nOo8 TQbrRVIjtQ52qQ7pz6DZJaFnQ695sQo3Xlm4tS3WV1+Pzwx8NOLyZZynnn4l+BzmSBc5 fbi8/bKHnHl/m6oZZFd+zOhlG85FAdI9KvEwaPkC//A7l9RfSBBf7YpC8JSifoYGBTiy JwxICHKYpuNm/2ydgoW2zMR3CTb5n+fauhmmssS6GoxKy6wiWm61XLIELvT+x6FQqOvx koMQ== 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=XOXXbFmKIzYlDZ6gGIuWNND3ouYEXltv7aZzivzNlxo=; b=WjRgxS6lnS69ULLRkV4PFR2jvrOybVT5AOMO1DUUup1TcDs+lI0sqmQ25MISfnTswj gGtKbLKEwhZ0rAQDpdVAZmJ6OYeFhnmevPB4Bpm95jahrzKs3itkfEXgi+CDYuVDtrL5 SbS/693neenL0c5ROeHRaGDFIyK8EqVZ8TXpLlgLj2eROc/C92HMYTjokhIdjMhIvCmh uh0zG6iTMiusWRZ0dGPGX7VTzzQJo4/9nZxaWr9riownUz4hTz/Xchfrc7kc9zEZgvZM fWDuyddbw/eu6BtlQPTwYycGhM0AmsFnH/Vw3Fnoh+GG75mitZgiwWqvkzS6v/GvpFFd Npdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lZQaQ31D; 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 c14si2529969qvc.96.2021.05.05.02.25.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 May 2021 02:25:07 -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=lZQaQ31D; 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]:33416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDmE-0001YB-FZ for patch@linaro.org; Wed, 05 May 2021 05:25:06 -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) 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-Received: by 2002:a7b:c24a:: with SMTP id b10mr8896908wmj.157.1620206587379; Wed, 05 May 2021 02:23:07 -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) From: =?utf-8?q?Alex_Benn=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 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_Benn=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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée Message-Id: <20210422005043.3569-3-ma.mandourr@gmail.com> --- contrib/plugins/hotpages.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.20.1 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); } + g_hash_table_destroy(pages); qemu_plugin_outs(report->str); } static void plugin_init(void) { page_mask = (page_size - 1); - pages = g_hash_table_new(NULL, g_direct_equal); + pages = g_hash_table_new_full(NULL, g_direct_equal, NULL, g_free); } static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo, From patchwork Wed May 5 09:22:58 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: 431157 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp331482jao; Wed, 5 May 2021 02:33:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIs1+yescCtnH47A6XmYuLqGOxgIqT7kuOc2SQbz8Rnxzl3M33PDLGc+kS4Ocfnj3LN8zw X-Received: by 2002:a6b:d918:: with SMTP id r24mr13560662ioc.25.1620207206662; Wed, 05 May 2021 02:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620207206; cv=none; d=google.com; s=arc-20160816; b=RmX0emaiUeDVLRLdroi4GzEpriY0fRHEkDebiY29L5lszLJQGlXlD2PqcOTiXc5N5F ti3J+55HNZ6H4qYAiyBM6F089Syn/0UNEZA6urk2vuW4GRgG99sCrrLwPKB5QDL2IsEv kCuOmFGu6mTyAWPWXttlM+JGXkLWsTXa17O+FHOGT22Oq/75Wgl5xt6tBUU4vO9cUXhN SdLDjTOnhni7mv4GB9MbzdVK70Dw8KXY3M1D/CpvETDfmxPEvSPAIbpi6sODlI9ix3XD PEei3KAFDqnXYJKZPKLznaE+XXAkUc390KpgVpixycC68z5QJ+q6/KXpS1puWU4YCR+c iuvw== 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=+Rw6OGQrVJGw3XC/foHAisgB3VI31AwIvMNzYonwovA=; b=oI3r+FYkuucW+bFIASkrq5n2mSfnYpFJTCXNhdZjnZaduHE9nN7ZCWtAVGCVe8OOHt oMr5E0Fc2Uotr09vUAd4D83xnvBTBkiIz6dKta9dAkNOJYmwEJR2r3jwrd2wcVUGR4dW AWO3nCYC6JrZvPRI+KIOikB0+9hnAMBiD0jEI6JjptruUxmhjsNQLVkA9YvBLggWy3P9 zOLWqqEuONWa5LQD83Ke8b8994HE2MUWFldRL210s/pB1A8Z+C/MH1cV6PzqMBhBTSwT YJ7YdYLC9hq6sql7r3K9/YfZzaQUce4+ovUkNg9Tc426TlJ+Lrc2WfmOacnGYCKUgxCd XzJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="qeP7/ybC"; 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 b14si22030445ilv.52.2021.05.05.02.33.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 May 2021 02:33:26 -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="qeP7/ybC"; 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]:54084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDuI-0001my-6B for patch@linaro.org; Wed, 05 May 2021 05:33:26 -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) 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-Received: by 2002:adf:8046:: with SMTP id 64mr36246315wrk.176.1620206593179; Wed, 05 May 2021 02:23:13 -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) From: =?utf-8?q?Alex_Benn=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 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_Benn=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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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=%p" would trigger: ValueError: Error at /home/alex/lsrc/qemu.git/./trace-events:149: Argument type 'TCGv_ptr' is not allowed. Only standard C types and fixed size integer types should be used. struct, union, and other complex pointer types should be declared as 'void *' Rather than expand ALLOWED_TYPES just directly handle TCGv types in validate_type. Fixes: 73ff061032 ("trace: only permit standard C types and fixed size integer types") Signed-off-by: Alex Bennée 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(-) -- 2.20.1 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", ] + def validate_type(name): bits = name.split(" ") for bit in bits: @@ -99,6 +98,10 @@ def validate_type(name): continue if bit == "const": continue + # Magic substitution of TCGv types will be done later + # using tracetool.transform.TCG_2_HOST + if bit.startswith("TCGv") and bit != "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 " 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.