Re: [RFC PATCH v2 3/3] perf tools: Support sparc user register samples and dwarf unwinding

From: Stian Halseth

Date: Tue Sep 22 2026 - 17:22:11 EST


Hi Ian,

On Tue, 2026-09-22 at 13:31 -0700, Ian Rogers wrote:
> > @@ -295,6 +330,8 @@ static bool
> > libdw_set_initial_registers(Dwfl_Thread *thread, void *arg)
> >                                 max_dwarf_reg = dwarf_reg;
> >                 }
> >         }
> > +       if (is_sparc && max_dwarf_reg < 31)
> > +               max_dwarf_reg = 31;
>
> Thanks! I think these are great patches! At this point in the code
> are
> you setting max_dwarf_reg so that there's space for the window
> registers? I think adding a comment here for clarity would be
> worthwhile as it matches up with libdw_set_sparc_window_registers.
>
I'm glad to hear that!

Yes. On sparc the sampled registers map only to DWARF 0-15, so without
this the array would be too short for the %l/%i values that
libdw_set_sparc_window_registers() writes to 16-31. I'll add a comment
there in the next version.

Thanks for the review!

--
Best regards
Stian Halseth

Attachment: signature.asc
Description: This is a digitally signed message part