fio: print io_u errors on one line
authorRobert Elliott <elliott@hp.com>
Tue, 16 Sep 2014 22:09:48 +0000 (17:09 -0500)
committerJens Axboe <axboe@fb.com>
Wed, 17 Sep 2014 02:10:55 +0000 (20:10 -0600)
Print io_u errors on one line and with one log_err command
to keep them from being interrupted by other prints

Old:
fio: io_u error on file /dev/sdt: Input/output error5.1MB/0KB/0KB /s]
[227K/0/0 iops] [eta 02d:10h:53m:36s]
     read offset=145442430976, buflen=4096
fio: io_u error on file /dev/sdt: Input/output error
     read offset=397760724992, buflen=4096

New:
fio: io_u error on file /dev/sdr: Input/output error: write offset=1532626153472, buflen=4096
fio: io_u error on file /dev/sdt: Input/output error: write offset=102684229632, buflen=4096

Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
io_u.c

diff --git a/io_u.c b/io_u.c
index 2adaf258d3912bc33599ca550079f9769c3f70e8..7cbdb915a19629fcbd3b500b9255c918bfbd6dd1 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1532,15 +1532,12 @@ void io_u_log_error(struct thread_data *td, struct io_u *io_u)
        if (td_non_fatal_error(td, eb, io_u->error) && !td->o.error_dump)
                return;
 
-       log_err("fio: io_u error");
-
-       if (io_u->file)
-               log_err(" on file %s", io_u->file->file_name);
-
-       log_err(": %s\n", strerror(io_u->error));
-
-       log_err("     %s offset=%llu, buflen=%lu\n", io_ddir_name(io_u->ddir),
-                                       io_u->offset, io_u->xfer_buflen);
+       log_err("fio: io_u error%s%s: %s: %s offset=%llu, buflen=%lu\n",
+               io_u->file ? " on file " : "",
+               io_u->file ? io_u->file->file_name : "",
+               strerror(io_u->error),
+               io_ddir_name(io_u->ddir),
+               io_u->offset, io_u->xfer_buflen);
 
        if (!td->error)
                td_verror(td, io_u->error, "io_u error");