Re: [PATCH v2 1/2] stacktrace: Provide arch_in_event_entry_text() hook
From: Dave Hansen
Date: Mon Aug 31 2026 - 12:53:00 EST
On 8/31/26 05:02, Yuanhe Shu wrote:
> +/*
> + * Optional arch hook for event entry text which cannot be placed in
> + * .irqentry.text. filter_irq_stacks() uses this and the section checks
> + * below to find where a trace entered the kernel, so the ranges are not
> + * necessarily irq-only: on x86 they also cover the exception entry stubs,
> + * and an architecture may deliver syscalls through the same entry text.
> + * A caller that has to tell interrupt entry and syscall entry apart
> + * cannot use this. An architecture overrides it by defining a macro of
> + * the same name in <asm/sections.h>, next to the markers it tests.
> + */
> +#ifndef arch_in_event_entry_text
> +static inline bool arch_in_event_entry_text(unsigned long addr) { return false; }
> +#endif
As much as I love inflicting x86-isms on generic comments, I don't think
this comment needs to talk about x86. I find the most useful generic
definitions to be like an instruction manual for future arch/
maintainers. Maybe something like:
/*
* Used to help find where a trace entered the kernel.
*
* Architectures use this when event entry text cannot be placed in
* .irqentry.text alone. Architectures should define their
* version in <asm/sections.h>.
*/
... and then talk about why x86 needs it in the x86 definition.