From: Jens Axboe Date: Mon, 15 Apr 2013 09:40:57 +0000 (+0200) Subject: Fixup bad logging types X-Git-Tag: fio-2.1~32 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=4e0a8fa2593006505b7f4e18931a201d221b49e9 Fixup bad logging types Signed-off-by: Jens Axboe --- diff --git a/backend.c b/backend.c index 119c4f98..1c4484be 100644 --- a/backend.c +++ b/backend.c @@ -835,7 +835,7 @@ sync_done: 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; diff --git a/client.c b/client.c index 3cb46ab1..155eb720 100644 --- 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) { - 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; } diff --git a/engines/e4defrag.c b/engines/e4defrag.c index d9ddf752..4d87f676 100644 --- a/engines/e4defrag.c +++ b/engines/e4defrag.c @@ -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"); - 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; } diff --git a/engines/mmap.c b/engines/mmap.c index c1aff5ba..8c04a19a 100644 --- a/engines/mmap.c +++ b/engines/mmap.c @@ -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 " - "%lu bytes\n", page_size); + "%llu bytes\n", (unsigned long long) page_size); return 1; } diff --git a/filesetup.c b/filesetup.c index 37ea7528..9f186fb4 100644 --- a/filesetup.c +++ b/filesetup.c @@ -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, - f->file_offset, f->real_file_size); + (unsigned long long) f->file_offset, + (unsigned long long) f->real_file_size); return 1; } diff --git a/gettime.c b/gettime.c index 8b3e1e52..1a0f8274 100644 --- a/gettime.c +++ b/gettime.c @@ -578,7 +578,7 @@ int fio_monotonic_clocktest(void) free(threads); if (failed) { - log_err("Clocksource test: %u threads failed\n", failed); + log_err("Clocksource test: %lu threads failed\n", failed); goto err; } @@ -595,9 +595,10 @@ int fio_monotonic_clocktest(void) 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++; } diff --git a/idletime.c b/idletime.c index 244723f0..d4d665a1 100644 --- a/idletime.c +++ b/idletime.c @@ -406,7 +406,7 @@ int fio_idle_prof_parse_opt(const char *args) 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 diff --git a/io_u.c b/io_u.c index 7941a6d7..19ef7b9f 100644 --- 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 { - 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; } } diff --git a/server.c b/server.c index e3fbf0fd..3d31cbf6 100644 --- 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) { - 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 */ @@ -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) { - log_err("fio: bad server port %u\n", port); + log_err("fio: bad server port %u\n", lport); return 1; } } diff --git a/stat.c b/stat.c index 581eead5..3db06125 100644 --- 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], - 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); @@ -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], - 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); @@ -544,8 +547,11 @@ void show_thread_status(struct thread_stat *ts, struct group_run_stats *rs) 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%%," @@ -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]); - 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", - ts->total_err_count, + (unsigned long long)ts->total_err_count, 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; } - 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); @@ -787,8 +796,10 @@ static void show_thread_status_terse_v2(struct thread_stat *ts, 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); @@ -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(";%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 */ @@ -849,8 +860,10 @@ static void show_thread_status_terse_v3_v4(struct thread_stat *ts, 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); @@ -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) - 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))