From: Jens Axboe Date: Mon, 13 Oct 2014 18:18:07 +0000 (-0600) Subject: engines: don't use printf or stderr directly X-Git-Tag: fio-2.1.14~60 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=7d4a8e7e2b16b900891b886295d1e8493f853b0c engines: don't use printf or stderr directly For networked runs, we can't just print to stdout or stderr. Use the appropriate logging functions. Signed-off-by: Jens Axboe --- diff --git a/engines/glusterfs_async.c b/engines/glusterfs_async.c index 599bc5df..cf6ea709 100644 --- a/engines/glusterfs_async.c +++ b/engines/glusterfs_async.c @@ -67,7 +67,7 @@ static void fio_gf_io_u_free(struct thread_data *td, struct io_u *io_u) io_u->engine_data = NULL; free(io); } - fprintf(stderr, "issued %lu finished %lu\n", issued, cb_count); + log_err("issued %lu finished %lu\n", issued, cb_count); } static int fio_gf_io_u_init(struct thread_data *td, struct io_u *io_u) @@ -145,8 +145,9 @@ int fio_gf_async_setup(struct thread_data *td) { int r = 0; struct gf_data *g = NULL; + #if defined(NOT_YET) - fprintf(stderr, "the async interface is still very experimental...\n"); + log_err("the async interface is still very experimental...\n"); #endif r = fio_gf_setup(td); if (r) { diff --git a/engines/libhdfs.c b/engines/libhdfs.c index 773d46b4..658cd6ae 100644 --- a/engines/libhdfs.c +++ b/engines/libhdfs.c @@ -87,7 +87,7 @@ static int fio_hdfsio_prep(struct thread_data *td, struct io_u *io_u) } else if (io_u->ddir == DDIR_WRITE) { open_flags = O_WRONLY; } else { - printf("Invalid I/O Operation\n"); + log_err("hdfs: Invalid I/O Operation\n"); } hd->curr_file_id = f_id; @@ -142,7 +142,7 @@ static int fio_hdfsio_queue(struct thread_data *td, struct io_u *io_u) hdfsWrite(hd->fs, hd->fp, io_u->xfer_buf, io_u->xfer_buflen); } else { - printf("Invalid I/O Operation\n"); + log_err("hdfs: Invalid I/O Operation\n"); } return fio_io_end(td, io_u, ret); @@ -202,8 +202,7 @@ static int fio_hdfsio_setup(struct thread_data *td) hd->fscount = atol(getenv("FIO_HDFS_FCOUNT")); hd->fsbs = atol(getenv("FIO_HDFS_BS")); } else { - fprintf(stderr, - "FIO_HDFS_FCOUNT and/or FIO_HDFS_BS not set.\n"); + log_err("FIO_HDFS_FCOUNT and/or FIO_HDFS_BS not set.\n"); return 1; } #endif