Re: [RFC] Merging ftrace_stack, perf_callchain, oprofile->backtrace and stack_trace

From: Peter Zijlstra
Date: Mon Oct 22 2018 - 05:14:16 EST


On Sun, Oct 21, 2018 at 08:31:06PM +1100, Aleksa Sarai wrote:
> Hi all,
>
> I'm currently working on a patchset to make kretprobes produce
> reasonable stack traces[1], and it appears this is a generic problem
> across the entire kernel -- you can see the same kretprobe_trampoline()
> issue when using ftrace just as much as bpf_trace.
>
> However, in working on this patch, I've noticed that there appear to be
> several different implementations of "get the stack trace from this
> pt_regs" which all appear quite similar. Namely:
>
> * struct ftrace_stack;
> * struct perf_callchain_entry; [**]
> * struct stack_trace;

the perf thing also does userspace stack, where the others do not afaik.
And for the kernel part it already uses the regular kernel unwinder.

I'm not sure what you're proposing.