From 18a1efe0156efd583a85e34d9869f92b02473705 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Sat, 7 Mar 2026 09:47:19 -0800 Subject: tools/workqueue/wq_dump.py: remove backslash separator from node_nr/max_active header Remove the backslash separator between the workqueue name and the data columns in the "Unbound workqueue -> node_nr/max_active" header for cleaner output. Signed-off-by: Breno Leitao Signed-off-by: Tejun Heo --- tools/workqueue/wq_dump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/workqueue') diff --git a/tools/workqueue/wq_dump.py b/tools/workqueue/wq_dump.py index d29b918306b4..2079e98f77e4 100644 --- a/tools/workqueue/wq_dump.py +++ b/tools/workqueue/wq_dump.py @@ -227,7 +227,7 @@ 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-2}}\\ min max', end='') + print(f'[{"workqueue":^{WQ_NAME_LEN-1}} min max', end='') first = True for node in for_each_node(): if first: -- cgit v1.2.3 From 15e1fab91b3d69773735447cbc151a8a96c4f4a0 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Sat, 7 Mar 2026 09:47:20 -0800 Subject: 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 Signed-off-by: Tejun Heo --- tools/workqueue/wq_dump.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tools/workqueue') 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?') -- cgit v1.2.3 From 25e1a46cc3b7dccb1e2c86ddb15a1c8b92b564f0 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Sat, 7 Mar 2026 09:47:21 -0800 Subject: tools/workqueue/wq_dump.py: add NODE prefix to all node columns Previously only the first node column showed "NODE 0" while subsequent columns showed just the bare node number, making it unclear what the numbers refer to. Add the "NODE" prefix to all node columns and remove the now-unnecessary first/else branching. Signed-off-by: Breno Leitao Signed-off-by: Tejun Heo --- tools/workqueue/wq_dump.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'tools/workqueue') diff --git a/tools/workqueue/wq_dump.py b/tools/workqueue/wq_dump.py index bddfeb9fc2a8..fb3b87aa40cf 100644 --- a/tools/workqueue/wq_dump.py +++ b/tools/workqueue/wq_dump.py @@ -228,13 +228,8 @@ if 'node_to_cpumask_map' in prog: print('') 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 " + str(node):>8}', end='') - first = False - else: - print(f' {node:>9}', end='') + print(f' {"NODE " + str(node):>9}', end='') print(f' {"dfl":>9} ]') print('') -- cgit v1.2.3 From 738390a5321c7d34f468bc69f7232db711210bc0 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Wed, 1 Apr 2026 06:03:55 -0700 Subject: tools/workqueue: add CACHE_SHARD support to wq_dump.py The WQ_AFFN_CACHE_SHARD affinity scope was added to the kernel but wq_dump.py was not updated to enumerate it. Add the missing constant lookup and include it in the affinity scopes iteration so that drgn output shows the CACHE_SHARD pod topology alongside the other scopes. Signed-off-by: Breno Leitao Signed-off-by: Tejun Heo --- tools/workqueue/wq_dump.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools/workqueue') diff --git a/tools/workqueue/wq_dump.py b/tools/workqueue/wq_dump.py index fb3b87aa40cf..ce4161f52f2f 100644 --- a/tools/workqueue/wq_dump.py +++ b/tools/workqueue/wq_dump.py @@ -107,6 +107,7 @@ WQ_MEM_RECLAIM = prog['WQ_MEM_RECLAIM'] WQ_AFFN_CPU = prog['WQ_AFFN_CPU'] WQ_AFFN_SMT = prog['WQ_AFFN_SMT'] WQ_AFFN_CACHE = prog['WQ_AFFN_CACHE'] +WQ_AFFN_CACHE_SHARD = prog['WQ_AFFN_CACHE_SHARD'] WQ_AFFN_NUMA = prog['WQ_AFFN_NUMA'] WQ_AFFN_SYSTEM = prog['WQ_AFFN_SYSTEM'] @@ -138,7 +139,7 @@ def print_pod_type(pt): print(f' [{cpu}]={pt.cpu_pod[cpu].value_()}', end='') print('') -for affn in [WQ_AFFN_CPU, WQ_AFFN_SMT, WQ_AFFN_CACHE, WQ_AFFN_NUMA, WQ_AFFN_SYSTEM]: +for affn in [WQ_AFFN_CPU, WQ_AFFN_SMT, WQ_AFFN_CACHE, WQ_AFFN_CACHE_SHARD, WQ_AFFN_NUMA, WQ_AFFN_SYSTEM]: print('') print(f'{wq_affn_names[affn].string_().decode().upper()}{" (default)" if affn == wq_affn_dfl else ""}') print_pod_type(wq_pod_types[affn]) -- cgit v1.2.3