From: Breno Leitao <leitao@debian.org>
To: tj@kernel.org, jiangshanlai@gmail.com
Cc: linux-kernel@vger.kernel.org, Breno Leitao <leitao@debian.org>,
kernel-team@meta.com
Subject: [PATCH 2/3] tools/workqueue/wq_dump.py: fix column alignment in node_nr/max_active section
Date: Sat, 07 Mar 2026 09:47:20 -0800 [thread overview]
Message-ID: <20260307-wqdump-v1-2-8663563c234e@debian.org> (raw)
In-Reply-To: <20260307-wqdump-v1-0-8663563c234e@debian.org>
On larger machines with many CPUs, max_active values such as 2048
exceed the hardcoded minimum field width of 3 characters, causing the
header and data columns to misalign.
Widen the format specifiers to accommodate 4-digit values and
right-align each nr/max as a single string to keep the output compact.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
tools/workqueue/wq_dump.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/workqueue/wq_dump.py b/tools/workqueue/wq_dump.py
index 2079e98f77e4e..bddfeb9fc2a8e 100644
--- a/tools/workqueue/wq_dump.py
+++ b/tools/workqueue/wq_dump.py
@@ -227,15 +227,15 @@ if 'node_to_cpumask_map' in prog:
print(f'NODE[{node:02}]={cpumask_str(node_to_cpumask_map[node])}')
print('')
- print(f'[{"workqueue":^{WQ_NAME_LEN-1}} min max', end='')
+ print(f'[{"workqueue":^{WQ_NAME_LEN-1}} {"min":>4} {"max":>4}', end='')
first = True
for node in for_each_node():
if first:
- print(f' NODE {node}', end='')
+ print(f' {"NODE " + str(node):>8}', end='')
first = False
else:
- print(f' {node:7}', end='')
- print(f' {"dfl":>7} ]')
+ print(f' {node:>9}', end='')
+ print(f' {"dfl":>9} ]')
print('')
for wq in list_for_each_entry('struct workqueue_struct', workqueues.address_of_(), 'list'):
@@ -243,11 +243,11 @@ if 'node_to_cpumask_map' in prog:
continue
print(f'{wq.name.string_().decode():{WQ_NAME_LEN}} ', end='')
- print(f'{wq.min_active.value_():3} {wq.max_active.value_():3}', end='')
+ print(f'{wq.min_active.value_():4} {wq.max_active.value_():4}', end='')
for node in for_each_node():
nna = wq.node_nr_active[node]
- print(f' {nna.nr.counter.value_():3}/{nna.max.value_():3}', end='')
+ print(f' {f"{nna.nr.counter.value_()}/{nna.max.value_()}":>9}', end='')
nna = wq.node_nr_active[nr_node_ids]
- print(f' {nna.nr.counter.value_():3}/{nna.max.value_():3}')
+ print(f' {f"{nna.nr.counter.value_()}/{nna.max.value_()}":>9}')
else:
printf(f'node_to_cpumask_map not present, is NUMA enabled?')
--
2.47.3
next prev parent reply other threads:[~2026-03-07 17:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-07 17:47 [PATCH 0/3] workqueue: Fix table in wq_dump.py for large number of workqueues Breno Leitao
2026-03-07 17:47 ` [PATCH 1/3] tools/workqueue/wq_dump.py: remove backslash separator from node_nr/max_active header Breno Leitao
2026-03-07 17:47 ` Breno Leitao [this message]
2026-03-07 17:47 ` [PATCH 3/3] tools/workqueue/wq_dump.py: add NODE prefix to all node columns Breno Leitao
2026-03-07 18:17 ` [PATCH 0/3] workqueue: Fix table in wq_dump.py for large number of workqueues Tejun Heo
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=20260307-wqdump-v1-2-8663563c234e@debian.org \
--to=leitao@debian.org \
--cc=jiangshanlai@gmail.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/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
all inboxes | Powered by JetHome®