From: Jens Axboe Date: Fri, 8 Apr 2022 18:32:12 +0000 (-0600) Subject: iolog: fix warning for 32-bit compilation X-Git-Tag: test-tag-2022-08-09~67 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=11cb686eeda83b9ff15619f01a8ad52f4be017cd;p=fio.git iolog: fix warning for 32-bit compilation Cast the 64-bit value, we can't print it directly as %lu. Fixes: e8cf24e570e0 ("iolog: add iolog_write for version 3") Signed-off-by: Jens Axboe --- diff --git a/iolog.c b/iolog.c index 51aecd43..42d2b0e9 100644 --- a/iolog.c +++ b/iolog.c @@ -47,10 +47,10 @@ void log_io_u(const struct thread_data *td, const struct io_u *io_u) return; fio_gettime(&now, NULL); - fprintf(td->iolog_f, "%lu %s %s %llu %llu\n", utime_since_now(&td->io_log_start_time), - io_u->file->file_name, - io_ddir_name(io_u->ddir), - io_u->offset, io_u->buflen); + fprintf(td->iolog_f, "%lu %s %s %llu %llu\n", + (unsigned long) utime_since_now(&td->io_log_start_time), + io_u->file->file_name, io_ddir_name(io_u->ddir), + io_u->offset, io_u->buflen); } @@ -73,8 +73,9 @@ void log_file(struct thread_data *td, struct fio_file *f, return; fio_gettime(&now, NULL); - fprintf(td->iolog_f, "%lu %s %s\n", utime_since_now(&td->io_log_start_time), - f->file_name, act[what]); + fprintf(td->iolog_f, "%lu %s %s\n", + (unsigned long) utime_since_now(&td->io_log_start_time), + f->file_name, act[what]); } static void iolog_delay(struct thread_data *td, unsigned long delay)