gprof: speeding up line-by-line mode
Richard Allen
rsaxvc@gmail.com
Wed Feb 12 22:58:11 GMT 2025
I build embedded devices. A couple of them have large enough
firmware that gprof is quite slow to load their debug line info.
gprofing gprof shows that much of the time spent in line-by-line mode
is spent in bfd_find_nearest_line(). Currently gprof calls it for every
byte or instruction in the .text section.
Would there be anything lost if we were to bfd_find_nearest_line()
across the program counter range of histograms instead? Or bins?
This is usually 1-2 orders of magnitude faster(2min->2sec) for me,
but, my usage of gprof only has histogram data sampled from
OpenOCD, and wouldn't want to break any other function.
Thank you for your time and consideration
-Richard
More information about the Binutils
mailing list