Add indication of whether a job got killed
authorJens Axboe <axboe@kernel.dk>
Mon, 2 Apr 2012 16:47:09 +0000 (09:47 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 2 Apr 2012 16:47:09 +0000 (09:47 -0700)
We have 'X' for exited with error, add 'K' for killed by
signal as well.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
HOWTO
backend.c
eta.c
fio.h

diff --git a/HOWTO b/HOWTO
index 9263da2feac2e1151d78b58c7ddb023ca1ea507d..662689ef304da064f677bdf5bf62b408e604abf3 100644 (file)
--- 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
index 23734d595d0d60325e0d2df7aa12fa13750fcc54..ec42a5cd23cc7e6e90c7c21206bcf8ff4f206c7a 100644 (file)
--- 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 4ad67629580cdb2b567166bd111282c4fb094bfa..7e837badc6d1b35368f26f82708aab6fe5e207a5 100644 (file)
--- 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 f59265a2a47d22ff31e43ab7ca475fc175043ef3..cf2e3c51aa2d2c9a4430164638f3ca60de2d4c76 100644 (file)
--- 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;