Add a new flag, --child-silent-after-fork=no|yes [no]. When enabled,

causes child processes after fork to fall completely silent, which can
make the output a lot less confusing.  In addition it is pretty much
essential in XML output mode, so as to avoid mixing up any child XML
output with the parent's.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7177
This commit is contained in:
Julian Seward
2007-11-17 22:29:25 +00:00
parent e83bc0c180
commit 29ff6066e9
7 changed files with 43 additions and 3 deletions

View File

@@ -333,6 +333,13 @@ SysRes ML_(do_fork_clone) ( ThreadId tid, UInt flags,
/* restore signal mask */
VG_(sigprocmask)(VKI_SIG_SETMASK, &fork_saved_mask, NULL);
/* If --child-silent-after-fork=yes was specified, set the
logging file descriptor to an 'impossible' value. This is
noticed by send_bytes_to_logging_sink in m_libcprint.c, which
duly stops writing any further logging output. */
if (!VG_(logging_to_socket) && VG_(clo_child_silent_after_fork))
VG_(clo_log_fd) = -1;
}
else
if (!res.isError && res.res > 0) {