aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2012-09-27 19:03:47 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2012-09-27 19:03:47 -0400
commit20dd1e4970f2a8f0170ed2194a050d45c1271485 (patch)
treeb2d38720df2f53fb863191680002f0329876d6d7
parent8f08598f8bc3f47a5c26241575e30df64f444641 (diff)
Added exit and tardy hooks.
-rw-r--r--include/litmus/litmus.h5
-rw-r--r--include/litmus/sched_trace.h1
-rw-r--r--litmus/litmus.c3
-rw-r--r--litmus/preempt.c8
-rw-r--r--litmus/sched_task_trace.c2
5 files changed, 11 insertions, 8 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h
index 807b7888695a..3e78b9c61580 100644
--- a/include/litmus/litmus.h
+++ b/include/litmus/litmus.h
@@ -57,10 +57,11 @@ void litmus_exit_task(struct task_struct *tsk);
57#define get_rt_phase(t) (tsk_rt(t)->task_params.phase) 57#define get_rt_phase(t) (tsk_rt(t)->task_params.phase)
58#define get_partition(t) (tsk_rt(t)->task_params.cpu) 58#define get_partition(t) (tsk_rt(t)->task_params.cpu)
59#define get_priority(t) (tsk_rt(t)->task_params.priority) 59#define get_priority(t) (tsk_rt(t)->task_params.priority)
60#define get_class(t) (tsk_rt(t)->task_params.cls) 60#define get_class(t) (tsk_rt(t)->task_params.cls)
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 81384327e850..1da1ec9a59b1 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -383,6 +383,9 @@ void litmus_exit_task(struct task_struct* tsk)
383{ 383{
384 if (is_realtime(tsk)) { 384 if (is_realtime(tsk)) {
385 sched_trace_task_completion(tsk, 1); 385 sched_trace_task_completion(tsk, 1);
386 sched_trace_task_exit(tsk);
387 sched_trace_task_tardy(tsk);
388 printk(KERN_WARNING "Swear I'm doing \n");
386 389
387 litmus->task_exit(tsk); 390 litmus->task_exit(tsk);
388 391
diff --git a/litmus/preempt.c b/litmus/preempt.c
index 5704d0bf4c0b..92c5d1b26a13 100644
--- a/litmus/preempt.c
+++ b/litmus/preempt.c
@@ -26,10 +26,10 @@ void sched_state_will_schedule(struct task_struct* tsk)
26 set_sched_state(PICKED_WRONG_TASK); 26 set_sched_state(PICKED_WRONG_TASK);
27 else 27 else
28 set_sched_state(WILL_SCHEDULE); 28 set_sched_state(WILL_SCHEDULE);
29 } else 29 } /* else */
30 /* Litmus tasks should never be subject to a remote 30 /* /\* Litmus tasks should never be subject to a remote */
31 * set_tsk_need_resched(). */ 31 /* * set_tsk_need_resched(). *\/ */
32 BUG_ON(is_realtime(tsk)); 32 /* BUG_ON(is_realtime(tsk)); */
33#ifdef CONFIG_PREEMPT_STATE_TRACE 33#ifdef CONFIG_PREEMPT_STATE_TRACE
34 TRACE_TASK(tsk, "set_tsk_need_resched() ret:%p\n", 34 TRACE_TASK(tsk, "set_tsk_need_resched() ret:%p\n",
35 __builtin_return_address(0)); 35 __builtin_return_address(0));
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c
index 60a3e8e5c028..7194d2fe6c6f 100644
--- a/litmus/sched_task_trace.c
+++ b/litmus/sched_task_trace.c
@@ -231,7 +231,7 @@ feather_callback void do_sched_trace_task_exit(unsigned long id,
231{ 231{
232 struct task_struct *t = (struct task_struct*) _task; 232 struct task_struct *t = (struct task_struct*) _task;
233 const lt_t max_exec_time = tsk_rt(t)->max_exec_time; 233 const lt_t max_exec_time = tsk_rt(t)->max_exec_time;
234 const lt_t avg_exec_time = tsk_rt(t)->tot_exec_time / (get_rt_job(t) - 1); 234 const lt_t avg_exec_time = tsk_rt(t)->tot_exec_time / (get_job_no(t) - 1);
235 235
236 struct st_event_record *rec = get_record(ST_TASK_EXIT, t); 236 struct st_event_record *rec = get_record(ST_TASK_EXIT, t);
237 if (rec) { 237 if (rec) {