use frame pointer unwinding for Go 1.21+ on aarch64#422
use frame pointer unwinding for Go 1.21+ on aarch64#422fabled merged 2 commits intoopen-telemetry:mainfrom
Conversation
0724bfe to
f95662e
Compare
c9ccd1f to
30fb123
Compare
Introduce a mechanism for native frame pointer unwinding in the ebpf code, and use it for the V8 and Golang unwinders. This allows a slightly optimized unwinding to happen as less bpf_probe_read_user() calls are done with the expense of slightly larger native unwinder ebpf program. Enable frame pointer unwinding for Go1.21+ on aarch64. fixes open-telemetry#342
30fb123 to
a3c7287
Compare
christos68k
left a comment
There was a problem hiding this comment.
LGTM but I can't test this atm.
florianl
left a comment
There was a problem hiding this comment.
Just two minor comments, that can be addressed in a follow up. Besides that 👍 thanks for the update!
| // Ambiguous regarding if frame pointer is kept correctly. | ||
| // Take the slow path of resolving Go version. | ||
| goVer, err := ee.file.GoVersion() | ||
| if err != nil || version.Compare(goVer, "go1.21rc1") < 0 { |
There was a problem hiding this comment.
Nit: Release candidates are for temporary testing. Maybe we can just use the first release with this change in Go:
| if err != nil || version.Compare(goVer, "go1.21rc1") < 0 { | |
| if err != nil || version.Compare(goVer, "go1.21.0") < 0 { |
There was a problem hiding this comment.
I have a strong preference to keep the actual first rc tag here. The Go libraries support comparing versions with them, and this makes the code work with the prerelease tags. This also serves as note to remind what is the first tag when the Golang change was made.
| UnwindCommandStop int32 = C.UNWIND_COMMAND_STOP | ||
| UnwindCommandPLT int32 = C.UNWIND_COMMAND_PLT | ||
| UnwindCommandSignal int32 = C.UNWIND_COMMAND_SIGNAL | ||
| UnwindCommandInvalid int32 = C.UNWIND_COMMAND_INVALID |
There was a problem hiding this comment.
Maybe we should bring these constants into support/types_def.go - then we don't need to manually keep them in sync. But this can be part of another PR.
There was a problem hiding this comment.
Sure, will do a follow up PR on this.
Reduce the spread of CGO across the code base and move definitions to support package. Follow up to #422 (comment) Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Reduce the spread of CGO across the code base and move definitions to support package. Follow up to #422 (comment). Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Introduce a mechanism for native frame pointer unwinding in the ebpf code, and use it for the V8 and Golang unwinders. This allows a slightly optimized unwinding to happen as less bpf_probe_read_user() calls are done with the expense of slightly larger native unwinder ebpf program.
Enable frame pointer unwinding for Go1.21+ on aarch64 (this significantly reduces the kernel memory needed for Go executable stack delta maps).
fixes #342