From 4b91ee8fd12c72bd76ce9f5ff9116626b48566a0 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 25 Feb 2013 10:18:33 +0100 Subject: [PATCH] Fixup wrong types for dprint() Signed-off-by: Jens Axboe --- filesetup.c | 9 +++++---- gettime.c | 5 +++-- io_u.c | 19 ++++++++++++------- memory.c | 12 +++++++----- server.c | 5 +++-- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/filesetup.c b/filesetup.c index ac1804bd..220ceb90 100644 --- a/filesetup.c +++ b/filesetup.c @@ -79,7 +79,8 @@ static int extend_file(struct thread_data *td, struct fio_file *f) break; case FIO_FALLOCATE_POSIX: dprint(FD_FILE, "posix_fallocate file %s size %llu\n", - f->file_name, f->real_file_size); + f->file_name, + (unsigned long long) f->real_file_size); r = posix_fallocate(f->fd, 0, f->real_file_size); if (r > 0) { @@ -91,8 +92,8 @@ static int extend_file(struct thread_data *td, struct fio_file *f) case FIO_FALLOCATE_KEEP_SIZE: dprint(FD_FILE, "fallocate(FALLOC_FL_KEEP_SIZE) " - "file %s size %llu\n", - f->file_name, f->real_file_size); + "file %s size %llu\n", f->file_name, + (unsigned long long) f->real_file_size); r = fallocate(f->fd, FALLOC_FL_KEEP_SIZE, 0, f->real_file_size); @@ -118,7 +119,7 @@ static int extend_file(struct thread_data *td, struct fio_file *f) */ if (!td->o.fill_device) { dprint(FD_FILE, "truncate file %s, size %llu\n", f->file_name, - f->real_file_size); + (unsigned long long) f->real_file_size); if (ftruncate(f->fd, f->real_file_size) == -1) { td_verror(td, errno, "ftruncate"); goto err; diff --git a/gettime.c b/gettime.c index d56045c5..352c1d3d 100644 --- a/gettime.c +++ b/gettime.c @@ -302,11 +302,12 @@ static int calibrate_cpu_clock(void) mean /= 10.0; for (i = 0; i < NR_TIME_ITERS; i++) - dprint(FD_TIME, "cycles[%d]=%lu\n", i, cycles[i] / 10); + dprint(FD_TIME, "cycles[%d]=%llu\n", i, + (unsigned long long) cycles[i] / 10); avg /= samples; avg = (avg + 5) / 10; - dprint(FD_TIME, "avg: %lu\n", avg); + dprint(FD_TIME, "avg: %llu\n", (unsigned long long) avg); dprint(FD_TIME, "mean=%f, S=%f\n", mean, S); cycles_per_usec = avg; diff --git a/io_u.c b/io_u.c index 1013c7fd..e474b48f 100644 --- a/io_u.c +++ b/io_u.c @@ -101,7 +101,7 @@ static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f, r = __rand(&td->__random_state); } - dprint(FD_RANDOM, "off rand %llu\n", r); + dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r); *b = (lastb - 1) * (r / ((uint64_t) rmax + 1.0)); } else { @@ -125,7 +125,8 @@ static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f, if (random_map_free(f, *b)) goto ret; - dprint(FD_RANDOM, "get_next_rand_offset: offset %llu busy\n", *b); + dprint(FD_RANDOM, "get_next_rand_offset: offset %llu busy\n", + (unsigned long long) *b); *b = axmap_next_free(f->io_axmap, *b); if (*b == (uint64_t) -1ULL) @@ -242,7 +243,8 @@ static int get_next_rand_block(struct thread_data *td, struct fio_file *f, } dprint(FD_IO, "%s: rand offset failed, last=%llu, size=%llu\n", - f->file_name, f->last_pos, f->real_file_size); + f->file_name, (unsigned long long) f->last_pos, + (unsigned long long) f->real_file_size); return 1; } @@ -344,14 +346,16 @@ static int __get_next_offset(struct thread_data *td, struct io_u *io_u) if (io_u->offset >= f->io_size) { dprint(FD_IO, "get_next_offset: offset %llu >= io_size %llu\n", - io_u->offset, f->io_size); + (unsigned long long) io_u->offset, + (unsigned long long) f->io_size); return 1; } io_u->offset += f->file_offset; if (io_u->offset >= f->real_file_size) { dprint(FD_IO, "get_next_offset: offset %llu >= size %llu\n", - io_u->offset, f->real_file_size); + (unsigned long long) io_u->offset, + (unsigned long long) f->real_file_size); return 1; } @@ -716,8 +720,9 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u) if (io_u->offset + io_u->buflen > io_u->file->real_file_size) { dprint(FD_IO, "io_u %p, offset too large\n", io_u); - dprint(FD_IO, " off=%llu/%lu > %llu\n", io_u->offset, - io_u->buflen, io_u->file->real_file_size); + dprint(FD_IO, " off=%llu/%lu > %llu\n", + (unsigned long long) io_u->offset, io_u->buflen, + (unsigned long long) io_u->file->real_file_size); return 1; } diff --git a/memory.c b/memory.c index 3759c8c5..ee5f895d 100644 --- a/memory.c +++ b/memory.c @@ -155,8 +155,8 @@ static int alloc_mem_mmap(struct thread_data *td, size_t total_mem) td->orig_buffer = mmap(NULL, total_mem, PROT_READ | PROT_WRITE, flags, td->mmapfd, 0); - dprint(FD_MEM, "mmap %u/%d %p\n", total_mem, td->mmapfd, - td->orig_buffer); + dprint(FD_MEM, "mmap %llu/%d %p\n", (unsigned long long) total_mem, + td->mmapfd, td->orig_buffer); if (td->orig_buffer == MAP_FAILED) { td_verror(td, errno, "mmap"); td->orig_buffer = NULL; @@ -173,7 +173,8 @@ static int alloc_mem_mmap(struct thread_data *td, size_t total_mem) static void free_mem_mmap(struct thread_data *td, size_t total_mem) { - dprint(FD_MEM, "munmap %u %p\n", total_mem, td->orig_buffer); + dprint(FD_MEM, "munmap %llu %p\n", (unsigned long long) total_mem, + td->orig_buffer); munmap(td->orig_buffer, td->orig_buffer_size); if (td->mmapfile) { close(td->mmapfd); @@ -185,7 +186,8 @@ static void free_mem_mmap(struct thread_data *td, size_t total_mem) static int alloc_mem_malloc(struct thread_data *td, size_t total_mem) { td->orig_buffer = malloc(total_mem); - dprint(FD_MEM, "malloc %u %p\n", total_mem, td->orig_buffer); + dprint(FD_MEM, "malloc %llu %p\n", (unsigned long long) total_mem, + td->orig_buffer); return td->orig_buffer == NULL; } @@ -216,7 +218,7 @@ int allocate_io_mem(struct thread_data *td) total_mem += td->o.mem_align - page_size; } - dprint(FD_MEM, "Alloc %lu for buffers\n", (size_t) total_mem); + dprint(FD_MEM, "Alloc %llu for buffers\n", (unsigned long long) total_mem); if (td->o.mem_type == MEM_MALLOC) ret = alloc_mem_malloc(td, total_mem); diff --git a/server.c b/server.c index ad785720..d4676dda 100644 --- a/server.c +++ b/server.c @@ -463,8 +463,9 @@ static int handle_command(struct fio_net_cmd *cmd) { int ret; - dprint(FD_NET, "server: got op [%s], pdu=%u, tag=%lx\n", - fio_server_op(cmd->opcode), cmd->pdu_len, cmd->tag); + dprint(FD_NET, "server: got op [%s], pdu=%u, tag=%llx\n", + fio_server_op(cmd->opcode), cmd->pdu_len, + (unsigned long long) cmd->tag); switch (cmd->opcode) { case FIO_NET_CMD_QUIT: -- 2.25.1