diff options
| author | Joseph Koshy <jkoshy@FreeBSD.org> | 2008-10-07 17:28:52 +0000 |
|---|---|---|
| committer | Joseph Koshy <jkoshy@FreeBSD.org> | 2008-10-07 17:28:52 +0000 |
| commit | 5477328d814cbca3ee8887b5caa0f0f604444be1 (patch) | |
| tree | d96073a1f6693ee08ef3c93c2fcbc751d114a749 /usr.sbin/pmcstat | |
| parent | d7798997d782906967fb8f141d4eb0d8ee73b4a0 (diff) | |
Notes
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 7361ceb72bed..f0a3a471c8a2 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 0e9a54a45d7b..8cbe55b44cc9 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) { |
