Fixup bad logging types
authorJens Axboe <axboe@kernel.dk>
Mon, 15 Apr 2013 09:40:57 +0000 (11:40 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 15 Apr 2013 09:40:57 +0000 (11:40 +0200)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
backend.c
client.c
engines/e4defrag.c
engines/mmap.c
filesetup.c
gettime.c
idletime.c
io_u.c
server.c
stat.c

index 119c4f982fb32e39e2f141fa792dab3e9f6cd290..1c4484be951e8ea437ff9cb91fa7a01818b24bb5 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -835,7 +835,7 @@ sync_done:
        check_update_rusage(td);
 
        if (td->trim_entries)
        check_update_rusage(td);
 
        if (td->trim_entries)
-               log_err("fio: %d trim entries leaked?\n", td->trim_entries);
+               log_err("fio: %lu trim entries leaked?\n", td->trim_entries);
 
        if (td->o.fill_device && td->error == ENOSPC) {
                td->error = 0;
 
        if (td->o.fill_device && td->error == ENOSPC) {
                td->error = 0;
index 3cb46ab1e4c81514f8a2d561770106b59d0de068..155eb72070038347e2857c26f71437aaa7f741b1 100644 (file)
--- a/client.c
+++ b/client.c
@@ -957,7 +957,7 @@ static void remove_reply_cmd(struct fio_client *client, struct fio_net_cmd *cmd)
        }
 
        if (!reply) {
        }
 
        if (!reply) {
-               log_err("fio: client: unable to find matching tag (%lx)\n", cmd->tag);
+               log_err("fio: client: unable to find matching tag (%llx)\n", (unsigned long long) cmd->tag);
                return;
        }
 
                return;
        }
 
index d9ddf752bf6e39be2bdd61c4ddee12ab2ddb9f20..4d87f676a128f1ab6cda8c826a9479098190d5b9 100644 (file)
@@ -92,7 +92,7 @@ static int fio_e4defrag_init(struct thread_data *td)
        ed->donor_fd = open(donor_name, O_CREAT|O_WRONLY, 0644);
        if (ed->donor_fd < 0) {
                td_verror(td, ed->donor_fd, "io_queue_init");
        ed->donor_fd = open(donor_name, O_CREAT|O_WRONLY, 0644);
        if (ed->donor_fd < 0) {
                td_verror(td, ed->donor_fd, "io_queue_init");
-               log_err("Can't open donor file %s err:%d", ed->donor_fd);
+               log_err("Can't open donor file %s err:%d", donor_name, ed->donor_fd);
                free(ed);
                return 1;
        }
                free(ed);
                return 1;
        }
index c1aff5ba97a0843b151c65f05fff55b3575d387a..8c04a19a748a7d13c77c2ec4ee1f876201a9ce31 100644 (file)
@@ -187,7 +187,7 @@ static int fio_mmapio_init(struct thread_data *td)
        if ((td->o.rw_min_bs & page_mask) &&
            (o->odirect || o->fsync_blocks || o->fdatasync_blocks)) {
                log_err("fio: mmap options dictate a minimum block size of "
        if ((td->o.rw_min_bs & page_mask) &&
            (o->odirect || o->fsync_blocks || o->fdatasync_blocks)) {
                log_err("fio: mmap options dictate a minimum block size of "
-                       "%lu bytes\n", page_size);
+                       "%llu bytes\n", (unsigned long long) page_size);
                return 1;
        }
 
                return 1;
        }
 
index 37ea75283e0a52af68dd573e91096ccf6943e5fb..9f186fb46436a4d46998709a787050be24905316 100644 (file)
@@ -355,7 +355,8 @@ static int get_file_size(struct thread_data *td, struct fio_file *f)
 
        if (f->file_offset > f->real_file_size) {
                log_err("%s: offset extends end (%llu > %llu)\n", td->o.name,
 
        if (f->file_offset > f->real_file_size) {
                log_err("%s: offset extends end (%llu > %llu)\n", td->o.name,
-                                       f->file_offset, f->real_file_size);
+                                       (unsigned long long) f->file_offset,
+                                       (unsigned long long) f->real_file_size);
                return 1;
        }
 
                return 1;
        }
 
index 8b3e1e5246eb5787663d51560219b6c6b0c4d7b9..1a0f827460c9da6562678733f041be73c2eec484 100644 (file)
--- a/gettime.c
+++ b/gettime.c
@@ -578,7 +578,7 @@ int fio_monotonic_clocktest(void)
        free(threads);
 
        if (failed) {
        free(threads);
 
        if (failed) {
-               log_err("Clocksource test: %u threads failed\n", failed);
+               log_err("Clocksource test: %lu threads failed\n", failed);
                goto err;
        }
 
                goto err;
        }
 
@@ -595,9 +595,10 @@ int fio_monotonic_clocktest(void)
                if (prev->tsc > this->tsc) {
                        uint64_t diff = prev->tsc - this->tsc;
 
                if (prev->tsc > this->tsc) {
                        uint64_t diff = prev->tsc - this->tsc;
 
-                       log_info("cs: CPU clock mismatch (diff=%lu):\n", diff);
-                       log_info("\t CPU%3lu: TSC=%lu, SEQ=%lu\n", prev->cpu, prev->tsc, prev->seq);
-                       log_info("\t CPU%3lu: TSC=%lu, SEQ=%lu\n", this->cpu, this->tsc, this->seq);
+                       log_info("cs: CPU clock mismatch (diff=%llu):\n",
+                                               (unsigned long long) diff);
+                       log_info("\t CPU%3u: TSC=%llu, SEQ=%u\n", prev->cpu, (unsigned long long) prev->tsc, prev->seq);
+                       log_info("\t CPU%3u: TSC=%llu, SEQ=%u\n", this->cpu, (unsigned long long) this->tsc, this->seq);
                        failed++;
                }
 
                        failed++;
                }
 
index 244723f051791ab13881398f0eab470f2b1ce62d..d4d665a1abb9beb6bcfd266d7ac11dea517cd961 100644 (file)
@@ -406,7 +406,7 @@ int fio_idle_prof_parse_opt(const char *args)
                ipc.opt = IDLE_PROF_OPT_PERCPU;
                return 0;
        } else {
                ipc.opt = IDLE_PROF_OPT_PERCPU;
                return 0;
        } else {
-               log_err("fio: incorrect idle-prof option\n", args);
+               log_err("fio: incorrect idle-prof option: %s\n", args);
                return -1;
        }       
 #else
                return -1;
        }       
 #else
diff --git a/io_u.c b/io_u.c
index 7941a6d739483edfc5e3b3e81403716133eee97a..19ef7b9f30fe0f2888d16e2ff1261fd99788b304 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -314,8 +314,7 @@ static int get_next_block(struct thread_data *td, struct io_u *io_u,
                else if (b != -1ULL)
                        io_u->offset = b * td->o.ba[ddir];
                else {
                else if (b != -1ULL)
                        io_u->offset = b * td->o.ba[ddir];
                else {
-                       log_err("fio: bug in offset generation: offset=%llu, b=%llu\n",
-                                                               offset, b);
+                       log_err("fio: bug in offset generation: offset=%llu, b=%llu\n", (unsigned long long) offset, (unsigned long long) b);
                        ret = 1;
                }
        }
                        ret = 1;
                }
        }
index e3fbf0fdd6da562297afb1cc2d07f2ba0b97664a..3d31cbf6bb01e16974642275cf77582e6a928d57 100644 (file)
--- a/server.c
+++ b/server.c
@@ -1467,7 +1467,7 @@ int fio_server_parse_string(const char *str, char **ptr, int *is_sock,
                host++;
                lport = atoi(host);
                if (!lport || lport > 65535) {
                host++;
                lport = atoi(host);
                if (!lport || lport > 65535) {
-                       log_err("fio: bad server port %u\n", port);
+                       log_err("fio: bad server port %u\n", lport);
                        return 1;
                }
                /* no hostname given, we are done */
                        return 1;
                }
                /* no hostname given, we are done */
@@ -1485,7 +1485,7 @@ int fio_server_parse_string(const char *str, char **ptr, int *is_sock,
                        portp++;
                        lport = atoi(portp);
                        if (!lport || lport > 65535) {
                        portp++;
                        lport = atoi(portp);
                        if (!lport || lport > 65535) {
-                               log_err("fio: bad server port %u\n", port);
+                               log_err("fio: bad server port %u\n", lport);
                                return 1;
                        }
                }
                                return 1;
                        }
                }
diff --git a/stat.c b/stat.c
index 581eead5b6bfae4e2d142484eb679a153ac4ec12..3db06125092b5fee1cbbeaa1749d839a426cab2d 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -282,7 +282,9 @@ void show_group_stats(struct group_run_stats *rs)
                log_info("%s: io=%s, aggrb=%s/s, minb=%s/s, maxb=%s/s,"
                         " mint=%llumsec, maxt=%llumsec\n",
                                rs->unified_rw_rep ? "  MIXED" : ddir_str[i],
                log_info("%s: io=%s, aggrb=%s/s, minb=%s/s, maxb=%s/s,"
                         " mint=%llumsec, maxt=%llumsec\n",
                                rs->unified_rw_rep ? "  MIXED" : ddir_str[i],
-                               p1, p2, p3, p4, rs->min_run[i], rs->max_run[i]);
+                               p1, p2, p3, p4,
+                               (unsigned long long) rs->min_run[i],
+                               (unsigned long long) rs->max_run[i]);
 
                free(p1);
                free(p2);
 
                free(p1);
                free(p2);
@@ -385,7 +387,8 @@ static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts,
 
        log_info("  %s: io=%s, bw=%s/s, iops=%s, runt=%6llumsec\n",
                                rs->unified_rw_rep ? "mixed" : ddir_str[ddir],
 
        log_info("  %s: io=%s, bw=%s/s, iops=%s, runt=%6llumsec\n",
                                rs->unified_rw_rep ? "mixed" : ddir_str[ddir],
-                               io_p, bw_p, iops_p, ts->runtime[ddir]);
+                               io_p, bw_p, iops_p,
+                               (unsigned long long) ts->runtime[ddir]);
 
        free(io_p);
        free(bw_p);
 
        free(io_p);
        free(bw_p);
@@ -544,8 +547,11 @@ void show_thread_status(struct thread_stat *ts, struct group_run_stats *rs)
                sys_cpu = 0;
        }
 
                sys_cpu = 0;
        }
 
-       log_info("  cpu          : usr=%3.2f%%, sys=%3.2f%%, ctx=%lu, majf=%lu,"
-                " minf=%lu\n", usr_cpu, sys_cpu, ts->ctx, ts->majf, ts->minf);
+       log_info("  cpu          : usr=%3.2f%%, sys=%3.2f%%, ctx=%llu,"
+                " majf=%llu, minf=%llu\n", usr_cpu, sys_cpu,
+                       (unsigned long long) ts->ctx,
+                       (unsigned long long) ts->majf,
+                       (unsigned long long) ts->minf);
 
        stat_calc_dist(ts->io_u_map, ddir_rw_sum(ts->total_io_u), io_u_dist);
        log_info("  IO depths    : 1=%3.1f%%, 2=%3.1f%%, 4=%3.1f%%, 8=%3.1f%%,"
 
        stat_calc_dist(ts->io_u_map, ddir_rw_sum(ts->total_io_u), io_u_dist);
        log_info("  IO depths    : 1=%3.1f%%, 2=%3.1f%%, 4=%3.1f%%, 8=%3.1f%%,"
@@ -566,15 +572,17 @@ void show_thread_status(struct thread_stat *ts, struct group_run_stats *rs)
                                        io_u_dist[1], io_u_dist[2],
                                        io_u_dist[3], io_u_dist[4],
                                        io_u_dist[5], io_u_dist[6]);
                                        io_u_dist[1], io_u_dist[2],
                                        io_u_dist[3], io_u_dist[4],
                                        io_u_dist[5], io_u_dist[6]);
-       log_info("     issued    : total=r=%lu/w=%lu/d=%lu,"
-                                " short=r=%lu/w=%lu/d=%lu\n",
-                                       ts->total_io_u[0], ts->total_io_u[1],
-                                       ts->total_io_u[2],
-                                       ts->short_io_u[0], ts->short_io_u[1],
-                                       ts->short_io_u[2]);
+       log_info("     issued    : total=r=%llu/w=%llu/d=%llu,"
+                                " short=r=%llu/w=%llu/d=%llu\n",
+                                       (unsigned long long) ts->total_io_u[0],
+                                       (unsigned long long) ts->total_io_u[1],
+                                       (unsigned long long) ts->total_io_u[2],
+                                       (unsigned long long) ts->short_io_u[0],
+                                       (unsigned long long) ts->short_io_u[1],
+                                       (unsigned long long) ts->short_io_u[2]);
        if (ts->continue_on_error) {
                log_info("     errors    : total=%llu, first_error=%d/<%s>\n",
        if (ts->continue_on_error) {
                log_info("     errors    : total=%llu, first_error=%d/<%s>\n",
-                                       ts->total_err_count,
+                                       (unsigned long long)ts->total_err_count,
                                        ts->first_error,
                                        strerror(ts->first_error));
        }
                                        ts->first_error,
                                        strerror(ts->first_error));
        }
@@ -600,8 +608,9 @@ static void show_ddir_status_terse(struct thread_stat *ts,
                iops = (1000 * (uint64_t) ts->total_io_u[ddir]) / runt;
        }
 
                iops = (1000 * (uint64_t) ts->total_io_u[ddir]) / runt;
        }
 
-       log_info(";%llu;%llu;%llu;%llu", ts->io_bytes[ddir] >> 10, bw, iops,
-                                                       ts->runtime[ddir]);
+       log_info(";%llu;%llu;%llu;%llu",
+               (unsigned long long) ts->io_bytes[ddir] >> 10, bw, iops,
+                                       (unsigned long long) ts->runtime[ddir]);
 
        if (calc_lat(&ts->slat_stat[ddir], &min, &max, &mean, &dev))
                log_info(";%lu;%lu;%f;%f", min, max, mean, dev);
 
        if (calc_lat(&ts->slat_stat[ddir], &min, &max, &mean, &dev))
                log_info(";%lu;%lu;%f;%f", min, max, mean, dev);
@@ -787,8 +796,10 @@ static void show_thread_status_terse_v2(struct thread_stat *ts,
                sys_cpu = 0;
        }
 
                sys_cpu = 0;
        }
 
-       log_info(";%f%%;%f%%;%lu;%lu;%lu", usr_cpu, sys_cpu, ts->ctx, ts->majf,
-                                                               ts->minf);
+       log_info(";%f%%;%f%%;%llu;%llu;%llu", usr_cpu, sys_cpu,
+                                               (unsigned long long) ts->ctx,
+                                               (unsigned long long) ts->majf,
+                                               (unsigned long long) ts->minf);
 
        /* Calc % distribution of IO depths, usecond, msecond latency */
        stat_calc_dist(ts->io_u_map, ddir_rw_sum(ts->total_io_u), io_u_dist);
 
        /* Calc % distribution of IO depths, usecond, msecond latency */
        stat_calc_dist(ts->io_u_map, ddir_rw_sum(ts->total_io_u), io_u_dist);
@@ -808,7 +819,7 @@ static void show_thread_status_terse_v2(struct thread_stat *ts,
                log_info(";%3.2f%%", io_u_lat_m[i]);
        /* Additional output if continue_on_error set - default off*/
        if (ts->continue_on_error)
                log_info(";%3.2f%%", io_u_lat_m[i]);
        /* Additional output if continue_on_error set - default off*/
        if (ts->continue_on_error)
-               log_info(";%lu;%d", ts->total_err_count, ts->first_error);
+               log_info(";%llu;%d", (unsigned long long) ts->total_err_count, ts->first_error);
        log_info("\n");
 
        /* Additional output if description is set */
        log_info("\n");
 
        /* Additional output if description is set */
@@ -849,8 +860,10 @@ static void show_thread_status_terse_v3_v4(struct thread_stat *ts,
                sys_cpu = 0;
        }
 
                sys_cpu = 0;
        }
 
-       log_info(";%f%%;%f%%;%lu;%lu;%lu", usr_cpu, sys_cpu, ts->ctx, ts->majf,
-                                                               ts->minf);
+       log_info(";%f%%;%f%%;%llu;%llu;%llu", usr_cpu, sys_cpu,
+                                               (unsigned long long) ts->ctx,
+                                               (unsigned long long) ts->majf,
+                                               (unsigned long long) ts->minf);
 
        /* Calc % distribution of IO depths, usecond, msecond latency */
        stat_calc_dist(ts->io_u_map, ddir_rw_sum(ts->total_io_u), io_u_dist);
 
        /* Calc % distribution of IO depths, usecond, msecond latency */
        stat_calc_dist(ts->io_u_map, ddir_rw_sum(ts->total_io_u), io_u_dist);
@@ -874,7 +887,7 @@ static void show_thread_status_terse_v3_v4(struct thread_stat *ts,
 
        /* Additional output if continue_on_error set - default off*/
        if (ts->continue_on_error)
 
        /* Additional output if continue_on_error set - default off*/
        if (ts->continue_on_error)
-               log_info(";%lu;%d", ts->total_err_count, ts->first_error);
+               log_info(";%llu;%d", (unsigned long long) ts->total_err_count, ts->first_error);
 
        /* Additional output if description is set */
        if (strlen(ts->description))
 
        /* Additional output if description is set */
        if (strlen(ts->description))