diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2013-03-28 19:18:44 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2013-03-31 11:58:12 -0400 |
commit | 699737644d64e88bceafb9c2d39bd587057c732a (patch) | |
tree | af542237aaa7dc56d4b960786263fafa970eb190 | |
parent | 157842c2e9dc7bb794ebaa84ef1c39037d15cc54 (diff) |
trace priority changes
-rw-r--r-- | include/litmus/sched_trace.h | 16 | ||||
-rw-r--r-- | include/trace/events/litmus.h | 63 | ||||
-rw-r--r-- | kernel/softirq.c | 4 |
3 files changed, 71 insertions, 12 deletions
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index bc86f184be2c..c7652b1aef73 100644 --- a/include/litmus/sched_trace.h +++ b/include/litmus/sched_trace.h | |||
@@ -122,8 +122,8 @@ struct st_work_end_data { | |||
122 | 122 | ||
123 | struct st_effective_priority_change_data { | 123 | struct st_effective_priority_change_data { |
124 | u64 when; | 124 | u64 when; |
125 | u16 inh_pid; | 125 | u32 inh_pid; |
126 | u8 __unused[6]; | 126 | u32 prev_inh_pid; |
127 | } __attribute__((packed)); | 127 | } __attribute__((packed)); |
128 | 128 | ||
129 | struct st_nv_interrupt_begin_data { | 129 | struct st_nv_interrupt_begin_data { |
@@ -325,6 +325,7 @@ feather_callback void do_sched_trace_lock(unsigned long id, | |||
325 | #define trace_litmus_task_block(t) | 325 | #define trace_litmus_task_block(t) |
326 | #define trace_litmus_task_resume(t) | 326 | #define trace_litmus_task_resume(t) |
327 | #define trace_litmus_sys_release(start) | 327 | #define trace_litmus_sys_release(start) |
328 | #define trace_litmus_eff_prio_change(t, p) | ||
328 | 329 | ||
329 | #endif | 330 | #endif |
330 | 331 | ||
@@ -417,10 +418,12 @@ feather_callback void do_sched_trace_lock(unsigned long id, | |||
417 | #define sched_trace_work_end(t, e, flushed) \ | 418 | #define sched_trace_work_end(t, e, flushed) \ |
418 | SCHED_TRACE3(SCHED_TRACE_BASE_ID + 16, do_sched_trace_work_end, t, e, flushed) | 419 | SCHED_TRACE3(SCHED_TRACE_BASE_ID + 16, do_sched_trace_work_end, t, e, flushed) |
419 | 420 | ||
420 | 421 | #define sched_trace_eff_prio_change(t, p) \ | |
421 | #define sched_trace_eff_prio_change(t, inh) \ | 422 | do { \ |
422 | SCHED_TRACE2(SCHED_TRACE_BASE_ID + 17, do_sched_trace_eff_prio_change, t, inh) | 423 | SCHED_TRACE2(SCHED_TRACE_BASE_ID + 17, \ |
423 | 424 | do_sched_trace_eff_prio_change, t, p); \ | |
425 | trace_litmus_eff_prio_change(t, p); \ | ||
426 | } while (0) | ||
424 | 427 | ||
425 | #define sched_trace_nv_interrupt_begin(d) \ | 428 | #define sched_trace_nv_interrupt_begin(d) \ |
426 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 18, do_sched_trace_nv_interrupt_begin, d) | 429 | SCHED_TRACE(SCHED_TRACE_BASE_ID + 18, do_sched_trace_nv_interrupt_begin, d) |
@@ -434,7 +437,6 @@ feather_callback void do_sched_trace_lock(unsigned long id, | |||
434 | #define sched_trace_lock(t, lock_id, acquired) \ | 437 | #define sched_trace_lock(t, lock_id, acquired) \ |
435 | SCHED_TRACE3(SCHED_TRACE_BASE_ID + 21, do_sched_trace_lock, t, lock_id, acquired) | 438 | SCHED_TRACE3(SCHED_TRACE_BASE_ID + 21, do_sched_trace_lock, t, lock_id, acquired) |
436 | 439 | ||
437 | |||
438 | #define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */ | 440 | #define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */ |
439 | 441 | ||
440 | #endif /* __KERNEL__ */ | 442 | #endif /* __KERNEL__ */ |
diff --git a/include/trace/events/litmus.h b/include/trace/events/litmus.h index 0fffcee02be0..a444bbe40a2e 100644 --- a/include/trace/events/litmus.h +++ b/include/trace/events/litmus.h | |||
@@ -142,6 +142,8 @@ TRACE_EVENT(litmus_task_completion, | |||
142 | __field( unsigned int, job ) | 142 | __field( unsigned int, job ) |
143 | __field( lt_t, when ) | 143 | __field( lt_t, when ) |
144 | __field( unsigned long, forced ) | 144 | __field( unsigned long, forced ) |
145 | __field( unsigned long, backlog ) | ||
146 | __field( unsigned long, was_backlog_job) | ||
145 | ), | 147 | ), |
146 | 148 | ||
147 | TP_fast_assign( | 149 | TP_fast_assign( |
@@ -149,11 +151,15 @@ TRACE_EVENT(litmus_task_completion, | |||
149 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | 151 | __entry->job = t ? t->rt_param.job_params.job_no : 0; |
150 | __entry->when = litmus_clock(); | 152 | __entry->when = litmus_clock(); |
151 | __entry->forced = forced; | 153 | __entry->forced = forced; |
154 | __entry->backlog = t ? t->rt_param.job_params.backlog : 0; | ||
155 | __entry->was_backlog_job = t ? t->rt_param.job_params.is_backlogged_job : 0; | ||
152 | ), | 156 | ), |
153 | 157 | ||
154 | TP_printk("completed(job(%u, %u)): %Lu (forced: %lu)\n", | 158 | TP_printk("completed(job(%u, %u)): %Lu (forced: %lu) (was_bkj: %s) (bk_remain: %lu)\n", |
155 | __entry->pid, __entry->job, | 159 | __entry->pid, __entry->job, |
156 | __entry->when, __entry->forced) | 160 | __entry->when, __entry->forced, |
161 | __entry->was_backlog_job ? "yes" : "no", | ||
162 | __entry->backlog) | ||
157 | ); | 163 | ); |
158 | 164 | ||
159 | /* | 165 | /* |
@@ -168,14 +174,26 @@ TRACE_EVENT(litmus_task_block, | |||
168 | TP_STRUCT__entry( | 174 | TP_STRUCT__entry( |
169 | __field( pid_t, pid ) | 175 | __field( pid_t, pid ) |
170 | __field( lt_t, when ) | 176 | __field( lt_t, when ) |
177 | __field( int, for_io ) | ||
171 | ), | 178 | ), |
172 | 179 | ||
173 | TP_fast_assign( | 180 | TP_fast_assign( |
174 | __entry->pid = t ? t->pid : 0; | 181 | __entry->pid = t ? t->pid : 0; |
175 | __entry->when = litmus_clock(); | 182 | __entry->when = litmus_clock(); |
183 | __entry->for_io = t ? 0 | ||
184 | #ifdef CONFIG_REALTIME_AUX_TASKS | ||
185 | || (t->rt_param.has_aux_tasks && !t->rt_param.hide_from_aux_tasks) | ||
186 | #endif | ||
187 | #ifdef CONFIG_LITMUS_NVIDIA | ||
188 | || (t->rt_param.held_gpus && !t->rt_param.->hide_from_gpu) | ||
189 | #endif | ||
190 | : 0; | ||
176 | ), | 191 | ), |
177 | 192 | ||
178 | TP_printk("(%u) blocks: %Lu\n", __entry->pid, __entry->when) | 193 | TP_printk("(%u) blocks (for I/O: %s): %Lu\n", |
194 | __entry->pid, | ||
195 | __entry->for_io ? "yes" : "no", | ||
196 | __entry->when) | ||
179 | ); | 197 | ); |
180 | 198 | ||
181 | /* | 199 | /* |
@@ -225,6 +243,45 @@ TRACE_EVENT(litmus_sys_release, | |||
225 | TP_printk("SynRelease(%Lu) at %Lu\n", __entry->rel, __entry->when) | 243 | TP_printk("SynRelease(%Lu) at %Lu\n", __entry->rel, __entry->when) |
226 | ); | 244 | ); |
227 | 245 | ||
246 | TRACE_EVENT(litmus_eff_prio_change, | ||
247 | |||
248 | TP_PROTO(struct task_struct* t, struct task_struct* p), | ||
249 | |||
250 | TP_ARGS(t, p), | ||
251 | |||
252 | TP_STRUCT__entry( | ||
253 | __field( lt_t, when) | ||
254 | __field( pid_t, pid ) | ||
255 | __field( lt_t, deadline ) | ||
256 | __field( pid_t, inh_pid ) | ||
257 | __field( lt_t, inh_deadline ) | ||
258 | __field( pid_t, prev_inh_pid ) | ||
259 | __field( lt_t, prev_inh_deadline ) | ||
260 | ), | ||
261 | |||
262 | TP_fast_assign( | ||
263 | __entry->when = litmus_clock(); | ||
264 | __entry->pid = t ? t->pid : 0; | ||
265 | __entry->deadline = t ? t->rt_param.job_params.deadline : 0; | ||
266 | __entry->inh_pid = p ? p->pid : 0; | ||
267 | __entry->inh_deadline = p ? p->rt_param.job_params.deadline : 0; | ||
268 | __entry->prev_inh_pid = (t && t->rt_param.inh_task) ? | ||
269 | t->rt_param.inh_task->pid : 0; | ||
270 | __entry->prev_inh_deadline = (t && t->rt_param.inh_task) ? | ||
271 | t->rt_param.inh_task->rt_param.job_params.deadline : 0; | ||
272 | ), | ||
273 | |||
274 | TP_printk("Priority Change at %Lu: " | ||
275 | "%d @ %Lu (eff: %d @ %Lu) -> %d @ %Lu (prio %s)\n", | ||
276 | __entry->when, | ||
277 | __entry->pid, __entry->deadline, | ||
278 | __entry->prev_inh_pid, __entry->prev_inh_deadline, | ||
279 | __entry->inh_pid, __entry->inh_deadline, | ||
280 | (__entry->inh_pid) ? | ||
281 | (__entry->inh_deadline <= (__entry->prev_inh_pid ? __entry->prev_inh_deadline : __entry->deadline)) ? | ||
282 | "INCREASE" : "DECREASE" : "DECREASE") | ||
283 | ); | ||
284 | |||
228 | #endif /* _SCHED_TASK_TRACEPOINT_H */ | 285 | #endif /* _SCHED_TASK_TRACEPOINT_H */ |
229 | 286 | ||
230 | /* Must stay outside the protection */ | 287 | /* Must stay outside the protection */ |
diff --git a/kernel/softirq.c b/kernel/softirq.c index 9c20a9ec06b2..561d60ce1f65 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
32 | 32 | ||
33 | #include <litmus/litmus.h> | 33 | #include <litmus/litmus.h> |
34 | #include <litmus/sched_trace.h> | 34 | //#include <litmus/sched_trace.h> |
35 | 35 | ||
36 | #ifdef CONFIG_LITMUS_NVIDIA | 36 | #ifdef CONFIG_LITMUS_NVIDIA |
37 | #include <litmus/nvidia_info.h> | 37 | #include <litmus/nvidia_info.h> |
@@ -472,7 +472,7 @@ static int __klmirqd_nv_tasklet_schedule(struct tasklet_struct *t, | |||
472 | klmirqd_th->pid, | 472 | klmirqd_th->pid, |
473 | litmus_clock()); | 473 | litmus_clock()); |
474 | 474 | ||
475 | sched_trace_tasklet_release(NULL, nvidia_device); | 475 | // sched_trace_tasklet_release(NULL, nvidia_device); |
476 | if(likely(klmirqd_func(t, klmirqd_th))) { | 476 | if(likely(klmirqd_func(t, klmirqd_th))) { |
477 | unlock_nvklmirqd_thread(nvidia_device, &flags); | 477 | unlock_nvklmirqd_thread(nvidia_device, &flags); |
478 | return 1; /* success */ | 478 | return 1; /* success */ |