Home | History | Annotate | Download | only in coregrind

Lines Matching defs:sink

115 /* Ok, the logging sink is running now.  Print a suitable preamble.
327 static void revert_sink_to_stderr ( OutputSink *sink )
329 sink->fd = 2; /* stderr */
330 sink->type = VgLogTo_Fd;
331 VG_(free)(sink->fsname_expanded);
332 sink->fsname_expanded = NULL;
335 static Int prepare_sink_fd(const HChar *clo_fname_unexpanded, OutputSink *sink,
351 sink->fsname_expanded = logfilename;
352 sink->type = VgLogTo_File;
364 OutputSink *sink, Bool is_xml)
384 vg_assert(sink->fd == 2);
385 vg_assert(sink->type == VgLogTo_Fd);
389 sink->type = VgLogTo_Socket;
394 static void finalize_sink_fd(OutputSink *sink, Int new_fd, Bool is_xml)
402 revert_sink_to_stderr(sink);
405 sink->fd = safe_fd;
409 /* Re-opens an output file sink when exanded file name differs from what we
410 have now. Returns 'True' if the sink was reopened */
412 OutputSink *sink, Bool is_xml)
414 if (sink->type == VgLogTo_File) {
420 if (VG_(strcmp)(logfilename, sink->fsname_expanded) != 0) {
421 Int fd = prepare_sink_fd(clo_fname_unexpanded, sink, is_xml);
422 finalize_sink_fd(sink, fd, is_xml);
488 sink has been selected, and we indiscriminately chuck stuff into it
569 /* Do the low-level send of a message to the logging sink. */
571 void send_bytes_to_logging_sink ( OutputSink* sink, const HChar* msg, Int nbytes )
573 if (sink->type == VgLogTo_Socket) {
574 Int rc = VG_(write_socket)( sink->fd, msg, nbytes );
577 revert_sink_to_stderr(sink);
578 VG_(write)( sink->fd, msg, nbytes );
581 /* sink->fd could have been set to -1 in the various
585 if (sink->fd >= 0)
586 VG_(write)( sink->fd, msg, nbytes );
587 else if (sink->fd == -2 && nbytes > 0)
605 OutputSink* sink;
610 // full, we write its contents to the logging sink.
616 send_bytes_to_logging_sink( b->sink, b->buf, b->buf_used );
628 if (b->sink->fd >= 0 || b->sink->fd == -2) {
635 static UInt vprintf_WRK ( OutputSink* sink,
639 = { "", 0, sink };
644 send_bytes_to_logging_sink( myprintf_buf.sink,
932 OutputSink* sink;
944 // contents to the logging sink.
1020 send_bytes_to_logging_sink( b->sink, b->buf, b->buf_used );
1048 send_bytes_to_logging_sink( b->sink, b->buf, b->buf_used );
1128 send_bytes_to_logging_sink( b->sink, b->buf, b->buf_used );