diff options
author | Richard Allen <rsaxvc@gmail.com> | 2025-02-09 10:49:01 -0600 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2025-02-10 08:58:02 +1030 |
commit | 2effb0d11fd184e432dbce2cd6e45240471c1189 (patch) | |
tree | e2400377bfa972801a863f6f9f395a4f04c4404b /gprof/hist.c | |
parent | cb0930a0005f2e4229a0ad253236b432ba95524f (diff) | |
download | gdb-2effb0d11fd184e432dbce2cd6e45240471c1189.zip gdb-2effb0d11fd184e432dbce2cd6e45240471c1189.tar.gz gdb-2effb0d11fd184e432dbce2cd6e45240471c1189.tar.bz2 |
gprof: fix odd inst len hist scale calculation
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>
Diffstat (limited to 'gprof/hist.c')
-rw-r--r-- | gprof/hist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gprof/hist.c b/gprof/hist.c index 1193b70..c82b5cd 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) |