]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tools/workqueue/wq_dump.py: fix column alignment in node_nr/max_active section
authorBreno Leitao <leitao@debian.org>
Sat, 7 Mar 2026 17:47:20 +0000 (09:47 -0800)
committerTejun Heo <tj@kernel.org>
Sat, 7 Mar 2026 18:13:53 +0000 (08:13 -1000)
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>
tools/workqueue/wq_dump.py

index 2079e98f77e4e5bcc31690ddc21faf691e8fd77f..bddfeb9fc2a8ec6153487137b2acbe06c76b225f 100644 (file)
@@ -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?')