-
Couldn't load subscription status.
- Fork 145
x86/fgraph,bpf: Fix ORC stack unwind from return probe #10111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Upstream branch: e758657 |
AI reviewed your patch. Please fix the bug or email reply why it's not a bug. In-Reply-To-Subject: |
|
Forwarding comment 3451362555 via email |
ecdeefe to
10ce4bd
Compare
|
Upstream branch: ff88079 |
3b75a30 to
33316f1
Compare
10ce4bd to
e5828a2
Compare
|
Upstream branch: f9db3a3 |
33316f1 to
971755b
Compare
|
Upstream branch: f9db3a3 |
971755b to
eca0808
Compare
e5828a2 to
13927c8
Compare
|
Upstream branch: 8842732 |
eca0808 to
e5038d1
Compare
13927c8 to
9b73883
Compare
|
Upstream branch: 23f852d |
e5038d1 to
079d141
Compare
9b73883 to
3cfe497
Compare
|
Upstream branch: 54c134f |
079d141 to
08e2a23
Compare
3cfe497 to
6d6792d
Compare
|
Upstream branch: 9f317bd |
08e2a23 to
8d5d788
Compare
6d6792d to
4481a85
Compare
|
Upstream branch: 54c134f |
8d5d788 to
8bdcab6
Compare
4481a85 to
5125528
Compare
This reverts commit 83f44ae. When perf_callchain_kernel calls unwind_start with first_frame, AFAICS we do not skip regs->ip, but it's added as part of the unwind process. Hence reverting the extra perf_callchain_store for non-hw regs leg. Acked-by: Song Liu <[email protected]> Signed-off-by: Jiri Olsa <[email protected]>
Currently we don't get stack trace via ORC unwinder on top of fgraph exit
handler. We can see that when generating stacktrace from kretprobe_multi
bpf program which is based on fprobe/fgraph.
The reason is that the ORC unwind code won't get pass the return_to_handler
callback installed by fgraph return probe machinery.
Solving this by creating stack frame in return_to_handler expected by
ftrace_graph_ret_addr function to recover original return address and
continue with the unwind.
Also updating the pt_regs data with cs/flags/rsp which are needed for
successful stack retrieval from ebpf bpf_get_stackid helper.
- in get_perf_callchain we check user_mode(regs) so CS has to be set
- in perf_callchain_kernel we call perf_hw_regs(regs), so EFLAGS/FIXED
has to be unset
Note I feel like it'd be better to set those directly in return_to_handler,
but Steven suggested setting them later in kprobe_multi code path.
Signed-off-by: Jiri Olsa <[email protected]>
Acked-by: Masami Hiramatsu (Google) <[email protected]>
|
Upstream branch: e2e668b |
Adding test that attaches kprobe/kretprobe multi and verifies the ORC stacktrace matches expected functions. It skips the test for if kernels built with frame pointer unwinder. Signed-off-by: Jiri Olsa <[email protected]>
8bdcab6 to
ec2dea1
Compare
5125528 to
1e2d874
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1016271 expired. Closing PR. |
Pull request for series with
subject: x86/fgraph,bpf: Fix ORC stack unwind from return probe
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1016271