set stdout line-buffering in throughput tests

Line buffering allows monitoring progress via pipes or files, and as there is just one line of output per second, it doesn't affect performance

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-01-21 17:16:10 +01:00
parent 4483807e71
commit 6e7e1ca448
2 changed files with 3 additions and 0 deletions

View file

@ -57,6 +57,8 @@ int main (int argc, char **argv)
dds_entity_t writer;
ThroughputModule_DataType sample;
setvbuf (stdout, NULL, _IOLBF, 0);
if (parse_args(argc, argv, &payloadSize, &burstInterval, &burstSize, &timeOut, &partitionName) == EXIT_FAILURE) {
return EXIT_FAILURE;
}

View file

@ -98,6 +98,7 @@ int main (int argc, char **argv)
sat.sa_flags = 0;
sigaction (SIGINT, &sat, &oldAction);
#endif
setvbuf (stdout, NULL, _IOLBF, 0);
if (parse_args(argc, argv, &maxCycles, &partitionName) == EXIT_FAILURE)
{