Re: [PATCH] perf riscv: Add perf_regs_load and enable the dwarf unwind test

From: Arnaldo Carvalho de Melo

Date: Tue Sep 22 2026 - 08:49:50 EST


On Tue, Sep 15, 2026 at 12:09:13PM -0700, Ian Rogers wrote:
> On Mon, Sep 14, 2026 at 6:54 PM Chen Pei <cp0613@xxxxxxxxxxxxxxxxx> wrote:
> >
> > Both items checked. Neither needs a v2 of this patch.
> >
> > > Does this file need to explicitly include <stdlib.h>? Since musl libc
> > > enforces strict POSIX header inclusions, missing the declaration for
> > > malloc could lead to a build failure regression on musl libc systems.
> >
> > It is not missing. "perf_regs.h" three lines above resolves to
> > arch/riscv/include/perf_regs.h, which has #include <stdlib.h> and is
> > also where PERF_REGS_MAX comes from, so this file cannot be built
> > without it. arm64 relies on the same transitive include. Checked with
> > riscv64 gcc 15.3, where an implicit declaration is a hard error:
> > including only that header is enough to call malloc() and calloc().
>
> Hi Pei,
>
> Thanks for the patch! Please don't rely on transitive includes as a
> change in the other header file will break code here. Since this code
> only builds for RISC-V, we're likely to miss the problem if the other
> header changes. Other than this,
>
> Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>

Thanks, applied to perf-tools-next, for v7.4.

- Arnaldo