1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
/*
* 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)
);
|