Closed dvyukov closed 4 years ago
It may be possible to cook something using debug/dwarf
, in particular see:
https://golang.org/pkg/debug/dwarf/#Data.Ranges
https://golang.org/pkg/debug/dwarf/#Data.LineReader
https://golang.org/pkg/debug/dwarf/#LineReader
Mailed Go change that we need for faster report generation: https://go-review.googlesource.com/c/go/+/256217 It will allow to iterate over all DW_TAG_compile_unit fast and then symbolize only subset of compile units that we need.
Report generation is now more than order of magnitude faster. Let's consider this fixed.
Coverage report generation is very slow first time, mainly because of running objdump and addr2line on the whole vmlinux. addr2line seems to take more time. Need to figure out a way to make it faster.
For objdump, we could find the binary call pattern in the .text section directly, without running objdump on it (does any arch have pc-relative addressing in calls?).
For addr2line we could try the Go debug/dwarf package instead, but most likely it's slower. Ideally, we should run addr2line incrementally, only on files/symbols that we need for the report, not the whole binary. But it may be tricky,