diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-11-15 15:41:54 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-03-18 10:42:24 -0400 |
| commit | 94edd278631ff219b4907322e620d9ffebceef4a (patch) | |
| tree | 65c42f25771f57ec0109e5e5e68b9ba046c7a839 | |
| parent | f4ffe0719dfc150ee182f308d31a226b034f206b (diff) | |
Initial commit.
| -rw-r--r-- | include/litmus/sched_trace.h | 49 | ||||
| -rw-r--r-- | include/trace/events/litmus.h | 177 | ||||
| -rw-r--r-- | include/trace/ftrace.h | 5 |
3 files changed, 229 insertions, 2 deletions
diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index 82bde8241298..42c361d54a0f 100644 --- a/include/litmus/sched_trace.h +++ b/include/litmus/sched_trace.h | |||
| @@ -180,6 +180,15 @@ feather_callback void do_sched_trace_sys_release(unsigned long id, | |||
| 180 | #define trace_litmus_task_resume(t) | 180 | #define trace_litmus_task_resume(t) |
| 181 | #define trace_litmus_sys_release(start) | 181 | #define trace_litmus_sys_release(start) |
| 182 | 182 | ||
| 183 | #define trace_litmus_container_param(cid, name) | ||
| 184 | #define trace_litmus_server_param(sid, cid, wcet, time) | ||
| 185 | #define trace_litmus_server_switch_to(sid, job, tid, tjob, cpu) | ||
| 186 | #define trace_litmus_server_switch_away(sid, job, tid, tjob, cpu) | ||
| 187 | #define trace_litmus_server_release(sid, job, release, deadline) | ||
| 188 | #define trace_litmus_server_completion(sid, job) | ||
| 189 | #define trace_litmus_server_block(sid) | ||
| 190 | #define trace_litmus_server_resume(sid) | ||
| 191 | |||
| 183 | #endif | 192 | #endif |
| 184 | 193 | ||
| 185 | 194 | ||
| @@ -252,6 +261,46 @@ feather_callback void do_sched_trace_sys_release(unsigned long id, | |||
| 252 | trace_litmus_sys_release(when); \ | 261 | trace_litmus_sys_release(when); \ |
| 253 | } while (0) | 262 | } while (0) |
| 254 | 263 | ||
| 264 | #define sched_trace_container_param(cid, name) \ | ||
| 265 | do { \ | ||
| 266 | trace_litmus_container_param(cid, name); \ | ||
| 267 | } while (0) | ||
| 268 | |||
| 269 | #define sched_trace_server_param(sid, cid, wcet, period) \ | ||
| 270 | do { \ | ||
| 271 | trace_litmus_server_param(sid, cid, wcet, period); \ | ||
| 272 | } while(0) | ||
| 273 | |||
| 274 | #define sched_trace_server_switch_to(sid, job, tid, tjob, cpu) \ | ||
| 275 | do { \ | ||
| 276 | trace_litmus_server_switch_to(sid, job, tid, tjob, cpu);\ | ||
| 277 | } while(0) | ||
| 278 | |||
| 279 | #define sched_trace_server_switch_away(sid, job, tid, tjob, cpu) \ | ||
| 280 | do { \ | ||
| 281 | trace_litmus_server_switch_away(sid, job, tid, tjob, cpu);\ | ||
| 282 | } while (0) | ||
| 283 | |||
| 284 | #define sched_trace_server_release(sid, job, release, deadline) \ | ||
| 285 | do { \ | ||
| 286 | trace_litmus_server_release(sid, job, release, deadline); \ | ||
| 287 | } while (0) | ||
| 288 | |||
| 289 | #define sched_trace_server_completion(sid, job) \ | ||
| 290 | do { \ | ||
| 291 | trace_litmus_server_completion(sid, job); \ | ||
| 292 | } while (0) | ||
| 293 | |||
| 294 | #define sched_trace_server_resume(sid) \ | ||
| 295 | do { \ | ||
| 296 | trace_litmus_server_resume(sid); \ | ||
| 297 | } while (0) | ||
| 298 | |||
| 299 | #define sched_trace_server_block(sid) \ | ||
| 300 | do { \ | ||
| 301 | trace_litmus_server_block(sid); \ | ||
| 302 | } while (0) | ||
| 303 | |||
| 255 | #define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */ | 304 | #define sched_trace_quantum_boundary() /* NOT IMPLEMENTED */ |
| 256 | 305 | ||
| 257 | #endif /* __KERNEL__ */ | 306 | #endif /* __KERNEL__ */ |
diff --git a/include/trace/events/litmus.h b/include/trace/events/litmus.h index 0fffcee02be0..e1843ad37509 100644 --- a/include/trace/events/litmus.h +++ b/include/trace/events/litmus.h | |||
| @@ -225,6 +225,183 @@ 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 | * Containers | ||
| 230 | */ | ||
| 231 | TRACE_EVENT(litmus_container_param, | ||
| 232 | |||
| 233 | TP_PROTO(int cid, const char *name), | ||
| 234 | |||
| 235 | TP_ARGS(cid, name), | ||
| 236 | |||
| 237 | TP_STRUCT__entry( | ||
| 238 | __field( int, cid ) | ||
| 239 | __array( char, name, TASK_COMM_LEN ) | ||
| 240 | ), | ||
| 241 | |||
| 242 | TP_fast_assign( | ||
| 243 | memcpy(__entry->name, name, TASK_COMM_LEN); | ||
| 244 | __entry->cid = cid; | ||
| 245 | ), | ||
| 246 | |||
| 247 | TP_printk("container, name: %s, id: %d\n", __entry->name, __entry->cid) | ||
| 248 | ); | ||
| 249 | |||
| 250 | TRACE_EVENT(litmus_server_param, | ||
| 251 | |||
| 252 | TP_PROTO(int sid, int cid, unsigned long long wcet, unsigned long long period), | ||
| 253 | |||
| 254 | TP_ARGS(sid, cid, wcet, period), | ||
| 255 | |||
| 256 | TP_STRUCT__entry( | ||
| 257 | __field( int, sid ) | ||
| 258 | __field( int, cid ) | ||
| 259 | __field( unsigned long long, wcet ) | ||
| 260 | __field( unsigned long long, period ) | ||
| 261 | ), | ||
| 262 | |||
| 263 | TP_fast_assign( | ||
| 264 | __entry->cid = cid; | ||
| 265 | __entry->sid = sid; | ||
| 266 | __entry->wcet = wcet; | ||
| 267 | __entry->period = period; | ||
| 268 | ), | ||
| 269 | |||
| 270 | TP_printk("server(%llu, %llu), sid: %llu, cont: %llu\n", | ||
| 271 | __entry->wcet, __entry->period, __entry->sid, __entry->cid) | ||
| 272 | ); | ||
| 273 | |||
| 274 | TRACE_EVENT(litmus_server_switch_to, | ||
| 275 | |||
| 276 | TP_PROTO(int sid, unsigned int job, int tid, unsigned int tjob, int cpu), | ||
| 277 | |||
| 278 | TP_ARGS(sid, job, tid, tjob, cpu), | ||
| 279 | |||
| 280 | TP_STRUCT__entry( | ||
| 281 | __field( int, sid) | ||
| 282 | __field( unsigned int, job) | ||
| 283 | __field( int, tid) | ||
| 284 | __field( unsigned int, tjob) | ||
| 285 | __field( int, cpu) | ||
| 286 | ), | ||
| 287 | |||
| 288 | TP_fast_assign( | ||
| 289 | __entry->sid = sid; | ||
| 290 | __entry->tid = tid; | ||
| 291 | __entry->job = job; | ||
| 292 | __entry->tjob = tjob; | ||
| 293 | __entry->cpu = cpu; | ||
| 294 | ), | ||
| 295 | |||
| 296 | TP_printk("switch_to(server(%d, %u)): (%d, %d) on %d\n", | ||
| 297 | __entry->sid, __entry->job, __entry->tid, __entry->tjob, __entry->cpu) | ||
| 298 | ); | ||
| 299 | |||
| 300 | TRACE_EVENT(litmus_server_switch_away, | ||
| 301 | |||
| 302 | TP_PROTO(int sid, unsigned int job, int tid, unsigned int tjob, int cpu), | ||
| 303 | |||
| 304 | TP_ARGS(sid, job, tid, tjob, cpu), | ||
| 305 | |||
| 306 | TP_STRUCT__entry( | ||
| 307 | __field( int, sid) | ||
| 308 | __field( unsigned int, job) | ||
| 309 | __field( int, tid) | ||
| 310 | __field( unsigned int, tjob) | ||
| 311 | __field( int, cpu) | ||
| 312 | ), | ||
| 313 | |||
| 314 | TP_fast_assign( | ||
| 315 | __entry->sid = sid; | ||
| 316 | __entry->tid = tid; | ||
| 317 | __entry->job = job; | ||
| 318 | __entry->tjob = tjob; | ||
| 319 | __entry->cpu = cpu; | ||
| 320 | ), | ||
| 321 | |||
| 322 | TP_printk("switch_away(server(%d, %u)): (%d, %d) on %d\n", | ||
| 323 | __entry->sid, __entry->job, __entry->tid, __entry->tjob, __entry->cpu) | ||
| 324 | ); | ||
| 325 | |||
| 326 | TRACE_EVENT(litmus_server_release, | ||
| 327 | |||
| 328 | TP_PROTO(int sid, unsigned int job, | ||
| 329 | unsigned long long release, | ||
| 330 | unsigned long long deadline), | ||
| 331 | |||
| 332 | TP_ARGS(sid, job, release, deadline), | ||
| 333 | |||
| 334 | TP_STRUCT__entry( | ||
| 335 | __field( int, sid) | ||
| 336 | __field( unsigned int, job) | ||
| 337 | __field( unsigned long long, release) | ||
| 338 | __field( unsigned long long, deadline) | ||
| 339 | ), | ||
| 340 | |||
| 341 | TP_fast_assign( | ||
| 342 | __entry->sid = sid; | ||
| 343 | __entry->job = job; | ||
| 344 | __entry->release = release; | ||
| 345 | __entry->deadline = deadline; | ||
| 346 | ), | ||
| 347 | |||
| 348 | TP_printk("release(server(%d, %u)), release: %llu, deadline: %llu\n", | ||
| 349 | __entry->sid, __entry->job, __entry->release, __entry->deadline) | ||
| 350 | ); | ||
| 351 | |||
| 352 | TRACE_EVENT(litmus_server_completion, | ||
| 353 | |||
| 354 | TP_PROTO(int sid, int job), | ||
| 355 | |||
| 356 | TP_ARGS(sid, job), | ||
| 357 | |||
| 358 | TP_STRUCT__entry( | ||
| 359 | __field( int, sid) | ||
| 360 | __field( unsigned int, job) | ||
| 361 | ), | ||
| 362 | |||
| 363 | TP_fast_assign( | ||
| 364 | __entry->sid = sid; | ||
| 365 | __entry->job = job; | ||
| 366 | ), | ||
| 367 | |||
| 368 | TP_printk("completion(server(%d, %d))\n", __entry->sid, __entry->job) | ||
| 369 | ); | ||
| 370 | |||
| 371 | TRACE_EVENT(litmus_server_resume, | ||
| 372 | |||
| 373 | TP_PROTO(int sid), | ||
| 374 | |||
| 375 | TP_ARGS(sid), | ||
| 376 | |||
| 377 | TP_STRUCT__entry( | ||
| 378 | __field( int, sid) | ||
| 379 | ), | ||
| 380 | |||
| 381 | TP_fast_assign( | ||
| 382 | __entry->sid = sid; | ||
| 383 | ), | ||
| 384 | |||
| 385 | TP_printk("resume(server(%d))\n", __entry->sid) | ||
| 386 | ); | ||
| 387 | |||
| 388 | TRACE_EVENT(litmus_server_block, | ||
| 389 | |||
| 390 | TP_PROTO(int sid), | ||
| 391 | |||
| 392 | TP_ARGS(sid), | ||
| 393 | |||
| 394 | TP_STRUCT__entry( | ||
| 395 | __field( int, sid) | ||
| 396 | ), | ||
| 397 | |||
| 398 | TP_fast_assign( | ||
| 399 | __entry->sid = sid; | ||
| 400 | ), | ||
| 401 | |||
| 402 | TP_printk("block(server(%d))\n", __entry->sid) | ||
| 403 | ); | ||
| 404 | |||
| 228 | #endif /* _SCHED_TASK_TRACEPOINT_H */ | 405 | #endif /* _SCHED_TASK_TRACEPOINT_H */ |
| 229 | 406 | ||
| 230 | /* Must stay outside the protection */ | 407 | /* Must stay outside the protection */ |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 533c49f48047..4d6f3474e8fa 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | #include <linux/ftrace_event.h> | 19 | #include <linux/ftrace_event.h> |
| 20 | #include <litmus/litmus.h> | ||
| 20 | 21 | ||
| 21 | /* | 22 | /* |
| 22 | * DECLARE_EVENT_CLASS can be used to add a generic function | 23 | * DECLARE_EVENT_CLASS can be used to add a generic function |
| @@ -54,7 +55,7 @@ | |||
| 54 | #define __string(item, src) __dynamic_array(char, item, -1) | 55 | #define __string(item, src) __dynamic_array(char, item, -1) |
| 55 | 56 | ||
| 56 | #undef TP_STRUCT__entry | 57 | #undef TP_STRUCT__entry |
| 57 | #define TP_STRUCT__entry(args...) args | 58 | #define TP_STRUCT__entry(args...) args __field( unsigned long long, __rt_ts ) |
| 58 | 59 | ||
| 59 | #undef DECLARE_EVENT_CLASS | 60 | #undef DECLARE_EVENT_CLASS |
| 60 | #define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) \ | 61 | #define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) \ |
| @@ -507,7 +508,7 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
| 507 | strcpy(__get_str(dst), src); | 508 | strcpy(__get_str(dst), src); |
| 508 | 509 | ||
| 509 | #undef TP_fast_assign | 510 | #undef TP_fast_assign |
| 510 | #define TP_fast_assign(args...) args | 511 | #define TP_fast_assign(args...) args; __entry->__rt_ts = litmus_clock(); |
| 511 | 512 | ||
| 512 | #undef TP_perf_assign | 513 | #undef TP_perf_assign |
| 513 | #define TP_perf_assign(args...) | 514 | #define TP_perf_assign(args...) |
