This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stpd and stdout


Martin Hunt wrote:

I think that in this case (stdout from procfs) it should always be
line-buffered. No option is necessary.  In fact I tried it and couldn't
measure any significant performance advantage for full buffering.  I've
gone ahead and committed the following patch.  Let me know how it works.

Index: librelay.c
===================================================================
RCS file: /cvs/systemtap/src/runtime/stpd/librelay.c,v
retrieving revision 1.37
diff -u -r1.37 librelay.c
--- librelay.c  8 Apr 2006 21:59:36 -0000       1.37
+++ librelay.c  18 May 2006 17:51:31 -0000
@@ -722,6 +722,7 @@
       int type;
       FILE *ofp = stdout;

+       setvbuf(ofp, (char *)NULL, _IOLBF, 0);
       pthread_mutex_init(&processing_mutex, NULL);

signal(SIGINT, sigproc);




Thanks Martin, it works.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]