summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pmcstat
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-09-01 17:52:43 +0000
committerjhb <jhb@FreeBSD.org>2015-09-01 17:52:43 +0000
commit5fbb8e5fa1fa251599f3a172bf83df8bf15ce6f3 (patch)
tree2579f0567994afdff26786615d83da1c78b3916c /usr.sbin/pmcstat
parent6e27baa21bbadf0b73654a305632e54bc5d93d3e (diff)
downloadFreeBSD-src-5fbb8e5fa1fa251599f3a172bf83df8bf15ce6f3.zip
FreeBSD-src-5fbb8e5fa1fa251599f3a172bf83df8bf15ce6f3.tar.gz
Fix an off by one error in r283613: Like regular ffs(), CPU_FFS() returns
1 for CPU 0, etc. so the return value must be decremented to obtain the first valid CPU ID. Submitted by: fabient MFC after: 1 week
Diffstat (limited to 'usr.sbin/pmcstat')
-rw-r--r--usr.sbin/pmcstat/pmcstat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c
index c51c5fa..914fc17 100644
--- a/usr.sbin/pmcstat/pmcstat.c
+++ b/usr.sbin/pmcstat/pmcstat.c
@@ -769,7 +769,7 @@ main(int argc, char **argv)
ev->ev_count = -1;
if (option == 'S' || option == 's')
- ev->ev_cpu = CPU_FFS(&cpumask);
+ ev->ev_cpu = CPU_FFS(&cpumask) - 1;
else
ev->ev_cpu = PMC_CPU_ANY;
OpenPOWER on IntegriCloud