diff options
| author | Breno Leitao <leitao@debian.org> | 2026-03-07 09:47:20 -0800 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-03-07 08:13:53 -1000 |
| commit | 15e1fab91b3d69773735447cbc151a8a96c4f4a0 (patch) | |
| tree | 27466970196fb3069607e4e85dfba9a7be1197d2 /tools/workqueue | |
| parent | 18a1efe0156efd583a85e34d9869f92b02473705 (diff) | |
tools/workqueue/wq_dump.py: fix column alignment in node_nr/max_active section
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>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/workqueue')
| -rw-r--r-- | tools/workqueue/wq_dump.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/workqueue/wq_dump.py b/tools/workqueue/wq_dump.py index 2079e98f77e4..bddfeb9fc2a8 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?') |
