diff options
author | fabient <fabient@FreeBSD.org> | 2010-03-08 19:58:00 +0000 |
---|---|---|
committer | fabient <fabient@FreeBSD.org> | 2010-03-08 19:58:00 +0000 |
commit | a8460cce17ebabfbca0131c6e1a00738d1277dc7 (patch) | |
tree | 0cc70dab8769706eb374fbf5208b3ab358ac46c6 /usr.sbin/pmcstat/pmcstat_log.c | |
parent | 2adbaaffe49e189520bb04b4737cc5658451b610 (diff) | |
download | FreeBSD-src-a8460cce17ebabfbca0131c6e1a00738d1277dc7.zip FreeBSD-src-a8460cce17ebabfbca0131c6e1a00738d1277dc7.tar.gz |
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.
MFC after: 3 days
Diffstat (limited to 'usr.sbin/pmcstat/pmcstat_log.c')
-rw-r--r-- | usr.sbin/pmcstat/pmcstat_log.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/usr.sbin/pmcstat/pmcstat_log.c b/usr.sbin/pmcstat/pmcstat_log.c index 5811af3..fc26001 100644 --- a/usr.sbin/pmcstat/pmcstat_log.c +++ b/usr.sbin/pmcstat/pmcstat_log.c @@ -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); } |