Don't prepend blktrace destination dir if we didn't run blktrace
authorJan Kara <jack@suse.cz>
Thu, 5 May 2016 15:17:10 +0000 (17:17 +0200)
committerJens Axboe <axboe@fb.com>
Thu, 5 May 2016 15:20:18 +0000 (09:20 -0600)
When user specifies trace files directly via -t option, it doesn't make
sense to prepend blktrace destination directory to them (it is
especially confusing if you specify absolute path names with -t option
and this logic breaks the path names). So avoid that.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
iowatcher/main.c

index 28ff4cbbb153dda905585d48ba0a89a1f18f4bec..2d0349c083b70debf94d24aa8adc6e6d53dda9a1 100644 (file)
@@ -328,7 +328,10 @@ static void read_traces(void)
        char *path = NULL;
 
        list_for_each_entry(tf, &all_traces, list) {
-               path = join_path(blktrace_dest_dir, tf->filename);
+               if (num_blktrace_devices)
+                       path = join_path(blktrace_dest_dir, tf->filename);
+               else
+                       path = strdup(tf->filename);
 
                trace = open_trace(path);
                if (!trace)