- usec = t[i].fn();
- mb_sec = (double) mb / (double) usec;
- mb_sec /= (1.024 * 1.024);
- printf("%s:\t%.2f MB/sec\n", t[i].name, mb_sec);
+ /*
+ * For first run, make sure CPUs are spun up and that
+ * we've touched the data.
+ */
+ if (first) {
+ usec_spin(100000);
+ t[i].fn(&t[i], buf, CHUNK);
+ }
+
+ fio_gettime(&tv, NULL);
+ t[i].fn(&t[i], buf, CHUNK);
+ usec = utime_since_now(&tv);
+
+ if (usec) {
+ mb_sec = (double) mb / (double) usec;
+ mb_sec /= (1.024 * 1.024);
+ if (strlen(t[i].name) >= 7)
+ sprintf(pre, "\t");
+ else
+ sprintf(pre, "\t\t");
+ printf("%s:%s%8.2f MB/sec\n", t[i].name, pre, mb_sec);
+ } else
+ printf("%s:inf MB/sec\n", t[i].name);
+ first = 0;