aboutsummaryrefslogtreecommitdiffstats
path: root/rt-graph.c
diff options
context:
space:
mode:
Diffstat (limited to 'rt-graph.c')
-rw-r--r--rt-graph.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/rt-graph.c b/rt-graph.c
index 0a72134..4aa06ac 100644
--- a/rt-graph.c
+++ b/rt-graph.c
@@ -1,7 +1,7 @@
1#include "trace-graph.h" 1#include "trace-graph.h"
2#include "trace-hash.h" 2#include "trace-hash.h"
3 3
4#define DEBUG_LEVEL 0 4#define DEBUG_LEVEL 3
5#if DEBUG_LEVEL > 0 5#if DEBUG_LEVEL > 0
6#define dprintf(l, x...) \ 6#define dprintf(l, x...) \
7 do { \ 7 do { \
@@ -86,17 +86,17 @@ int rt_graph_check_any(struct rt_graph_info *rtg_info,
86 86
87/** 87/**
88 * rt_graph_check_task_param - check for litmus_task_param record 88 * rt_graph_check_task_param - check for litmus_task_param record
89 * Return 1 and @pid, @wcet, and @period if the record matches 89 * Return 1 and @pid, @out_wcet, and @out_period if the record matches
90 */ 90 */
91int rt_graph_check_task_param(struct rt_graph_info *rtg_info, 91int rt_graph_check_task_param(struct rt_graph_info *rtg_info,
92 struct pevent *pevent, struct record *record, 92 struct pevent *pevent, struct record *record,
93 gint *pid, unsigned long long *wcet, 93 gint *pid, unsigned long long *out_wcet,
94 unsigned long long *period) 94 unsigned long long *out_period)
95{ 95{
96 struct event_format *event; 96 struct event_format *event;
97 struct rt_task_params *params; 97 struct rt_task_params *params;
98 struct task_list *list; 98 struct task_list *list;
99 unsigned long long val; 99 unsigned long long val, wcet, period;
100 gint id; 100 gint id;
101 int ret = 0; 101 int ret = 0;
102 102
@@ -122,12 +122,12 @@ int rt_graph_check_task_param(struct rt_graph_info *rtg_info,
122 record->data, &val); 122 record->data, &val);
123 *pid = val; 123 *pid = val;
124 pevent_read_number_field(rtg_info->param_wcet_field, 124 pevent_read_number_field(rtg_info->param_wcet_field,
125 record->data, wcet); 125 record->data, &wcet);
126 pevent_read_number_field(rtg_info->param_period_field, 126 pevent_read_number_field(rtg_info->param_period_field,
127 record->data, period); 127 record->data, &period);
128 ret = 1; 128 ret = 1;
129 dprintf(3, "Read task_param (%d) record for task %d " 129 dprintf(3, "Read task_param (%d) record for task %d "
130 "(%llu, %llu)\n", id, *pid, *wcet, *period); 130 "(%llu, %llu)\n", id, *pid, wcet, period);
131 131
132 list = add_task_hash(rtg_info->tasks, *pid); 132 list = add_task_hash(rtg_info->tasks, *pid);
133 if (!list->data) { 133 if (!list->data) {
@@ -138,13 +138,15 @@ int rt_graph_check_task_param(struct rt_graph_info *rtg_info,
138 * Store them with the task to avoid this issue. 138 * Store them with the task to avoid this issue.
139 */ 139 */
140 params = malloc_or_die(sizeof(*params)); 140 params = malloc_or_die(sizeof(*params));
141 params->wcet = *wcet; 141 params->wcet = wcet;
142 params->period = *period; 142 params->period = period;
143 list->data = params; 143 list->data = params;
144 } 144 }
145 145
146 if (*period > rtg_info->max_period) 146 if (period > rtg_info->max_period)
147 rtg_info->max_period = *period; 147 rtg_info->max_period = period;
148 *out_wcet = wcet;
149 *out_period = period;
148 } 150 }
149 out: 151 out:
150 return ret; 152 return ret;