summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2013-01-21 11:22:58 -0500
committerChris Mason <clm@fb.com>2014-09-24 12:02:08 -0700
commit7a51b395a7cf1218d2ad55008d5a64cd7721a057 (patch)
tree21700329541a4270266b22eb078f9a73149f661e
parent660b041110b6032d2e85b7c6a8a8d56803a60919 (diff)
downloadblktrace-7a51b395a7cf1218d2ad55008d5a64cd7721a057.tar.gz
blktrace-7a51b395a7cf1218d2ad55008d5a64cd7721a057.tar.bz2
iowatcher: Don't print a legend on the tput graphs during movies
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--iowatcher/main.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/iowatcher/main.c b/iowatcher/main.c
index 8fa9115..1444fbc 100644
--- a/iowatcher/main.c
+++ b/iowatcher/main.c
@@ -775,7 +775,8 @@ static void plot_io(struct plot *plot, int min_seconds, int max_seconds, u64 min
close_plot(plot);
}
-static void plot_tput(struct plot *plot, int min_seconds, int max_seconds)
+static void plot_tput(struct plot *plot, int min_seconds, int max_seconds,
+ int with_legend)
{
struct trace_file *tf;
char *units;
@@ -785,7 +786,8 @@ static void plot_tput(struct plot *plot, int min_seconds, int max_seconds)
if (active_graphs[TPUT_GRAPH_INDEX] == 0)
return;
- svg_alloc_legend(plot, num_traces * 2);
+ if (with_legend)
+ svg_alloc_legend(plot, num_traces * 2);
list_for_each_entry(tf, &all_traces, list) {
if (tf->tput_writes_gld->max > max)
@@ -814,18 +816,22 @@ static void plot_tput(struct plot *plot, int min_seconds, int max_seconds)
list_for_each_entry(tf, &all_traces, list) {
if (tf->tput_writes_gld->max > 0) {
svg_line_graph(plot, tf->tput_writes_gld, tf->writes_color, 0, 0);
- svg_add_legend(plot, tf->label, "Writes", tf->writes_color);
+ if (with_legend)
+ svg_add_legend(plot, tf->label, "Writes", tf->writes_color);
}
if (tf->tput_reads_gld->max > 0) {
svg_line_graph(plot, tf->tput_reads_gld, tf->reads_color, 0, 0);
- svg_add_legend(plot, tf->label, "Reads", tf->reads_color);
+ if (with_legend)
+ svg_add_legend(plot, tf->label, "Reads", tf->reads_color);
}
}
if (plot->add_xlabel)
set_xlabel(plot, "Time (seconds)");
- svg_write_legend(plot);
+ if (with_legend)
+ svg_write_legend(plot);
+
close_plot(plot);
total_graphs_written++;
}
@@ -1111,8 +1117,7 @@ static void plot_io_movie(struct plot *plot)
set_graph_size(cols / graph_width_factor, rows / 8);
plot->timeline = i / graph_width_factor;
- plot_tput(plot, tf->min_seconds,
- tf->max_seconds);
+ plot_tput(plot, tf->min_seconds, tf->max_seconds, 0);
plot_cpu(plot, tf->max_seconds,
"CPU System Time", CPU_SYS_GRAPH_INDEX, MPSTAT_SYS);
@@ -1705,7 +1710,7 @@ int main(int ac, char **av)
num_yticks--;
check_plot_columns(plot, TPUT_GRAPH_INDEX);
- plot_tput(plot, min_seconds, max_seconds);
+ plot_tput(plot, min_seconds, max_seconds, 1);
check_plot_columns(plot, FIO_GRAPH_INDEX);
plot_fio_tput(plot, min_seconds, max_seconds);