Clean up unit prefixes for binary multiples in comments and prints
authorRobert Elliott <elliott@hpe.com>
Thu, 22 Dec 2016 20:50:49 +0000 (14:50 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 3 Jan 2017 01:19:49 +0000 (18:19 -0700)
Change comments and prints that are referring to values based on
binary multiples to use IEC 80000-13 prefixes for binary
multiples rather than SI prefixes for decimal multiples (e.g.,
KiB, MiB, and GiB rather than KB, MB, and GB).

Includes a fix for the rate_min print that was printing "KB/s"
although it was really printing bytes per second.

Includes a fix for goptions confusing the PB and TB units (while
changing them to PiB and TiB).

Signed-off-by: Jens Axboe <axboe@fb.com>
README
backend.c
engines/dev-dax.c
engines/mmap.c
eta.c
filesetup.c
goptions.c
memory.c
stat.c

diff --git a/README b/README
index 4570f53bcb84278d39d01c1af528c4795af627ff..a35842efbcf8860ec81c53ae7341cd07a6afe28c 100644 (file)
--- a/README
+++ b/README
@@ -233,7 +233,7 @@ sections.  The reserved 'global' section is always parsed and used.
 The --alloc-size switch allows one to use a larger pool size for smalloc.
 If running large jobs with randommap enabled, fio can run out of memory.
 Smalloc is an internal allocator for shared structures from a fixed size
 The --alloc-size switch allows one to use a larger pool size for smalloc.
 If running large jobs with randommap enabled, fio can run out of memory.
 Smalloc is an internal allocator for shared structures from a fixed size
-memory pool. The pool size defaults to 16M and can grow to 8 pools.
+memory pool. The pool size defaults to 16MiB and can grow to 8 pools.
 
 NOTE: While running .fio_smalloc.* backing store files are visible in /tmp.
 
 
 NOTE: While running .fio_smalloc.* backing store files are visible in /tmp.
 
index a048452d61c8e12b0138baad9bc05f125fb90151..c8c6de6d69c826867f2b482bfca6ebd1c211d602 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -180,8 +180,8 @@ static bool __check_min_rate(struct thread_data *td, struct timeval *now,
                         * check bandwidth specified rate
                         */
                        if (bytes < td->rate_bytes[ddir]) {
                         * check bandwidth specified rate
                         */
                        if (bytes < td->rate_bytes[ddir]) {
-                               log_err("%s: min rate %u not met\n", td->o.name,
-                                                               ratemin);
+                               log_err("%s: rate_min=%uB/s not met, only transferred %lluB\n",
+                                       td->o.name, ratemin, bytes);
                                return true;
                        } else {
                                if (spent)
                                return true;
                        } else {
                                if (spent)
@@ -191,9 +191,8 @@ static bool __check_min_rate(struct thread_data *td, struct timeval *now,
 
                                if (rate < ratemin ||
                                    bytes < td->rate_bytes[ddir]) {
 
                                if (rate < ratemin ||
                                    bytes < td->rate_bytes[ddir]) {
-                                       log_err("%s: min rate %u not met, got"
-                                               " %luKB/sec\n", td->o.name,
-                                                       ratemin, rate);
+                                       log_err("%s: rate_min=%uB/s not met, got %luB/s\n",
+                                               td->o.name, ratemin, rate);
                                        return true;
                                }
                        }
                                        return true;
                                }
                        }
@@ -202,8 +201,8 @@ static bool __check_min_rate(struct thread_data *td, struct timeval *now,
                         * checks iops specified rate
                         */
                        if (iops < rate_iops) {
                         * checks iops specified rate
                         */
                        if (iops < rate_iops) {
-                               log_err("%s: min iops rate %u not met\n",
-                                               td->o.name, rate_iops);
+                               log_err("%s: rate_iops_min=%u not met, only performed %lu IOs\n",
+                                               td->o.name, rate_iops, iops);
                                return true;
                        } else {
                                if (spent)
                                return true;
                        } else {
                                if (spent)
@@ -213,9 +212,8 @@ static bool __check_min_rate(struct thread_data *td, struct timeval *now,
 
                                if (rate < rate_iops_min ||
                                    iops < td->rate_blocks[ddir]) {
 
                                if (rate < rate_iops_min ||
                                    iops < td->rate_blocks[ddir]) {
-                                       log_err("%s: min iops rate %u not met,"
-                                               " got %lu\n", td->o.name,
-                                                       rate_iops_min, rate);
+                                       log_err("%s: rate_iops_min=%u not met, got %lu IOPS\n",
+                                               td->o.name, rate_iops_min, rate);
                                        return true;
                                }
                        }
                                        return true;
                                }
                        }
index 6372576b86bb4cdcaa1150029defcc0ef88724d3..2516bcadf2a638831e47c5e00f1f2aa70dd12f06 100644 (file)
@@ -58,7 +58,7 @@
 #include "../verify.h"
 
 /*
 #include "../verify.h"
 
 /*
- * Limits us to 1GB of mapped files in total to model after
+ * Limits us to 1GiB of mapped files in total to model after
  * mmap engine behavior
  */
 #define MMAP_TOTAL_SZ  (1 * 1024 * 1024 * 1024UL)
  * mmap engine behavior
  */
 #define MMAP_TOTAL_SZ  (1 * 1024 * 1024 * 1024UL)
index c479ed39497ef8c3bd8c70e380cdd6e3f18c8be1..99e1d6a4b35861ccb8be485cf4831d36c72ce40a 100644 (file)
@@ -15,7 +15,7 @@
 #include "../verify.h"
 
 /*
 #include "../verify.h"
 
 /*
- * Limits us to 1GB of mapped files in total
+ * Limits us to 1GiB of mapped files in total
  */
 #define MMAP_TOTAL_SZ  (1 * 1024 * 1024 * 1024UL)
 
  */
 #define MMAP_TOTAL_SZ  (1 * 1024 * 1024 * 1024UL)
 
diff --git a/eta.c b/eta.c
index 19afad5b04293df75201ee00914a862964f78b20..68dc0c9b40dffe7a647542e83ea46f2637fbd077 100644 (file)
--- a/eta.c
+++ b/eta.c
@@ -308,7 +308,7 @@ static void calc_rate(int unified_rw_rep, unsigned long mtime,
 
                diff = io_bytes[i] - prev_io_bytes[i];
                if (mtime)
 
                diff = io_bytes[i] - prev_io_bytes[i];
                if (mtime)
-                       this_rate = ((1000 * diff) / mtime) / 1024;
+                       this_rate = ((1000 * diff) / mtime) / 1024; /* KiB/s */
                else
                        this_rate = 0;
 
                else
                        this_rate = 0;
 
index 969e7cc0a70e4a06ce6c287f6f88dcc8d0c87b68..ef94bd285210d5009e6498d233375317971917ad 100644 (file)
@@ -948,9 +948,8 @@ int setup_files(struct thread_data *td)
        if (need_extend) {
                temp_stall_ts = 1;
                if (output_format & FIO_OUTPUT_NORMAL)
        if (need_extend) {
                temp_stall_ts = 1;
                if (output_format & FIO_OUTPUT_NORMAL)
-                       log_info("%s: Laying out IO file(s) (%u file(s) /"
-                                " %lluMB)\n", o->name, need_extend,
-                                       extend_size >> 20);
+                       log_info("%s: Laying out IO file(s) (%u file(s) / %lluMiB)\n",
+                                o->name, need_extend, extend_size >> 20);
 
                for_each_file(td, f, i) {
                        unsigned long long old_len = -1ULL, extend_len = -1ULL;
 
                for_each_file(td, f, i) {
                        unsigned long long old_len = -1ULL, extend_len = -1ULL;
index b3d3684697707f962ff311c2a578be87ae078f05..16938eda141641b298434a626498dd087ff60752 100644 (file)
@@ -826,7 +826,7 @@ static struct gopt *gopt_new_str_val(struct gopt_job_view *gjv,
                                     unsigned long long *p, unsigned int idx)
 {
        struct gopt_str_val *g;
                                     unsigned long long *p, unsigned int idx)
 {
        struct gopt_str_val *g;
-       const gchar *postfix[] = { "B", "KB", "MB", "GB", "PB", "TB", "" };
+       const gchar *postfix[] = { "B", "KiB", "MiB", "GiB", "PiB", "PiB", "" };
        GtkWidget *label;
        int i;
 
        GtkWidget *label;
        int i;
 
index 91241175978ec1ce32310c9c58fef6c38f79da71..9e73f100740a20c0f7d5c17af23366d92e436186 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -33,13 +33,13 @@ int fio_pin_memory(struct thread_data *td)
        dprint(FD_MEM, "pinning %llu bytes\n", td->o.lockmem);
 
        /*
        dprint(FD_MEM, "pinning %llu bytes\n", td->o.lockmem);
 
        /*
-        * Don't allow mlock of more than real_mem-128MB
+        * Don't allow mlock of more than real_mem-128MiB
         */
        phys_mem = os_phys_mem();
        if (phys_mem) {
                if ((td->o.lockmem + 128 * 1024 * 1024) > phys_mem) {
                        td->o.lockmem = phys_mem - 128 * 1024 * 1024;
         */
        phys_mem = os_phys_mem();
        if (phys_mem) {
                if ((td->o.lockmem + 128 * 1024 * 1024) > phys_mem) {
                        td->o.lockmem = phys_mem - 128 * 1024 * 1024;
-                       log_info("fio: limiting mlocked memory to %lluMB\n",
+                       log_info("fio: limiting mlocked memory to %lluMiB\n",
                                                        td->o.lockmem >> 20);
                }
        }
                                                        td->o.lockmem >> 20);
                }
        }
diff --git a/stat.c b/stat.c
index f014e60883c3a2946ba6c70d38fd2d3a82a03eb8..8562ab4add1335205db49dc8909697fb1465ae16 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -812,7 +812,7 @@ static void show_ddir_status_terse(struct thread_stat *ts,
        if (ts->runtime[ddir]) {
                uint64_t runt = ts->runtime[ddir];
 
        if (ts->runtime[ddir]) {
                uint64_t runt = ts->runtime[ddir];
 
-               bw = ((1000 * ts->io_bytes[ddir]) / runt) / 1024;
+               bw = ((1000 * ts->io_bytes[ddir]) / runt) / 1024; /* KiB/s */
                iops = (1000 * (uint64_t) ts->total_io_u[ddir]) / runt;
        }
 
                iops = (1000 * (uint64_t) ts->total_io_u[ddir]) / runt;
        }
 
@@ -896,7 +896,7 @@ static void add_ddir_status_json(struct thread_stat *ts,
        if (ts->runtime[ddir]) {
                uint64_t runt = ts->runtime[ddir];
 
        if (ts->runtime[ddir]) {
                uint64_t runt = ts->runtime[ddir];
 
-               bw = ((1000 * ts->io_bytes[ddir]) / runt) / 1024;
+               bw = ((1000 * ts->io_bytes[ddir]) / runt) / 1024; /* KiB/s */
                iops = (1000.0 * (uint64_t) ts->total_io_u[ddir]) / runt;
        }
 
                iops = (1000.0 * (uint64_t) ts->total_io_u[ddir]) / runt;
        }
 
@@ -2431,7 +2431,7 @@ static int add_bw_samples(struct thread_data *td, struct timeval *t)
                        continue; /* No entries for interval */
 
                if (spent)
                        continue; /* No entries for interval */
 
                if (spent)
-                       rate = delta * 1000 / spent / 1024;
+                       rate = delta * 1000 / spent / 1024; /* KiB/s */
                else
                        rate = 0;
 
                else
                        rate = 0;