From owner-svn-src-all@FreeBSD.ORG Mon May 24 18:21:42 2010 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 9DB191065670; Mon, 24 May 2010 18:21:42 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 726D88FC1C; Mon, 24 May 2010 18:21:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4OILgcU078318; Mon, 24 May 2010 18:21:42 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4OILgYp078316; Mon, 24 May 2010 18:21:42 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201005241821.o4OILgYp078316@svn.freebsd.org> From: Ryan Stone Date: Mon, 24 May 2010 18:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208517 - stable/8/sys/dev/hwpmc 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: Mon, 24 May 2010 18:21:42 -0000 Author: rstone Date: Mon May 24 18:21:42 2010 New Revision: 208517 URL: http://svn.freebsd.org/changeset/base/208517 Log: MFC r207484: When configuring a system-wide couting PMC, hwpmc was incorrectly logging process mappings for that PMC. Nothing ever reads pmc logs out of a counting PMC, so the log buffers were leaked when the PMC was deconfigured. The process mappings are only useful for sampling PMCs anyway, so only log the mappings if the PMC is a sampling PMC. This bug would cause allocating sample-mode PMCs to fail with ENOMEM after allocating several counting-mode PMCs. Approved by: emaste (mentor) Modified: stable/8/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_mod.c Mon May 24 18:00:28 2010 (r208516) +++ stable/8/sys/dev/hwpmc/hwpmc_mod.c Mon May 24 18:21:42 2010 (r208517) @@ -2675,16 +2675,16 @@ pmc_start(struct pmc *pm) PMCDBG(PMC,OPS,1, "po=%p in global list", po); } po->po_sscount++; - } - /* - * Log mapping information for all existing processes in the - * system. Subsequent mappings are logged as they happen; - * see pmc_process_mmap(). - */ - if (po->po_logprocmaps == 0) { - pmc_log_all_process_mappings(po); - po->po_logprocmaps = 1; + /* + * Log mapping information for all existing processes in the + * system. Subsequent mappings are logged as they happen; + * see pmc_process_mmap(). + */ + if (po->po_logprocmaps == 0) { + pmc_log_all_process_mappings(po); + po->po_logprocmaps = 1; + } } /*