• Home
  • Raw
  • Download

Lines Matching refs:tf

156 static void alloc_mpstat_gld(struct trace_file *tf)  in alloc_mpstat_gld()  argument
160 if (tf->trace->mpstat_num_cpus == 0) in alloc_mpstat_gld()
163 ptr = calloc((tf->trace->mpstat_num_cpus + 1) * MPSTAT_GRAPHS, in alloc_mpstat_gld()
169 tf->mpstat_gld = ptr; in alloc_mpstat_gld()
243 struct trace_file *tf; in add_trace_file() local
245 tf = calloc(1, sizeof(*tf)); in add_trace_file()
246 if (!tf) { in add_trace_file()
250 tf->label = ""; in add_trace_file()
251 tf->filename = strdup(filename); in add_trace_file()
252 list_add_tail(&tf->list, &all_traces); in add_trace_file()
253 tf->line_color = "black"; in add_trace_file()
259 struct trace_file *tf; in add_fio_trace_file() local
261 tf = calloc(1, sizeof(*tf)); in add_fio_trace_file()
262 if (!tf) { in add_fio_trace_file()
266 tf->label = ""; in add_fio_trace_file()
267 tf->filename = strdup(filename); in add_fio_trace_file()
268 list_add_tail(&tf->list, &fio_traces); in add_fio_trace_file()
269 tf->line_color = pick_fio_color(); in add_fio_trace_file()
270 tf->fio_trace = 1; in add_fio_trace_file()
276 struct trace_file *tf; in setup_trace_file_graphs() local
285 list_for_each_entry(tf, &all_traces, list) { in setup_trace_file_graphs()
286 tf->tput_reads_gld = alloc_line_data(tf->min_seconds, tf->max_seconds, tf->stop_seconds); in setup_trace_file_graphs()
287 tf->tput_writes_gld = alloc_line_data(tf->min_seconds, tf->max_seconds, tf->stop_seconds); in setup_trace_file_graphs()
288 tf->latency_gld = alloc_line_data(tf->min_seconds, tf->max_seconds, tf->stop_seconds); in setup_trace_file_graphs()
289 tf->queue_depth_gld = alloc_line_data(tf->min_seconds, tf->max_seconds, tf->stop_seconds); in setup_trace_file_graphs()
291 tf->iop_gld = alloc_line_data(tf->min_seconds, tf->max_seconds, tf->stop_seconds); in setup_trace_file_graphs()
292 tf->gdd_writes = calloc(alloc_ptrs, sizeof(struct graph_dot_data *)); in setup_trace_file_graphs()
293 tf->gdd_reads = calloc(alloc_ptrs, sizeof(struct graph_dot_data *)); in setup_trace_file_graphs()
294 tf->io_plots_allocated = alloc_ptrs; in setup_trace_file_graphs()
296 if (tf->trace->mpstat_num_cpus == 0) in setup_trace_file_graphs()
299 alloc_mpstat_gld(tf); in setup_trace_file_graphs()
300 for (i = 0; i < (tf->trace->mpstat_num_cpus + 1) * MPSTAT_GRAPHS; i++) { in setup_trace_file_graphs()
301 tf->mpstat_gld[i] = in setup_trace_file_graphs()
302 alloc_line_data(tf->mpstat_min_seconds, in setup_trace_file_graphs()
303 tf->mpstat_max_seconds, in setup_trace_file_graphs()
304 tf->mpstat_max_seconds); in setup_trace_file_graphs()
305 tf->mpstat_gld[i]->max = 100; in setup_trace_file_graphs()
309 list_for_each_entry(tf, &fio_traces, list) { in setup_trace_file_graphs()
310 if (tf->trace->fio_seconds > 0) { in setup_trace_file_graphs()
311 tf->fio_gld = alloc_line_data(tf->min_seconds, in setup_trace_file_graphs()
312 tf->max_seconds, in setup_trace_file_graphs()
313 tf->stop_seconds); in setup_trace_file_graphs()
321 struct trace_file *tf; in read_traces() local
330 list_for_each_entry(tf, &all_traces, list) { in read_traces()
332 path = join_path(blktrace_dest_dir, tf->filename); in read_traces()
334 path = strdup(tf->filename); in read_traces()
341 tf->trace = trace; in read_traces()
342 tf->max_seconds = SECONDS(last_time) + 1; in read_traces()
343 tf->stop_seconds = SECONDS(last_time) + 1; in read_traces()
345 find_extreme_offsets(trace, &tf->min_offset, &tf->max_offset, in read_traces()
347 filter_outliers(trace, tf->min_offset, tf->max_offset, &ymin, &ymax); in read_traces()
348 tf->min_offset = ymin; in read_traces()
349 tf->max_offset = ymax; in read_traces()
352 tf->mpstat_stop_seconds = trace->mpstat_seconds; in read_traces()
353 tf->mpstat_max_seconds = trace->mpstat_seconds; in read_traces()
354 if (tf->mpstat_max_seconds) in read_traces()
360 list_for_each_entry(tf, &fio_traces, list) { in read_traces()
361 trace = open_fio_trace(tf->filename); in read_traces()
364 tf->trace = trace; in read_traces()
365 tf->max_seconds = tf->trace->fio_seconds; in read_traces()
366 tf->stop_seconds = tf->trace->fio_seconds; in read_traces()
372 struct trace_file *tf; in pick_line_graph_color() local
375 list_for_each_entry(tf, &all_traces, list) { in pick_line_graph_color()
376 for (i = 0; i < tf->io_plots; i++) { in pick_line_graph_color()
377 if (tf->gdd_reads[i]) { in pick_line_graph_color()
378 tf->line_color = tf->gdd_reads[i]->color; in pick_line_graph_color()
379 tf->reads_color = tf->gdd_reads[i]->color; in pick_line_graph_color()
381 if (tf->gdd_writes[i]) { in pick_line_graph_color()
382 tf->line_color = tf->gdd_writes[i]->color; in pick_line_graph_color()
383 tf->writes_color = tf->gdd_writes[i]->color; in pick_line_graph_color()
385 if (tf->writes_color && tf->reads_color) in pick_line_graph_color()
388 if (!tf->reads_color) in pick_line_graph_color()
389 tf->reads_color = tf->line_color; in pick_line_graph_color()
390 if (!tf->writes_color) in pick_line_graph_color()
391 tf->writes_color = tf->line_color; in pick_line_graph_color()
395 static void read_fio_events(struct trace_file *tf) in read_fio_events() argument
402 first_fio(tf->trace); in read_fio_events()
404 ret = read_fio_event(tf->trace, &time, &bw, &dir); in read_fio_events()
409 add_fio_gld(time, bw, tf->fio_gld); in read_fio_events()
410 if (next_fio_line(tf->trace)) in read_fio_events()
418 struct trace_file *tf; in read_trace_events() local
427 list_for_each_entry(tf, &fio_traces, list) in read_trace_events()
428 read_fio_events(tf); in read_trace_events()
430 list_for_each_entry(tf, &all_traces, list) { in read_trace_events()
431 trace = tf->trace; in read_trace_events()
436 if (SECONDS(get_record_time(trace)) > tf->max_seconds) in read_trace_events()
438 add_tput(trace, tf->tput_writes_gld, tf->tput_reads_gld); in read_trace_events()
439 add_iop(trace, tf->iop_gld); in read_trace_events()
440 add_io(trace, tf); in read_trace_events()
441 add_pending_io(trace, tf->queue_depth_gld); in read_trace_events()
442 add_completed_io(trace, tf->latency_gld); in read_trace_events()
445 list_for_each_entry(tf, &all_traces, list) { in read_trace_events()
446 trace = tf->trace; in read_trace_events()
453 for (time = 0; time < tf->mpstat_stop_seconds; time++) { in read_trace_events()
471 add_mpstat_gld(time, sys, tf->mpstat_gld[i + MPSTAT_SYS]); in read_trace_events()
472 add_mpstat_gld(time, irq, tf->mpstat_gld[i + MPSTAT_IRQ]); in read_trace_events()
473 add_mpstat_gld(time, soft, tf->mpstat_gld[i + MPSTAT_SOFT]); in read_trace_events()
474 add_mpstat_gld(time, user, tf->mpstat_gld[i + MPSTAT_USER]); in read_trace_events()
475 add_mpstat_gld(time, iowait, tf->mpstat_gld[i + MPSTAT_IO]); in read_trace_events()
483 list_for_each_entry(tf, &all_traces, list) { in read_trace_events()
484 trace = tf->trace; in read_trace_events()
489 tf->mpstat_gld[MPSTAT_SYS]->max = max_sys; in read_trace_events()
490 tf->mpstat_gld[MPSTAT_IRQ]->max = max_irq; in read_trace_events()
491 tf->mpstat_gld[MPSTAT_SOFT]->max = max_soft; in read_trace_events()
492 tf->mpstat_gld[MPSTAT_USER]->max = max_user; in read_trace_events()
493 tf->mpstat_gld[MPSTAT_IO]->max = max_iowait;; in read_trace_events()
501 struct trace_file *tf; in set_trace_label() local
507 list_for_each_entry(tf, &all_traces, list) { in set_trace_label()
509 tf->label = strdup(label); in set_trace_label()
516 list_for_each_entry(tf, &fio_traces, list) { in set_trace_label()
518 tf->label = strdup(label); in set_trace_label()
539 static void compare_minmax_tf(struct trace_file *tf, unsigned int *max_seconds, in compare_minmax_tf() argument
542 if (tf->max_seconds > *max_seconds) in compare_minmax_tf()
543 *max_seconds = tf->max_seconds; in compare_minmax_tf()
544 if (tf->max_offset > *max_offset) in compare_minmax_tf()
545 *max_offset = tf->max_offset; in compare_minmax_tf()
546 if (tf->min_offset < *min_offset) in compare_minmax_tf()
547 *min_offset = tf->min_offset; in compare_minmax_tf()
554 struct trace_file *tf; in set_all_minmax_tf() local
557 list_for_each_entry(tf, traces, list) { in set_all_minmax_tf()
558 tf->min_seconds = min_seconds; in set_all_minmax_tf()
559 tf->max_seconds = max_seconds; in set_all_minmax_tf()
560 if (tf->stop_seconds > max_seconds) in set_all_minmax_tf()
561 tf->stop_seconds = max_seconds; in set_all_minmax_tf()
562 if (tf->mpstat_max_seconds) { in set_all_minmax_tf()
563 tf->mpstat_min_seconds = min_seconds; in set_all_minmax_tf()
564 tf->mpstat_max_seconds = max_seconds; in set_all_minmax_tf()
565 if (tf->mpstat_stop_seconds > max_seconds) in set_all_minmax_tf()
566 tf->mpstat_stop_seconds = max_seconds; in set_all_minmax_tf()
568 tf->min_offset = min_offset; in set_all_minmax_tf()
569 tf->max_offset = max_offset; in set_all_minmax_tf()
597 static struct plot_history *alloc_plot_history(struct trace_file *tf) in alloc_plot_history() argument
606 ph->read_pid_history = calloc(tf->io_plots, sizeof(struct pid_plot_history *)); in alloc_plot_history()
611 ph->write_pid_history = calloc(tf->io_plots, sizeof(struct pid_plot_history *)); in alloc_plot_history()
616 ph->pid_history_count = tf->io_plots; in alloc_plot_history()
617 for (i = 0; i < tf->io_plots; i++) { in alloc_plot_history()
618 if (tf->gdd_reads[i]) in alloc_plot_history()
619 ph->read_pid_history[i] = alloc_pid_plot_history(tf->gdd_reads[i]->color); in alloc_plot_history()
620 if (tf->gdd_writes[i]) in alloc_plot_history()
621 ph->write_pid_history[i] = alloc_pid_plot_history(tf->gdd_writes[i]->color); in alloc_plot_history()
704 struct trace_file *tf; in count_io_plot_types() local
708 list_for_each_entry(tf, &all_traces, list) { in count_io_plot_types()
709 for (i = 0; i < tf->io_plots; i++) { in count_io_plot_types()
710 if (tf->gdd_reads[i]) in count_io_plot_types()
712 if (tf->gdd_writes[i]) in count_io_plot_types()
738 struct trace_file *tf; in plot_io() local
754 list_for_each_entry(tf, &all_traces, list) { in plot_io()
755 char *prefix = tf->label ? tf->label : ""; in plot_io()
757 for (i = 0; i < tf->io_plots; i++) { in plot_io()
758 if (tf->gdd_writes[i]) { in plot_io()
759 svg_io_graph(plot, tf->gdd_writes[i]); in plot_io()
760 plot_io_legend(plot, tf->gdd_writes[i], prefix, " Writes"); in plot_io()
762 if (tf->gdd_reads[i]) { in plot_io()
763 svg_io_graph(plot, tf->gdd_reads[i]); in plot_io()
764 plot_io_legend(plot, tf->gdd_reads[i], prefix, " Reads"); in plot_io()
777 struct trace_file *tf; in plot_tput() local
788 list_for_each_entry(tf, &all_traces, list) { in plot_tput()
789 val = line_graph_roll_avg_max(tf->tput_writes_gld); in plot_tput()
792 val = line_graph_roll_avg_max(tf->tput_reads_gld); in plot_tput()
796 list_for_each_entry(tf, &all_traces, list) { in plot_tput()
797 if (tf->tput_writes_gld->max > 0) in plot_tput()
798 tf->tput_writes_gld->max = max; in plot_tput()
799 if (tf->tput_reads_gld->max > 0) in plot_tput()
800 tf->tput_reads_gld->max = max; in plot_tput()
806 tf = list_entry(all_traces.next, struct trace_file, list); in plot_tput()
814 list_for_each_entry(tf, &all_traces, list) { in plot_tput()
815 if (tf->tput_writes_gld->max > 0) { in plot_tput()
816 svg_line_graph(plot, tf->tput_writes_gld, tf->writes_color, 0, 0); in plot_tput()
818 svg_add_legend(plot, tf->label, " Writes", tf->writes_color); in plot_tput()
820 if (tf->tput_reads_gld->max > 0) { in plot_tput()
821 svg_line_graph(plot, tf->tput_reads_gld, tf->reads_color, 0, 0); in plot_tput()
823 svg_add_legend(plot, tf->label, " Reads", tf->reads_color); in plot_tput()
840 struct trace_file *tf; in plot_fio_tput() local
851 list_for_each_entry(tf, &fio_traces, list) { in plot_fio_tput()
852 val = line_graph_roll_avg_max(tf->fio_gld); in plot_fio_tput()
857 list_for_each_entry(tf, &fio_traces, list) { in plot_fio_tput()
858 if (tf->fio_gld->max > 0) in plot_fio_tput()
859 tf->fio_gld->max = max; in plot_fio_tput()
865 tf = list_entry(all_traces.next, struct trace_file, list); in plot_fio_tput()
873 list_for_each_entry(tf, &fio_traces, list) { in plot_fio_tput()
874 if (tf->fio_gld->max > 0) { in plot_fio_tput()
875 svg_line_graph(plot, tf->fio_gld, tf->line_color, 0, 0); in plot_fio_tput()
877 svg_add_legend(plot, tf->label, "", tf->line_color); in plot_fio_tput()
893 struct trace_file *tf; in plot_cpu() local
905 list_for_each_entry(tf, &all_traces, list) { in plot_cpu()
906 if (tf->trace->mpstat_num_cpus > max) in plot_cpu()
907 max = tf->trace->mpstat_num_cpus; in plot_cpu()
912 tf = list_entry(all_traces.next, struct trace_file, list); in plot_cpu()
914 ymax = tf->mpstat_gld[gld_index]->max; in plot_cpu()
923 max_seconds = tf->mpstat_max_seconds; in plot_cpu()
925 set_yticks(plot, num_yticks, 0, tf->mpstat_gld[gld_index]->max, ""); in plot_cpu()
927 set_xticks(plot, num_xticks, tf->mpstat_min_seconds, max_seconds); in plot_cpu()
930 list_for_each_entry(tf, &all_traces, list) { in plot_cpu()
931 if (tf->mpstat_gld == 0) in plot_cpu()
933 for (gld_i = tf->mpstat_gld[0]->min_seconds; in plot_cpu()
934 gld_i < tf->mpstat_gld[0]->stop_seconds; gld_i++) { in plot_cpu()
935 if (tf->mpstat_gld[gld_index]->data[gld_i].count) { in plot_cpu()
936 avg += (tf->mpstat_gld[gld_index]->data[gld_i].sum / in plot_cpu()
937 tf->mpstat_gld[gld_index]->data[gld_i].count); in plot_cpu()
940 avg /= tf->mpstat_gld[gld_index]->stop_seconds - in plot_cpu()
941 tf->mpstat_gld[gld_index]->min_seconds; in plot_cpu()
943 svg_line_graph(plot, tf->mpstat_gld[0], color, 0, 0); in plot_cpu()
944 svg_add_legend(plot, tf->label, " avg", color); in plot_cpu()
946 for (i = 1; i < tf->trace->mpstat_num_cpus + 1; i++) { in plot_cpu()
947 struct graph_line_data *gld = tf->mpstat_gld[i * MPSTAT_GRAPHS + gld_index]; in plot_cpu()
973 svg_add_legend(plot, tf->label, line, color); in plot_cpu()
996 struct trace_file *tf; in plot_queue_depth() local
1007 list_for_each_entry(tf, &all_traces, list) { in plot_queue_depth()
1008 val = line_graph_roll_avg_max(tf->queue_depth_gld); in plot_queue_depth()
1013 list_for_each_entry(tf, &all_traces, list) in plot_queue_depth()
1014 tf->queue_depth_gld->max = max; in plot_queue_depth()
1020 list_for_each_entry(tf, &all_traces, list) { in plot_queue_depth()
1021 svg_line_graph(plot, tf->queue_depth_gld, tf->line_color, 0, 0); in plot_queue_depth()
1023 svg_add_legend(plot, tf->label, "", tf->line_color); in plot_queue_depth()
1096 struct trace_file *tf; in plot_io_movie() local
1120 list_for_each_entry(tf, &all_traces, list) { in plot_io_movie()
1121 char *prefix = tf->label ? tf->label : ""; in plot_io_movie()
1135 plot_tput(plot, tf->min_seconds, tf->max_seconds, 0); in plot_io_movie()
1137 plot_cpu(plot, tf->max_seconds, in plot_io_movie()
1141 plot_queue_depth(plot, tf->min_seconds, tf->max_seconds); in plot_io_movie()
1157 history = alloc_plot_history(tf); in plot_io_movie()
1160 for (pid = 0; pid < tf->io_plots; pid++) { in plot_io_movie()
1161 if (tf->gdd_reads[pid]) in plot_io_movie()
1162 plot_io_legend(plot, tf->gdd_reads[pid], prefix, " Reads"); in plot_io_movie()
1163 if (tf->gdd_writes[pid]) in plot_io_movie()
1164 plot_io_legend(plot, tf->gdd_writes[pid], prefix, " Writes"); in plot_io_movie()
1169 for (pid = 0; pid < tf->io_plots; pid++) { in plot_io_movie()
1170 if (tf->gdd_reads[pid]) { in plot_io_movie()
1171 svg_io_graph_movie(tf->gdd_reads[pid], in plot_io_movie()
1175 if (tf->gdd_writes[pid]) { in plot_io_movie()
1176 svg_io_graph_movie(tf->gdd_writes[pid], in plot_io_movie()
1205 struct trace_file *tf; in plot_latency() local
1216 list_for_each_entry(tf, &all_traces, list) { in plot_latency()
1217 val = line_graph_roll_avg_max(tf->latency_gld); in plot_latency()
1222 list_for_each_entry(tf, &all_traces, list) in plot_latency()
1223 tf->latency_gld->max = max; in plot_latency()
1228 tf = list_entry(all_traces.next, struct trace_file, list); in plot_latency()
1236 list_for_each_entry(tf, &all_traces, list) { in plot_latency()
1237 svg_line_graph(plot, tf->latency_gld, tf->line_color, 0, 0); in plot_latency()
1239 svg_add_legend(plot, tf->label, "", tf->line_color); in plot_latency()
1253 struct trace_file *tf; in plot_iops() local
1260 list_for_each_entry(tf, &all_traces, list) { in plot_iops()
1261 val = line_graph_roll_avg_max(tf->iop_gld); in plot_iops()
1266 list_for_each_entry(tf, &all_traces, list) in plot_iops()
1267 tf->iop_gld->max = max; in plot_iops()
1274 tf = list_entry(all_traces.next, struct trace_file, list); in plot_iops()
1282 list_for_each_entry(tf, &all_traces, list) { in plot_iops()
1283 svg_line_graph(plot, tf->iop_gld, tf->line_color, 0, 0); in plot_iops()
1285 svg_add_legend(plot, tf->label, "", tf->line_color); in plot_iops()
1598 struct trace_file *tf; in main() local
1670 list_for_each_entry(tf, &all_traces, list) in main()
1671 compare_minmax_tf(tf, &max_seconds, &min_offset, &max_offset); in main()
1672 list_for_each_entry(tf, &fio_traces, list) in main()
1673 compare_minmax_tf(tf, &max_seconds, &min_offset, &max_offset); in main()