Re: [PATCH] perf regs: Add alpha support
From: Ian Rogers
Date: Mon Oct 12 2026 - 18:47:04 EST
On Mon, Oct 12, 2026 at 3:38 PM Magnus Lindholm <linmag7@xxxxxxxxx> wrote:
>
> Hi Ian,
>
> On Mon, Oct 12, 2026 at 11:45 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
> >
> > On Mon, Oct 12, 2026 at 2:41 PM Magnus Lindholm <linmag7@xxxxxxxxx> wrote:
> > >
> > > Hi again,
> > >
> > > On Mon, Oct 12, 2026 at 7:37 PM Magnus Lindholm <linmag7@xxxxxxxxx> wrote:
> > > > > base-commit: bc01105ed65d15787b2eb93ac26e8624a2139e35
> > > > > change-id: 20261001-alpha-perf-tools-regs-c206a84dec7f
> > > > >
> > > > > Best regards,
> > > > > --
> > > > > Matt Turner <mattst88@xxxxxxxxx>
> > > > >
> > > >
> > > > Thanks for doing this!
> > > >
> > > > Register selection, recording, decoding and user stack dumps tested
> > > > on my ES40. End-to-end DWARF unwinding remains unverified because the
> > > > installed elfutils 0.195 lacks Alpha unwinding support.
> > > >
> > > > Tested-by: Magnus Lindholm <linmag7@xxxxxxxxx>
> > >
> > > I just pulled your elfutils patches and ran some more tests.
> > > With your elfutils patches, DWARF unwinding now works on my ES40.
> > > Both existing and fresh perf recordings recovered the expected
> > > leaf -> middle -> outer -> main call chain.
> > >
> > > As documented, samples whose CFA depends on r15 stopped at the
> > > sampled frame, since r15 is unavailable. Tested-by tag already given
> > > to this series.
> >
> > I'm finding this fantastic and exciting to follow! Being greedy, does
> > the cross-platform DWARF unwinding work? perf record on an alpha and
> > perf report on, say, an x86. It would in no way block this work, but
> > I'm keen to check Matt/I wired this up properly :-)
> >
>
> Tested recording on the ES40 and reporting on x86-64 with patched
> perf and elfutils. I hit an existing offline architecture-detection
> issue in my for-next-based perf tree: it selected x86 registers for
> the Alpha samples.
>
> After two local corrections, both perf report and perf script
> recovered identical seven-frame chains for all 391 optimized samples.
> The r15-dependent workload stopped at the leaf, just as on Alpha.
>
> Both issues predate Matt's patch in this tree. The places to look
> are machines__init() in tools/perf/util/machine.c, where the host's
> machines pointer is left unset, and thread__e_machine_endian() in
> tools/perf/util/thread.c, where the session->data check for is_live
> appears, to me, inverted?
>
> Locally, setting machines->host.machines = machines and changing
> is_live = !!session->data to is_live = !session->data resolved this.
> These changes still need broader review, but the Alpha cross-platform
> unwinding itself looks good.
That's great news! I think the is_live issue was addressed here:
https://lore.kernel.org/linux-perf-users/20260905-perf-alpha-annotate-v1-1-97380433ccb6@xxxxxxxxx/
and the machines issue maybe in:
https://lore.kernel.org/linux-perf-users/20260918062620.2145220-1-irogers@xxxxxxxxxx/
Both these fixes are already queued up in perf-tools-next:
https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/
Thanks!
Ian
> Thanks,
> Magnus