Author: mmacy
Date: Mon Jun  4 21:42:21 2018
New Revision: 334641
URL: https://svnweb.freebsd.org/changeset/base/334641

Log:
  pmc stat: fix offset of specified counter

Modified:
  head/usr.sbin/pmc/cmd_pmc_stat.c   (contents, props changed)

Modified: head/usr.sbin/pmc/cmd_pmc_stat.c
==============================================================================
--- head/usr.sbin/pmc/cmd_pmc_stat.c    Mon Jun  4 21:21:55 2018        
(r334640)
+++ head/usr.sbin/pmc/cmd_pmc_stat.c    Mon Jun  4 21:42:21 2018        
(r334641)
@@ -86,6 +86,7 @@ getstathz(void)
 }
 
 #define STAT_MODE_NPMCS 6
+#define FIXED_MODE_NPMCS 2
 static struct timespec before_ts;
 #define CYCLES         0
 #define INST           1
@@ -179,7 +180,7 @@ pmc_stat_setup_stat(int system_mode, const char *arg)
                        if (pmc_pmu_sample_rate_get(counter) == 
DEFAULT_SAMPLE_COUNT)
                                errx(EX_USAGE, "ERROR: %s not recognized on 
host", counter);
                }
-               start = IAP_START + STAT_MODE_NPMCS - newcnt;
+               start = IAP_START + STAT_MODE_NPMCS - FIXED_MODE_NPMCS - newcnt;
                for (i = 0; i < newcnt; i++) {
                        stat_mode_cntrs[start + i] = new_cntrs[i];
                        stat_mode_names[start + i] = new_cntrs[i];
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to