diff options
Diffstat (limited to 'rt-graph.c')
-rw-r--r-- | rt-graph.c | 223 |
1 files changed, 114 insertions, 109 deletions
@@ -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 4 | 4 | #define DEBUG_LEVEL 0 |
5 | #if DEBUG_LEVEL > 0 | 5 | #if DEBUG_LEVEL > 0 |
6 | #define dprintf(l, x...) \ | 6 | #define dprintf(l, x...) \ |
7 | do { \ | 7 | do { \ |
@@ -61,7 +61,7 @@ add_ts_hash(struct ts_list **events, gint eid, gint key, | |||
61 | * @epid: set to the event's task PID | 61 | * @epid: set to the event's task PID |
62 | * @rt_ts: set to the event's real-time timestamp | 62 | * @rt_ts: set to the event's real-time timestamp |
63 | */ | 63 | */ |
64 | int rt_graph_check_any(struct rt_graph_info *rtinfo, | 64 | int rt_graph_check_any(struct rt_graph_info *rtg_info, |
65 | struct pevent *pevent, struct record *record, | 65 | struct pevent *pevent, struct record *record, |
66 | gint *epid, gint *out_eid, unsigned long long *ts) | 66 | gint *epid, gint *out_eid, unsigned long long *ts) |
67 | { | 67 | { |
@@ -70,10 +70,10 @@ int rt_graph_check_any(struct rt_graph_info *rtinfo, | |||
70 | 70 | ||
71 | eid = pevent_data_type(pevent, record); | 71 | eid = pevent_data_type(pevent, record); |
72 | key = get_event_hash_key(eid); | 72 | key = get_event_hash_key(eid); |
73 | field = find_ts_hash(rtinfo->events, key, eid); | 73 | field = find_ts_hash(rtg_info->events, key, eid); |
74 | 74 | ||
75 | if (!field) | 75 | if (!field) |
76 | field = add_ts_hash(rtinfo->events, eid, key, pevent, record); | 76 | field = add_ts_hash(rtg_info->events, eid, key, pevent, record); |
77 | 77 | ||
78 | *epid = pevent_data_pid(pevent, record); | 78 | *epid = pevent_data_pid(pevent, record); |
79 | pevent_read_number_field(field, record->data, ts); | 79 | pevent_read_number_field(field, record->data, ts); |
@@ -88,7 +88,7 @@ int rt_graph_check_any(struct rt_graph_info *rtinfo, | |||
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, @wcet, and @period if the record matches |
90 | */ | 90 | */ |
91 | int rt_graph_check_task_param(struct rt_graph_info *rtinfo, | 91 | int 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 *wcet, |
94 | unsigned long long *period) | 94 | unsigned long long *period) |
@@ -102,32 +102,35 @@ int rt_graph_check_task_param(struct rt_graph_info *rtinfo, | |||
102 | * after the pevent has "seen" its first litmus_task_param | 102 | * after the pevent has "seen" its first litmus_task_param |
103 | * event. | 103 | * event. |
104 | */ | 104 | */ |
105 | if (rtinfo->task_param_id < 0) { | 105 | if (rtg_info->task_param_id < 0) { |
106 | event = pevent_find_event_by_name(pevent, "litmus", | 106 | event = pevent_find_event_by_name(pevent, "litmus", |
107 | "litmus_task_param"); | 107 | "litmus_task_param"); |
108 | if (!event) | 108 | if (!event) |
109 | goto out; | 109 | goto out; |
110 | rtinfo->task_param_id = event->id; | 110 | rtg_info->task_param_id = event->id; |
111 | dprintf(2, "Found task_param id %d\n", event->id); | 111 | dprintf(2, "Found task_param id %d\n", event->id); |
112 | rtinfo->param_pid_field = pevent_find_field(event, "pid"); | 112 | rtg_info->param_pid_field = pevent_find_field(event, "pid"); |
113 | rtinfo->param_wcet_field = pevent_find_field(event, "wcet"); | 113 | rtg_info->param_wcet_field = pevent_find_field(event, "wcet"); |
114 | rtinfo->param_period_field = pevent_find_field(event, "period"); | 114 | rtg_info->param_period_field = pevent_find_field(event, "period"); |
115 | } | 115 | } |
116 | 116 | ||
117 | id = pevent_data_type(pevent, record); | 117 | id = pevent_data_type(pevent, record); |
118 | if (id == rtinfo->task_param_id) { | 118 | if (id == rtg_info->task_param_id) { |
119 | pevent_read_number_field(rtinfo->param_pid_field, | 119 | pevent_read_number_field(rtg_info->param_pid_field, |
120 | record->data, &val); | 120 | record->data, &val); |
121 | *pid = val; | 121 | *pid = val; |
122 | pevent_read_number_field(rtinfo->param_wcet_field, | 122 | pevent_read_number_field(rtg_info->param_wcet_field, |
123 | record->data, wcet); | 123 | record->data, wcet); |
124 | pevent_read_number_field(rtinfo->param_period_field, | 124 | pevent_read_number_field(rtg_info->param_period_field, |
125 | record->data, period); | 125 | record->data, period); |
126 | ret = 1; | 126 | ret = 1; |
127 | dprintf(3, "Read task_param (%d) record for task %d " | 127 | dprintf(3, "Read task_param (%d) record for task %d " |
128 | "(%llu, %llu)\n", id, *pid, *wcet, *period); | 128 | "(%llu, %llu)\n", id, *pid, *wcet, *period); |
129 | 129 | ||
130 | add_task_hash(rtinfo->tasks, *pid); | 130 | add_task_hash(rtg_info->tasks, *pid); |
131 | |||
132 | if (*period > rtg_info->max_period) | ||
133 | rtg_info->max_period = *period; | ||
131 | } | 134 | } |
132 | out: | 135 | out: |
133 | return ret; | 136 | return ret; |
@@ -137,7 +140,7 @@ int rt_graph_check_task_param(struct rt_graph_info *rtinfo, | |||
137 | * rt_graph_check_switch_to - check for litmus_switch_to record | 140 | * rt_graph_check_switch_to - check for litmus_switch_to record |
138 | * Return 1 and @pid, @job, and @ts if the record matches | 141 | * Return 1 and @pid, @job, and @ts if the record matches |
139 | */ | 142 | */ |
140 | int rt_graph_check_switch_to(struct rt_graph_info *rtinfo, | 143 | int rt_graph_check_switch_to(struct rt_graph_info *rtg_info, |
141 | struct pevent *pevent, struct record *record, | 144 | struct pevent *pevent, struct record *record, |
142 | gint *pid, gint *job, | 145 | gint *pid, gint *job, |
143 | unsigned long long *ts) | 146 | unsigned long long *ts) |
@@ -147,27 +150,27 @@ int rt_graph_check_switch_to(struct rt_graph_info *rtinfo, | |||
147 | gint id; | 150 | gint id; |
148 | int ret = 0; | 151 | int ret = 0; |
149 | 152 | ||
150 | if (rtinfo->switch_to_id < 0) { | 153 | if (rtg_info->switch_to_id < 0) { |
151 | event = pevent_find_event_by_name(pevent, "litmus", | 154 | event = pevent_find_event_by_name(pevent, "litmus", |
152 | "litmus_switch_to"); | 155 | "litmus_switch_to"); |
153 | if (!event) | 156 | if (!event) |
154 | goto out; | 157 | goto out; |
155 | rtinfo->switch_to_id = event->id; | 158 | rtg_info->switch_to_id = event->id; |
156 | dprintf(2, "Found switch_to id %d\n", event->id); | 159 | dprintf(2, "Found switch_to id %d\n", event->id); |
157 | rtinfo->switch_to_pid_field = pevent_find_field(event, "pid"); | 160 | rtg_info->switch_to_pid_field = pevent_find_field(event, "pid"); |
158 | rtinfo->switch_to_job_field = pevent_find_field(event, "job"); | 161 | rtg_info->switch_to_job_field = pevent_find_field(event, "job"); |
159 | rtinfo->switch_to_ts_field = pevent_find_field(event, RT_TS_FIELD); | 162 | rtg_info->switch_to_ts_field = pevent_find_field(event, RT_TS_FIELD); |
160 | } | 163 | } |
161 | 164 | ||
162 | id = pevent_data_type(pevent, record); | 165 | id = pevent_data_type(pevent, record); |
163 | if (id == rtinfo->switch_to_id) { | 166 | if (id == rtg_info->switch_to_id) { |
164 | pevent_read_number_field(rtinfo->switch_to_pid_field, | 167 | pevent_read_number_field(rtg_info->switch_to_pid_field, |
165 | record->data, &val); | 168 | record->data, &val); |
166 | *pid = val; | 169 | *pid = val; |
167 | pevent_read_number_field(rtinfo->switch_to_job_field, | 170 | pevent_read_number_field(rtg_info->switch_to_job_field, |
168 | record->data, &val); | 171 | record->data, &val); |
169 | *job = val; | 172 | *job = val; |
170 | pevent_read_number_field(rtinfo->switch_to_ts_field, | 173 | pevent_read_number_field(rtg_info->switch_to_ts_field, |
171 | record->data, ts); | 174 | record->data, ts); |
172 | ret = 1; | 175 | ret = 1; |
173 | dprintf(3, "Read switch_to (%d) record for job %d:%d, " | 176 | dprintf(3, "Read switch_to (%d) record for job %d:%d, " |
@@ -181,7 +184,7 @@ int rt_graph_check_switch_to(struct rt_graph_info *rtinfo, | |||
181 | * rt_graph_check_switch_away - check for litmus_switch_away record | 184 | * rt_graph_check_switch_away - check for litmus_switch_away record |
182 | * Return 1 and @pid, @job, and @ts if the record matches | 185 | * Return 1 and @pid, @job, and @ts if the record matches |
183 | */ | 186 | */ |
184 | int rt_graph_check_switch_away(struct rt_graph_info *rtinfo, | 187 | int rt_graph_check_switch_away(struct rt_graph_info *rtg_info, |
185 | struct pevent *pevent, struct record *record, | 188 | struct pevent *pevent, struct record *record, |
186 | gint *pid, gint *job, | 189 | gint *pid, gint *job, |
187 | unsigned long long *ts) | 190 | unsigned long long *ts) |
@@ -191,27 +194,27 @@ int rt_graph_check_switch_away(struct rt_graph_info *rtinfo, | |||
191 | gint id; | 194 | gint id; |
192 | int ret = 0; | 195 | int ret = 0; |
193 | 196 | ||
194 | if (rtinfo->switch_away_id < 0) { | 197 | if (rtg_info->switch_away_id < 0) { |
195 | event = pevent_find_event_by_name(pevent, "litmus", | 198 | event = pevent_find_event_by_name(pevent, "litmus", |
196 | "litmus_switch_away"); | 199 | "litmus_switch_away"); |
197 | if (!event) | 200 | if (!event) |
198 | goto out; | 201 | goto out; |
199 | rtinfo->switch_away_id = event->id; | 202 | rtg_info->switch_away_id = event->id; |
200 | dprintf(2, "Found switch_away id %d\n", event->id); | 203 | dprintf(2, "Found switch_away id %d\n", event->id); |
201 | rtinfo->switch_away_pid_field = pevent_find_field(event, "pid"); | 204 | rtg_info->switch_away_pid_field = pevent_find_field(event, "pid"); |
202 | rtinfo->switch_away_job_field = pevent_find_field(event, "job"); | 205 | rtg_info->switch_away_job_field = pevent_find_field(event, "job"); |
203 | rtinfo->switch_away_ts_field = pevent_find_field(event, RT_TS_FIELD); | 206 | rtg_info->switch_away_ts_field = pevent_find_field(event, RT_TS_FIELD); |
204 | } | 207 | } |
205 | 208 | ||
206 | id = pevent_data_type(pevent, record); | 209 | id = pevent_data_type(pevent, record); |
207 | if (id == rtinfo->switch_away_id) { | 210 | if (id == rtg_info->switch_away_id) { |
208 | pevent_read_number_field(rtinfo->switch_away_pid_field, | 211 | pevent_read_number_field(rtg_info->switch_away_pid_field, |
209 | record->data, &val); | 212 | record->data, &val); |
210 | *pid = val; | 213 | *pid = val; |
211 | pevent_read_number_field(rtinfo->switch_away_job_field, | 214 | pevent_read_number_field(rtg_info->switch_away_job_field, |
212 | record->data, &val); | 215 | record->data, &val); |
213 | *job = val; | 216 | *job = val; |
214 | pevent_read_number_field(rtinfo->switch_away_ts_field, | 217 | pevent_read_number_field(rtg_info->switch_away_ts_field, |
215 | record->data, ts); | 218 | record->data, ts); |
216 | ret = 1; | 219 | ret = 1; |
217 | dprintf(3, "Read switch_away (%d) record for job %d:%d, " | 220 | dprintf(3, "Read switch_away (%d) record for job %d:%d, " |
@@ -225,7 +228,7 @@ int rt_graph_check_switch_away(struct rt_graph_info *rtinfo, | |||
225 | * rt_graph_check_task_release - check for litmus_task_release record | 228 | * rt_graph_check_task_release - check for litmus_task_release record |
226 | * Return 1 and @pid, @job, @release, and @deadline if the record matches | 229 | * Return 1 and @pid, @job, @release, and @deadline if the record matches |
227 | */ | 230 | */ |
228 | int rt_graph_check_task_release(struct rt_graph_info *rtinfo, | 231 | int rt_graph_check_task_release(struct rt_graph_info *rtg_info, |
229 | struct pevent *pevent, struct record *record, | 232 | struct pevent *pevent, struct record *record, |
230 | gint *pid, gint *job, | 233 | gint *pid, gint *job, |
231 | unsigned long long *release, | 234 | unsigned long long *release, |
@@ -236,30 +239,30 @@ int rt_graph_check_task_release(struct rt_graph_info *rtinfo, | |||
236 | gint id; | 239 | gint id; |
237 | int ret = 0; | 240 | int ret = 0; |
238 | 241 | ||
239 | if (rtinfo->task_release_id < 0) { | 242 | if (rtg_info->task_release_id < 0) { |
240 | event = pevent_find_event_by_name(pevent, "litmus", | 243 | event = pevent_find_event_by_name(pevent, "litmus", |
241 | "litmus_task_release"); | 244 | "litmus_task_release"); |
242 | if (!event) | 245 | if (!event) |
243 | goto out; | 246 | goto out; |
244 | rtinfo->task_release_id = event->id; | 247 | rtg_info->task_release_id = event->id; |
245 | dprintf(2, "Found task_release id %d\n", event->id); | 248 | dprintf(2, "Found task_release id %d\n", event->id); |
246 | rtinfo->release_pid_field = pevent_find_field(event, "pid"); | 249 | rtg_info->release_pid_field = pevent_find_field(event, "pid"); |
247 | rtinfo->release_job_field = pevent_find_field(event, "job"); | 250 | rtg_info->release_job_field = pevent_find_field(event, "job"); |
248 | rtinfo->release_release_field = pevent_find_field(event, "release"); | 251 | rtg_info->release_release_field = pevent_find_field(event, "release"); |
249 | rtinfo->release_deadline_field = pevent_find_field(event, "deadline"); | 252 | rtg_info->release_deadline_field = pevent_find_field(event, "deadline"); |
250 | } | 253 | } |
251 | 254 | ||
252 | id = pevent_data_type(pevent, record); | 255 | id = pevent_data_type(pevent, record); |
253 | if (id == rtinfo->task_release_id) { | 256 | if (id == rtg_info->task_release_id) { |
254 | pevent_read_number_field(rtinfo->release_pid_field, | 257 | pevent_read_number_field(rtg_info->release_pid_field, |
255 | record->data, &val); | 258 | record->data, &val); |
256 | *pid = val; | 259 | *pid = val; |
257 | pevent_read_number_field(rtinfo->release_job_field, | 260 | pevent_read_number_field(rtg_info->release_job_field, |
258 | record->data, &val); | 261 | record->data, &val); |
259 | *job = val; | 262 | *job = val; |
260 | pevent_read_number_field(rtinfo->release_release_field, | 263 | pevent_read_number_field(rtg_info->release_release_field, |
261 | record->data, release); | 264 | record->data, release); |
262 | pevent_read_number_field(rtinfo->release_deadline_field, | 265 | pevent_read_number_field(rtg_info->release_deadline_field, |
263 | record->data, deadline); | 266 | record->data, deadline); |
264 | ret = 1; | 267 | ret = 1; |
265 | dprintf(3, "Read task_release (%d) record for job %d:%d, " | 268 | dprintf(3, "Read task_release (%d) record for job %d:%d, " |
@@ -274,7 +277,7 @@ int rt_graph_check_task_release(struct rt_graph_info *rtinfo, | |||
274 | * rt_graph_check_task_completion - check for litmus_task_completion record | 277 | * rt_graph_check_task_completion - check for litmus_task_completion record |
275 | * Return 1 and @pid, @job, and @ts if the record matches | 278 | * Return 1 and @pid, @job, and @ts if the record matches |
276 | */ | 279 | */ |
277 | int rt_graph_check_task_completion(struct rt_graph_info *rtinfo, | 280 | int rt_graph_check_task_completion(struct rt_graph_info *rtg_info, |
278 | struct pevent *pevent, struct record *record, | 281 | struct pevent *pevent, struct record *record, |
279 | gint *pid, gint *job, unsigned long long *ts) | 282 | gint *pid, gint *job, unsigned long long *ts) |
280 | { | 283 | { |
@@ -283,27 +286,27 @@ int rt_graph_check_task_completion(struct rt_graph_info *rtinfo, | |||
283 | gint id; | 286 | gint id; |
284 | int ret = 0; | 287 | int ret = 0; |
285 | 288 | ||
286 | if (rtinfo->task_completion_id < 0) { | 289 | if (rtg_info->task_completion_id < 0) { |
287 | event = pevent_find_event_by_name(pevent, "litmus", | 290 | event = pevent_find_event_by_name(pevent, "litmus", |
288 | "litmus_task_completion"); | 291 | "litmus_task_completion"); |
289 | if (!event) | 292 | if (!event) |
290 | goto out; | 293 | goto out; |
291 | rtinfo->task_completion_id = event->id; | 294 | rtg_info->task_completion_id = event->id; |
292 | dprintf(2, "Found task_completion id %d\n", event->id); | 295 | dprintf(2, "Found task_completion id %d\n", event->id); |
293 | rtinfo->completion_pid_field = pevent_find_field(event, "pid"); | 296 | rtg_info->completion_pid_field = pevent_find_field(event, "pid"); |
294 | rtinfo->completion_job_field = pevent_find_field(event, "job"); | 297 | rtg_info->completion_job_field = pevent_find_field(event, "job"); |
295 | rtinfo->completion_ts_field = pevent_find_field(event, RT_TS_FIELD); | 298 | rtg_info->completion_ts_field = pevent_find_field(event, RT_TS_FIELD); |
296 | } | 299 | } |
297 | 300 | ||
298 | id = pevent_data_type(pevent, record); | 301 | id = pevent_data_type(pevent, record); |
299 | if (id == rtinfo->task_completion_id) { | 302 | if (id == rtg_info->task_completion_id) { |
300 | pevent_read_number_field(rtinfo->completion_pid_field, | 303 | pevent_read_number_field(rtg_info->completion_pid_field, |
301 | record->data, &val); | 304 | record->data, &val); |
302 | *pid = val; | 305 | *pid = val; |
303 | pevent_read_number_field(rtinfo->completion_job_field, | 306 | pevent_read_number_field(rtg_info->completion_job_field, |
304 | record->data, &val); | 307 | record->data, &val); |
305 | *job = val; | 308 | *job = val; |
306 | pevent_read_number_field(rtinfo->completion_ts_field, | 309 | pevent_read_number_field(rtg_info->completion_ts_field, |
307 | record->data, ts); | 310 | record->data, ts); |
308 | ret = 1; | 311 | ret = 1; |
309 | dprintf(3, "Read task_completion (%d) record for job %d:%d " | 312 | dprintf(3, "Read task_completion (%d) record for job %d:%d " |
@@ -317,7 +320,7 @@ int rt_graph_check_task_completion(struct rt_graph_info *rtinfo, | |||
317 | * rt_graph_check_task_block - check for litmus_task_block record | 320 | * rt_graph_check_task_block - check for litmus_task_block record |
318 | * Return 1, @pid, and @ts if the record matches | 321 | * Return 1, @pid, and @ts if the record matches |
319 | */ | 322 | */ |
320 | int rt_graph_check_task_block(struct rt_graph_info *rtinfo, | 323 | int rt_graph_check_task_block(struct rt_graph_info *rtg_info, |
321 | struct pevent *pevent, struct record *record, | 324 | struct pevent *pevent, struct record *record, |
322 | gint *pid, unsigned long long *ts) | 325 | gint *pid, unsigned long long *ts) |
323 | { | 326 | { |
@@ -326,23 +329,23 @@ int rt_graph_check_task_block(struct rt_graph_info *rtinfo, | |||
326 | gint id; | 329 | gint id; |
327 | int ret = 0; | 330 | int ret = 0; |
328 | 331 | ||
329 | if (rtinfo->task_block_id < 0) { | 332 | if (rtg_info->task_block_id < 0) { |
330 | event = pevent_find_event_by_name(pevent, "litmus", | 333 | event = pevent_find_event_by_name(pevent, "litmus", |
331 | "litmus_task_block"); | 334 | "litmus_task_block"); |
332 | if (!event) | 335 | if (!event) |
333 | goto out; | 336 | goto out; |
334 | dprintf(2, "Found task_block id %d\n", event->id); | 337 | dprintf(2, "Found task_block id %d\n", event->id); |
335 | rtinfo->task_block_id = event->id; | 338 | rtg_info->task_block_id = event->id; |
336 | rtinfo->block_pid_field = pevent_find_field(event, "pid"); | 339 | rtg_info->block_pid_field = pevent_find_field(event, "pid"); |
337 | rtinfo->block_ts_field = pevent_find_field(event, RT_TS_FIELD); | 340 | rtg_info->block_ts_field = pevent_find_field(event, RT_TS_FIELD); |
338 | } | 341 | } |
339 | 342 | ||
340 | id = pevent_data_type(pevent, record); | 343 | id = pevent_data_type(pevent, record); |
341 | if (id == rtinfo->task_block_id) { | 344 | if (id == rtg_info->task_block_id) { |
342 | pevent_read_number_field(rtinfo->block_pid_field, | 345 | pevent_read_number_field(rtg_info->block_pid_field, |
343 | record->data, &val); | 346 | record->data, &val); |
344 | *pid = val; | 347 | *pid = val; |
345 | pevent_read_number_field(rtinfo->block_ts_field, | 348 | pevent_read_number_field(rtg_info->block_ts_field, |
346 | record->data, ts); | 349 | record->data, ts); |
347 | ret = 1; | 350 | ret = 1; |
348 | dprintf(3, "Read task_block (%d) record for task %d\n", | 351 | dprintf(3, "Read task_block (%d) record for task %d\n", |
@@ -356,7 +359,7 @@ int rt_graph_check_task_block(struct rt_graph_info *rtinfo, | |||
356 | * rt_graph_check_task_resume - check for litmus_task_resume record | 359 | * rt_graph_check_task_resume - check for litmus_task_resume record |
357 | * Return 1 and @pid if the record matches | 360 | * Return 1 and @pid if the record matches |
358 | */ | 361 | */ |
359 | int rt_graph_check_task_resume(struct rt_graph_info *rtinfo, | 362 | int rt_graph_check_task_resume(struct rt_graph_info *rtg_info, |
360 | struct pevent *pevent, struct record *record, | 363 | struct pevent *pevent, struct record *record, |
361 | gint *pid, unsigned long long *ts) | 364 | gint *pid, unsigned long long *ts) |
362 | { | 365 | { |
@@ -365,23 +368,23 @@ int rt_graph_check_task_resume(struct rt_graph_info *rtinfo, | |||
365 | gint id; | 368 | gint id; |
366 | int ret = 0; | 369 | int ret = 0; |
367 | 370 | ||
368 | if (rtinfo->task_resume_id < 0) { | 371 | if (rtg_info->task_resume_id < 0) { |
369 | event = pevent_find_event_by_name(pevent, "litmus", | 372 | event = pevent_find_event_by_name(pevent, "litmus", |
370 | "litmus_task_resume"); | 373 | "litmus_task_resume"); |
371 | if (!event) | 374 | if (!event) |
372 | goto out; | 375 | goto out; |
373 | dprintf(2, "Found task_resume id %d\n", event->id); | 376 | dprintf(2, "Found task_resume id %d\n", event->id); |
374 | rtinfo->task_resume_id = event->id; | 377 | rtg_info->task_resume_id = event->id; |
375 | rtinfo->resume_pid_field = pevent_find_field(event, "pid"); | 378 | rtg_info->resume_pid_field = pevent_find_field(event, "pid"); |
376 | rtinfo->resume_ts_field = pevent_find_field(event, RT_TS_FIELD); | 379 | rtg_info->resume_ts_field = pevent_find_field(event, RT_TS_FIELD); |
377 | } | 380 | } |
378 | 381 | ||
379 | id = pevent_data_type(pevent, record); | 382 | id = pevent_data_type(pevent, record); |
380 | if (id == rtinfo->task_resume_id) { | 383 | if (id == rtg_info->task_resume_id) { |
381 | pevent_read_number_field(rtinfo->resume_pid_field, | 384 | pevent_read_number_field(rtg_info->resume_pid_field, |
382 | record->data, &val); | 385 | record->data, &val); |
383 | *pid = val; | 386 | *pid = val; |
384 | pevent_read_number_field(rtinfo->resume_ts_field, | 387 | pevent_read_number_field(rtg_info->resume_ts_field, |
385 | record->data, ts); | 388 | record->data, ts); |
386 | ret = 1; | 389 | ret = 1; |
387 | dprintf(3, "Read task_resume (%d) record for task %d\n", | 390 | dprintf(3, "Read task_resume (%d) record for task %d\n", |
@@ -394,43 +397,45 @@ int rt_graph_check_task_resume(struct rt_graph_info *rtinfo, | |||
394 | /** | 397 | /** |
395 | * init_rt_event_cache - reset cached field values | 398 | * init_rt_event_cache - reset cached field values |
396 | */ | 399 | */ |
397 | void init_rt_event_cache(struct rt_graph_info *rtinfo) | 400 | void init_rt_event_cache(struct rt_graph_info *rtg_info) |
398 | { | 401 | { |
399 | dprintf(1, "Initializing RT event cache\n"); | 402 | dprintf(1, "Initializing RT event cache\n"); |
400 | rtinfo->task_param_id = -1; | 403 | rtg_info->task_param_id = -1; |
401 | rtinfo->switch_to_id = -1; | 404 | rtg_info->switch_to_id = -1; |
402 | rtinfo->switch_away_id = -1; | 405 | rtg_info->switch_away_id = -1; |
403 | rtinfo->task_release_id = -1; | 406 | rtg_info->task_release_id = -1; |
404 | rtinfo->task_completion_id = -1; | 407 | rtg_info->task_completion_id = -1; |
405 | rtinfo->task_block_id = -1; | 408 | rtg_info->task_block_id = -1; |
406 | rtinfo->task_resume_id = -1; | 409 | rtg_info->task_resume_id = -1; |
407 | 410 | ||
408 | rtinfo->param_pid_field = NULL; | 411 | rtg_info->max_period = 0; |
409 | rtinfo->param_wcet_field = NULL; | 412 | |
410 | rtinfo->param_period_field = NULL; | 413 | rtg_info->param_pid_field = NULL; |
411 | 414 | rtg_info->param_wcet_field = NULL; | |
412 | rtinfo->switch_to_pid_field = NULL; | 415 | rtg_info->param_period_field = NULL; |
413 | rtinfo->switch_to_job_field = NULL; | 416 | |
414 | rtinfo->switch_to_ts_field = NULL; | 417 | rtg_info->switch_to_pid_field = NULL; |
415 | 418 | rtg_info->switch_to_job_field = NULL; | |
416 | rtinfo->switch_away_pid_field = NULL; | 419 | rtg_info->switch_to_ts_field = NULL; |
417 | rtinfo->switch_away_job_field = NULL; | 420 | |
418 | rtinfo->switch_away_ts_field = NULL; | 421 | rtg_info->switch_away_pid_field = NULL; |
419 | 422 | rtg_info->switch_away_job_field = NULL; | |
420 | rtinfo->release_pid_field = NULL; | 423 | rtg_info->switch_away_ts_field = NULL; |
421 | rtinfo->release_job_field = NULL; | 424 | |
422 | rtinfo->release_release_field = NULL; | 425 | rtg_info->release_pid_field = NULL; |
423 | rtinfo->release_deadline_field = NULL; | 426 | rtg_info->release_job_field = NULL; |
424 | 427 | rtg_info->release_release_field = NULL; | |
425 | rtinfo->completion_pid_field = NULL; | 428 | rtg_info->release_deadline_field = NULL; |
426 | rtinfo->completion_job_field = NULL; | 429 | |
427 | rtinfo->completion_ts_field = NULL; | 430 | rtg_info->completion_pid_field = NULL; |
428 | 431 | rtg_info->completion_job_field = NULL; | |
429 | rtinfo->block_pid_field = NULL; | 432 | rtg_info->completion_ts_field = NULL; |
430 | rtinfo->block_ts_field = NULL; | 433 | |
431 | 434 | rtg_info->block_pid_field = NULL; | |
432 | rtinfo->resume_pid_field = NULL; | 435 | rtg_info->block_ts_field = NULL; |
433 | rtinfo->resume_ts_field = NULL; | 436 | |
437 | rtg_info->resume_pid_field = NULL; | ||
438 | rtg_info->resume_ts_field = NULL; | ||
434 | } | 439 | } |
435 | 440 | ||
436 | /** | 441 | /** |
@@ -445,7 +450,7 @@ get_rts(struct graph_info *ginfo, struct record *record) | |||
445 | gint epid, eid; | 450 | gint epid, eid; |
446 | unsigned long long ts; | 451 | unsigned long long ts; |
447 | if (!record->cached_rts) { | 452 | if (!record->cached_rts) { |
448 | rt_graph_check_any(&ginfo->rtinfo, ginfo->pevent, record, | 453 | rt_graph_check_any(&ginfo->rtg_info, ginfo->pevent, record, |
449 | &epid, &eid, &ts); | 454 | &epid, &eid, &ts); |
450 | record->cached_rts = ts; | 455 | record->cached_rts = ts; |
451 | } else | 456 | } else |