diff options
Diffstat (limited to 'usr.sbin/pmcstat')
-rw-r--r-- | usr.sbin/pmcstat/pmcstat.8 | 6 | ||||
-rw-r--r-- | usr.sbin/pmcstat/pmcstat.c | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/pmcstat/pmcstat.8 b/usr.sbin/pmcstat/pmcstat.8 index 7361ceb..f0a3a47 100644 --- a/usr.sbin/pmcstat/pmcstat.8 +++ b/usr.sbin/pmcstat/pmcstat.8 @@ -209,9 +209,9 @@ Argument .Ar cpu-spec is a comma separated list of CPU numbers, or the literal .Sq * -denoting all CPUs. -The default is to allocate system mode PMCs on all active CPUs in -the system. +denoting all unhalted CPUs. +The default is to allocate system mode PMCs on all unhalted +CPUs. .It Fl d Toggle between process mode PMCs measuring events for the target process' current and future children or only measuring events for diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index 0e9a54a..8cbe55b 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -581,6 +581,7 @@ main(int argc, char **argv) if (sysctlbyname("hw.ncpu", &ncpu, &dummy, NULL, 0) < 0) err(EX_OSERR, "ERROR: Cannot determine the number of CPUs"); cpumask = (1 << ncpu) - 1; + haltedcpus = 0; if (ncpu > 1) { if (sysctlbyname("machdep.hlt_cpus", &haltedcpus, &dummy, NULL, 0) < 0) @@ -600,7 +601,7 @@ main(int argc, char **argv) case 'c': /* CPU */ if (optarg[0] == '*' && optarg[1] == '\0') - cpumask = (1 << ncpu) - 1; + cpumask = ((1 << ncpu) - 1) & ~haltedcpus; else cpumask = pmcstat_get_cpumask(optarg); @@ -1149,7 +1150,7 @@ main(int argc, char **argv) if (SLIST_EMPTY(&args.pa_targets)) errx(EX_DATAERR, "ERROR: No matching target " "processes."); - else + if (args.pa_flags & FLAG_HAS_PROCESS_PMCS) pmcstat_attach_pmcs(&args); if (pmcstat_kvm) { |