History

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.

Juri Lelli committed 2 years ago

Commit ab5e5b91 parent 31c89001 file · +29 −0Browse files

Unified · Split

tools/workqueue/wq_dump.py+29−0
@@ -175,3 +175,32 @@ for wq in list_for_each_entry('struct workqueue_struct', workqueues.address_of_( · 174 unmodified lines
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('')