diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-09-27 19:03:47 -0400 |
---|---|---|
committer | Bryan Ward <bcw@cs.unc.edu> | 2013-04-16 14:39:28 -0400 |
commit | 52ce4d22b164c96d1decc60547c50cc6e05cea24 (patch) | |
tree | a8305bc691ba2336e4218163930fca547e9c16f3 | |
parent | 8bc303a346cd8dbae6eba585930ffb3104d3c87b (diff) |
Added exit and tardy hooks.
-rw-r--r-- | include/litmus/litmus.h | 3 | ||||
-rw-r--r-- | include/litmus/sched_trace.h | 1 | ||||
-rw-r--r-- | litmus/litmus.c | 3 | ||||
-rw-r--r-- | litmus/preempt.c | 8 | ||||
-rw-r--r-- | litmus/sched_task_trace.c | 2 |
5 files changed, 10 insertions, 7 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index 9282f3a8f28f..6a1a59da6b52 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
@@ -60,7 +60,8 @@ void litmus_exit_task(struct task_struct *tsk); | |||
60 | #define get_release_policy(t) (tsk_rt(t)->task_params.release_policy) | 60 | #define get_release_policy(t) (tsk_rt(t)->task_params.release_policy) |
61 | 61 | ||
62 | /* job_param macros */ | 62 | /* job_param macros */ |
63 | #define get_exec_time(t) (tsk_rt(t)->job_params.exec_time) | 63 | #define get_job_no(t) (tsk_rt(t)->job_params.job_no) |
64 | #define get_exec_time(t) (tsk_rt(t)->job_params.exec_time) | ||
64 | #define get_deadline(t) (tsk_rt(t)->job_params.deadline) | 65 | #define get_deadline(t) (tsk_rt(t)->job_params.deadline) |
65 | #define get_release(t) (tsk_rt(t)->job_params.release) | 66 | #define get_release(t) (tsk_rt(t)->job_params.release) |
66 | #define get_lateness(t) (tsk_rt(t)->job_params.lateness) | 67 | #define get_lateness(t) (tsk_rt(t)->job_params.lateness) |
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index bf6c4cf4316c..2f992789affb 100644 --- a/include/litmus/sched_trace.h +++ b/include/litmus/sched_trace.h | |||
@@ -308,7 +308,6 @@ feather_callback void do_sched_trace_task_tardy(unsigned long id, | |||
308 | do { \ | 308 | do { \ |
309 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 12, \ | 309 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 12, \ |
310 | do_sched_trace_task_tardy, t); \ | 310 | do_sched_trace_task_tardy, t); \ |
311 | trace_litmus_task_tardy(t); \ | ||
312 | } while (0) | 311 | } while (0) |
313 | 312 | ||
314 | #define QT_START lt_t _qt_start = litmus_clock() | 313 | #define QT_START lt_t _qt_start = litmus_clock() |
diff --git a/litmus/litmus.c b/litmus/litmus.c index dc94be71bfb6..4bbac9786243 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c | |||
@@ -384,6 +384,9 @@ void litmus_exit_task(struct task_struct* tsk) | |||
384 | { | 384 | { |
385 | if (is_realtime(tsk)) { | 385 | if (is_realtime(tsk)) { |
386 | sched_trace_task_completion(tsk, 1); | 386 | sched_trace_task_completion(tsk, 1); |
387 | sched_trace_task_exit(tsk); | ||
388 | sched_trace_task_tardy(tsk); | ||
389 | printk(KERN_WARNING "Swear I'm doing \n"); | ||
387 | 390 | ||
388 | litmus->task_exit(tsk); | 391 | litmus->task_exit(tsk); |
389 | 392 | ||
diff --git a/litmus/preempt.c b/litmus/preempt.c index 6be2f26728b8..a202d70c627e 100644 --- a/litmus/preempt.c +++ b/litmus/preempt.c | |||
@@ -27,10 +27,10 @@ void sched_state_will_schedule(struct task_struct* tsk) | |||
27 | set_sched_state(PICKED_WRONG_TASK); | 27 | set_sched_state(PICKED_WRONG_TASK); |
28 | else | 28 | else |
29 | set_sched_state(WILL_SCHEDULE); | 29 | set_sched_state(WILL_SCHEDULE); |
30 | } else | 30 | } /* else */ |
31 | /* Litmus tasks should never be subject to a remote | 31 | /* /\* Litmus tasks should never be subject to a remote */ |
32 | * set_tsk_need_resched(). */ | 32 | /* * set_tsk_need_resched(). *\/ */ |
33 | BUG_ON(is_realtime(tsk)); | 33 | /* BUG_ON(is_realtime(tsk)); */ |
34 | #ifdef CONFIG_PREEMPT_STATE_TRACE | 34 | #ifdef CONFIG_PREEMPT_STATE_TRACE |
35 | TRACE_TASK(tsk, "set_tsk_need_resched() ret:%p\n", | 35 | TRACE_TASK(tsk, "set_tsk_need_resched() ret:%p\n", |
36 | __builtin_return_address(0)); | 36 | __builtin_return_address(0)); |
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c index 7578acd666f3..3c42dfedac18 100644 --- a/litmus/sched_task_trace.c +++ b/litmus/sched_task_trace.c | |||
@@ -234,7 +234,7 @@ feather_callback void do_sched_trace_task_exit(unsigned long id, | |||
234 | { | 234 | { |
235 | struct task_struct *t = (struct task_struct*) _task; | 235 | struct task_struct *t = (struct task_struct*) _task; |
236 | const lt_t max_exec_time = tsk_rt(t)->max_exec_time; | 236 | const lt_t max_exec_time = tsk_rt(t)->max_exec_time; |
237 | const lt_t avg_exec_time = tsk_rt(t)->tot_exec_time / (get_rt_job(t) - 1); | 237 | const lt_t avg_exec_time = tsk_rt(t)->tot_exec_time / (get_job_no(t) - 1); |
238 | 238 | ||
239 | struct st_event_record *rec = get_record(ST_TASK_EXIT, t); | 239 | struct st_event_record *rec = get_record(ST_TASK_EXIT, t); |
240 | if (rec) { | 240 | if (rec) { |