From owner-svn-src-stable-7@FreeBSD.ORG Thu Mar 11 07:39:37 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28C341065672; Thu, 11 Mar 2010 07:39:37 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1793D8FC13; Thu, 11 Mar 2010 07:39:37 +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 o2B7daiL003020; Thu, 11 Mar 2010 07:39:36 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2B7daIk003018; Thu, 11 Mar 2010 07:39:36 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201003110739.o2B7daIk003018@svn.freebsd.org> From: Fabien Thomas Date: Thu, 11 Mar 2010 07:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205001 - stable/7/usr.sbin/pmcstat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Mar 2010 07:39:37 -0000 Author: fabient Date: Thu Mar 11 07:39:36 2010 New Revision: 205001 URL: http://svn.freebsd.org/changeset/base/205001 Log: MFC r204878: Change the way shutdown is handled for log file. pmc_flush_logfile is now non-blocking and just ask the kernel to shutdown the file. From that point, no more data is accepted by the log thread and when the last buffer is flushed the file is closed. This will remove a deadlock between pmcstat asking for flush while it cannot flush the pipe itself. Modified: stable/7/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/7/usr.sbin/pmcstat/ (props changed) Modified: stable/7/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/7/usr.sbin/pmcstat/pmcstat_log.c Thu Mar 11 07:38:27 2010 (r205000) +++ stable/7/usr.sbin/pmcstat/pmcstat_log.c Thu Mar 11 07:39:36 2010 (r205001) @@ -1670,10 +1670,8 @@ pmcstat_print_log(void) int pmcstat_close_log(void) { - if (pmc_flush_logfile() < 0 || - pmc_configure_logfile(-1) < 0) + if (pmc_flush_logfile() < 0) err(EX_OSERR, "ERROR: logging failed"); - args.pa_flags &= ~(FLAG_HAS_OUTPUT_LOGFILE | FLAG_HAS_PIPE); return (args.pa_flags & FLAG_HAS_PIPE ? PMCSTAT_EXITING : PMCSTAT_FINISHED); }