Fix bad random offset generation for file map
[fio.git] / eta.c
diff --git a/eta.c b/eta.c
index ba6a3989366f37b025c42b5a4569e91ab707febe..d93bf1a16f80ff51f9b025149568f3a199472970 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -7,7 +7,7 @@
 
 #include "fio.h"
 
-static char run_str[MAX_JOBS + 1];
+static char run_str[REAL_MAX_JOBS + 1];
 
 /*
  * Sets the status of the 'td' in the printed status map.
@@ -28,10 +28,21 @@ static void check_str_update(struct thread_data *td)
                break;
        case TD_RUNNING:
                if (td_rw(td)) {
-                       if (td_random(td))
-                               c = 'm';
-                       else
-                               c = 'M';
+                       if (td_random(td)) {
+                               if (td->o.rwmix[DDIR_READ] == 100)
+                                       c = 'r';
+                               else if (td->o.rwmix[DDIR_WRITE] == 100)
+                                       c = 'w';
+                               else
+                                       c = 'm';
+                       } else {
+                               if (td->o.rwmix[DDIR_READ] == 100)
+                                       c = 'R';
+                               else if (td->o.rwmix[DDIR_WRITE] == 100)
+                                       c = 'W';
+                               else
+                                       c = 'M';
+                       }
                } else if (td_read(td)) {
                        if (td_random(td))
                                c = 'r';
@@ -391,7 +402,7 @@ void print_thread_status(void)
        fflush(stdout);
 }
 
-void print_status_init(int thread_number)
+void print_status_init(int thr_number)
 {
-       run_str[thread_number] = 'P';
+       run_str[thr_number] = 'P';
 }