This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [RFC] Add possibility to force buffering mode for stdout/stderr


On 08/21/2013 11:08 PM, Pierre Muller wrote:
basically adding
"-ex {maint setvbuf stdout full 1000000}"
or
"-ex {maint setvbuf stdout line 80}"
should allow to test both performance differences
induced by buffering changes and possible regressions
in testsuite results.

This patch is really only of interest to developers
using the testsuite or wanting to investigate
performance issues related to buffering.

Pierre,
I am afraid we can't call setvbuf on-the-fly to adjust the buffering to
a stream.

  "The setvbuf() function may be used after the stream pointed to by
stream is associated with an open file but before any other operation"
See http://pubs.opengroup.org/onlinepubs/009696699/functions/setvbuf.html

setvbuf on Windows has similar requirement.

Even this command is only used once like "-ex {maint setvbuf stdout full 1000000}" or "-iex {maint setvbuf stdout line 80}", they are executed after GDB printed version info to stdout, so it is not right to call setvbuf, IMO.

--
Yao (éå)


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