Skip to content

Commit ab5e5b9

Browse files
jlellihtejun
authored andcommitted
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>
1 parent 31c8900 commit ab5e5b9

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

tools/workqueue/wq_dump.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,32 @@ def print_pod_type(pt):
175175
if wq.flags & WQ_UNBOUND:
176176
print(f' {wq.dfl_pwq.pool.id.value_():{max_pool_id_len}}', end='')
177177
print('')
178+
179+
print('')
180+
print('Workqueue -> rescuer')
181+
print('=====================')
182+
print(f'wq_unbound_cpumask={cpumask_str(wq_unbound_cpumask)}')
183+
print('')
184+
print('[ workqueue \ type unbound_cpumask rescuer pid cpumask]')
185+
186+
for wq in list_for_each_entry('struct workqueue_struct', workqueues.address_of_(), 'list'):
187+
print(f'{wq.name.string_().decode()[-24:]:24}', end='')
188+
if wq.flags & WQ_UNBOUND:
189+
if wq.flags & WQ_ORDERED:
190+
print(' ordered ', end='')
191+
else:
192+
print(' unbound', end='')
193+
if wq.unbound_attrs.affn_strict:
194+
print(',S ', end='')
195+
else:
196+
print(' ', end='')
197+
print(f' {cpumask_str(wq.unbound_attrs.cpumask):24}', end='')
198+
else:
199+
print(' percpu ', end='')
200+
print(' ', end='')
201+
202+
if wq.flags & WQ_MEM_RECLAIM:
203+
print(f' {wq.rescuer.task.comm.string_().decode()[-24:]:24}', end='')
204+
print(f' {wq.rescuer.task.pid.value_():5}', end='')
205+
print(f' {cpumask_str(wq.rescuer.task.cpus_ptr)}', end='')
206+
print('')

0 commit comments

Comments
 (0)