Date: Thu, 11 Mar 2010 07:39:36 +0000 (UTC) From: Fabien Thomas <fabient@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r205001 - stable/7/usr.sbin/pmcstat Message-ID: <201003110739.o2B7daIk003018@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003110739.o2B7daIk003018>