Re: [PATCH v2] tools/workqueue/wq_dump.py: Add busy worker inspection and BH pool states

From: Aaron Tomlin

Date: Mon Sep 14 2026 - 16:22:05 EST


On Mon, Sep 14, 2026 at 01:55:36AM -0700, Breno Leitao wrote:
> On Fri, Sep 11, 2026 at 05:06:25PM -0400, Aaron Tomlin wrote:
> > @@ -176,6 +202,40 @@ for pi, pool in idr_for_each(worker_pool_idr):
> > print(' strict', end='')
> > print('')
> >
> > + if args.busy:
> > + for bkt in pool.busy_hash:
> > + for worker in hlist_for_each_entry('struct worker', bkt.address_of_(), 'hentry'):
> > + for _ in range(3):
> > + try:
> ...
> > + except Exception:
> > + continue
>
> Is a bare except the right scope here? It swallows all other silly
> exceptions, so a typo anywhere in this block makes -b print nothing at
> all instead of failing.
>
> I would go for drgn.FaultError and LookupError, these two that are
> actually expected.
>
> --breno

Hi Breno,

Thank you for your feedback.

That was an oversight. Indeed, drgn.FaultError (or imported FaultError) and
LookupError (i.e. prog.symbol(0)) is more appropriate.

>>> w = Object(prog, 'struct worker *', address=0x0)
>>> print(w)
Traceback (most recent call last):
File "<python-input-2>", line 1, in <module>
print(w)
~~~~~^^^
_drgn.FaultError: address is not mapped: 0x0

Kind regards,
--
Aaron Tomlin