qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Mahmoud Mandour" <ma.mandourr@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Alexandre Iooss" <erdnaxe@crans.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Jason Wang" <jasowang@redhat.com>,
	"Riku Voipio" <riku.voipio@iki.fi>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>
Subject: [PATCH 2/7] gitlab: add -n option to check_units
Date: Thu, 10 Jul 2025 11:45:25 +0100	[thread overview]
Message-ID: <20250710104531.3099313-3-alex.bennee@linaro.org> (raw)
In-Reply-To: <20250710104531.3099313-1-alex.bennee@linaro.org>

Mostly a developer aid for those who want to look at the full backlog
of multiple build units.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 .gitlab-ci.d/check-units.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.d/check-units.py b/.gitlab-ci.d/check-units.py
index cdc62ae5ee..cebef0e8be 100755
--- a/.gitlab-ci.d/check-units.py
+++ b/.gitlab-ci.d/check-units.py
@@ -30,7 +30,7 @@ def extract_build_units(cc_path):
     return build_units
 
 
-def analyse_units(build_units):
+def analyse_units(build_units, top_n):
     """
     Analyse the build units and report stats and the top 10 rebuilds
     """
@@ -44,7 +44,7 @@ def analyse_units(build_units):
                                 reverse=True)
 
     print("Most rebuilt units:")
-    for unit, count in sorted_build_units[:20]:
+    for unit, count in sorted_build_units[:top_n]:
         print(f"  {unit} built {count} times")
 
     print("Least rebuilt units:")
@@ -57,12 +57,14 @@ def analyse_units(build_units):
         description="analyse number of build units in compile_commands.json")
     parser.add_argument("cc_path", type=Path, default=None,
                         help="Path to compile_commands.json")
+    parser.add_argument("-n", type=int, default=20,
+                        help="Dump the top <n> entries")
 
     args = parser.parse_args()
 
     if path.isfile(args.cc_path) and access(args.cc_path, R_OK):
         units = extract_build_units(args.cc_path)
-        analyse_units(units)
+        analyse_units(units, args.n)
         exit(0)
     else:
         print(f"{args.cc_path} doesn't exist or isn't readable")
-- 
2.47.2



  parent reply	other threads:[~2025-07-10 10:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-10 10:45 [PATCH 0/7] maintainer updates for 10.1 softfreeeze (gitlab, plugins, docs) pre-PR Alex Bennée
2025-07-10 10:45 ` [PATCH 1/7] gitlab: use argparse in check-units script Alex Bennée
2025-07-10 10:48   ` Manos Pitsidianakis
2025-07-10 10:45 ` Alex Bennée [this message]
2025-07-10 10:57   ` [PATCH 2/7] gitlab: add -n option to check_units Manos Pitsidianakis
2025-07-10 10:45 ` [PATCH 3/7] contrib/plugins/execlog: Add tab to the separator search of insn_disas Alex Bennée
2025-07-10 15:22   ` Pierrick Bouvier
2025-07-10 10:45 ` [PATCH 4/7] target/alpha: Add GDB XML feature file Alex Bennée
2025-07-10 10:45 ` [PATCH 5/7] plugins: fix inclusion of user-mode APIs Alex Bennée
2025-07-10 15:22   ` Pierrick Bouvier
2025-07-10 10:45 ` [PATCH 6/7] docs: use :kbd: role in sphinx docs Alex Bennée
2025-07-10 10:45 ` [PATCH 7/7] docs/system: clean-up formatting of virtio-net-failover Alex Bennée
2025-07-10 10:59   ` Manos Pitsidianakis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250710104531.3099313-3-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=erdnaxe@crans.org \
    --cc=jasowang@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=ma.mandourr@gmail.com \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=riku.voipio@iki.fi \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).