From nobody Sun Dec 14 06:42:22 2025 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=igalia.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764716874889283.09459147667735; Tue, 2 Dec 2025 15:07:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQZSs-0005OJ-RG; Tue, 02 Dec 2025 18:07:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vQZSp-0005Nq-4E for qemu-devel@nongnu.org; Tue, 02 Dec 2025 18:07:19 -0500 Received: from fanzine2.igalia.com ([213.97.179.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vQZSn-0005ZJ-Bj for qemu-devel@nongnu.org; Tue, 02 Dec 2025 18:07:18 -0500 Received: from 82-69-92-151.dsl.in-addr.zen.co.uk ([82.69.92.151] helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1vQZSk-0082ga-Ql; Wed, 03 Dec 2025 00:07:14 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=2cyWs0qE5w0ZzDEHqyw5CimIHY/5aB/ez5MabYTVPQw=; b=n7HiowRrquf2/p7yLOCsKFw1Og /wRcCla+sPrDWC1ashgM15ZG0mU+85C5oEGW7hUKf5WCPmKQO1WZ0Dh/UNZDOVnaMGZFed847qPg4 YSRcC6zRiaOtG+jx+SzicZqCtt3QWHJ2SaklJW0S+00FVvouQ1lkGD9VU6ISqPecOLsNJN4ehXaTz aFa5uHpfoQZ93ZBEfc6SCt00S3Nx8m1JvpA+dxu/yP2ej8MkLyuvVkDx0KLfrPyac7cT8kY5yAHrV BioOk+DR6I7VVw24P4M8z2hDuMVOLWTIUFWFhhyX7YH0XGRhcsU9XKCIU8YOUAfb0UGokxGC0qD2h PKN8UHgA==; From: Alex Bradbury To: qemu-devel@nongnu.org Cc: Alex Bradbury , alex.bennee@linaro.org, erdnaxe@crans.org, ma.mandourr@gmail.com, pierrick.bouvier@linaro.org, Manos Pitsidianakis Subject: [PATCH v2 1/5] contrib/plugins/hotblocks: Correctly free sorted counts list Date: Tue, 2 Dec 2025 23:05:54 +0000 Message-ID: <0529ab0212aae1e4a5ff3c287045acc0731e5d01.1764716538.git.asb@igalia.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 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=213.97.179.56; envelope-from=asb@igalia.com; helo=fanzine2.igalia.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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1764716881835019200 Content-Type: text/plain; charset="utf-8" g_list_free should be passed the head of the list. Signed-off-by: Alex Bradbury Reviewed-by: Manos Pitsidianakis Reviewed-by: Pierrick Bouvier Reviewed-by tags to the patches, which all received review. --- contrib/plugins/hotblocks.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 98404b6885..d3dd23ed9f 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -73,15 +73,16 @@ static void exec_count_free(gpointer key, gpointer valu= e, gpointer user_data) static void plugin_exit(qemu_plugin_id_t id, void *p) { g_autoptr(GString) report =3D g_string_new("collected "); - GList *counts, *it; + GList *counts, *sorted_counts, *it; int i; =20 g_string_append_printf(report, "%d entries in the hash table\n", g_hash_table_size(hotblocks)); counts =3D g_hash_table_get_values(hotblocks); - it =3D g_list_sort_with_data(counts, cmp_exec_count, NULL); + sorted_counts =3D g_list_sort_with_data(counts, cmp_exec_count, NULL); =20 - if (it) { + if (sorted_counts) { + it =3D sorted_counts; g_string_append_printf(report, "pc, tcount, icount, ecount\n"); =20 for (i =3D 0; i < limit && it->next; i++, it =3D it->next) { @@ -94,7 +95,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) qemu_plugin_scoreboard_u64(rec->exec_count))); } =20 - g_list_free(it); + g_list_free(sorted_counts); } =20 qemu_plugin_outs(report->str); --=20 2.52.0 From nobody Sun Dec 14 06:42:22 2025 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=igalia.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764716875168543.3034514012595; Tue, 2 Dec 2025 15:07:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQZSu-0005P5-OH; Tue, 02 Dec 2025 18:07:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vQZSs-0005Og-V5 for qemu-devel@nongnu.org; Tue, 02 Dec 2025 18:07:22 -0500 Received: from fanzine2.igalia.com ([213.97.179.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vQZSq-0005Za-Bx for qemu-devel@nongnu.org; Tue, 02 Dec 2025 18:07:21 -0500 Received: from 82-69-92-151.dsl.in-addr.zen.co.uk ([82.69.92.151] helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1vQZSo-0082ga-OY; Wed, 03 Dec 2025 00:07:18 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=CN+1UZVLa45qQRicW1aM6nWsTAgOWP7zCStmqGa6D9Q=; b=hv4qrqWmSWtlXmKLYS0JfS2YMz tHuScacbRIOVNrepM1wVOPCUoLoe2ML+t0iluqz+gGpxfoc/efQlE1PeraP/kTzvYBaouFO9kcKlE WF67W0cLiU60J/TqRcKfAzJCiAGCEJ3OPI8hKPLQw15/l3aHiXY4pFLm+9GlLNjVKv7S7cYCIGSbv 5Tsup9L7D/MDinC8QZGWe8pV/+7SQAHXPSKi6Vu0StfG+4ISUWi1PafLpivMytThSCAogrcIDvEzi Oc7Lbd1okdOAev+slnktnw5K8zzovX5/T7ErIWh8YAFgzUyYx2lfTLQdeRRazEMu7KWLLVHCktK2n I4L4EKIg==; From: Alex Bradbury To: qemu-devel@nongnu.org Cc: Alex Bradbury , alex.bennee@linaro.org, erdnaxe@crans.org, ma.mandourr@gmail.com, pierrick.bouvier@linaro.org Subject: [PATCH v2 2/5] contrib/plugins/hotblocks: Fix off by one error in iteration of sorted blocks Date: Tue, 2 Dec 2025 23:05:55 +0000 Message-ID: <2e1c404fd21d064610391ebb2ffe24d0c536f8dd.1764716538.git.asb@igalia.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 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=213.97.179.56; envelope-from=asb@igalia.com; helo=fanzine2.igalia.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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1764716882526019200 Content-Type: text/plain; charset="utf-8" The logic to iterate over the hottest blocks will never reach the last item in the list, as it checks `it->next !=3D NULL` before entering the loop. It's hard to trigger this off-by-one error with the default limit=3D20, but it is a bug and is problematic if that default is changed to something larger. Signed-off-by: Alex Bradbury Reviewed-by: Pierrick Bouvier Reviewed-by tags to the patches, which all received review. --- contrib/plugins/hotblocks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index d3dd23ed9f..cf4d6b8c36 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -82,10 +82,9 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) sorted_counts =3D g_list_sort_with_data(counts, cmp_exec_count, NULL); =20 if (sorted_counts) { - it =3D sorted_counts; g_string_append_printf(report, "pc, tcount, icount, ecount\n"); =20 - for (i =3D 0; i < limit && it->next; i++, it =3D it->next) { + for (i =3D 0, it =3D sorted_counts; i < limit && it; i++, it =3D i= t->next) { ExecCount *rec =3D (ExecCount *) it->data; g_string_append_printf( report, "0x%016"PRIx64", %d, %ld, %"PRId64"\n", --=20 2.52.0 From nobody Sun Dec 14 06:42:22 2025 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=igalia.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764716895410355.63650535956003; Tue, 2 Dec 2025 15:08:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQZT0-0005Ps-AL; Tue, 02 Dec 2025 18:07:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vQZSu-0005PC-S4 for qemu-devel@nongnu.org; Tue, 02 Dec 2025 18:07:24 -0500 Received: from fanzine2.igalia.com ([213.97.179.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vQZSs-0005Zt-Nj for qemu-devel@nongnu.org; Tue, 02 Dec 2025 18:07:23 -0500 Received: from 82-69-92-151.dsl.in-addr.zen.co.uk ([82.69.92.151] helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1vQZSq-0082ga-Mr; Wed, 03 Dec 2025 00:07:20 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=UVSDrQj2EE2Xom2fSCqutr2x2fz+iiadtu9ED7/RGkM=; b=rfq9SuMUSdxQ4bVfme2QD96TpV mKOT5okhR7kww8QCkQ0CHqwkMpvuTxAINoYIt7mF2FBmYz9w7as8oqpuHE66iibxxiBZxvPa0LHeN LwAEeh730DeDWY5rrFeYQ+nvnYJlEprvGq5xfEwOyjza+HUxosjVCK/2urIHgo0PqvVerVZlz1j/O Ocy70BHRtDXmnyJfka0DOp2LFfCrXE+QbtDrLh+M/lffyBtSJSNhrAJezeHxVjSdqDMS60kqIbxrx 5FF6Gq+1AqUPMavkA8VV6NxM+1bxMfF9Z+EhvkJ2md3ZJpT4AVmKsdcTUiWW2Pv/ABG04FRrv0EEC EufRR+jg==; From: Alex Bradbury To: qemu-devel@nongnu.org Cc: Alex Bradbury , alex.bennee@linaro.org, erdnaxe@crans.org, ma.mandourr@gmail.com, pierrick.bouvier@linaro.org, Manos Pitsidianakis Subject: [PATCH v2 3/5] contrib/plugins/hotblocks: Print uint64_t with PRIu64 rather than PRId64 Date: Tue, 2 Dec 2025 23:05:56 +0000 Message-ID: <46f83ac83c6cabace91b9be85da2547ff7b08204.1764716538.git.asb@igalia.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 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=213.97.179.56; envelope-from=asb@igalia.com; helo=fanzine2.igalia.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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1764716896300019200 Content-Type: text/plain; charset="utf-8" qemu_plugin_u64_sum returns a uint64_t, so PRIu64 is the correct format specifier. Signed-off-by: Alex Bradbury Reviewed-by: Manos Pitsidianakis Reviewed-by: Pierrick Bouvier Reviewed-by tags to the patches, which all received review. --- contrib/plugins/hotblocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index cf4d6b8c36..40d8dae1cd 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -87,7 +87,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) for (i =3D 0, it =3D sorted_counts; i < limit && it; i++, it =3D i= t->next) { ExecCount *rec =3D (ExecCount *) it->data; g_string_append_printf( - report, "0x%016"PRIx64", %d, %ld, %"PRId64"\n", + report, "0x%016"PRIx64", %d, %ld, %"PRIu64"\n", rec->start_addr, rec->trans_count, rec->insns, qemu_plugin_u64_sum( --=20 2.52.0 From nobody Sun Dec 14 06:42:22 2025 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=igalia.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764716886264368.394768579637; Tue, 2 Dec 2025 15:08:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQZT3-0005Qw-R6; Tue, 02 Dec 2025 18:07:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vQZSw-0005Pi-OT for qemu-devel@nongnu.org; Tue, 02 Dec 2025 18:07:26 -0500 Received: from fanzine2.igalia.com ([213.97.179.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vQZSu-0005a2-Iz for qemu-devel@nongnu.org; Tue, 02 Dec 2025 18:07:25 -0500 Received: from 82-69-92-151.dsl.in-addr.zen.co.uk ([82.69.92.151] helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1vQZSs-0082ga-55; Wed, 03 Dec 2025 00:07:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=lqiYRejEYBLv6Tq9eu8J7y3F8sRHZgkSQrLLqz3fkRQ=; b=JdKCpWw9HW1pA34H/ayx1HwE0V Psxf/PYJZ6/a6waHF1EwBLURnZJotLo6bWQr6hsakHUTfW3+m6ez11hhjjP8iFb1LhVlgvac+d1Oa UC9hxdguQDR5X5Mi3bp5AB75ecfFPVYCwm0oV6BsOk0h7A+wMiTCisZ/qI/0yeqcpQpvRHjZ3OkqG wMY/a1AktwCYD6MD0XN2WTTN2gVUeomIpAw6ORUsD32NWUKTMcwgFEZEqIQidWS9Pc3/eBQcJ5fbA uGgECNXOFNg07Xlbi8YAbRayXaF0HiPYjdhEeRzFvJBdymWpA0/PCMQAS5pNCkDEZDt3j4Xv3gxqs YEPS6tvw==; From: Alex Bradbury To: qemu-devel@nongnu.org Cc: Alex Bradbury , alex.bennee@linaro.org, erdnaxe@crans.org, ma.mandourr@gmail.com, pierrick.bouvier@linaro.org Subject: [PATCH v2 4/5] docs/about/emulation: Add documentation for hotblocks plugin arguments Date: Tue, 2 Dec 2025 23:05:57 +0000 Message-ID: <60f1ad20663f7e5c6cb00dd83fe0f1f5aa6ca4de.1764716538.git.asb@igalia.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 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=213.97.179.56; envelope-from=asb@igalia.com; helo=fanzine2.igalia.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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1764716888511019200 Content-Type: text/plain; charset="utf-8" Currently just 'inline'. Signed-off-by: Alex Bradbury Reviewed-by: Pierrick Bouvier Reviewed-by tags to the patches, which all received review. --- docs/about/emulation.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/about/emulation.rst b/docs/about/emulation.rst index 4a7d1f4178..543efc4d7d 100644 --- a/docs/about/emulation.rst +++ b/docs/about/emulation.rst @@ -463,6 +463,16 @@ Example:: 0x000000004002b0, 1, 4, 66087 ... =20 +Behaviour can be tweaked with the following arguments: + +.. list-table:: Hot Blocks plugin arguments + :widths: 20 80 + :header-rows: 1 + + * - Option + - Description + * - inline=3Dtrue|false + - Use faster inline addition of a single counter. =20 Hot Pages ......... --=20 2.52.0 From nobody Sun Dec 14 06:42:22 2025 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=igalia.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764716888777537.2968002736519; Tue, 2 Dec 2025 15:08:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQZT5-0005RV-S8; Tue, 02 Dec 2025 18:07:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vQZSy-0005Q8-Iu for qemu-devel@nongnu.org; Tue, 02 Dec 2025 18:07:30 -0500 Received: from fanzine2.igalia.com ([213.97.179.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vQZSw-0005aE-Ac for qemu-devel@nongnu.org; Tue, 02 Dec 2025 18:07:27 -0500 Received: from 82-69-92-151.dsl.in-addr.zen.co.uk ([82.69.92.151] helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1vQZSt-0082ga-KD; Wed, 03 Dec 2025 00:07:23 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QmTQx7yfPGhmuO07X/peGrpsG1Xz1dTipb7VhMHYbcw=; b=o+3JbMXj56FvJ84n72VDRgldH4 k89NFG8ZfPN1qDzy42nHnP+bidZd6GBgnuavq4xCFz9bsQ2D/YronBCQpCmqvsHvSVZDcQb+ue2x1 zCeHV5OdUI4gZdSAn9U1VARu6mHmwEekPQAjVzHdHU1QNnnY8Q6caMcCykxRbRMkwNSN8jmi0PBdr SF2xwtawayDnNggAtkV4bcb4RdfIqbzAg/FYB/0HoF4MSLhiMZL8PMgcoR6hfsYmpA1POHBQkvMqb +T28envGnJJQvf3HEvPKpOKmW0w7/IXQF5KUKCEFlg2CvnKEda9Z6bU1CDOSPYTqKYrw1THzABI9I voSCo5yg==; From: Alex Bradbury To: qemu-devel@nongnu.org Cc: Alex Bradbury , alex.bennee@linaro.org, erdnaxe@crans.org, ma.mandourr@gmail.com, pierrick.bouvier@linaro.org Subject: [PATCH v2 5/5] contrib/plugins/hotblocks: Allow limit to be set as a command line argument Date: Tue, 2 Dec 2025 23:05:58 +0000 Message-ID: X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 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=213.97.179.56; envelope-from=asb@igalia.com; helo=fanzine2.igalia.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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1764716892530019200 Content-Type: text/plain; charset="utf-8" Also add documentation for this argument. This allows the default of 20 to be overridden, and is helpful for using the hotblocks plugin for analysis scripts that require collecting data on a larger number of blocks (e.g. setting limit=3D0 to dump information on all blocks). Signed-off-by: Alex Bradbury Reviewed-by: Pierrick Bouvier Reviewed-by tags to the patches, which all received review. --- contrib/plugins/hotblocks.c | 10 +++++++++- docs/about/emulation.rst | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 40d8dae1cd..8ecf033997 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -84,7 +84,8 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) if (sorted_counts) { g_string_append_printf(report, "pc, tcount, icount, ecount\n"); =20 - for (i =3D 0, it =3D sorted_counts; i < limit && it; i++, it =3D i= t->next) { + for (i =3D 0, it =3D sorted_counts; (limit =3D=3D 0 || i < limit) = && it; + i++, it =3D it->next) { ExecCount *rec =3D (ExecCount *) it->data; g_string_append_printf( report, "0x%016"PRIx64", %d, %ld, %"PRIu64"\n", @@ -170,6 +171,13 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qem= u_info_t *info, fprintf(stderr, "boolean argument parsing failed: %s\n", o= pt); return -1; } + } else if (g_strcmp0(tokens[0], "limit") =3D=3D 0) { + char *endptr =3D NULL; + limit =3D g_ascii_strtoull(tokens[1], &endptr, 10); + if (endptr =3D=3D tokens[1] || *endptr !=3D '\0') { + fprintf(stderr, "unsigned integer parsing failed: %s\n", o= pt); + return -1; + } } else { fprintf(stderr, "option parsing failed: %s\n", opt); return -1; diff --git a/docs/about/emulation.rst b/docs/about/emulation.rst index 543efc4d7d..e8793b0f9c 100644 --- a/docs/about/emulation.rst +++ b/docs/about/emulation.rst @@ -473,6 +473,8 @@ Behaviour can be tweaked with the following arguments: - Description * - inline=3Dtrue|false - Use faster inline addition of a single counter. + * - limit=3DN + - The number of blocks to be printed. (Default: N =3D 20, use 0 for no= limit). =20 Hot Pages ......... --=20 2.52.0