From owner-svn-src-all@FreeBSD.ORG Fri Jul 15 11:30:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ACCA10656D1; Fri, 15 Jul 2011 11:30:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B5808FC1F; Fri, 15 Jul 2011 11:30:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6FBUfME078316; Fri, 15 Jul 2011 11:30:41 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6FBUfTi078313; Fri, 15 Jul 2011 11:30:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201107151130.p6FBUfTi078313@svn.freebsd.org> From: Andriy Gapon Date: Fri, 15 Jul 2011 11:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224057 - in head/usr.sbin: pmccontrol pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2011 11:30:42 -0000 Author: avg Date: Fri Jul 15 11:30:41 2011 New Revision: 224057 URL: http://svn.freebsd.org/changeset/base/224057 Log: pmcstat, pmccontrol: catch up with removal of machdep.hlt_cpus sysctl Reported by: Pan Tsu Reviewed by: attilio No objections: gnn Modified: head/usr.sbin/pmccontrol/pmccontrol.c head/usr.sbin/pmcstat/pmcstat.c Modified: head/usr.sbin/pmccontrol/pmccontrol.c ============================================================================== --- head/usr.sbin/pmccontrol/pmccontrol.c Fri Jul 15 09:37:14 2011 (r224056) +++ head/usr.sbin/pmccontrol/pmccontrol.c Fri Jul 15 11:30:41 2011 (r224057) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -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_li 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); Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Fri Jul 15 09:37:14 2011 (r224056) +++ head/usr.sbin/pmcstat/pmcstat.c Fri Jul 15 11:30:41 2011 (r224057) @@ -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);