Re: [PATCH v2 01/18] perf bench internals: Add symbols and maps benchmarks

From: Alireza Haghdoost

Date: Thu Oct 29 2026 - 15:46:42 EST


On Tue, Oct 27, 2026 at 4:14 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
> +#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 33)
> + struct stats mem_stats;
> +#endif

Does this build on a libc without __GLIBC_PREREQ, such as musl ?
How about nesting it:

#if defined(__GLIBC__)
#if __GLIBC_PREREQ(2, 33)
#define HAVE_MALLINFO2
#endif
#endif

and then #ifdef HAVE_MALLINFO2 at the five uses.

Two smaller things: 'perf bench internals symbols' exits with an error
when the binary has no defined symbols (a stripped executable), even
though the synthetic insert and lookup phases don't need the binary.
And symbol__init() has no matching symbol__exit().