From 2b34ccadbe56eca1d41cf8eb3ddfb32d8f28dd73 Mon Sep 17 00:00:00 2001 From: Sitsofe Wheeler Date: Sat, 23 Dec 2017 09:55:02 +0000 Subject: [PATCH] eta: show complete status line with max job states Make the ETA output buffer big enough to cope with the maximum possible jobs when their states can't be compressed (i.e. when every job's state is different to the state of the job that came before it). Allows the following script to display the complete status line: rw[0]='read'; rw[1]='write'; \ for i in {1..4096}; do \ echo -e "[job$i]\nrw=${rw[$((i % 2))]}\n" \ "runtime=15"; \ done | \ ./fio --eta=always --group_reporting=1 --ioengine=null --size=1g \ --time_based --bs=1k --thread --rate_iops=1 - Fixes: https://github.com/axboe/fio/issues/500 ("Large number of threads result in Seg faults") Signed-off-by: Sitsofe Wheeler --- eta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eta.c b/eta.c index d019747b..0b795263 100644 --- a/eta.c +++ b/eta.c @@ -520,7 +520,7 @@ void display_thread_status(struct jobs_eta *je) static int eta_new_line_init, eta_new_line_pending; static int linelen_last; static int eta_good; - char output[REAL_MAX_JOBS + 512], *p = output; + char output[__THREAD_RUNSTR_SZ(REAL_MAX_JOBS) + 512], *p = output; char eta_str[128]; double perc = 0.0; -- 2.25.1