diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-08-31 11:19:00 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-08-31 11:19:00 -0400 |
commit | 096d4a1070fd067ab6e36f272c812616f266bb5e (patch) | |
tree | 09d4c2a6d77f550ac893e7aa8dfb06884aaf3a78 | |
parent | bd785a74d55010269548cb1d05740643e96a321d (diff) |
Avoid unnecessary record parsing
-rw-r--r-- | rt-plot-cpu.c | 18 | ||||
-rw-r--r-- | rt-plot-task.c | 15 | ||||
-rw-r--r-- | trace-graph.c | 6 | ||||
-rw-r--r-- | trace-graph.h | 2 |
4 files changed, 26 insertions, 15 deletions
diff --git a/rt-plot-cpu.c b/rt-plot-cpu.c index 9a609e0..aa7b611 100644 --- a/rt-plot-cpu.c +++ b/rt-plot-cpu.c | |||
@@ -345,21 +345,25 @@ static int rt_cpu_plot_event(struct graph_info *ginfo, struct graph_plot *plot, | |||
345 | 345 | ||
346 | match = try_switch_away(ginfo, rtc_info, record, info) || | 346 | match = try_switch_away(ginfo, rtc_info, record, info) || |
347 | try_switch_to(ginfo, rtc_info, record, info) || | 347 | try_switch_to(ginfo, rtc_info, record, info) || |
348 | try_completion(ginfo, rtc_info, record, info) || | ||
349 | try_sched_switch(ginfo, rtc_info, record, info); | 348 | try_sched_switch(ginfo, rtc_info, record, info); |
350 | 349 | ||
350 | if (is_high_res(ginfo)) { | ||
351 | match = match || try_completion(ginfo, rtc_info, record, info); | ||
352 | |||
353 | } | ||
354 | |||
351 | if (!match) { | 355 | if (!match) { |
352 | /* TODO: this should not be necessary! | 356 | /* TODO: this should not be necessary! |
353 | * Have to call checks to ensure ids are loaded. Otherwise, | 357 | * Have to call checks to ensure ids are loaded. Otherwise, |
354 | * is_displayed will not work here or in any other methods. | 358 | * is_displayed will not work here or in any other methods. |
355 | */ | 359 | */ |
356 | #define ARG ginfo,record, &pid | 360 | #define ARG ginfo,record, &pid |
357 | rt_graph_check_task_param(ARG, &dull, &dull); | 361 | rt_graph_check_task_param(ARG, &dull, &dull) || |
358 | rt_graph_check_container_param(ARG, &dchar); | 362 | rt_graph_check_container_param(ARG, &dchar) || |
359 | rt_graph_check_server_param(ARG, &dint, &dull, &dull); | 363 | rt_graph_check_server_param(ARG, &dint, &dull, &dull) || |
360 | rt_graph_check_task_release(ARG, &dint, &dull, &dull); | 364 | rt_graph_check_task_release(ARG, &dint, &dull, &dull) || |
361 | rt_graph_check_task_block(ARG, &dint, &dull); | 365 | rt_graph_check_task_block(ARG, &dint, &dull) || |
362 | rt_graph_check_task_resume(ARG, &dint, &dull); | 366 | rt_graph_check_task_resume(ARG, &dint, &dull) || |
363 | rt_graph_check_any(ARG, &eid, &ts); | 367 | rt_graph_check_any(ARG, &eid, &ts); |
364 | #undef ARG | 368 | #undef ARG |
365 | 369 | ||
diff --git a/rt-plot-task.c b/rt-plot-task.c index afb2bef..ec13313 100644 --- a/rt-plot-task.c +++ b/rt-plot-task.c | |||
@@ -473,12 +473,15 @@ rt_task_plot_record_matches(struct rt_plot_common *rt, | |||
473 | */ | 473 | */ |
474 | #define ARG ginfo, record, &pid | 474 | #define ARG ginfo, record, &pid |
475 | match = rt_graph_check_switch_to(ARG, &dint, &dull) || | 475 | match = rt_graph_check_switch_to(ARG, &dint, &dull) || |
476 | rt_graph_check_switch_away(ARG, &dint, &dull) || | 476 | rt_graph_check_switch_away(ARG, &dint, &dull); |
477 | rt_graph_check_task_release(ARG, &dint, &dull, &dull) || | 477 | if (is_high_res(ginfo)) { |
478 | rt_graph_check_task_completion(ARG, &dint, &dull) || | 478 | match = match || |
479 | rt_graph_check_task_block(ARG, &dint, &dull) || | 479 | rt_graph_check_task_release(ARG, &dint, &dull, &dull) || |
480 | rt_graph_check_task_resume(ARG, &dint, &dull) || | 480 | rt_graph_check_task_completion(ARG, &dint, &dull) || |
481 | rt_graph_check_any(ARG, &dint, &dull); | 481 | rt_graph_check_task_block(ARG, &dint, &dull) || |
482 | rt_graph_check_task_resume(ARG, &dint, &dull) || | ||
483 | rt_graph_check_any(ARG, &dint, &dull); | ||
484 | } | ||
482 | #undef ARG | 485 | #undef ARG |
483 | return pid == match_pid; | 486 | return pid == match_pid; |
484 | } | 487 | } |
diff --git a/trace-graph.c b/trace-graph.c index 2ad32a8..66c2722 100644 --- a/trace-graph.c +++ b/trace-graph.c | |||
@@ -92,7 +92,7 @@ static int convert_dist_to_time(struct graph_info *ginfo, int dist) | |||
92 | return convert_x_to_time(ginfo, dist) - convert_x_to_time(ginfo, 0); | 92 | return convert_x_to_time(ginfo, dist) - convert_x_to_time(ginfo, 0); |
93 | } | 93 | } |
94 | 94 | ||
95 | static int is_high_res(struct graph_info *ginfo) | 95 | int is_high_res(struct graph_info *ginfo) |
96 | { | 96 | { |
97 | return convert_dist_to_time(ginfo, PLOT_TRI_SIZE) < MAX_TRI_TIME; | 97 | return convert_dist_to_time(ginfo, PLOT_TRI_SIZE) < MAX_TRI_TIME; |
98 | } | 98 | } |
@@ -1867,6 +1867,7 @@ static void draw_hashed_plots(struct graph_info *ginfo) | |||
1867 | struct record *record; | 1867 | struct record *record; |
1868 | struct plot_hash *hash; | 1868 | struct plot_hash *hash; |
1869 | struct plot_list *list; | 1869 | struct plot_list *list; |
1870 | unsigned long long old_start; | ||
1870 | 1871 | ||
1871 | set_cpus_to_rts(ginfo, ginfo->view_start_time); | 1872 | set_cpus_to_rts(ginfo, ginfo->view_start_time); |
1872 | 1873 | ||
@@ -1899,8 +1900,9 @@ static void draw_hashed_plots(struct graph_info *ginfo) | |||
1899 | rt_graph_check_server_param(ARG, &dint, &dull, &dull); | 1900 | rt_graph_check_server_param(ARG, &dint, &dull, &dull); |
1900 | #undef ARG | 1901 | #undef ARG |
1901 | if (rt_graph_check_sys_release(ginfo, record, &rel)) { | 1902 | if (rt_graph_check_sys_release(ginfo, record, &rel)) { |
1902 | dull = rel - .1 * (ginfo->view_end_time - rel);; | 1903 | dull = rel - .1 * (ginfo->view_end_time - rel); |
1903 | ginfo->rtg_info.start_time = get_rts(ginfo, record); | 1904 | ginfo->rtg_info.start_time = get_rts(ginfo, record); |
1905 | //ginfo->view_end_time -= get_rts(ginfo, record) - ginfo->view_start_time; | ||
1904 | ginfo->view_start_time = get_rts(ginfo, record); | 1906 | ginfo->view_start_time = get_rts(ginfo, record); |
1905 | if (first) | 1907 | if (first) |
1906 | return; | 1908 | return; |
diff --git a/trace-graph.h b/trace-graph.h index 67a8f35..b3eff57 100644 --- a/trace-graph.h +++ b/trace-graph.h | |||
@@ -427,6 +427,8 @@ void graph_plot_cpus_update_callback(gboolean accept, | |||
427 | guint64 *selected_cpu_mask, | 427 | guint64 *selected_cpu_mask, |
428 | gpointer data); | 428 | gpointer data); |
429 | 429 | ||
430 | int is_high_res(struct graph_info *ginfo); | ||
431 | |||
430 | static inline void convert_nano(unsigned long long time, unsigned long *sec, | 432 | static inline void convert_nano(unsigned long long time, unsigned long *sec, |
431 | unsigned long *usec) | 433 | unsigned long *usec) |
432 | { | 434 | { |