diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-05-03 16:50:32 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-05-03 17:17:52 -0400 |
commit | bb35f3fc684667598d7ae39fd2d49a16f77beb39 (patch) | |
tree | 6a70f13510e36e2771652bb3fc6d60321bf1daf6 /include/trace/events/litmus.h | |
parent | e0e02579c34b9920781b3ce3fc9d6d7bcafb4d5b (diff) |
Added color schedule
Diffstat (limited to 'include/trace/events/litmus.h')
-rw-r--r-- | include/trace/events/litmus.h | 425 |
1 files changed, 425 insertions, 0 deletions
diff --git a/include/trace/events/litmus.h b/include/trace/events/litmus.h new file mode 100644 index 000000000000..136a80db54a4 --- /dev/null +++ b/include/trace/events/litmus.h | |||
@@ -0,0 +1,425 @@ | |||
1 | /* | ||
2 | * LITMUS^RT kernel style scheduling tracepoints | ||
3 | */ | ||
4 | #undef TRACE_SYSTEM | ||
5 | #define TRACE_SYSTEM litmus | ||
6 | |||
7 | #if !defined(_SCHED_TASK_TRACEPOINT_H) || defined(TRACE_HEADER_MULTI_READ) | ||
8 | #define _SCHED_TASK_TRACEPOINT_H | ||
9 | |||
10 | #include <linux/tracepoint.h> | ||
11 | |||
12 | #include <litmus/litmus.h> | ||
13 | #include <litmus/rt_param.h> | ||
14 | |||
15 | TRACE_EVENT(litmus_task_param, | ||
16 | |||
17 | TP_PROTO(struct task_struct *t), | ||
18 | |||
19 | TP_ARGS(t), | ||
20 | |||
21 | TP_STRUCT__entry( | ||
22 | __field( pid_t, pid ) | ||
23 | __field( unsigned int, job ) | ||
24 | __field( unsigned long long, wcet ) | ||
25 | __field( unsigned long long, period ) | ||
26 | __field( unsigned long long, phase ) | ||
27 | __field( int, partition ) | ||
28 | ), | ||
29 | |||
30 | TP_fast_assign( | ||
31 | __entry->pid = t ? t->pid : 0; | ||
32 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | ||
33 | __entry->wcet = get_exec_cost(t); | ||
34 | __entry->period = get_rt_period(t); | ||
35 | __entry->phase = get_rt_phase(t); | ||
36 | __entry->partition = get_partition(t); | ||
37 | ), | ||
38 | |||
39 | TP_printk("period(%d, %Lu).\nwcet(%d, %Lu).\n", | ||
40 | __entry->pid, __entry->period, | ||
41 | __entry->pid, __entry->wcet) | ||
42 | ); | ||
43 | |||
44 | /* | ||
45 | * Tracing jobs release | ||
46 | */ | ||
47 | TRACE_EVENT(litmus_task_release, | ||
48 | |||
49 | TP_PROTO(struct task_struct *t), | ||
50 | |||
51 | TP_ARGS(t), | ||
52 | |||
53 | TP_STRUCT__entry( | ||
54 | __field( pid_t, pid ) | ||
55 | __field( unsigned int, job ) | ||
56 | __field( unsigned long long, release ) | ||
57 | __field( unsigned long long, deadline ) | ||
58 | ), | ||
59 | |||
60 | TP_fast_assign( | ||
61 | __entry->pid = t ? t->pid : 0; | ||
62 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | ||
63 | __entry->release = get_release(t); | ||
64 | __entry->deadline = get_deadline(t); | ||
65 | ), | ||
66 | |||
67 | TP_printk("release(job(%u, %u)): %Lu\ndeadline(job(%u, %u)): %Lu\n", | ||
68 | __entry->pid, __entry->job, __entry->release, | ||
69 | __entry->pid, __entry->job, __entry->deadline) | ||
70 | ); | ||
71 | |||
72 | /* | ||
73 | * Tracepoint for switching to new task | ||
74 | */ | ||
75 | TRACE_EVENT(litmus_switch_to, | ||
76 | |||
77 | TP_PROTO(struct task_struct *t), | ||
78 | |||
79 | TP_ARGS(t), | ||
80 | |||
81 | TP_STRUCT__entry( | ||
82 | __field( pid_t, pid ) | ||
83 | __field( unsigned int, job ) | ||
84 | __field( unsigned long long, exec_time ) | ||
85 | ), | ||
86 | |||
87 | TP_fast_assign( | ||
88 | __entry->pid = t->pid;//is_realtime(t) ? t->pid : 0; | ||
89 | __entry->job = t->rt_param.job_params.job_no;//is_realtime(t) ? t->rt_param.job_params.job_no : 0; | ||
90 | __entry->exec_time = get_exec_time(t); | ||
91 | ), | ||
92 | |||
93 | TP_printk("switch_to(job(%u, %u)): (exec: %Lu)\n", | ||
94 | __entry->pid, __entry->job, | ||
95 | __entry->exec_time) | ||
96 | ); | ||
97 | |||
98 | /* | ||
99 | * Tracepoint for switching away previous task | ||
100 | */ | ||
101 | TRACE_EVENT(litmus_switch_away, | ||
102 | |||
103 | TP_PROTO(struct task_struct *t), | ||
104 | |||
105 | TP_ARGS(t), | ||
106 | |||
107 | TP_STRUCT__entry( | ||
108 | __field( pid_t, pid ) | ||
109 | __field( unsigned int, job ) | ||
110 | __field( unsigned long long, exec_time ) | ||
111 | ), | ||
112 | |||
113 | TP_fast_assign( | ||
114 | __entry->pid = t->pid;//is_realtime(t) ? t->pid : 0; | ||
115 | __entry->job = t->rt_param.job_params.job_no;//is_realtime(t) ? t->rt_param.job_params.job_no : 0; | ||
116 | __entry->exec_time = get_exec_time(t); | ||
117 | ), | ||
118 | |||
119 | TP_printk("switch_away(job(%u, %u)): (exec: %Lu)\n", | ||
120 | __entry->pid, __entry->job, | ||
121 | __entry->exec_time) | ||
122 | ); | ||
123 | |||
124 | /* | ||
125 | * Tracing jobs completion | ||
126 | */ | ||
127 | TRACE_EVENT(litmus_task_completion, | ||
128 | |||
129 | TP_PROTO(struct task_struct *t, unsigned long forced), | ||
130 | |||
131 | TP_ARGS(t, forced), | ||
132 | |||
133 | TP_STRUCT__entry( | ||
134 | __field( pid_t, pid ) | ||
135 | __field( unsigned int, job ) | ||
136 | __field( unsigned long, forced ) | ||
137 | ), | ||
138 | |||
139 | TP_fast_assign( | ||
140 | __entry->pid = t ? t->pid : 0; | ||
141 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | ||
142 | __entry->forced = forced; | ||
143 | ), | ||
144 | |||
145 | TP_printk("completed(job(%u, %u)): (forced: %lu)\n", | ||
146 | __entry->pid, __entry->job, | ||
147 | __entry->forced) | ||
148 | ); | ||
149 | |||
150 | /* | ||
151 | * Trace blocking tasks. | ||
152 | */ | ||
153 | TRACE_EVENT(litmus_task_block, | ||
154 | |||
155 | TP_PROTO(struct task_struct *t, int lid), | ||
156 | |||
157 | TP_ARGS(t, lid), | ||
158 | |||
159 | TP_STRUCT__entry( | ||
160 | __field( pid_t, pid ) | ||
161 | __field( int, lid ) | ||
162 | ), | ||
163 | |||
164 | TP_fast_assign( | ||
165 | __entry->pid = t ? t->pid : 0; | ||
166 | __entry->lid = lid; | ||
167 | ), | ||
168 | |||
169 | TP_printk("(%u) blocks on %d\n", __entry->pid, | ||
170 | __entry->lid) | ||
171 | ); | ||
172 | |||
173 | /* | ||
174 | * Lock events | ||
175 | */ | ||
176 | TRACE_EVENT(litmus_resource_acquire, | ||
177 | |||
178 | TP_PROTO(struct task_struct *t, int lid), | ||
179 | |||
180 | TP_ARGS(t, lid), | ||
181 | |||
182 | TP_STRUCT__entry( | ||
183 | __field( pid_t, pid ) | ||
184 | __field( int, lid ) | ||
185 | ), | ||
186 | |||
187 | TP_fast_assign( | ||
188 | __entry->pid = t ? t->pid : 0; | ||
189 | __entry->lid = lid; | ||
190 | ), | ||
191 | |||
192 | TP_printk("(%u) acquires %d\n", __entry->pid, | ||
193 | __entry->lid) | ||
194 | ); | ||
195 | |||
196 | TRACE_EVENT(litmus_resource_release, | ||
197 | |||
198 | TP_PROTO(struct task_struct *t, int lid), | ||
199 | |||
200 | TP_ARGS(t, lid), | ||
201 | |||
202 | TP_STRUCT__entry( | ||
203 | __field( pid_t, pid ) | ||
204 | __field( int, lid ) | ||
205 | ), | ||
206 | |||
207 | TP_fast_assign( | ||
208 | __entry->pid = t ? t->pid : 0; | ||
209 | __entry->lid = lid; | ||
210 | ), | ||
211 | |||
212 | TP_printk("(%u) releases %d\n", __entry->pid, | ||
213 | __entry->lid) | ||
214 | ); | ||
215 | |||
216 | TRACE_EVENT(litmus_priority_donate, | ||
217 | |||
218 | TP_PROTO(struct task_struct *t, struct task_struct *donor, int lid), | ||
219 | |||
220 | TP_ARGS(t, donor, lid), | ||
221 | |||
222 | TP_STRUCT__entry( | ||
223 | __field( pid_t, t_pid ) | ||
224 | __field( pid_t, d_pid ) | ||
225 | __field( unsigned long long, prio) | ||
226 | __field( int, lid ) | ||
227 | ), | ||
228 | |||
229 | TP_fast_assign( | ||
230 | __entry->t_pid = t ? t->pid : 0; | ||
231 | __entry->d_pid = donor ? donor->pid : 0; | ||
232 | __entry->prio = get_deadline(donor); | ||
233 | __entry->lid = lid; | ||
234 | ), | ||
235 | |||
236 | TP_printk("(%u) inherits %llu from (%u) on %d\n", __entry->t_pid, | ||
237 | __entry->d_pid, __entry->prio, __entry->lid) | ||
238 | ); | ||
239 | |||
240 | /* | ||
241 | * Tracing jobs resume | ||
242 | */ | ||
243 | TRACE_EVENT(litmus_task_resume, | ||
244 | |||
245 | TP_PROTO(struct task_struct *t, int lid), | ||
246 | |||
247 | TP_ARGS(t, lid), | ||
248 | |||
249 | TP_STRUCT__entry( | ||
250 | __field( pid_t, pid ) | ||
251 | __field( int, lid ) | ||
252 | __field( unsigned int, job ) | ||
253 | ), | ||
254 | |||
255 | TP_fast_assign( | ||
256 | __entry->pid = t ? t->pid : 0; | ||
257 | __entry->job = t ? t->rt_param.job_params.job_no : 0; | ||
258 | __entry->lid = lid; | ||
259 | ), | ||
260 | |||
261 | TP_printk("resume(job(%u, %u)) on %d\n", | ||
262 | __entry->pid, __entry->job, | ||
263 | __entry->lid) | ||
264 | ); | ||
265 | |||
266 | /* | ||
267 | * Trace synchronous release | ||
268 | */ | ||
269 | TRACE_EVENT(litmus_sys_release, | ||
270 | |||
271 | TP_PROTO(unsigned long long *start), | ||
272 | |||
273 | TP_ARGS(start), | ||
274 | |||
275 | TP_STRUCT__entry( | ||
276 | __field( unsigned long long, rel ) | ||
277 | ), | ||
278 | |||
279 | TP_fast_assign( | ||
280 | __entry->rel = *start; | ||
281 | ), | ||
282 | |||
283 | TP_printk("SynRelease(%Lu)\n", __entry->rel) | ||
284 | ); | ||
285 | |||
286 | /* | ||
287 | * Containers | ||
288 | */ | ||
289 | TRACE_EVENT(litmus_container_param, | ||
290 | |||
291 | TP_PROTO(int cid, const char *name), | ||
292 | |||
293 | TP_ARGS(cid, name), | ||
294 | |||
295 | TP_STRUCT__entry( | ||
296 | __field( int, cid ) | ||
297 | __array( char, name, TASK_COMM_LEN ) | ||
298 | ), | ||
299 | |||
300 | TP_fast_assign( | ||
301 | memcpy(__entry->name, name, TASK_COMM_LEN); | ||
302 | __entry->cid = cid; | ||
303 | ), | ||
304 | |||
305 | TP_printk("container, name: %s, id: %d\n", __entry->name, __entry->cid) | ||
306 | ); | ||
307 | |||
308 | TRACE_EVENT(litmus_server_param, | ||
309 | |||
310 | TP_PROTO(int sid, int cid, unsigned long long wcet, unsigned long long period), | ||
311 | |||
312 | TP_ARGS(sid, cid, wcet, period), | ||
313 | |||
314 | TP_STRUCT__entry( | ||
315 | __field( int, sid ) | ||
316 | __field( int, cid ) | ||
317 | __field( unsigned long long, wcet ) | ||
318 | __field( unsigned long long, period ) | ||
319 | ), | ||
320 | |||
321 | TP_fast_assign( | ||
322 | __entry->cid = cid; | ||
323 | __entry->sid = sid; | ||
324 | __entry->wcet = wcet; | ||
325 | __entry->period = period; | ||
326 | ), | ||
327 | |||
328 | TP_printk("server(%llu, %llu), sid: %llu, cont: %llu\n", | ||
329 | __entry->wcet, __entry->period, __entry->sid, __entry->cid) | ||
330 | ); | ||
331 | |||
332 | TRACE_EVENT(litmus_server_switch_to, | ||
333 | |||
334 | TP_PROTO(int sid, unsigned int job, int tid, unsigned int tjob), | ||
335 | |||
336 | TP_ARGS(sid, job, tid, tjob), | ||
337 | |||
338 | TP_STRUCT__entry( | ||
339 | __field( int, sid) | ||
340 | __field( unsigned int, job) | ||
341 | __field( int, tid) | ||
342 | __field( unsigned int, tjob) | ||
343 | ), | ||
344 | |||
345 | TP_fast_assign( | ||
346 | __entry->sid = sid; | ||
347 | __entry->tid = tid; | ||
348 | __entry->job = job; | ||
349 | __entry->tjob = tjob; | ||
350 | ), | ||
351 | |||
352 | TP_printk("switch_to(server(%d, %u)): (%d, %d)\n", __entry->sid, __entry->job, __entry->tid, __entry->tjob) | ||
353 | ); | ||
354 | |||
355 | TRACE_EVENT(litmus_server_switch_away, | ||
356 | |||
357 | TP_PROTO(int sid, unsigned int job, int tid, unsigned int tjob), | ||
358 | |||
359 | TP_ARGS(sid, job, tid, tjob), | ||
360 | |||
361 | TP_STRUCT__entry( | ||
362 | __field( int, sid) | ||
363 | __field( unsigned int, job) | ||
364 | __field( int, tid) | ||
365 | __field( unsigned int, tjob) | ||
366 | ), | ||
367 | |||
368 | TP_fast_assign( | ||
369 | __entry->sid = sid; | ||
370 | __entry->tid = tid; | ||
371 | __entry->job = job; | ||
372 | __entry->tjob = tjob; | ||
373 | ), | ||
374 | |||
375 | TP_printk("switch_away(server(%d, %u)): (%d, %d)\n", __entry->sid, __entry->job, __entry->tid, __entry->tjob) | ||
376 | ); | ||
377 | |||
378 | TRACE_EVENT(litmus_server_release, | ||
379 | |||
380 | TP_PROTO(int sid, unsigned int job, | ||
381 | unsigned long long release, | ||
382 | unsigned long long deadline), | ||
383 | |||
384 | TP_ARGS(sid, job, release, deadline), | ||
385 | |||
386 | TP_STRUCT__entry( | ||
387 | __field( int, sid) | ||
388 | __field( unsigned int, job) | ||
389 | __field( unsigned long long, release) | ||
390 | __field( unsigned long long, deadline) | ||
391 | ), | ||
392 | |||
393 | TP_fast_assign( | ||
394 | __entry->sid = sid; | ||
395 | __entry->job = job; | ||
396 | __entry->release = release; | ||
397 | __entry->deadline = deadline; | ||
398 | ), | ||
399 | |||
400 | TP_printk("release(server(%d, %u)), release: %llu, deadline: %llu\n", __entry->sid, __entry->job, __entry->release, __entry->deadline) | ||
401 | ); | ||
402 | |||
403 | TRACE_EVENT(litmus_server_completion, | ||
404 | |||
405 | TP_PROTO(int sid, int job), | ||
406 | |||
407 | TP_ARGS(sid, job), | ||
408 | |||
409 | TP_STRUCT__entry( | ||
410 | __field( int, sid) | ||
411 | __field( unsigned int, job) | ||
412 | ), | ||
413 | |||
414 | TP_fast_assign( | ||
415 | __entry->sid = sid; | ||
416 | __entry->job = job; | ||
417 | ), | ||
418 | |||
419 | TP_printk("completion(server(%d, %d))\n", __entry->sid, __entry->job) | ||
420 | ); | ||
421 | |||
422 | #endif /* _SCHED_TASK_TRACEPOINT_H */ | ||
423 | |||
424 | /* Must stay outside the protection */ | ||
425 | #include <trace/define_trace.h> | ||