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
This commit is contained in:
Ruslan Bukin 2018-01-16 09:31:01 +00:00
parent 8fc8068eba
commit 167b8a609d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=328044

View file

@ -101,7 +101,7 @@ pmcstat_pmcid_add(pmc_id_t pmcid, pmcstat_interned_string ps,
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;