diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-05-09 17:11:56 -0400 |
---|---|---|
committer | Bryan Ward <bcw@cs.unc.edu> | 2013-04-16 14:37:12 -0400 |
commit | 6fd05d4b6c92bb3207fbd30423adf93d5b9b1bdc (patch) | |
tree | 415f822a477224fc36a6ba618f696be672ae5866 | |
parent | 080c188bbdb433e6cf7139dd6486f8578ad46029 (diff) |
Track tasks average execution time, drop in TASK_EXIT record
Conflicts:
include/litmus/rt_param.h
litmus/jobs.c
litmus/sched_color.c
litmus/sched_task_trace.c
-rw-r--r-- | include/litmus/rt_param.h | 1 | ||||
-rw-r--r-- | include/litmus/sched_trace.h | 2 | ||||
-rw-r--r-- | litmus/jobs.c | 11 | ||||
-rw-r--r-- | litmus/sched_task_trace.c | 3 |
4 files changed, 10 insertions, 7 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index b3d4b37f81e3..6f52fbc81abd 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -272,6 +272,7 @@ struct rt_param { | |||
272 | struct control_page * ctrl_page; | 272 | struct control_page * ctrl_page; |
273 | 273 | ||
274 | lt_t max_exec_time; | 274 | lt_t max_exec_time; |
275 | lt_t tot_exec_time; | ||
275 | }; | 276 | }; |
276 | 277 | ||
277 | #endif | 278 | #endif |
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index c71a08ab552e..f910c63c067a 100644 --- a/include/litmus/sched_trace.h +++ b/include/litmus/sched_trace.h | |||
@@ -81,7 +81,7 @@ struct st_sys_release_data { | |||
81 | }; | 81 | }; |
82 | 82 | ||
83 | struct st_task_exit_data { | 83 | struct st_task_exit_data { |
84 | u64 when; | 84 | u64 avg_exec_time; |
85 | u64 max_exec_time; | 85 | u64 max_exec_time; |
86 | }; | 86 | }; |
87 | 87 | ||
diff --git a/litmus/jobs.c b/litmus/jobs.c index 13a4ed4c9e93..8f56131b9591 100644 --- a/litmus/jobs.c +++ b/litmus/jobs.c | |||
@@ -8,13 +8,14 @@ | |||
8 | 8 | ||
9 | static inline void setup_release(struct task_struct *t, lt_t release) | 9 | static inline void setup_release(struct task_struct *t, lt_t release) |
10 | { | 10 | { |
11 | /* prepare next release */ | 11 | tsk_rt(t)->tot_exec_time += tsk_rt(t)->job_params.exec_time; |
12 | t->rt_param.job_params.release = release; | ||
13 | t->rt_param.job_params.deadline = release + get_rt_relative_deadline(t); | ||
14 | t->rt_param.job_params.exec_time = 0; | ||
15 | 12 | ||
13 | /* prepare next release */ | ||
14 | tsk_rt(t)->job_params.release = tsk_rt(t)->job_params.deadline; | ||
15 | tsk_rt(t)->job_params.deadline += get_rt_period(t); | ||
16 | tsk_rt(t)->job_params.exec_time = 0; | ||
16 | /* update job sequence number */ | 17 | /* update job sequence number */ |
17 | t->rt_param.job_params.job_no++; | 18 | tsk_rt(t)->job_params.job_no++; |
18 | 19 | ||
19 | /* don't confuse Linux */ | 20 | /* don't confuse Linux */ |
20 | t->rt.time_slice = 1; | 21 | t->rt.time_slice = 1; |
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c index b06764e8b330..d9cf46ec0550 100644 --- a/litmus/sched_task_trace.c +++ b/litmus/sched_task_trace.c | |||
@@ -234,10 +234,11 @@ 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 | 238 | ||
238 | struct st_event_record *rec = get_record(ST_TASK_EXIT, t); | 239 | struct st_event_record *rec = get_record(ST_TASK_EXIT, t); |
239 | if (rec) { | 240 | if (rec) { |
240 | rec->data.task_exit.when = now(); | 241 | rec->data.task_exit.avg_exec_time = avg_exec_time; |
241 | rec->data.task_exit.max_exec_time = max_exec_time; | 242 | rec->data.task_exit.max_exec_time = max_exec_time; |
242 | put_record(rec); | 243 | put_record(rec); |
243 | } | 244 | } |