From 7816cb4a0b5d999211176fca48905e23b5c89688 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 1 Sep 2015 17:52:43 +0000 Subject: [PATCH] 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 --- usr.sbin/pmcstat/pmcstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index c51c5fa6daf0..914fc17d1f8e 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;