[PATCH v4] gprof: only process line numbers for intersection of vmas and histograms

Richard Allen rsaxvc@gmail.com
Tue Mar 11 05:53:05 GMT 2025


> I've noticed that some of my profiles have discrepancies
> with the change to limit to histogram range parsing,
> usually of no more than 2-3 bytes.

The discrepancy occurs in line-by-line mode, when a
low histogram bound occurs within the PC range for a line.

Ex: draw_border_generic (lv_draw_sw_rect.c:1260 @ 4209fc15)
vs  draw_border_generic (lv_draw_sw_rect.c:1260 @ 4209fc17)

When loading all address symbols, 4209fc15
points to the first instruction of the line.

When loading all histogram symbols,4209fc17 points to
the first instruction sampled by the histogram, which
happens 2B/1inst after the first instruction of the line.

This isn't a problem for me. If it's a problem for anyone,
we could reproduce the exact original printout by parsing the
address range of all functions that intersect the histograms.


More information about the Binutils mailing list