+
+ if (with_legend)
+ svg_write_legend(plot);
+
+ close_plot(plot);
+ total_graphs_written++;
+}
+
+static void plot_fio_tput(struct plot *plot,
+ unsigned int min_seconds, unsigned int max_seconds)
+{
+ struct trace_file *tf;
+ char *units;
+ char line[128];
+ u64 max = 0;
+
+ if (num_fio_traces == 0 || active_graphs[FIO_GRAPH_INDEX] == 0)
+ return;
+
+ if (num_fio_traces > 1)
+ svg_alloc_legend(plot, num_fio_traces);
+
+ list_for_each_entry(tf, &fio_traces, list) {
+ if (tf->fio_gld->max > max)
+ max = tf->fio_gld->max;
+ }
+
+ list_for_each_entry(tf, &fio_traces, list) {
+ if (tf->fio_gld->max > 0)
+ tf->fio_gld->max = max;
+ }
+
+ setup_axis(plot);
+ set_plot_label(plot, "Fio Throughput");
+
+ tf = list_entry(all_traces.next, struct trace_file, list);
+
+ scale_line_graph_bytes(&max, &units, 1024);
+ sprintf(line, "%sB/s", units);
+ set_ylabel(plot, line);
+ set_yticks(plot, num_yticks, 0, max, "");
+
+ set_xticks(plot, num_xticks, min_seconds, max_seconds);
+ list_for_each_entry(tf, &fio_traces, list) {
+ if (tf->fio_gld->max > 0) {
+ svg_line_graph(plot, tf->fio_gld, tf->line_color, 0, 0);
+ if (num_fio_traces > 1)
+ svg_add_legend(plot, tf->label, "", tf->line_color);
+ }
+ }
+
+ if (plot->add_xlabel)
+ set_xlabel(plot, "Time (seconds)");
+
+ if (num_fio_traces > 1)