aboutsummaryrefslogtreecommitdiff
path: root/tools/workqueue
diff options
context:
space:
mode:
authorGravatar Juri Lelli <juri.lelli@redhat.com> 2024-01-16 17:19:26 +0100
committerGravatar Tejun Heo <tj@kernel.org> 2024-01-16 08:47:22 -1000
commitab5e5b99a949b9f282c605d00557b2c727856485 (patch)
treec5dfdc904c276560e89b66a2bc108a481ea7f450 /tools/workqueue
parentworkqueue.c: Increase workqueue name length (diff)
downloadlinux-ab5e5b99a949b9f282c605d00557b2c727856485.tar.gz
linux-ab5e5b99a949b9f282c605d00557b2c727856485.tar.bz2
linux-ab5e5b99a949b9f282c605d00557b2c727856485.zip
tools/workqueue: Add rescuers printing to wq_dump.py
Retrieving rescuers information (e.g., affinity and name) is quite useful when debugging workqueues configurations. Add printing of such information to the existing wq_dump.py script. Signed-off-by: Juri Lelli <juri.lelli@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/workqueue')
-rw-r--r--tools/workqueue/wq_dump.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/workqueue/wq_dump.py b/tools/workqueue/wq_dump.py
index d0df5833f2c1..6da621989e21 100644
--- a/tools/workqueue/wq_dump.py
+++ b/tools/workqueue/wq_dump.py
@@ -175,3 +175,32 @@ for wq in list_for_each_entry('struct workqueue_struct', workqueues.address_of_(
if wq.flags & WQ_UNBOUND:
print(f' {wq.dfl_pwq.pool.id.value_():{max_pool_id_len}}', end='')
print('')
+
+print('')
+print('Workqueue -> rescuer')
+print('=====================')
+print(f'wq_unbound_cpumask={cpumask_str(wq_unbound_cpumask)}')
+print('')
+print('[ workqueue \ type unbound_cpumask rescuer pid cpumask]')
+
+for wq in list_for_each_entry('struct workqueue_struct', workqueues.address_of_(), 'list'):
+ print(f'{wq.name.string_().decode()[-24:]:24}', end='')
+ if wq.flags & WQ_UNBOUND:
+ if wq.flags & WQ_ORDERED:
+ print(' ordered ', end='')
+ else:
+ print(' unbound', end='')
+ if wq.unbound_attrs.affn_strict:
+ print(',S ', end='')
+ else:
+ print(' ', end='')
+ print(f' {cpumask_str(wq.unbound_attrs.cpumask):24}', end='')
+ else:
+ print(' percpu ', end='')
+ print(' ', end='')
+
+ if wq.flags & WQ_MEM_RECLAIM:
+ print(f' {wq.rescuer.task.comm.string_().decode()[-24:]:24}', end='')
+ print(f' {wq.rescuer.task.pid.value_():5}', end='')
+ print(f' {cpumask_str(wq.rescuer.task.cpus_ptr)}', end='')
+ print('')