aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pmc/cmd_pmc_stat.c
diff options
context:
space:
mode:
authorMatt Macy <mmacy@FreeBSD.org>2018-06-04 21:42:21 +0000
committerMatt Macy <mmacy@FreeBSD.org>2018-06-04 21:42:21 +0000
commit6e69774ad439329a972719c2f2d1e7e919f51ca3 (patch)
tree6e2f14e73eae21e977c0e7be0cccbc1896b9c3fa /usr.sbin/pmc/cmd_pmc_stat.c
parent0929b3d971aa362466c7a653ad8d43e103f09097 (diff)
pmc stat: fix offset of specified counter
Notes
Notes: svn path=/head/; revision=334641
Diffstat (limited to 'usr.sbin/pmc/cmd_pmc_stat.c')
-rw-r--r--usr.sbin/pmc/cmd_pmc_stat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/pmc/cmd_pmc_stat.c b/usr.sbin/pmc/cmd_pmc_stat.c
index 3b5eed347b05..e32efb64a3d3 100644
--- a/usr.sbin/pmc/cmd_pmc_stat.c
+++ b/usr.sbin/pmc/cmd_pmc_stat.c
@@ -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];