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 <axboe@kernel.dk>
diff --git a/HOWTO b/HOWTO
index 9263da2..662689e 100644
--- a/HOWTO
+++ b/HOWTO
@@ -1341,6 +1341,7 @@
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 23734d5..ec42a5c 100644
--- a/backend.c
+++ b/backend.c
@@ -1294,6 +1294,7 @@
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 @@
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 4ad6762..7e837ba 100644
--- a/eta.c
+++ b/eta.c
@@ -20,6 +20,8 @@
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 f59265a..cf2e3c5 100644
--- a/fio.h
+++ b/fio.h
@@ -310,6 +310,7 @@
struct frand_state __next_file_state;
};
int error;
+ int sig;
int done;
pid_t pid;
char *orig_buffer;