diff options
Diffstat (limited to 'rt-plot-task.c')
-rw-r--r-- | rt-plot-task.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/rt-plot-task.c b/rt-plot-task.c index 557bfff..57662b7 100644 --- a/rt-plot-task.c +++ b/rt-plot-task.c | |||
@@ -296,6 +296,7 @@ static int try_release(struct graph_info *ginfo, struct rt_task_info *rtt_info, | |||
296 | &release, &deadline); | 296 | &release, &deadline); |
297 | if (match && pid == rtt_info->pid) { | 297 | if (match && pid == rtt_info->pid) { |
298 | update_job(rtt_info, job); | 298 | update_job(rtt_info, job); |
299 | |||
299 | info->release = TRUE; | 300 | info->release = TRUE; |
300 | info->rtime = release; | 301 | info->rtime = release; |
301 | 302 | ||
@@ -612,7 +613,7 @@ static int rt_task_plot_display_info(struct graph_info *ginfo, | |||
612 | int pid, job, eid; | 613 | int pid, job, eid; |
613 | struct record *record; | 614 | struct record *record; |
614 | struct event_format *event; | 615 | struct event_format *event; |
615 | unsigned long usec, sec; | 616 | unsigned long long msec, nsec; |
616 | unsigned long long release, deadline, rts; | 617 | unsigned long long release, deadline, rts; |
617 | struct rt_task_info *rtt_info = plot->private; | 618 | struct rt_task_info *rtt_info = plot->private; |
618 | struct offset_cache *offsets; | 619 | struct offset_cache *offsets; |
@@ -654,9 +655,9 @@ static int rt_task_plot_display_info(struct graph_info *ginfo, | |||
654 | trace_seq_printf(s, "\nUNKNOWN EVENT %d\n", eid); | 655 | trace_seq_printf(s, "\nUNKNOWN EVENT %d\n", eid); |
655 | } | 656 | } |
656 | trace_seq_putc(s, '\n'); | 657 | trace_seq_putc(s, '\n'); |
657 | convert_nano(time, &sec, &usec); | 658 | nano_to_milli(time, &msec, &nsec); |
658 | trace_seq_printf(s, "%lu.%06lu CPU: %03d", | 659 | trace_seq_printf(s, "%llu.%06llu ms CPU: %03d", |
659 | sec, usec, record->cpu); | 660 | msec, nsec, record->cpu); |
660 | free_record(record); | 661 | free_record(record); |
661 | } | 662 | } |
662 | 663 | ||
@@ -740,23 +741,35 @@ void rt_plot_task(struct graph_info *ginfo, int pid, int pos) | |||
740 | { | 741 | { |
741 | struct rt_graph_info *rtg_info = &ginfo->rtg_info; | 742 | struct rt_graph_info *rtg_info = &ginfo->rtg_info; |
742 | struct rt_task_info *rtt_info; | 743 | struct rt_task_info *rtt_info; |
744 | struct rt_task_params *params; | ||
743 | struct graph_plot *plot; | 745 | struct graph_plot *plot; |
746 | struct task_list *list; | ||
744 | const char *comm; | 747 | const char *comm; |
748 | unsigned long long wm, wn, pm, pn; | ||
745 | char *plot_label; | 749 | char *plot_label; |
746 | int len; | 750 | int len; |
747 | 751 | ||
748 | if (!find_task_list(rtg_info->tasks, pid)) | 752 | list = find_task_list(rtg_info->tasks, pid); |
753 | if (!list) | ||
749 | die("Cannot create RT plot of non-RT task %d!\n", pid); | 754 | die("Cannot create RT plot of non-RT task %d!\n", pid); |
750 | 755 | ||
756 | params = list->data; | ||
757 | if (!params) | ||
758 | die ("RT task %d added without RT params!\n", pid); | ||
751 | rtt_info = malloc_or_die(sizeof(*rtt_info)); | 759 | rtt_info = malloc_or_die(sizeof(*rtt_info)); |
752 | rtt_info->pid = pid; | 760 | rtt_info->pid = pid; |
753 | rtt_info->label = malloc_or_die(LLABEL); | 761 | rtt_info->label = malloc_or_die(LLABEL); |
754 | 762 | ||
763 | nano_to_milli(params->wcet, &wm, &wn); | ||
764 | nano_to_milli(params->period, &pm, &pn); | ||
765 | |||
755 | /* Create plot */ | 766 | /* Create plot */ |
756 | comm = pevent_data_comm_from_pid(ginfo->pevent, pid); | 767 | comm = pevent_data_comm_from_pid(ginfo->pevent, pid); |
757 | len = strlen(comm) + 100; | 768 | len = strlen(comm) + 100; |
758 | plot_label = malloc_or_die(len); | 769 | plot_label = malloc_or_die(len); |
759 | snprintf(plot_label, len, "*%s-%d", comm, pid); | 770 | snprintf(plot_label, len, |
771 | "*%s-%d\n(%llu.%1llu, %llu.%1llu)", | ||
772 | comm, pid, wm, wn, pm, pn); | ||
760 | plot = trace_graph_plot_insert(ginfo, pos, plot_label, PLOT_TYPE_RT_TASK, | 773 | plot = trace_graph_plot_insert(ginfo, pos, plot_label, PLOT_TYPE_RT_TASK, |
761 | &rt_task_cb, rtt_info); | 774 | &rt_task_cb, rtt_info); |
762 | free(plot_label); | 775 | free(plot_label); |