summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2017-08-11 10:08:18 +0000
committerkib <kib@FreeBSD.org>2017-08-11 10:08:18 +0000
commite203b8943676b875a13885c1a47c8c5d5b9fdf6d (patch)
tree93d57acdebaf02f1f531423c4cd25b93eccfd70c /usr.sbin
parentf7c5235e99d6e65565d292e8dc7438d7a5cb96ad (diff)
downloadFreeBSD-src-e203b8943676b875a13885c1a47c8c5d5b9fdf6d.zip
FreeBSD-src-e203b8943676b875a13885c1a47c8c5d5b9fdf6d.tar.gz
MFC r322059:
Fix off by one in calculation of the number of buckets for the pc addresses.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pmcstat/pmcpl_gprof.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/pmcstat/pmcpl_gprof.c b/usr.sbin/pmcstat/pmcpl_gprof.c
index b147786..acb339e 100644
--- a/usr.sbin/pmcstat/pmcpl_gprof.c
+++ b/usr.sbin/pmcstat/pmcpl_gprof.c
@@ -468,8 +468,8 @@ pmcpl_gmon_process(struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr,
image, pmcid);
pgf->pgf_pmcid = pmcid;
assert(image->pi_end > image->pi_start);
- pgf->pgf_nbuckets = (image->pi_end - image->pi_start) /
- FUNCTION_ALIGNMENT; /* see <machine/profile.h> */
+ pgf->pgf_nbuckets = howmany(image->pi_end - image->pi_start,
+ FUNCTION_ALIGNMENT); /* see <machine/profile.h> */
pgf->pgf_ndatabytes = sizeof(struct gmonhdr) +
pgf->pgf_nbuckets * hc_sz;
pgf->pgf_nsamples = 0;
OpenPOWER on IntegriCloud