From a5e371a61c9e37a2389f7473d65e35b29dec1ccd Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 2 Apr 2012 09:47:09 -0700 Subject: [PATCH] Add indication of whether a job got killed We have 'X' for exited with error, add 'K' for killed by signal as well. Signed-off-by: Jens Axboe --- HOWTO | 1 + backend.c | 2 ++ eta.c | 2 ++ fio.h | 1 + 4 files changed, 6 insertions(+) diff --git a/HOWTO b/HOWTO index 9263da2f..662689ef 100644 --- a/HOWTO +++ b/HOWTO @@ -1341,6 +1341,7 @@ I Thread initialized, waiting. E Thread exited, not reaped by main thread yet. _ Thread reaped, or X Thread reaped, exited with an error. +K Thread reaped, exited due to signal. The other values are fairly self explanatory - number of threads currently running and doing io, rate of io since last check (read speed diff --git a/backend.c b/backend.c index 23734d59..ec42a5cd 100644 --- a/backend.c +++ b/backend.c @@ -1294,6 +1294,7 @@ static void reap_threads(unsigned int *nr_running, unsigned int *t_rate, if (errno == ECHILD) { log_err("fio: pid=%d disappeared %d\n", (int) td->pid, td->runstate); + td->sig = ECHILD; td_set_runstate(td, TD_REAPED); goto reaped; } @@ -1305,6 +1306,7 @@ static void reap_threads(unsigned int *nr_running, unsigned int *t_rate, if (sig != SIGTERM) log_err("fio: pid=%d, got signal=%d\n", (int) td->pid, sig); + td->sig = sig; td_set_runstate(td, TD_REAPED); goto reaped; } diff --git a/eta.c b/eta.c index 4ad67629..7e837bad 100644 --- a/eta.c +++ b/eta.c @@ -20,6 +20,8 @@ static void check_str_update(struct thread_data *td) case TD_REAPED: if (td->error) c = 'X'; + else if (td->sig) + c = 'K'; else c = '_'; break; diff --git a/fio.h b/fio.h index f59265a2..cf2e3c51 100644 --- a/fio.h +++ b/fio.h @@ -310,6 +310,7 @@ struct thread_data { struct frand_state __next_file_state; }; int error; + int sig; int done; pid_t pid; char *orig_buffer; -- 2.25.1