From bb35f3fc684667598d7ae39fd2d49a16f77beb39 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Thu, 3 May 2012 16:50:32 -0400 Subject: Added color schedule --- include/trace/events/litmus.h | 425 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 425 insertions(+) create mode 100644 include/trace/events/litmus.h (limited to 'include/trace/events/litmus.h') 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 @@ +/* + * LITMUS^RT kernel style scheduling tracepoints + */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM litmus + +#if !defined(_SCHED_TASK_TRACEPOINT_H) || defined(TRACE_HEADER_MULTI_READ) +#define _SCHED_TASK_TRACEPOINT_H + +#include + +#include +#include + +TRACE_EVENT(litmus_task_param, + + TP_PROTO(struct task_struct *t), + + TP_ARGS(t), + + TP_STRUCT__entry( + __field( pid_t, pid ) + __field( unsigned int, job ) + __field( unsigned long long, wcet ) + __field( unsigned long long, period ) + __field( unsigned long long, phase ) + __field( int, partition ) + ), + + TP_fast_assign( + __entry->pid = t ? t->pid : 0; + __entry->job = t ? t->rt_param.job_params.job_no : 0; + __entry->wcet = get_exec_cost(t); + __entry->period = get_rt_period(t); + __entry->phase = get_rt_phase(t); + __entry->partition = get_partition(t); + ), + + TP_printk("period(%d, %Lu).\nwcet(%d, %Lu).\n", + __entry->pid, __entry->period, + __entry->pid, __entry->wcet) +); + +/* + * Tracing jobs release + */ +TRACE_EVENT(litmus_task_release, + + TP_PROTO(struct task_struct *t), + + TP_ARGS(t), + + TP_STRUCT__entry( + __field( pid_t, pid ) + __field( unsigned int, job ) + __field( unsigned long long, release ) + __field( unsigned long long, deadline ) + ), + + TP_fast_assign( + __entry->pid = t ? t->pid : 0; + __entry->job = t ? t->rt_param.job_params.job_no : 0; + __entry->release = get_release(t); + __entry->deadline = get_deadline(t); + ), + + TP_printk("release(job(%u, %u)): %Lu\ndeadline(job(%u, %u)): %Lu\n", + __entry->pid, __entry->job, __entry->release, + __entry->pid, __entry->job, __entry->deadline) +); + +/* + * Tracepoint for switching to new task + */ +TRACE_EVENT(litmus_switch_to, + + TP_PROTO(struct task_struct *t), + + TP_ARGS(t), + + TP_STRUCT__entry( + __field( pid_t, pid ) + __field( unsigned int, job ) + __field( unsigned long long, exec_time ) + ), + + TP_fast_assign( + __entry->pid = t->pid;//is_realtime(t) ? t->pid : 0; + __entry->job = t->rt_param.job_params.job_no;//is_realtime(t) ? t->rt_param.job_params.job_no : 0; + __entry->exec_time = get_exec_time(t); + ), + + TP_printk("switch_to(job(%u, %u)): (exec: %Lu)\n", + __entry->pid, __entry->job, + __entry->exec_time) +); + +/* + * Tracepoint for switching away previous task + */ +TRACE_EVENT(litmus_switch_away, + + TP_PROTO(struct task_struct *t), + + TP_ARGS(t), + + TP_STRUCT__entry( + __field( pid_t, pid ) + __field( unsigned int, job ) + __field( unsigned long long, exec_time ) + ), + + TP_fast_assign( + __entry->pid = t->pid;//is_realtime(t) ? t->pid : 0; + __entry->job = t->rt_param.job_params.job_no;//is_realtime(t) ? t->rt_param.job_params.job_no : 0; + __entry->exec_time = get_exec_time(t); + ), + + TP_printk("switch_away(job(%u, %u)): (exec: %Lu)\n", + __entry->pid, __entry->job, + __entry->exec_time) +); + +/* + * Tracing jobs completion + */ +TRACE_EVENT(litmus_task_completion, + + TP_PROTO(struct task_struct *t, unsigned long forced), + + TP_ARGS(t, forced), + + TP_STRUCT__entry( + __field( pid_t, pid ) + __field( unsigned int, job ) + __field( unsigned long, forced ) + ), + + TP_fast_assign( + __entry->pid = t ? t->pid : 0; + __entry->job = t ? t->rt_param.job_params.job_no : 0; + __entry->forced = forced; + ), + + TP_printk("completed(job(%u, %u)): (forced: %lu)\n", + __entry->pid, __entry->job, + __entry->forced) +); + +/* + * Trace blocking tasks. + */ +TRACE_EVENT(litmus_task_block, + + TP_PROTO(struct task_struct *t, int lid), + + TP_ARGS(t, lid), + + TP_STRUCT__entry( + __field( pid_t, pid ) + __field( int, lid ) + ), + + TP_fast_assign( + __entry->pid = t ? t->pid : 0; + __entry->lid = lid; + ), + + TP_printk("(%u) blocks on %d\n", __entry->pid, + __entry->lid) +); + +/* + * Lock events + */ +TRACE_EVENT(litmus_resource_acquire, + + TP_PROTO(struct task_struct *t, int lid), + + TP_ARGS(t, lid), + + TP_STRUCT__entry( + __field( pid_t, pid ) + __field( int, lid ) + ), + + TP_fast_assign( + __entry->pid = t ? t->pid : 0; + __entry->lid = lid; + ), + + TP_printk("(%u) acquires %d\n", __entry->pid, + __entry->lid) +); + +TRACE_EVENT(litmus_resource_release, + + TP_PROTO(struct task_struct *t, int lid), + + TP_ARGS(t, lid), + + TP_STRUCT__entry( + __field( pid_t, pid ) + __field( int, lid ) + ), + + TP_fast_assign( + __entry->pid = t ? t->pid : 0; + __entry->lid = lid; + ), + + TP_printk("(%u) releases %d\n", __entry->pid, + __entry->lid) +); + +TRACE_EVENT(litmus_priority_donate, + + TP_PROTO(struct task_struct *t, struct task_struct *donor, int lid), + + TP_ARGS(t, donor, lid), + + TP_STRUCT__entry( + __field( pid_t, t_pid ) + __field( pid_t, d_pid ) + __field( unsigned long long, prio) + __field( int, lid ) + ), + + TP_fast_assign( + __entry->t_pid = t ? t->pid : 0; + __entry->d_pid = donor ? donor->pid : 0; + __entry->prio = get_deadline(donor); + __entry->lid = lid; + ), + + TP_printk("(%u) inherits %llu from (%u) on %d\n", __entry->t_pid, + __entry->d_pid, __entry->prio, __entry->lid) +); + +/* + * Tracing jobs resume + */ +TRACE_EVENT(litmus_task_resume, + + TP_PROTO(struct task_struct *t, int lid), + + TP_ARGS(t, lid), + + TP_STRUCT__entry( + __field( pid_t, pid ) + __field( int, lid ) + __field( unsigned int, job ) + ), + + TP_fast_assign( + __entry->pid = t ? t->pid : 0; + __entry->job = t ? t->rt_param.job_params.job_no : 0; + __entry->lid = lid; + ), + + TP_printk("resume(job(%u, %u)) on %d\n", + __entry->pid, __entry->job, + __entry->lid) +); + +/* + * Trace synchronous release + */ +TRACE_EVENT(litmus_sys_release, + + TP_PROTO(unsigned long long *start), + + TP_ARGS(start), + + TP_STRUCT__entry( + __field( unsigned long long, rel ) + ), + + TP_fast_assign( + __entry->rel = *start; + ), + + TP_printk("SynRelease(%Lu)\n", __entry->rel) +); + +/* + * Containers + */ +TRACE_EVENT(litmus_container_param, + + TP_PROTO(int cid, const char *name), + + TP_ARGS(cid, name), + + TP_STRUCT__entry( + __field( int, cid ) + __array( char, name, TASK_COMM_LEN ) + ), + + TP_fast_assign( + memcpy(__entry->name, name, TASK_COMM_LEN); + __entry->cid = cid; + ), + + TP_printk("container, name: %s, id: %d\n", __entry->name, __entry->cid) +); + +TRACE_EVENT(litmus_server_param, + + TP_PROTO(int sid, int cid, unsigned long long wcet, unsigned long long period), + + TP_ARGS(sid, cid, wcet, period), + + TP_STRUCT__entry( + __field( int, sid ) + __field( int, cid ) + __field( unsigned long long, wcet ) + __field( unsigned long long, period ) + ), + + TP_fast_assign( + __entry->cid = cid; + __entry->sid = sid; + __entry->wcet = wcet; + __entry->period = period; + ), + + TP_printk("server(%llu, %llu), sid: %llu, cont: %llu\n", + __entry->wcet, __entry->period, __entry->sid, __entry->cid) +); + +TRACE_EVENT(litmus_server_switch_to, + + TP_PROTO(int sid, unsigned int job, int tid, unsigned int tjob), + + TP_ARGS(sid, job, tid, tjob), + + TP_STRUCT__entry( + __field( int, sid) + __field( unsigned int, job) + __field( int, tid) + __field( unsigned int, tjob) + ), + + TP_fast_assign( + __entry->sid = sid; + __entry->tid = tid; + __entry->job = job; + __entry->tjob = tjob; + ), + + TP_printk("switch_to(server(%d, %u)): (%d, %d)\n", __entry->sid, __entry->job, __entry->tid, __entry->tjob) +); + +TRACE_EVENT(litmus_server_switch_away, + + TP_PROTO(int sid, unsigned int job, int tid, unsigned int tjob), + + TP_ARGS(sid, job, tid, tjob), + + TP_STRUCT__entry( + __field( int, sid) + __field( unsigned int, job) + __field( int, tid) + __field( unsigned int, tjob) + ), + + TP_fast_assign( + __entry->sid = sid; + __entry->tid = tid; + __entry->job = job; + __entry->tjob = tjob; + ), + + TP_printk("switch_away(server(%d, %u)): (%d, %d)\n", __entry->sid, __entry->job, __entry->tid, __entry->tjob) +); + +TRACE_EVENT(litmus_server_release, + + TP_PROTO(int sid, unsigned int job, + unsigned long long release, + unsigned long long deadline), + + TP_ARGS(sid, job, release, deadline), + + TP_STRUCT__entry( + __field( int, sid) + __field( unsigned int, job) + __field( unsigned long long, release) + __field( unsigned long long, deadline) + ), + + TP_fast_assign( + __entry->sid = sid; + __entry->job = job; + __entry->release = release; + __entry->deadline = deadline; + ), + + TP_printk("release(server(%d, %u)), release: %llu, deadline: %llu\n", __entry->sid, __entry->job, __entry->release, __entry->deadline) +); + +TRACE_EVENT(litmus_server_completion, + + TP_PROTO(int sid, int job), + + TP_ARGS(sid, job), + + TP_STRUCT__entry( + __field( int, sid) + __field( unsigned int, job) + ), + + TP_fast_assign( + __entry->sid = sid; + __entry->job = job; + ), + + TP_printk("completion(server(%d, %d))\n", __entry->sid, __entry->job) +); + +#endif /* _SCHED_TASK_TRACEPOINT_H */ + +/* Must stay outside the protection */ +#include -- cgit v1.2.2