aboutsummaryrefslogtreecommitdiffstats
path: root/rt-plot-cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'rt-plot-cpu.c')
-rw-r--r--rt-plot-cpu.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/rt-plot-cpu.c b/rt-plot-cpu.c
index 7b201dc..25c4ec9 100644
--- a/rt-plot-cpu.c
+++ b/rt-plot-cpu.c
@@ -74,10 +74,16 @@ __find_record(struct graph_info *ginfo, int cpu, unsigned long long time,
74 74
75 while ((record = tracecmd_read_data(ginfo->handle, cpu))) { 75 while ((record = tracecmd_read_data(ginfo->handle, cpu))) {
76 ignored = 0; 76 ignored = 0;
77 if (display) { 77 eid = pevent_data_type(ginfo->pevent, record);
78 eid = pevent_data_type(ginfo->pevent, record); 78
79 if (display)
79 ignored = !is_displayed(ginfo, eid); 80 ignored = !is_displayed(ginfo, eid);
80 } 81 else
82 /* Without this ignore, the info popup is going
83 * to be sched_switchs almost always.
84 */
85 ignored = (eid == ginfo->event_sched_switch_id);
86
81 if (get_rts(ginfo, record) >= time && !ignored) 87 if (get_rts(ginfo, record) >= time && !ignored)
82 break; 88 break;
83 free_record(record); 89 free_record(record);
@@ -342,11 +348,13 @@ static int rt_cpu_plot_event(struct graph_info *ginfo, struct graph_plot *plot,
342 * is_displayed will not work here or in any other methods. 348 * is_displayed will not work here or in any other methods.
343 */ 349 */
344#define ARG rtg_info, ginfo->pevent, record, &pid 350#define ARG rtg_info, ginfo->pevent, record, &pid
351 rt_graph_check_task_param(ARG, &dull, &dull);
345 rt_graph_check_task_release(ARG, &dint, &dull, &dull); 352 rt_graph_check_task_release(ARG, &dint, &dull, &dull);
346 rt_graph_check_task_block(ARG, &dull); 353 rt_graph_check_task_block(ARG, &dull);
347 rt_graph_check_task_resume(ARG, &dull); 354 rt_graph_check_task_resume(ARG, &dull);
348 rt_graph_check_any(ARG, &eid, &ts); 355 rt_graph_check_any(ARG, &eid, &ts);
349#undef ARG 356#undef ARG
357
350 if (is_displayed(ginfo, eid)) { 358 if (is_displayed(ginfo, eid)) {
351 info->line = TRUE; 359 info->line = TRUE;
352 info->lcolor = hash_pid(pid); 360 info->lcolor = hash_pid(pid);
@@ -427,6 +435,8 @@ rt_cpu_plot_display_info(struct graph_info *ginfo, struct graph_plot *plot,
427 trace_seq_putc(s, '\n'); 435 trace_seq_putc(s, '\n');
428 pevent_event_info(s, event, record); 436 pevent_event_info(s, event, record);
429 trace_seq_putc(s, '\n'); 437 trace_seq_putc(s, '\n');
438 if (!is_running)
439 trace_seq_putc(s, '\n');
430 } else 440 } else
431 trace_seq_printf(s, "UNKNOWN EVENT %d\n", eid); 441 trace_seq_printf(s, "UNKNOWN EVENT %d\n", eid);
432 } 442 }
@@ -554,9 +564,16 @@ void rt_plot_cpu(struct graph_info *ginfo, int cpu)
554 rtc_info->cpu = cpu; 564 rtc_info->cpu = cpu;
555 rtc_info->label = malloc_or_die(LLABEL); 565 rtc_info->label = malloc_or_die(LLABEL);
556 566
557 snprintf(label, 100, "*CPU %d", cpu); 567 snprintf(label, 100, "RT-CPU %d", cpu);
558 568
559 plot = trace_graph_plot_append(ginfo, label, PLOT_TYPE_RT_CPU, 569 plot = trace_graph_plot_append(ginfo, label, PLOT_TYPE_RT_CPU,
560 TIME_TYPE_RT, &rt_cpu_cb, rtc_info); 570 TIME_TYPE_RT, &rt_cpu_cb, rtc_info);
561 trace_graph_plot_add_all_recs(ginfo, plot); 571 trace_graph_plot_add_all_recs(ginfo, plot);
562} 572}
573
574void rt_plot_init_cpus(struct graph_info *ginfo, int cpus)
575{
576 long cpu;
577 for (cpu = 0; cpu < cpus; cpu++)
578 rt_plot_cpu(ginfo, cpu);
579}