[PATCH] blkparse: add log_action()
authorJens Axboe <axboe@suse.de>
Thu, 15 Sep 2005 13:09:49 +0000 (15:09 +0200)
committerJens Axboe <axboe@suse.de>
Thu, 15 Sep 2005 13:09:49 +0000 (15:09 +0200)
For events where sectors and length don't really apply (eg plugging)

blkparse.c

index b221951129d9fe6367305fb0df39d937fdb770d1..9c2123ae7b32ed84bf5db3b2ae7748c547e657e7 100644 (file)
@@ -779,6 +779,13 @@ static void log_merge(struct per_cpu_info *pci, struct blk_io_trace *t,
        output(pci, tstring);
 }
 
+static void log_action(struct per_cpu_info *pci, struct blk_io_trace *t,
+                       char act)
+{
+       sprintf(tstring,"%s [%s]\n", setup_header(pci, t, act), t->comm);
+       output(pci, tstring);
+}
+
 static void log_generic(struct per_cpu_info *pci, struct blk_io_trace *t,
                        char act)
 {
@@ -895,7 +902,7 @@ static void dump_trace_fs(struct blk_io_trace *t, struct per_cpu_info *pci)
                        log_complete(pci, t, 'C');
                        break;
                case __BLK_TA_PLUG:
-                       log_generic(pci, t, 'P');
+                       log_action(pci, t, 'P');
                        break;
                case __BLK_TA_UNPLUG:
                        log_unplug(pci, t, 'U');