Date: Fri, 4 Aug 2017 18:02:54 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322059 - head/usr.sbin/pmcstat Message-ID: <201708041802.v74I2suo057919@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Fri Aug 4 18:02:54 2017 New Revision: 322059 URL: https://svnweb.freebsd.org/changeset/base/322059 Log: Fix off by one in calculation of the number of buckets for the pc addresses. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D11864 Modified: head/usr.sbin/pmcstat/pmcpl_gprof.c Modified: head/usr.sbin/pmcstat/pmcpl_gprof.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_gprof.c Fri Aug 4 17:41:49 2017 (r322058) +++ head/usr.sbin/pmcstat/pmcpl_gprof.c Fri Aug 4 18:02:54 2017 (r322059) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708041802.v74I2suo057919>