Hi Serhei,

On Mon, Nov 24, 2025 at 04:38:03PM -0500, Serhei Makarov wrote:
> Not all Linux arches include <asm/perf_regs.h>. Checking for just
> architecture (__x86__/__i386__) has turned out to be brittle, so
> now we add configury.
> 
> * configure.ac: Introduce HAVE_PERF_REGS_H.
> * backends/i386_initreg_sample.c: Guard asm/perf_regs.h include.
> * backends/x86_64_initreg_sample.c: Ditto.
> * backends/libebl_PERF_FLAGS.h: Ditto.
> * src/stacktrace.c: Clarify that eu-stacktrace configury currently
>   conditions the asm/perf_regs.h include on _ASM_X86_PERF_REGS_H.
[...]
> --- a/src/stacktrace.c
> +++ b/src/stacktrace.c
> @@ -83,7 +83,9 @@
>  
>  #include <linux/perf_event.h>
>  
> -/* TODO: Need to generalize the code beyond x86 architectures. */
> +/* TODO: Need to generalize the code beyond x86 architectures.
> +   eu-stacktrace currently disabled by configury
> +   unless _ASM_X86_PERF_REGS_H is detected. */
>  #include <asm/perf_regs.h>
>  #ifndef _ASM_X86_PERF_REGS_H
>  #error "eu-stacktrace is currently limited to x86 architectures"

Shouldn't this also be guarded like the other includes:

#ifdef HAVE_PERF_REGS_H
#  include <asm/perf_regs.h>
#endif

Or is there some other mechanism that prevents stacktrace.c to be
compiled if asm/perf_regs.h isn't available?

Thanks,

Mark

Reply via email to