arm64 dwarf unwind wrong
go program, use fp to unwind in arm64 have bug:
https://github.com/golang/go/issues/70804.
use parca-agent v0.31.1 to unwind.
program:
package main
import (
"encoding/json"
"net/http"
_ "net/http/pprof"
)
func main() {
go func() {
http.ListenAndServe(":7079", nil )
}()
for {
json.Marshal([]byte("sss"))
}
}
cmd:
./parca-agent_0.31.1_Linux_aarch64 --local-store-directory=pprof --profiling-cpu-sampling-frequency=100 --profiling-duration=60s --dwarf-unwinding-mixed
the parca-agent output:
go tool pprof -svg
Could you try with latest Parca agent? We actually changed the unwind strategy dramatically for go starting in v0.32.
Could you try with latest Parca agent? We actually changed the unwind strategy dramatically for go starting in v0.32.
same as before.
cat /proc/version
Linux version 5.10.134-17.3.al8.aarch64 ([email protected]) (gcc (GCC) 10.2.1 20200825 (Alibaba 10.2.1-3.8 2.32), GNU ld version2.35-12.3.al8) #1 SMP Thu Oct 31 14:27:09 CST 2024
the perf report could get correct result.
perf record -a -g --call-graph=dwarf -F 100
perf report
@brancz
the reason is that the go exec do not have eh_frame section.
if we could parse debug_frame , we could unwind stack by using ld register.
i already make a smallest demo and it run success.
I am happy to contribute, but the opentelemetry ebpf agent is too complicated that i could not read it.
just noticed it has already implement debug_frame in v0.31.0.
but it work on v0.30.0, strange.
Have you tried the v0.32+ agent? We've observed arm64 working flawlessly.
Have you tried the v0.32+ agent? We've observed arm64 working flawlessly.
finally i find the reason.
func bpf_get_stack seems work not right.
in this mr, parca agent implement it's fp unwind, it work:
https://github.com/parca-dev/parca-agent/pull/2419/files