From 167b8a609df9e746e67cf34a54bdef9f1627d49c Mon Sep 17 00:00:00 2001 From: Ruslan Bukin Date: Tue, 16 Jan 2018 09:31:01 +0000 Subject: [PATCH] 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 --- lib/libpmcstat/libpmcstat_logging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libpmcstat/libpmcstat_logging.c b/lib/libpmcstat/libpmcstat_logging.c index d86762f38bb..a77a326b9ab 100644 --- a/lib/libpmcstat/libpmcstat_logging.c +++ b/lib/libpmcstat/libpmcstat_logging.c @@ -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;