[PATCH 4/4] gprof: fix odd inst len hist scale calculation
Richard Allen
rsaxvc@gmail.com
Sun Feb 9 16:49:01 GMT 2025
With even instruction sizes, this rounding never truncated.
Xtensa CPUs mostly use 2-3 byte instructions, and this can lead
to a histogram being captured with an odd length address range.
This small truncation prevented gprof from parsing gmon.out files
containing multiple histograms when at least one of them has an
odd address range length and another has any other address range.
Signed-off-by: Richard Allen <rsaxvc@gmail.com>
---
gprof/hist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gprof/hist.c b/gprof/hist.c
index 1193b7025e9..c82b5cd4db7 100644
--- a/gprof/hist.c
+++ b/gprof/hist.c
@@ -109,7 +109,7 @@ read_histogram_header (histogram *record,
done (1);
}
- n_hist_scale = (double)((record->highpc - record->lowpc) / sizeof (UNIT))
+ n_hist_scale = (double)(record->highpc - record->lowpc) / sizeof (UNIT)
/ record->num_bins;
if (first)
--
2.39.5
More information about the Binutils
mailing list