-
Notifications
You must be signed in to change notification settings - Fork 283
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
implement native stack unwind in arm64 #300
Comments
Hi @zdyj3170101136 Does this resolve your request? |
As far as I know, for go functions. Its eh_frame is incomplete, so if you want to do stack unwinding, you can only use debug_frame. |
This project supports unwinding the Go via .gopclntab - for details feel free to check out https://github.com/open-telemetry/opentelemetry-ebpf-profiler/blob/main/nativeunwind/elfunwindinfo/elfgopclntab.go. At some point unwinding the Go stack using the Go internal FP could be an option for newer Go versions, that support that. |
the go itself replace .gopcintab with fp, you could see https://blog.felixge.de/reducing-gos-execution-tracer-overhead-with-frame-pointer-unwinding/. and the arm64 fp unwind is not supported is for all language below linux 6. |
In the future unwinding the Go stack using the Go internal FP could be an optimization for Go versions, that support that. But to keep backwards compatibility, unwinding the Go stack with support of .gopclntab will be kept, I think. |
What you mean by "Linux 6"? Linux kernel 6 or some distribution version? Why it cannot use fp unwinding?
We support
This is a traditional problem on architectures without
This does not apply to us. At attach time, the However, for Go, this is a problem because the Go executables are statically built and tend to be huge in size. This also results in millions of unwinding entries which take a lot of memory. For this reason, we default ot |
given a go program, and use perf fp, you cloud see that the user stack fp unwind have problem. the func bpf_get_stackid could not unwind successfully, i do not know the reason.
here is my linux version
in fact, the linux 6 already solve leaf caller miss problem, see https://github.com/torvalds/linux/blob/2144da25584eb10b84252230319b5783f6a83041/tools/perf/util/arm64-frame-pointer-unwind-support.c#L31 |
We do not use this function ever. All unwinding is done by custom ebpf code at: The native unwinder code is at: |
if you read fp by bpf_probe_read_user, seems there is no problem, but i have not tested. |
In arm64, systems below Linux 6 cannot use fp stack unwinding.
Therefore, I suggest that we implement our own fp stack unwinding to support arm64 below linux 6.
In addition, for the go language, if there is a function call chain of a -> b -> c and fp is used for stack unwinding, then when the function is in c, the call chain of fp stack unwinding is a -> c, one function less.
On arm64, we can use the lr link register to solve this problem.
The text was updated successfully, but these errors were encountered: