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; _______________________________________________ svn-src-stable-10@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"