From: Kris Davis Date: Wed, 30 Sep 2015 16:00:00 +0000 (+0200) Subject: Use line buffering on stdout X-Git-Tag: fio-2.2.11~28 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=18dc4295f53c83af3feba6861b5bdbaf09d720fe Use line buffering on stdout Line Buffer stdio to prevent multi-thread output from mixing within a line Signed-off-by: Jens Axboe --- diff --git a/fio.c b/fio.c index ee6eae24..bafbd48e 100644 --- a/fio.c +++ b/fio.c @@ -42,6 +42,12 @@ int main(int argc, char *argv[], char *envp[]) if (parse_options(argc, argv)) goto done; + /* + * line buffer stdout to avoid output lines from multiple + * threads getting mixed + */ + setvbuf(stdout, NULL, _IOLBF, 0); + fio_time_init(); if (nr_clients) {