From owner-svn-src-all@freebsd.org Tue Jan 16 09:31:03 2018 Return-Path: Delivered-To: svn-src-all@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 2A7A9EB7A73; Tue, 16 Jan 2018 09:31:03 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 031B970074; Tue, 16 Jan 2018 09:31:03 +0000 (UTC) (envelope-from br@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 277341E8E5; Tue, 16 Jan 2018 09:31:02 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0G9V2V7078828; Tue, 16 Jan 2018 09:31:02 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0G9V2k8078827; Tue, 16 Jan 2018 09:31:02 GMT (envelope-from br@FreeBSD.org) Message-Id: <201801160931.w0G9V2k8078827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 16 Jan 2018 09:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328044 - head/lib/libpmcstat X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/lib/libpmcstat X-SVN-Commit-Revision: 328044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 09:31:03 -0000 Author: br Date: Tue Jan 16 09:31:01 2018 New Revision: 328044 URL: https://svnweb.freebsd.org/changeset/base/328044 Log: Fix bug: increment the value of pmcstat_npmcs instead of moving pointer to the next int position. Bug was introduced in r324959 ("Extract a set of pmcstat functions and interfaces to the new internal library -- libpmcstat.") This fixes pmcstat top mode (-T) operation. Example: pmcstat -n1 -S clock.hard -T Reported by: Peter Holm Sponsored by: DARPA, AFRL Modified: head/lib/libpmcstat/libpmcstat_logging.c Modified: head/lib/libpmcstat/libpmcstat_logging.c ============================================================================== --- head/lib/libpmcstat/libpmcstat_logging.c Tue Jan 16 08:00:07 2018 (r328043) +++ head/lib/libpmcstat/libpmcstat_logging.c Tue Jan 16 09:31:01 2018 (r328044) @@ -101,7 +101,7 @@ pmcstat_pmcid_add(pmc_id_t pmcid, pmcstat_interned_str pr->pr_pmcid = pmcid; pr->pr_pmcname = ps; - pr->pr_pmcin = *pmcstat_npmcs++; + pr->pr_pmcin = (*pmcstat_npmcs)++; pr->pr_samples = 0; pr->pr_dubious_frames = 0; pr->pr_merge = prm == NULL ? pr : prm;