From owner-svn-src-stable@freebsd.org Fri Aug 11 11:38:05 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F06A1DC8288; Fri, 11 Aug 2017 11:38:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDB976E243; Fri, 11 Aug 2017 11:38:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7BBc474052867; Fri, 11 Aug 2017 11:38:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7BBc4lw052866; Fri, 11 Aug 2017 11:38:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708111138.v7BBc4lw052866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 11 Aug 2017 11:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322399 - stable/10/usr.sbin/pmcstat X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/usr.sbin/pmcstat X-SVN-Commit-Revision: 322399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Aug 2017 11:38:06 -0000 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 */ + pgf->pgf_nbuckets = howmany(image->pi_end - image->pi_start, + FUNCTION_ALIGNMENT); /* see */ pgf->pgf_ndatabytes = sizeof(struct gmonhdr) + pgf->pgf_nbuckets * hc_sz; pgf->pgf_nsamples = 0;