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/pmccontrol/pmccontrol.c | |
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/pmccontrol/pmccontrol.c')
-rw-r--r-- | usr.sbin/pmccontrol/pmccontrol.c | 22 |
1 files changed, 1 insertions, 21 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); |