Add ramp_time option
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index cedbfb0d44e61bce100fbe5bf1b902d5b4a91ebe..2a09fbe2d71b68fe40eaa0f7fb4f77056219d81f 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -125,6 +125,17 @@ static void sig_int(int sig)
        }
 }
 
+static void sig_ill(int sig)
+{
+       if (!threads)
+               return;
+
+       log_err("fio: illegal instruction. your cpu does not support "
+               "the sse4.2 instruction for crc32c\n");
+       terminate_threads(TERMINATE_ALL);
+       exit(4);
+}
+
 static void set_sig_handlers(void)
 {
        struct sigaction act;
@@ -138,6 +149,11 @@ static void set_sig_handlers(void)
        act.sa_handler = sig_int;
        act.sa_flags = SA_RESTART;
        sigaction(SIGINT, &act, NULL);
+
+       memset(&act, 0, sizeof(act));
+       act.sa_handler = sig_ill;
+       act.sa_flags = SA_RESTART;
+       sigaction(SIGILL, &act, NULL);
 }
 
 /*
@@ -603,15 +619,17 @@ sync_done:
                 * of completions except the very first one which may look
                 * a little bursty
                 */
-               usec = utime_since(&s, &comp_time);
+               if (ramp_time_over(td)) {
+                       usec = utime_since(&s, &comp_time);
 
-               rate_throttle(td, usec, bytes_done);
+                       rate_throttle(td, usec, bytes_done);
 
-               if (check_min_rate(td, &comp_time)) {
-                       if (exitall_on_terminate)
-                               terminate_threads(td->groupid);
-                       td_verror(td, EIO, "check_min_rate");
-                       break;
+                       if (check_min_rate(td, &comp_time)) {
+                               if (exitall_on_terminate)
+                                       terminate_threads(td->groupid);
+                               td_verror(td, EIO, "check_min_rate");
+                               break;
+                       }
                }
 
                if (td->o.thinktime) {