Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4B069E66884 for ; Fri, 19 Dec 2025 19:10:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vWfqs-0000iz-1F; Fri, 19 Dec 2025 14:09: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 1vWfqV-0000aR-Iu for qemu-arm@nongnu.org; Fri, 19 Dec 2025 14:09:01 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vWfqT-0006op-8g for qemu-arm@nongnu.org; Fri, 19 Dec 2025 14:08:59 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4779aa4f928so20098165e9.1 for ; Fri, 19 Dec 2025 11:08:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1766171336; x=1766776136; 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=ux7kVWPeqmtcqvBFWd5xPGxBWI980qM/I/ICO55bI8Ni7yBoOZkuU9rwhvyEj7I5zI mqkcm7rg15DiJtWxYbqF1mYvKvhVteEEvjFLkTU9hhkSvQHFPzcn3FIZ+qkxDqO/69Kq iMU5MDD1CKSYvZn2VQzW9gy+65Qx4SwRc7cDl6uwX0USkX/mnpK51Oa2FgFOQ7sbOLo1 C29LnSptdEU68z97zcXMpy8ENIaVFQUD6nQtWZ9yVJjxF5O19Fc/4vfL22cdsE1iVkIe 3GH33NGWrUauKCNcC3IkoNFnG02wz3ar4c00usO9aBm8s3tg/JAr59B7gMo98S9/+dLc qNzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766171336; x=1766776136; 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=gqxgkzhu4KsyLGgU/rxnYbuh3WZYDUgzQs03X0BxD1+KmDTlGeIUZyojbV2I7Dtlyx PPEgee1IFvlwwYLNrv6P/OROQjFeVM9EvFNP25kf0NNcvIi50hP67xq39A8Tdhd54g3F wybi35XC3o61PQ0nUjrFRRnsMky6UrdmdOHp92RA5u3rIDiffPBDbOpvX1OWzSeqGNQM 7RDL3Z/8MZoeCNp152zuQa+gbkec1DNW3m6vtWxF4Zxd/V4+wa1qwG6wAU4MuqHik0lQ mXTwkphHKP/fxRKFrszx9ChsMSTKoZXJ3r8gm5CO7TXijM5lop/8lPQcmnrSBqrxyaCq 79Dw== X-Forwarded-Encrypted: i=1; AJvYcCVFzKSK0MT5krJNT0QiRaS48mIMgWREENWQW2k5lElzWUFKugBeTF1/rCGZnbRGozviM4YqR8623g==@nongnu.org X-Gm-Message-State: AOJu0Yzr+QC3E+EliNQRjRGPb6jWgkfmvgfOLGd8Y7qdQwZctlm2FVa2 Gi1Pv8DZQQclVPTcI+p5YqRfKHeB0lTGnm49prl/6Fs2FOT82ezh4kCEQcu9sNv5YGw= X-Gm-Gg: AY/fxX7fbQTIApbAyDbPR6Poamha1tJeuAnz3VkLuGEMYcQoMkDxKyAJ07NOoW+62DU O/6tn08WXdoRyRWi4W5UyksEkTgsL64t0JxBIndwI2VlWMmo2pxCgrrY4vUBwCYG8lCN6qKL0jB KN45ReuD50uiwgG+ClUEpbDXomU6kM8Nbw8Qf4pHMtcxULdjH86j8jk54Kx5o9z7fkzpKcq8+Se aTZDjckjFP3i+2+d+7zQDQ8tPr4blodUH3IWy7bWEZ4yn/tlOVpIjMe0zYXdHTEPjDuOHlPlUV+ 3C89J1AKOpacj6ke1nd7QwOy2XqbdhOP9/LgvcWYYx7FAFrY3y4fUWwwNuARAqG/BRHmaNVSMoF Ncx8wD9zokr7mtDuvggecDqrlrofylvrQNx/1ruWlb1pgRWjB//wpHOv7LhLTDNQfBaGbeHkRU8 FPuqGIZtVQjlw= 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) 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) 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: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.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-arm@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-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org 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=0 to dump information on all blocks). Signed-off-by: Alex Bradbury Reviewed-by: Pierrick Bouvier Message-ID: Signed-off-by: Alex Bennée --- 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=true|false - Use faster inline addition of a single counter. + * - limit=N + - The number of blocks to be printed. (Default: N = 20, use 0 for no limit). 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"); - for (i = 0, it = sorted_counts; i < limit && it; i++, it = it->next) { + for (i = 0, it = sorted_counts; (limit == 0 || i < limit) && it; + i++, it = it->next) { ExecCount *rec = (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 qemu_info_t *info, fprintf(stderr, "boolean argument parsing failed: %s\n", opt); return -1; } + } else if (g_strcmp0(tokens[0], "limit") == 0) { + char *endptr = NULL; + limit = g_ascii_strtoull(tokens[1], &endptr, 10); + if (endptr == tokens[1] || *endptr != '\0') { + fprintf(stderr, "unsigned integer parsing failed: %s\n", opt); + return -1; + } } else { fprintf(stderr, "option parsing failed: %s\n", opt); return -1; -- 2.47.3