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


On Tuesday, May 09, 2006 3:21 PM, Hien Nguyen wrote:
> While working on the the systemtap GUI we run into the problem of
> getting the stdout to the gui app in a timely fashion. We does get the
> output as a blob of text once in a while (looks like data were only
> flushed out when the buffer is full). To recreate the problem you can
> try this
> 
> stap -e 'probe syscall.open{ log(filename) }' | tee
> 
> Anyway, I added one line of code to flushout the data as soon as the
> stpd gets it. It seems to solve the above problem. To avoid
> unnecessary performance issues for others, perhaps we should have
> that as an option. What do you think?

I've run into this with Perl scripts before -- Perl normally
line-buffers output to STDOUT and block-buffers otherwise (e.g. to a
pipe or socket).  Their solution for this problem is an autoflush
option:
http://perldoc.perl.org/perlvar.html#HANDLE->autoflush(EXPR)

I think it would be very reasonable to support a similar command-line
option in stap/stpd.


Josh


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