svn commit: r322399 - stable/10/usr.sbin/pmcstat
Konstantin Belousov
kib at FreeBSD.org
Fri Aug 11 11:38:06 UTC 2017
Author: kib
Date: Fri Aug 11 11:38:04 2017
New Revision: 322399
URL: https://svnweb.freebsd.org/changeset/base/322399
Log:
MFC r322059:
Fix off by one in calculation of the number of buckets for the pc
addresses.
Approved by: re (marius)
Modified:
stable/10/usr.sbin/pmcstat/pmcpl_gprof.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.sbin/pmcstat/pmcpl_gprof.c
==============================================================================
--- stable/10/usr.sbin/pmcstat/pmcpl_gprof.c Fri Aug 11 10:59:34 2017 (r322398)
+++ stable/10/usr.sbin/pmcstat/pmcpl_gprof.c Fri Aug 11 11:38:04 2017 (r322399)
@@ -464,8 +464,8 @@ pmcpl_gmon_process(struct pmcstat_process *pp, struct
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;
More information about the svn-src-stable
mailing list