morestack blocks unwinding, because it clears any registers that could be used for unwinding before calling into newstack.
Fortunately, it saves the values in some variables on the current goroutine structure, so we can read them using some of the same infrastructure we use for reading labels (reliably on x86, best effort on aarch64).
This seems to work: https://github.com/parca-dev/opentelemetry-ebpf-profiler/tree/btv/morestack-wip (WIP, not yet ready to land)
for about 90% of frames on x86:
when running this program: https://github.com/umanwizard/morestack_invoker
morestackblocks unwinding, because it clears any registers that could be used for unwinding before calling intonewstack.Fortunately, it saves the values in some variables on the current goroutine structure, so we can read them using some of the same infrastructure we use for reading labels (reliably on x86, best effort on aarch64).
This seems to work: https://github.com/parca-dev/opentelemetry-ebpf-profiler/tree/btv/morestack-wip (WIP, not yet ready to land)
for about 90% of frames on x86:
when running this program: https://github.com/umanwizard/morestack_invoker