> > Hi, > > > > As part of enabling frame pointers system wide for Fedora to get fast > > system wide stack unwinding, we're now looking to do the same for > > s390x after previously enabling frame pointers for x86-64 and aarch64. > > From what we can find, on s390x stack unwinding is done via the > > "-mbackchain" compiler option. However, from some early experiments > > rebuilding a small part of the distro, this option alone does not seem > > to result in usable stack traces in perf (perf record -g => perf > > report). > > > > Are there any other compiler options that need to be enabled in order > > to get usable stack traces in perf for s390x? Has anyone managed to > > get this working before? > > So, are you saying that you want to enable "-mbackchain" for whole user > space for Fedora? If that is the case, what certainly is missing is kernel > support to unwind user space stack frames from the kernel, since until now > no distribution had user space where it would be possible to unwind the > user space stack from the kernel; which is the reason why this was never > implemented. > > If this (or some other compiler options) will be enabled for user space, we > need to add kernel support in order to make this work. 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! Cheers, Daan On Thu, 26 Oct 2023 at 16:57, Heiko Carstens <hca@xxxxxxxxxxxxx> wrote: > > On Thu, Oct 26, 2023 at 02:30:41PM +0200, Daan De Meyer wrote: > > Hi, > > > > As part of enabling frame pointers system wide for Fedora to get fast > > system wide stack unwinding, we're now looking to do the same for > > s390x after previously enabling frame pointers for x86-64 and aarch64. > > From what we can find, on s390x stack unwinding is done via the > > "-mbackchain" compiler option. However, from some early experiments > > rebuilding a small part of the distro, this option alone does not seem > > to result in usable stack traces in perf (perf record -g => perf > > report). > > > > Are there any other compiler options that need to be enabled in order > > to get usable stack traces in perf for s390x? Has anyone managed to > > get this working before? > > So, are you saying that you want to enable "-mbackchain" for whole user > space for Fedora? If that is the case, what certainly is missing is kernel > support to unwind user space stack frames from the kernel, since until now > no distribution had user space where it would be possible to unwind the > user space stack from the kernel; which is the reason why this was never > implemented. > > If this (or some other compiler options) will be enabled for user space, we > need to add kernel support in order to make this work.