/*
* LITMUS^RT scheduling events
* included from sched.
*/
#include <litmus/litmus.h>
#include <litmus/rt_param.h>
/*
* Tracing task admission
*/
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( lt_t, wcet )
__field( lt_t, period )
__field( lt_t, 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( lt_t, release )
__field( lt_t, 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("released(job(%u, %u), %Lu).\ndeadline(job(%u, %u), %Lu).\n",
__entry->pid, __entry->job, __entry->release,
__entry->pid, __entry->job, __entry->deadline)
);
/*
* 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( lt_t, when )
__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->when = litmus_clock();
__entry->forced = forced;
),
TP_printk("completed(job(%u, %u), %Lu).\n",
__entry->pid, __entry->job, __entry->when)
);
/*
* Tracing jobs resume
*/
TRACE_EVENT(litmus_task_resume,
TP_PROTO(struct task_struct *t),
TP_ARGS(t),
TP_STRUCT__entry(
__field( pid_t, pid )
__field( unsigned int, job )
__field( lt_t, when )
),
TP_fast_assign(
__entry->pid = t ? t->pid : 0;
__entry->job = t ? t->rt_param.job_params.job_no : 0;
__entry->when = litmus_clock();
),
TP_printk("resumed(job(%u, %u), %Lu).\n",
__entry->pid, __entry->job, __entry->when)
);
/*
* 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( lt_t, when )
__field( lt_t, exec_time )
),
TP_fast_assign(
__entry->pid = t ? t->pid : 0;
__entry->job = t ? t->rt_param.job_params.job_no : 0;
__entry->when = litmus_clock();
__entry->exec_time = get_exec_time(t);
),
TP_printk("scheduled(job(%u, %u), %Lu, %Lu).\n",
__entry->pid, __entry->job,
__entry->when, __entry->exec_time)
);