Re: [patch v2 04/14] x86/irq: Make irqstats array based
From: Thomas Gleixner
Date: Fri Mar 27 2026 - 07:05:34 EST
Florian!
On Thu, Mar 26 2026 at 16:00, Florian Fainelli wrote:
> On 3/26/26 03:29, Thomas Gleixner wrote:
>> So if Radu hadn't noticed and pointed it out, I wouldn't have known
>> about it at all.
>
> Yes that's a fair point and it has been a complaint of mine whenever I
> had to use the GDB scripts because they get out of sync so easily with
> the code they are trying to parse, at some point it's not even fun.
>
> This should still apply if you want to take it:
>
> https://lore.kernel.org/all/20250625231053.1134589-6-florian.fainelli@xxxxxxxxxxxx/
That's just delegating something unenforcable, not automatically
testable to other maintainers. So it's not solving anything.
You want something which breaks the build for the submitter so that he
needs to go and fix up the gdb script or at least ask for help if he
can't figure it out on his own. If he does not build with debug enabled
the CI robots will catch it and send him back to the drawing board.
> As far as ensuring that the C/Rust code stays in sync with GDB at
> compile time, did not have any bright idea about how to do that.
Add parseable annotation into each of the snake scripts:
class kernel_dep(object):
def __init__(self, name, member=None, config=None, type=TYPE_VAR)
self.name = name
self.member = member
self.config = config
self.type = type
and per unit you add:
kernel_dependencies = [
kernel_dep(TYPE_VAR, 'nr_irqs'),
kernel_dep(TYPE_VAR, 'irq_stat', '__nmi_count', 'CONFIG_X86'),
kernel_dep('irq_chip', 'name', type=TYPE_STRUCT),
....
]
or something daft like that. I'm 100% sure that real snake experts will
come up with a way more elegant solution, but you get the idea.
Then have a script which collects this information from the source files
and validates it against the debug information in vmlinux. Obviously
this would allow you to validate the snake code against those
dependencies as well.
The first two entries would have caught both changes I made, the array
conversion of irq_stat and the rename of nr_irqs.
Hmm?
Thanks,
tglx