diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-05-15 13:39:52 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-09-27 15:46:08 -0400 |
commit | 8f08598f8bc3f47a5c26241575e30df64f444641 (patch) | |
tree | 13fc954742b1e70be38b4aa99a1b1a5f44fc5e8d | |
parent | c445c89aacd79d3083af45c02b8e7db32bfe9dfb (diff) |
Summarize schedulability with final record
Conflicts:
include/litmus/rt_param.h
litmus/sched_color.c
-rw-r--r-- | include/litmus/rt_param.h | 3 | ||||
-rw-r--r-- | include/litmus/sched_trace.h | 19 | ||||
-rw-r--r-- | litmus/sched_task_trace.c | 15 |
3 files changed, 36 insertions, 1 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 8c996b91ead8..20268190757f 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -226,6 +226,9 @@ struct rt_param { | |||
226 | /* Pointer to the page shared between userspace and kernel. */ | 226 | /* Pointer to the page shared between userspace and kernel. */ |
227 | struct control_page * ctrl_page; | 227 | struct control_page * ctrl_page; |
228 | 228 | ||
229 | lt_t total_tardy; | ||
230 | lt_t max_tardy; | ||
231 | unsigned int missed; | ||
229 | lt_t max_exec_time; | 232 | lt_t max_exec_time; |
230 | lt_t tot_exec_time; | 233 | lt_t tot_exec_time; |
231 | }; | 234 | }; |
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index f910c63c067a..bf6c4cf4316c 100644 --- a/include/litmus/sched_trace.h +++ b/include/litmus/sched_trace.h | |||
@@ -85,6 +85,12 @@ struct st_task_exit_data { | |||
85 | u64 max_exec_time; | 85 | u64 max_exec_time; |
86 | }; | 86 | }; |
87 | 87 | ||
88 | struct st_task_tardy_data { | ||
89 | u64 total_tardy; | ||
90 | u32 max_tardy; | ||
91 | u32 missed; | ||
92 | }; | ||
93 | |||
88 | #define DATA(x) struct st_ ## x ## _data x; | 94 | #define DATA(x) struct st_ ## x ## _data x; |
89 | 95 | ||
90 | typedef enum { | 96 | typedef enum { |
@@ -101,6 +107,7 @@ typedef enum { | |||
101 | ST_ACTION, | 107 | ST_ACTION, |
102 | ST_SYS_RELEASE, | 108 | ST_SYS_RELEASE, |
103 | ST_TASK_EXIT, | 109 | ST_TASK_EXIT, |
110 | ST_TASK_TARDY, | ||
104 | } st_event_record_type_t; | 111 | } st_event_record_type_t; |
105 | 112 | ||
106 | struct st_event_record { | 113 | struct st_event_record { |
@@ -120,6 +127,7 @@ struct st_event_record { | |||
120 | DATA(action); | 127 | DATA(action); |
121 | DATA(sys_release); | 128 | DATA(sys_release); |
122 | DATA(task_exit); | 129 | DATA(task_exit); |
130 | DATA(task_tardy); | ||
123 | } data; | 131 | } data; |
124 | }; | 132 | }; |
125 | 133 | ||
@@ -163,6 +171,8 @@ feather_callback void do_sched_trace_sys_release(unsigned long id, | |||
163 | lt_t* start); | 171 | lt_t* start); |
164 | feather_callback void do_sched_trace_task_exit(unsigned long id, | 172 | feather_callback void do_sched_trace_task_exit(unsigned long id, |
165 | struct task_struct* task); | 173 | struct task_struct* task); |
174 | feather_callback void do_sched_trace_task_tardy(unsigned long id, | ||
175 | struct task_struct* task); | ||
166 | 176 | ||
167 | #endif | 177 | #endif |
168 | 178 | ||
@@ -189,6 +199,7 @@ feather_callback void do_sched_trace_task_exit(unsigned long id, | |||
189 | #define trace_litmus_task_resume(t) | 199 | #define trace_litmus_task_resume(t) |
190 | #define trace_litmus_sys_release(start) | 200 | #define trace_litmus_sys_release(start) |
191 | #define trace_litmus_task_exit(t) | 201 | #define trace_litmus_task_exit(t) |
202 | #define trace_litmus_task_tardy(t) | ||
192 | 203 | ||
193 | #define trace_litmus_container_param(cid, name) | 204 | #define trace_litmus_container_param(cid, name) |
194 | #define trace_litmus_server_param(sid, cid, wcet, time) | 205 | #define trace_litmus_server_param(sid, cid, wcet, time) |
@@ -292,6 +303,14 @@ feather_callback void do_sched_trace_task_exit(unsigned long id, | |||
292 | trace_litmus_task_exit(t); \ | 303 | trace_litmus_task_exit(t); \ |
293 | } while (0) | 304 | } while (0) |
294 | 305 | ||
306 | |||
307 | #define sched_trace_task_tardy(t) \ | ||
308 | do { \ | ||
309 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 12, \ | ||
310 | do_sched_trace_task_tardy, t); \ | ||
311 | trace_litmus_task_tardy(t); \ | ||
312 | } while (0) | ||
313 | |||
295 | #define QT_START lt_t _qt_start = litmus_clock() | 314 | #define QT_START lt_t _qt_start = litmus_clock() |
296 | #define QT_END \ | 315 | #define QT_END \ |
297 | sched_trace_log_message("%d P%d [%s@%s:%d]: Took %llu\n\n", \ | 316 | sched_trace_log_message("%d P%d [%s@%s:%d]: Took %llu\n\n", \ |
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c index c65c021ec809..60a3e8e5c028 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 | 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; |
@@ -241,6 +241,19 @@ feather_callback void do_sched_trace_task_exit(unsigned long id, | |||
241 | } | 241 | } |
242 | } | 242 | } |
243 | 243 | ||
244 | feather_callback void do_sched_trace_task_tardy(unsigned long id, | ||
245 | unsigned long _task) | ||
246 | { | ||
247 | struct task_struct *t = (struct task_struct*) _task; | ||
248 | struct st_event_record *rec = get_record(ST_TASK_TARDY, t); | ||
249 | if (rec) { | ||
250 | rec->data.task_tardy.max_tardy = tsk_rt(t)->max_tardy; | ||
251 | rec->data.task_tardy.total_tardy = tsk_rt(t)->total_tardy; | ||
252 | rec->data.task_tardy.missed = tsk_rt(t)->missed; | ||
253 | put_record(rec); | ||
254 | } | ||
255 | } | ||
256 | |||
244 | feather_callback void do_sched_trace_action(unsigned long id, | 257 | feather_callback void do_sched_trace_action(unsigned long id, |
245 | unsigned long _task, | 258 | unsigned long _task, |
246 | unsigned long action) | 259 | unsigned long action) |