diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-05-15 13:39:52 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-05-15 13:39:52 -0400 |
commit | 1cb90226816c7af7808be4c0de866c54da17ecc9 (patch) | |
tree | 512ff08edb877b615aa72f6bec06c29d17ef53a3 /litmus | |
parent | 5b2b006507f91f9beeb9538698018fb61d36caf0 (diff) |
Summarize schedulability with final recordwip-color
Diffstat (limited to 'litmus')
-rw-r--r-- | litmus/sched_color.c | 15 | ||||
-rw-r--r-- | litmus/sched_task_trace.c | 15 |
2 files changed, 28 insertions, 2 deletions
diff --git a/litmus/sched_color.c b/litmus/sched_color.c index e72fdc3bb7d1..44327d60aaa5 100644 --- a/litmus/sched_color.c +++ b/litmus/sched_color.c | |||
@@ -305,7 +305,7 @@ static void job_arrival(struct task_struct *t) | |||
305 | static void job_completion(struct rt_server *server) | 305 | static void job_completion(struct rt_server *server) |
306 | { | 306 | { |
307 | struct task_struct *t = server->linked; | 307 | struct task_struct *t = server->linked; |
308 | lt_t et; | 308 | lt_t et, now = litmus_clock(); |
309 | 309 | ||
310 | TRACE_TASK(t, "Job completed\n"); | 310 | TRACE_TASK(t, "Job completed\n"); |
311 | if (is_server(t)) | 311 | if (is_server(t)) |
@@ -320,6 +320,15 @@ static void job_completion(struct rt_server *server) | |||
320 | tsk_rt(t)->max_exec_time = et; | 320 | tsk_rt(t)->max_exec_time = et; |
321 | } | 321 | } |
322 | 322 | ||
323 | if (is_tardy(t, now)) { | ||
324 | lt_t miss = now - get_deadline(t); | ||
325 | ++tsk_rt(t)->missed; | ||
326 | tsk_rt(t)->total_tardy += miss; | ||
327 | if (lt_before(tsk_rt(t)->max_tardy, miss)) { | ||
328 | tsk_rt(t)->max_tardy = miss; | ||
329 | } | ||
330 | } | ||
331 | |||
323 | unlink(server); | 332 | unlink(server); |
324 | set_rt_flags(t, RT_F_SLEEP); | 333 | set_rt_flags(t, RT_F_SLEEP); |
325 | prepare_for_next_period(t); | 334 | prepare_for_next_period(t); |
@@ -566,6 +575,9 @@ static void color_task_new(struct task_struct *t, int on_rq, int running) | |||
566 | tsk_rt(t)->req = req; | 575 | tsk_rt(t)->req = req; |
567 | tsk_rt(t)->tot_exec_time = 0; | 576 | tsk_rt(t)->tot_exec_time = 0; |
568 | tsk_rt(t)->max_exec_time = 0; | 577 | tsk_rt(t)->max_exec_time = 0; |
578 | tsk_rt(t)->max_tardy = 0; | ||
579 | tsk_rt(t)->missed = 0; | ||
580 | tsk_rt(t)->total_tardy = 0; | ||
569 | tsk_rt(t)->ctrl_page->colors_updated = 1; | 581 | tsk_rt(t)->ctrl_page->colors_updated = 1; |
570 | tsk_rt(t)->last_exec_time = 0; | 582 | tsk_rt(t)->last_exec_time = 0; |
571 | 583 | ||
@@ -644,6 +656,7 @@ static void color_task_exit(struct task_struct *t) | |||
644 | local_irq_save(flags); | 656 | local_irq_save(flags); |
645 | 657 | ||
646 | sched_trace_task_exit(t); | 658 | sched_trace_task_exit(t); |
659 | sched_trace_task_tardy(t); | ||
647 | 660 | ||
648 | /* Remove from scheduler consideration */ | 661 | /* Remove from scheduler consideration */ |
649 | if (is_queued(t)) { | 662 | if (is_queued(t)) { |
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c index 48124b756be7..d4fedaa15744 100644 --- a/litmus/sched_task_trace.c +++ b/litmus/sched_task_trace.c | |||
@@ -227,7 +227,7 @@ feather_callback void do_sched_trace_sys_release(unsigned long id, | |||
227 | } | 227 | } |
228 | 228 | ||
229 | feather_callback void do_sched_trace_task_exit(unsigned long id, | 229 | feather_callback void do_sched_trace_task_exit(unsigned long id, |
230 | unsigned long _task) | 230 | unsigned long _task) |
231 | { | 231 | { |
232 | struct task_struct *t = (struct task_struct*) _task; | 232 | struct task_struct *t = (struct task_struct*) _task; |
233 | #ifdef CONFIG_PLUGIN_COLOR | 233 | #ifdef CONFIG_PLUGIN_COLOR |
@@ -245,6 +245,19 @@ feather_callback void do_sched_trace_task_exit(unsigned long id, | |||
245 | } | 245 | } |
246 | } | 246 | } |
247 | 247 | ||
248 | feather_callback void do_sched_trace_task_tardy(unsigned long id, | ||
249 | unsigned long _task) | ||
250 | { | ||
251 | struct task_struct *t = (struct task_struct*) _task; | ||
252 | struct st_event_record *rec = get_record(ST_TASK_TARDY, t); | ||
253 | if (rec) { | ||
254 | rec->data.task_tardy.max_tardy = tsk_rt(t)->max_tardy; | ||
255 | rec->data.task_tardy.total_tardy = tsk_rt(t)->total_tardy; | ||
256 | rec->data.task_tardy.missed = tsk_rt(t)->missed; | ||
257 | put_record(rec); | ||
258 | } | ||
259 | } | ||
260 | |||
248 | feather_callback void do_sched_trace_action(unsigned long id, | 261 | feather_callback void do_sched_trace_action(unsigned long id, |
249 | unsigned long _task, | 262 | unsigned long _task, |
250 | unsigned long action) | 263 | unsigned long action) |