svn commit: r322396 - stable/11/usr.sbin/pmcstat

Konstantin Belousov kib at FreeBSD.org
Fri Aug 11 10:08:20 UTC 2017


Author: kib
Date: Fri Aug 11 10:08:18 2017
New Revision: 322396
URL: https://svnweb.freebsd.org/changeset/base/322396

Log:
  MFC r322059:
  Fix off by one in calculation of the number of buckets for the pc
  addresses.

Modified:
  stable/11/usr.sbin/pmcstat/pmcpl_gprof.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/pmcstat/pmcpl_gprof.c
==============================================================================
--- stable/11/usr.sbin/pmcstat/pmcpl_gprof.c	Fri Aug 11 10:05:41 2017	(r322395)
+++ stable/11/usr.sbin/pmcstat/pmcpl_gprof.c	Fri Aug 11 10:08:18 2017	(r322396)
@@ -468,8 +468,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-all mailing list