static struct list_head io_hash_table[IO_HASH_TABLE_SIZE];
static u64 ios_in_flight = 0;
+extern int plot_io_action;
/*
* Trace categories
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)
u64 *max_bank_ret, u64 *max_offset_ret);
int filter_outliers(struct trace *trace, u64 min_offset, u64 max_offset,
u64 *yzoom_min, u64 *yzoom_max);
+int action_char_to_num(char action);
void add_iop(struct trace *trace, struct graph_line_data *gld);
void check_record(struct trace *trace);
void add_completed_io(struct trace *trace,
static unsigned long long min_mb = 0;
static unsigned long long max_mb = ULLONG_MAX >> 20;
+int plot_io_action = 0;
+
/*
* this doesn't include the IO graph,
* but it counts the other graphs as they go out
HELP_LONG_OPT = 1,
};
-char *option_string = "T:t:o:l:r:O:N:d:p:m::h:w:c:x:y:";
+char *option_string = "T:t:o:l:r:O:N:d:p:m::h:w:c:x:y:a:";
static struct option long_options[] = {
{"columns", required_argument, 0, 'c'},
{"title", required_argument, 0, 'T'},
{"height", required_argument, 0, 'h'},
{"xzoom", required_argument, 0, 'x'},
{"yzoom", required_argument, 0, 'y'},
+ {"io-plot-action", required_argument, 0, 'a'},
{"help", no_argument, 0, HELP_LONG_OPT},
{0, 0, 0, 0}
};
"\t-c (--columns): numbers of columns in graph output\n"
"\t-x (--xzoom): limit processed time to min:max\n"
"\t-y (--yzoom): limit processed sectors to min:max\n"
+ "\t-a (--io-plot-action): plot given action (one of Q,D,C) in IO graph\n"
);
exit(1);
}
exit(1);
}
break;
+ case 'a':
+ if (strlen(optarg) != 1) {
+action_err:
+ fprintf(stderr, "Action must be one of Q, D, C.");
+ exit(1);
+ }
+ plot_io_action = action_char_to_num(optarg[0]);
+ if (plot_io_action < 0)
+ goto action_err;
+ break;
case '?':
case HELP_LONG_OPT:
print_usage();