Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Breno Leitao and committed by
Tejun Heo
15e1fab9 18a1efe0

+7 -7
+7 -7
tools/workqueue/wq_dump.py
··· 227 227 print(f'NODE[{node:02}]={cpumask_str(node_to_cpumask_map[node])}') 228 228 print('') 229 229 230 - print(f'[{"workqueue":^{WQ_NAME_LEN-1}} min max', end='') 230 + print(f'[{"workqueue":^{WQ_NAME_LEN-1}} {"min":>4} {"max":>4}', end='') 231 231 first = True 232 232 for node in for_each_node(): 233 233 if first: 234 - print(f' NODE {node}', end='') 234 + print(f' {"NODE " + str(node):>8}', end='') 235 235 first = False 236 236 else: 237 - print(f' {node:7}', end='') 238 - print(f' {"dfl":>7} ]') 237 + print(f' {node:>9}', end='') 238 + print(f' {"dfl":>9} ]') 239 239 print('') 240 240 241 241 for wq in list_for_each_entry('struct workqueue_struct', workqueues.address_of_(), 'list'): ··· 243 243 continue 244 244 245 245 print(f'{wq.name.string_().decode():{WQ_NAME_LEN}} ', end='') 246 - print(f'{wq.min_active.value_():3} {wq.max_active.value_():3}', end='') 246 + print(f'{wq.min_active.value_():4} {wq.max_active.value_():4}', end='') 247 247 for node in for_each_node(): 248 248 nna = wq.node_nr_active[node] 249 - print(f' {nna.nr.counter.value_():3}/{nna.max.value_():3}', end='') 249 + print(f' {f"{nna.nr.counter.value_()}/{nna.max.value_()}":>9}', end='') 250 250 nna = wq.node_nr_active[nr_node_ids] 251 - print(f' {nna.nr.counter.value_():3}/{nna.max.value_():3}') 251 + print(f' {f"{nna.nr.counter.value_()}/{nna.max.value_()}":>9}') 252 252 else: 253 253 printf(f'node_to_cpumask_map not present, is NUMA enabled?')