aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan <hermanjl@hermanjl-Aspire-5553G.(none)>2012-03-07 16:30:59 -0500
committerJonathan <hermanjl@hermanjl-Aspire-5553G.(none)>2012-03-07 16:30:59 -0500
commit000249b6b36adb88e4fea5e020319b9361d0ca54 (patch)
tree81b1e82c9c97fa324f0a1d43132387ba5ec25bf5
parent26c36cfaa22ce2c86084b5bdb8f94a6d831bae01 (diff)
rt-graph: rt tasks supply their own match and find functions
-rw-r--r--rt-plot-task.c42
1 files changed, 38 insertions, 4 deletions
diff --git a/rt-plot-task.c b/rt-plot-task.c
index cfe45f7..31f4c7e 100644
--- a/rt-plot-task.c
+++ b/rt-plot-task.c
@@ -618,16 +618,50 @@ static int rt_task_plot_display_info(struct graph_info *ginfo,
618 return 1; 618 return 1;
619} 619}
620 620
621static int rt_task_plot_match_time(struct graph_info *ginfo,
622 struct graph_plot *plot,
623 unsigned long long time)
624{
625 struct record *record = NULL;
626 struct rt_task_info *rtt_info = plot->private;
627 int next_cpu, match, ret;
628
629 set_cpus_to_time(ginfo, time);
630
631 do {
632 free_record(record);
633 record = tracecmd_read_next_data(ginfo->handle, &next_cpu);
634 if (!record)
635 return 0;
636 match = record_matches_pid(ginfo, record, rtt_info->base.pid);
637 } while ((!match && get_rts(ginfo, record) < time + 1) ||
638 (match && get_rts(ginfo, record) < time));
639
640 if (record && get_rts(ginfo, record) == time)
641 ret = 1;
642 free_record(record);
643
644 return ret;
645}
646
647static struct record *
648rt_task_plot_find_record(struct graph_info *ginfo, struct graph_plot *plot,
649 unsigned long long time)
650{
651 struct rt_task_info *rtt_info = plot->private;
652 return find_record(ginfo, rtt_info->base.pid, time);
653}
654
655
621static const struct plot_callbacks rt_task_cb = { 656static const struct plot_callbacks rt_task_cb = {
622 .plot_event = rt_task_plot_event,
623 .start = rt_task_plot_start, 657 .start = rt_task_plot_start,
624 .destroy = rt_task_plot_destroy, 658 .destroy = rt_task_plot_destroy,
625 659
660 .plot_event = rt_task_plot_event,
626 .display_last_event = rt_task_plot_display_last_event, 661 .display_last_event = rt_task_plot_display_last_event,
627 .display_info = rt_task_plot_display_info, 662 .display_info = rt_task_plot_display_info,
628 663 .match_time = rt_task_plot_match_time,
629 .match_time = task_plot_match_time, 664 .find_record = rt_task_plot_find_record,
630 .find_record = task_plot_find_record,
631}; 665};
632 666
633void rt_plot_task_update_callback(gboolean accept, 667void rt_plot_task_update_callback(gboolean accept,