diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2013-09-27 13:44:08 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2014-02-19 15:33:40 -0500 |
commit | 36bd5c4bb70936815c5273aef8bee1cafccf1a1a (patch) | |
tree | 3d0f89762b51de4bd4bd75546d0c107404662645 | |
parent | e01b6a8b49bf5c8f3a53b260b9d625a2321e4f42 (diff) |
Tracing for PGM release/deadline adjustment.
Patch adds tracing of job release/deadline adjustments
of PGM tasks. Tracing is separate from regular job tracing
so that we many observe the magnitude of adjustments/slippage.
-rw-r--r-- | include/litmus/sched_trace.h | 19 | ||||
-rw-r--r-- | include/trace/events/litmus.h | 28 | ||||
-rw-r--r-- | litmus/pgm.c | 3 | ||||
-rw-r--r-- | litmus/sched_task_trace.c | 12 |
4 files changed, 60 insertions, 2 deletions
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index 82bde8241298..3d3b06ced797 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 | ||
83 | struct st_pgm_release_data { | ||
84 | u64 release; /* PGM-adjusted release time */ | ||
85 | u64 deadline; /* PGM-adjusted deadline */ | ||
86 | }; | ||
87 | |||
83 | #define DATA(x) struct st_ ## x ## _data x; | 88 | #define DATA(x) struct st_ ## x ## _data x; |
84 | 89 | ||
85 | typedef enum { | 90 | typedef 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_PGM_RELEASE | ||
98 | } st_event_record_type_t; | 104 | } st_event_record_type_t; |
99 | 105 | ||
100 | struct st_event_record { | 106 | struct 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(pgm_release); | ||
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); |
155 | feather_callback void do_sched_trace_sys_release(unsigned long id, | 162 | feather_callback void do_sched_trace_sys_release(unsigned long id, |
156 | lt_t* start); | 163 | lt_t* start); |
164 | feather_callback void do_sched_trace_pgm_release(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_pgm_release(t) | ||
182 | 192 | ||
183 | #endif | 193 | #endif |
184 | 194 | ||
@@ -252,6 +262,13 @@ feather_callback void do_sched_trace_sys_release(unsigned long id, | |||
252 | trace_litmus_sys_release(when); \ | 262 | trace_litmus_sys_release(when); \ |
253 | } while (0) | 263 | } while (0) |
254 | 264 | ||
265 | #define sched_trace_pgm_release(t) \ | ||
266 | do { \ | ||
267 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 11, \ | ||
268 | do_sched_trace_pgm_release, t); \ | ||
269 | trace_litmus_pgm_release(t); \ | ||
270 | } while (0) | ||
271 | |||
255 | #define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */ | 272 | #define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */ |
256 | 273 | ||
257 | #endif /* __KERNEL__ */ | 274 | #endif /* __KERNEL__ */ |
diff --git a/include/trace/events/litmus.h b/include/trace/events/litmus.h index 0fffcee02be0..0b4eac386dfe 100644 --- a/include/trace/events/litmus.h +++ b/include/trace/events/litmus.h | |||
@@ -225,6 +225,34 @@ TRACE_EVENT(litmus_sys_release, | |||
225 | TP_printk("SynRelease(%Lu) at %Lu\n", __entry->rel, __entry->when) | 225 | TP_printk("SynRelease(%Lu) at %Lu\n", __entry->rel, __entry->when) |
226 | ); | 226 | ); |
227 | 227 | ||
228 | /* | ||
229 | * Tracing PGM-adjusted job release | ||
230 | */ | ||
231 | TRACE_EVENT(litmus_pgm_release, | ||
232 | |||
233 | TP_PROTO(struct task_struct *t), | ||
234 | |||
235 | TP_ARGS(t), | ||
236 | |||
237 | TP_STRUCT__entry( | ||
238 | __field( pid_t, pid ) | ||
239 | __field( unsigned int, job ) | ||
240 | __field( lt_t, release ) | ||
241 | __field( lt_t, deadline ) | ||
242 | ), | ||
243 | |||
244 | TP_fast_assign( | ||
245 | __entry->pid = t ? t->pid : 0; | ||
246 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | ||
247 | __entry->release = get_release(t); | ||
248 | __entry->deadline = get_deadline(t); | ||
249 | ), | ||
250 | |||
251 | TP_printk("release(job(%u, %u)): %Lu\ndeadline(job(%u, %u)): %Lu\n", | ||
252 | __entry->pid, __entry->job, __entry->release, | ||
253 | __entry->pid, __entry->job, __entry->deadline) | ||
254 | ); | ||
255 | |||
228 | #endif /* _SCHED_TASK_TRACEPOINT_H */ | 256 | #endif /* _SCHED_TASK_TRACEPOINT_H */ |
229 | 257 | ||
230 | /* Must stay outside the protection */ | 258 | /* Must stay outside the protection */ |
diff --git a/litmus/pgm.c b/litmus/pgm.c index f8b857de8118..2bfa8d0843c1 100644 --- a/litmus/pgm.c +++ b/litmus/pgm.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/sched.h> | 4 | #include <linux/sched.h> |
5 | #include <litmus/litmus.h> | 5 | #include <litmus/litmus.h> |
6 | #include <litmus/pgm.h> | 6 | #include <litmus/pgm.h> |
7 | #include <litmus/sched_trace.h> | ||
7 | 8 | ||
8 | /* Only readjust release/deadline if difference is over a given threshold. | 9 | /* Only readjust release/deadline if difference is over a given threshold. |
9 | It's a weak method for accounting overheads. Ideally, we'd know the last | 10 | It's a weak method for accounting overheads. Ideally, we'd know the last |
@@ -51,4 +52,6 @@ void setup_pgm_release(struct task_struct* t) | |||
51 | "cur time = %llu, release time = %llu\n", | 52 | "cur time = %llu, release time = %llu\n", |
52 | now, tsk_rt(t)->job_params.release); | 53 | now, tsk_rt(t)->job_params.release); |
53 | } | 54 | } |
55 | |||
56 | sched_trace_pgm_release(t); | ||
54 | } | 57 | } |
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c index 933e7e4c7094..422314f29a60 100644 --- a/litmus/sched_task_trace.c +++ b/litmus/sched_task_trace.c | |||
@@ -231,10 +231,20 @@ feather_callback void do_sched_trace_action(unsigned long id, | |||
231 | { | 231 | { |
232 | struct task_struct *t = (struct task_struct*) _task; | 232 | struct task_struct *t = (struct task_struct*) _task; |
233 | struct st_event_record* rec = get_record(ST_ACTION, t); | 233 | struct st_event_record* rec = get_record(ST_ACTION, t); |
234 | |||
235 | if (rec) { | 234 | if (rec) { |
236 | rec->data.action.when = now(); | 235 | rec->data.action.when = now(); |
237 | rec->data.action.action = action; | 236 | rec->data.action.action = action; |
238 | put_record(rec); | 237 | put_record(rec); |
239 | } | 238 | } |
240 | } | 239 | } |
240 | |||
241 | feather_callback void do_sched_trace_pgm_release(unsigned long id, unsigned long _task) | ||
242 | { | ||
243 | struct task_struct *t = (struct task_struct*) _task; | ||
244 | struct st_event_record* rec = get_record(ST_PGM_RELEASE, t); | ||
245 | if (rec) { | ||
246 | rec->data.release.release = get_release(t); | ||
247 | rec->data.release.deadline = get_deadline(t); | ||
248 | put_record(rec); | ||
249 | } | ||
250 | } | ||