Re: s390x stack unwinding with perf?

Heiko Carstens
2023-11-09T14:48:46Z

On Mon, Oct 30, 2023 at 09:19:02AM -0400, Neal Gompa wrote:
> On Mon, Oct 30, 2023 at 9:02 AM Heiko Carstens <hca@linux.ibm.com> wrote:
> >
> > On Fri, Oct 27, 2023 at 11:22:42AM -0400, Neal Gompa wrote:
> > > On Fri, Oct 27, 2023 at 6:10 AM Heiko Carstens <hca@linux.ibm.com> wrote:
> > > >
> > > > On Fri, Oct 27, 2023 at 10:00:53AM +0200, Daan De Meyer wrote:
> > > > >
> > > > > If the kernel gets support for s390x user space unwinding using the backchain,
> > > > > we'll propose to enable -mbackchain in the default compilation flags for Fedora
> > > > > so that s390x on Fedora will have the same profiling experience as x86-64, arm64
> > > > > and ppc64. For now we'll keep the status quo since compiling with the backchain
> > > > > doesn't provide any benefit until the kernel unwinder can unwind user
> > > > > space stacks
> > > > > using it.
> > > > >
> > > > > Thanks for clarifying the current state of user space stack unwinding on s390x!
> > > >
> > > > We will implement the missing pieces and let you know when things are
> > > > supposed to work.
> > >
> > > Do you think we could have an initial patch set for implementing the
> > > missing pieces in time for the Linux 6.8 merge window? Then we can
> > > look at enabling this for s390x as a Fedora Linux 40 Change.
> >
> > This will be very likely the case. Actually the plan is to go with the
> > patch below. I gave it some testing with Fedora 38 and replaced (only)
> > glibc with a variant that was compiled with -mbackchain.
...
> This patch LGTM. I'd love to see it land in Linux 6.7!
>
> Reviewed-by: Neal Gompa <ngompa@fedoraproject.org>

FWIW, this is now upstream and will land in 6.7, together with a similar
patch which adds user stacktrace support:

504b73d00a55 ("s390/perf: implement perf_callchain_user()")
aa44433ac4ee ("s390: add USER_STACKTRACE support")

Please let us know if there are any problems.