From nobody Tue Feb 10 02:43:05 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1766171474; cv=none; d=zohomail.com; s=zohoarc; b=mSNNP/Ni99wTeifZ41yR2jHeH2gKBM4CwpTvftVL3zI1DO/BSIifdkL+SPkMK0kGve1yw+o6jj1o5CSGwoPGRNYgBrbJv6MPvl2rPaSSWM6YD7p8VYLx7FnYX2PqNICfhTiImya5Mlst8PWuXAXxx/FbBlIErxedCVkYK6hRzS0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1766171474; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Z1Ho9A/XPHpaG24XQJMf5tV6Yy1l2byzrQqypIVDpzA=; b=TpHxTQO3mp+IDJPXWZYhL9zPLF2nhfWoMZY0CKhF0KO8YB/SrJEYz1pj+nDBo5AbSuqCb0Tfj+Yy1FN7/RMXAIDi+fbWYWqHfZVtm6IGiVP3wl8d8VPp/4Sn9rWzS1ktPHkJudIRGTJ0Xt1sJCMA1av91ddb9wmH+XUvJvOe2ms= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1766171474851243.6379336137203; Fri, 19 Dec 2025 11:11:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vWfrN-0001br-9F; Fri, 19 Dec 2025 14:09:53 -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 1vWfqX-0000ci-N6 for qemu-devel@nongnu.org; Fri, 19 Dec 2025 14:09:03 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vWfqU-0006pR-Ck for qemu-devel@nongnu.org; Fri, 19 Dec 2025 14:09:00 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-477770019e4so18527585e9.3 for ; Fri, 19 Dec 2025 11:08:57 -0800 (PST) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47be2723d19sm123428605e9.2.2025.12.19.11.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Dec 2025 11:08:53 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 518AD5FE99; Fri, 19 Dec 2025 19:08:50 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1766171337; x=1766776137; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z1Ho9A/XPHpaG24XQJMf5tV6Yy1l2byzrQqypIVDpzA=; b=G+FnhMtzS3RMtfv/TdimH1hYI4sg4UbXLJxoG60Yi7MUk07gXQKu665zMKi9PNFvlf i/VZzOsdz0T3kGa44FD8PTreMz4QCtmljC8nvjpTJWZpmpb6y/hQ70I9+yWtGMtmLheK Pwtsp3lXF4msGxl2GIgTW3qK3a2e/4BLEm5Xznw9BuZ7KD5+bQJradqm+Qd21gHLCJ61 juj2R9nArj91yb0nk9h39cGaDMWHepSrJl+eXpx5oI9/8GncUe648mBlkUkaGAERIIEs c6RaIHjSLqlxGrZPo6DMxtZD4XWXNUMa5SM0NCnYAKGEZqk5/8F0MQhTDRsLTvVpgG05 42pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766171337; x=1766776137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Z1Ho9A/XPHpaG24XQJMf5tV6Yy1l2byzrQqypIVDpzA=; b=QH00x8UDbwDstEyHtJuSc7e0jAXIezfzv0akJ9jWczalxD2rgTH35T0RlEHRFEQz4P OsYAg4A2fboevHprPrczbBaQZM2LAoUAfa48OwGYSeEGXCUct8qa11H6tEVSvZTSDHjX LtV+BYhKbkKOJ6LO+49XI6U/LXnd9aS51psVIkMRlO2Jz2P2LkY6FMQmBQTSZSSujIIq WFUWj8Y44m2Clmmd9zhx6JjrjkIaKDbmMEmlKdWAn0z16a+s968vSa+KVM9/tWE6gNBr 644aacV6SCiqXOWX7yeT5r/TgnrRMYdG7/H23EAQ/aaezBirMROPX7q9VYtecng0i8cg rq9w== X-Gm-Message-State: AOJu0YxQjNNFnPw0hYKIagQI8pppb2K5SWDZq/EM8s6nWLIp2ameUm4V rNJrjhbyQftZs7KjbkVuTmTUmxEr/YcKnyrXtVDRS8ZnAUlPwViWc7gvesLlJSy8SAg= X-Gm-Gg: AY/fxX7q6wEet3CitMT1ohy8s6Rr9pptJNcHfPaiN/VoWYaiULtapthWQdakc80ZSoF Wj5wDOE1G63tXDNQS8wuVVESzDuCargf4p8zBXCxrwglDsEPBH/oCOCiI4VCNtvfyf/NGaRflrc tgbBiPzhnEEgaOY8w7k1dzHFNfsEn/zWL4H1++XKnpKgHCsuWxYFX6CKF4Jb57zLsopbG2b7P72 wt7u5ar3cUCLGkuGJBJJ2yknnBAP1nZnGMkuCpL/YwOuM7XbH35mmOQMhVp3relPq+jfJWpuBNE xrX/eFEpilHpxzBUXvmgWesKeQ9+20mexBhzxyITsSfOiYJoyNMgz69vqb8f678pbVI/m2UTn1O nmlIKdSkNvseh4nAkyVcM1ByEmU1qXTeUfz7utCXUulLEsnt+mCBQ4zHH4GcU4WoKn+PMrSbh9c EuUYByg0V62zs= X-Google-Smtp-Source: AGHT+IEiRuseyh0saS2WdyWQSI+3lEZVjidRsb7ooPV+14p4ymxQyBFa4fsZZF3Ealju2FknUZz8Fw== X-Received: by 2002:a05:600c:1d1d:b0:477:9eb8:97d2 with SMTP id 5b1f17b1804b1-47d1953b8acmr38452675e9.8.1766171335660; Fri, 19 Dec 2025 11:08:55 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Yanan Wang , Paolo Bonzini , Alwalid Salama , qemu-arm@nongnu.org, Zhao Liu , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Riku Voipio , Marcel Apfelbaum , Peter Maydell , Mahmoud Mandour , Eduardo Habkost , Mark Burton , Laurent Vivier , Pierrick Bouvier , Alexandre Iooss , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alex Bradbury Subject: [RFC PATCH 05/12] contrib/plugins/hotblocks: Allow limit to be set as a command line argument Date: Fri, 19 Dec 2025 19:08:42 +0000 Message-ID: <20251219190849.238323-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251219190849.238323-1-alex.bennee@linaro.org> References: <20251219190849.238323-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 (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::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.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.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: pass (identity @linaro.org) X-ZM-MESSAGEID: 1766171476070158500 From: Alex Bradbury 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 Message-ID: Signed-off-by: Alex Benn=C3=A9e --- docs/about/emulation.rst | 2 ++ contrib/plugins/hotblocks.c | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/about/emulation.rst b/docs/about/emulation.rst index 543efc4d7dc..e8793b0f9ce 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 ......... diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 40d8dae1cd3..8ecf0339974 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; --=20 2.47.3