diff options
author | avg <avg@FreeBSD.org> | 2011-07-15 11:30:41 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2011-07-15 11:30:41 +0000 |
commit | 466a13c175275736c8af0c003ec4a4f0ec0abd48 (patch) | |
tree | 6311d5740943ee37cb0406e019c3ce131651b2d9 /usr.sbin | |
parent | 70f535313aa1ca4af3ed671bb68989fe80d925ae (diff) | |
download | FreeBSD-src-466a13c175275736c8af0c003ec4a4f0ec0abd48.zip FreeBSD-src-466a13c175275736c8af0c003ec4a4f0ec0abd48.tar.gz |
pmcstat, pmccontrol: catch up with removal of machdep.hlt_cpus sysctl
Reported by: Pan Tsu <inyaoo@gmail.com>
Reviewed by: attilio
No objections: gnn
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pmccontrol/pmccontrol.c | 22 | ||||
-rw-r--r-- | usr.sbin/pmcstat/pmcstat.c | 12 |
2 files changed, 3 insertions, 31 deletions
diff --git a/usr.sbin/pmccontrol/pmccontrol.c b/usr.sbin/pmccontrol/pmccontrol.c index 80d4bd7..35ea005 100644 --- a/usr.sbin/pmccontrol/pmccontrol.c +++ b/usr.sbin/pmccontrol/pmccontrol.c @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/queue.h> -#include <sys/cpuset.h> #include <sys/sysctl.h> #include <assert.h> @@ -134,33 +133,15 @@ pmcc_init_debug(void) static int pmcc_do_enable_disable(struct pmcc_op_list *op_list) { - long cpusetsize; int c, error, i, j, ncpu, npmc, t; - cpuset_t haltedcpus, cpumask; struct pmcc_op *np; unsigned char *map; unsigned char op; int cpu, pmc; - size_t setsize; if ((ncpu = pmc_ncpu()) < 0) err(EX_OSERR, "Unable to determine the number of cpus"); - /* Determine the set of active CPUs. */ - cpusetsize = sysconf(_SC_CPUSET_SIZE); - if (cpusetsize == -1 || (u_long)cpusetsize > sizeof(cpuset_t)) { - err(EX_OSERR, "ERROR: Cannot determine which CPUs are " - "halted"); - } - CPU_ZERO(&haltedcpus); - setsize = (size_t)cpusetsize; - if (ncpu > 1 && sysctlbyname("machdep.hlt_cpus", &haltedcpus, - &setsize, NULL, 0) < 0) - err(EX_OSERR, "ERROR: Cannot determine which CPUs are " - "halted"); - CPU_FILL(&cpumask); - CPU_NAND(&cpumask, &haltedcpus); - /* Determine the maximum number of PMCs in any CPU. */ npmc = 0; for (c = 0; c < ncpu; c++) { @@ -207,8 +188,7 @@ pmcc_do_enable_disable(struct pmcc_op_list *op_list) if (cpu == PMCC_CPU_ALL) for (i = 0; i < ncpu; i++) { - if (CPU_ISSET(i, &cpumask)) - SET_PMCS(i, pmc, op); + SET_PMCS(i, pmc, op); } else SET_PMCS(cpu, pmc, op); diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index ab3846c..52e02a8 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -552,7 +552,7 @@ int main(int argc, char **argv) { double interval; - int option, npmc, ncpu, haltedcpus; + int option, npmc, ncpu; int c, check_driver_stats, current_cpu, current_sampling_count; int do_callchain, do_descendants, do_logproccsw, do_logprocexit; int do_print; @@ -617,14 +617,6 @@ 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) - err(EX_OSERR, "ERROR: Cannot determine which CPUs are " - "halted"); - cpumask &= ~haltedcpus; - } while ((option = getopt(argc, argv, "CD:EF:G:M:NO:P:R:S:TWc:df:gk:m:n:o:p:qr:s:t:vw:z:")) != -1) @@ -637,7 +629,7 @@ main(int argc, char **argv) case 'c': /* CPU */ if (optarg[0] == '*' && optarg[1] == '\0') - cpumask = ((1 << ncpu) - 1) & ~haltedcpus; + cpumask = (1 << ncpu) - 1; else cpumask = pmcstat_get_cpumask(optarg); |