aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Kenna <cjk@cs.unc.edu>2012-05-06 21:18:33 -0400
committerBryan Ward <bcw@cs.unc.edu>2013-04-16 14:37:11 -0400
commit47fd5923596859cf71a1cab1a0271b5acf45fedb (patch)
tree5ea79930be82144b81bd6a6614a63181d80308d9
parentf2d0840115e68334af761b9fda6efd48a5918bd0 (diff)
Add task_exit event that records max exec time under color plugin.
Conflicts: include/litmus/rt_param.h litmus/sched_color.c
-rw-r--r--include/litmus/rt_param.h2
-rw-r--r--include/litmus/sched_trace.h19
-rw-r--r--include/trace/events/litmus.h22
-rw-r--r--litmus/sched_task_trace.c13
4 files changed, 55 insertions, 1 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h
index a16ac84d804..b3d4b37f81e 100644
--- a/include/litmus/rt_param.h
+++ b/include/litmus/rt_param.h
@@ -270,6 +270,8 @@ struct rt_param {
270 270
271 /* Pointer to the page shared between userspace and kernel. */ 271 /* Pointer to the page shared between userspace and kernel. */
272 struct control_page * ctrl_page; 272 struct control_page * ctrl_page;
273
274 lt_t max_exec_time;
273}; 275};
274 276
275#endif 277#endif
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h
index adc223e9c8a..098df065317 100644
--- a/include/litmus/sched_trace.h
+++ b/include/litmus/sched_trace.h
@@ -80,6 +80,11 @@ struct st_sys_release_data {
80 u64 release; 80 u64 release;
81}; 81};
82 82
83struct st_task_exit_data {
84 u64 max_exec_time;
85 u64 __unused;
86};
87
83#define DATA(x) struct st_ ## x ## _data x; 88#define DATA(x) struct st_ ## x ## _data x;
84 89
85typedef enum { 90typedef enum {
@@ -94,7 +99,8 @@ typedef enum {
94 ST_BLOCK, 99 ST_BLOCK,
95 ST_RESUME, 100 ST_RESUME,
96 ST_ACTION, 101 ST_ACTION,
97 ST_SYS_RELEASE 102 ST_SYS_RELEASE,
103 ST_TASK_EXIT,
98} st_event_record_type_t; 104} st_event_record_type_t;
99 105
100struct st_event_record { 106struct st_event_record {
@@ -113,6 +119,7 @@ struct st_event_record {
113 DATA(resume); 119 DATA(resume);
114 DATA(action); 120 DATA(action);
115 DATA(sys_release); 121 DATA(sys_release);
122 DATA(task_exit);
116 } data; 123 } data;
117}; 124};
118 125
@@ -154,6 +161,8 @@ feather_callback void do_sched_trace_action(unsigned long id,
154 unsigned long action); 161 unsigned long action);
155feather_callback void do_sched_trace_sys_release(unsigned long id, 162feather_callback void do_sched_trace_sys_release(unsigned long id,
156 lt_t* start); 163 lt_t* start);
164feather_callback void do_sched_trace_task_exit(unsigned long id,
165 struct task_struct* task);
157 166
158#endif 167#endif
159 168
@@ -179,6 +188,7 @@ feather_callback void do_sched_trace_sys_release(unsigned long id,
179#define trace_litmus_task_block(t) 188#define trace_litmus_task_block(t)
180#define trace_litmus_task_resume(t) 189#define trace_litmus_task_resume(t)
181#define trace_litmus_sys_release(start) 190#define trace_litmus_sys_release(start)
191#define trace_litmus_task_exit(t)
182 192
183#define trace_litmus_container_param(cid, name) 193#define trace_litmus_container_param(cid, name)
184#define trace_litmus_server_param(sid, cid, wcet, time) 194#define trace_litmus_server_param(sid, cid, wcet, time)
@@ -275,6 +285,13 @@ feather_callback void do_sched_trace_sys_release(unsigned long id,
275 trace_litmus_sys_release(when); \ 285 trace_litmus_sys_release(when); \
276 } while (0) 286 } while (0)
277 287
288#define sched_trace_task_exit(t) \
289 do { \
290 SCHED_TRACE(SCHED_TRACE_BASE_ID + 11, \
291 do_sched_trace_task_exit, t); \
292 trace_litmus_task_exit(t); \
293 } while (0)
294
278#define QT_START lt_t _qt_start = litmus_clock() 295#define QT_START lt_t _qt_start = litmus_clock()
279#define QT_END \ 296#define QT_END \
280 sched_trace_log_message("%d P%d [%s@%s:%d]: Took %llu\n\n", \ 297 sched_trace_log_message("%d P%d [%s@%s:%d]: Took %llu\n\n", \
diff --git a/include/trace/events/litmus.h b/include/trace/events/litmus.h
index b3a8f166e65..c3a92f8ec6e 100644
--- a/include/trace/events/litmus.h
+++ b/include/trace/events/litmus.h
@@ -275,6 +275,28 @@ TRACE_EVENT(litmus_sys_release,
275); 275);
276 276
277/* 277/*
278 * Trace task exit
279 */
280TRACE_EVENT(litmus_task_exit,
281
282 TP_PROTO(struct task_struct *t),
283
284 TP_ARGS(t),
285
286 TP_STRUCT__entry(
287 __field( pid_t, pid )
288 __field( unsigned long long, max_exec_time )
289 ),
290
291 TP_fast_assign(
292 __entry->pid = t ? t->pid : 0;
293 __entry->max_exec_time = t ? t->rt_param.max_exec_time : 0;
294 ),
295
296 TP_printk("(%u) exit\n", __entry->pid)
297);
298
299/*
278 * Containers 300 * Containers
279 */ 301 */
280TRACE_EVENT(litmus_container_param, 302TRACE_EVENT(litmus_container_param,
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c
index 1679a13bde2..a85057a6c81 100644
--- a/litmus/sched_task_trace.c
+++ b/litmus/sched_task_trace.c
@@ -229,6 +229,19 @@ feather_callback void do_sched_trace_sys_release(unsigned long id,
229 } 229 }
230} 230}
231 231
232feather_callback void do_sched_trace_task_exit(unsigned long id,
233 unsigned long _task)
234{
235 struct task_struct *t = (struct task_struct*) _task;
236 const lt_t max_exec_time = tsk_rt(t)->max_exec_time;
237
238 struct st_event_record *rec = get_record(ST_TASK_EXIT, t);
239 if (rec) {
240 rec->data.task_exit.max_exec_time = max_exec_time;
241 put_record(rec);
242 }
243}
244
232feather_callback void do_sched_trace_action(unsigned long id, 245feather_callback void do_sched_trace_action(unsigned long id,
233 unsigned long _task, 246 unsigned long _task,
234 unsigned long action) 247 unsigned long action)