[PATCH] Improve run_str[] updates and printing
authorJens Axboe <axboe@suse.de>
Thu, 8 Jun 2006 12:46:24 +0000 (14:46 +0200)
committerJens Axboe <axboe@suse.de>
Thu, 8 Jun 2006 12:46:24 +0000 (14:46 +0200)
fio.c
fio.h

diff --git a/fio.c b/fio.c
index 4446335..cc71a08 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -513,7 +513,6 @@ static struct io_u *get_io_u(struct thread_data *td)
 
 static inline void td_set_runstate(struct thread_data *td, int runstate)
 {
-       td->old_runstate = td->runstate;
        td->runstate = runstate;
 }
 
@@ -1421,9 +1420,6 @@ static void check_str_update(struct thread_data *td)
 {
        char c = run_str[td->thread_number - 1];
 
-       if (td->runstate == td->old_runstate)
-               return;
-
        switch (td->runstate) {
                case TD_REAPED:
                        c = '_';
@@ -1469,7 +1465,6 @@ static void check_str_update(struct thread_data *td)
        }
 
        run_str[td->thread_number - 1] = c;
-       td->old_runstate = td->runstate;
 }
 
 static void eta_to_str(char *str, int eta_sec)
@@ -1614,6 +1609,9 @@ static void print_thread_status(void)
                eta_to_str(eta_str, eta_sec);
        }
 
+       if (!nr_running)
+               return;
+
        printf("Threads now running (%d)", nr_running);
        if (m_rate || t_rate)
                printf(", commitrate %d/%dKiB/sec", t_rate, m_rate);
diff --git a/fio.h b/fio.h
index 1bc72a6..671cb22 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -153,7 +153,6 @@ struct thread_data {
        size_t orig_buffer_size;
        volatile int terminate;
        volatile int runstate;
-       volatile int old_runstate;
        enum fio_ddir ddir;
        unsigned int iomix;
        unsigned int ioprio;