A few debug debug log fixes
authorJens Axboe <jens.axboe@oracle.com>
Fri, 1 Feb 2008 20:51:02 +0000 (21:51 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 1 Feb 2008 20:51:02 +0000 (21:51 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
filesetup.c
fio.h

index 20ef3f8ffc97ce238e39ba4f2ef21e46a188bf7a..76b45a9c76af6762d73521355b031bdc38046c9c 100644 (file)
@@ -600,14 +600,14 @@ int add_file(struct thread_data *td, const char *fname)
 
 void get_file(struct fio_file *f)
 {
 
 void get_file(struct fio_file *f)
 {
-       dprint(FD_FILE, "get file %s/%d\n", f->file_name, f->references);
+       dprint(FD_FILE, "get file %s, ref=%d\n", f->file_name, f->references);
        assert(f->flags & FIO_FILE_OPEN);
        f->references++;
 }
 
 void put_file(struct thread_data *td, struct fio_file *f)
 {
        assert(f->flags & FIO_FILE_OPEN);
        f->references++;
 }
 
 void put_file(struct thread_data *td, struct fio_file *f)
 {
-       dprint(FD_FILE, "get put %s/%d\n", f->file_name, f->references);
+       dprint(FD_FILE, "put file %s, ref=%d\n", f->file_name, f->references);
 
        if (!(f->flags & FIO_FILE_OPEN))
                return;
 
        if (!(f->flags & FIO_FILE_OPEN))
                return;
diff --git a/fio.h b/fio.h
index c86e4629afef3116dd32cabf123a6d4bf3e94837..4f2dc8f6cfd322421b8ba09cda67480d7b10e96e 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -1004,9 +1004,12 @@ static inline void dprint_io_u(struct io_u *io_u, const char *p)
 
        dprint(FD_IO, "%s: io_u %p: off=%llu/len=%lu/ddir=%d", p, io_u,
                                        io_u->offset, io_u->buflen, io_u->ddir);
 
        dprint(FD_IO, "%s: io_u %p: off=%llu/len=%lu/ddir=%d", p, io_u,
                                        io_u->offset, io_u->buflen, io_u->ddir);
-       if (f)
-               dprint(FD_IO, "/%s", f->file_name);
-       dprint(FD_IO, "\n");
+       if (fio_debug & (1 << FD_IO)) {
+               if (f)
+                       log_info("/%s", f->file_name);
+
+               log_info("\n");
+       }
 }
 
 #endif
 }
 
 #endif