aboutsummaryrefslogtreecommitdiffstats
path: root/blkparse.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2012-09-06 18:23:05 +0200
committerChris Mason <chris.mason@oracle.com>2012-09-10 20:53:05 -0400
commit928f1c769c989f7c75fad58712227cdf827b1018 (patch)
tree0049467905ec2d3eaa10d4100917d2e743826ecb /blkparse.c
parent1b6d49249326660812f205a0259dbc98b2abd922 (diff)
downloadiowatcher-928f1c769c989f7c75fad58712227cdf827b1018.tar.gz
Add option to set action which should be displayed in the IO graph
Sometimes this is useful to see how IO scheduler or storage itself changes the IO submitted by the application. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'blkparse.c')
-rw-r--r--blkparse.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/blkparse.c b/blkparse.c
index ab7a637..a0fb8c5 100644
--- a/blkparse.c
+++ b/blkparse.c
@@ -41,6 +41,7 @@
static struct list_head io_hash_table[IO_HASH_TABLE_SIZE];
static u64 ios_in_flight = 0;
+extern int plot_io_action;
/*
* Trace categories
@@ -613,8 +614,23 @@ static inline int tput_event(struct trace *trace)
return __BLK_TA_COMPLETE;
}
+int action_char_to_num(char action)
+{
+ switch (action) {
+ case 'Q':
+ return __BLK_TA_QUEUE;
+ case 'D':
+ return __BLK_TA_ISSUE;
+ case 'C':
+ return __BLK_TA_COMPLETE;
+ }
+ return -1;
+}
+
static inline int io_event(struct trace *trace)
{
+ if (plot_io_action)
+ return plot_io_action;
if (trace->found_queue)
return __BLK_TA_QUEUE;
if (trace->found_issue)