Skip to content

Commit

Permalink
tools/workqueue: Add rescuers printing to wq_dump.py
Browse files Browse the repository at this point in the history
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>
jlelli authored and htejun committed Jan 16, 2024
1 parent 31c8900 commit ab5e5b9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tools/workqueue/wq_dump.py
Original file line number Diff line number Diff line change
@@ -175,3 +175,32 @@ def print_pod_type(pt):
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('')

0 comments on commit ab5e5b9

Please sign in to comment.