Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2018 09:31:02 +0000 (UTC)
From:      Ruslan Bukin <br@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328044 - head/lib/libpmcstat
Message-ID:  <201801160931.w0G9V2k8078827@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <peter@holm.cc>
  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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801160931.w0G9V2k8078827>