aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-03-09 23:03:44 -0400
committerSteven Rostedt <srostedt@redhat.com>2009-03-10 00:35:09 -0400
commit12b5fdb8bbb2d2fc31746d7b672c12fd8897aa08 (patch)
treee3fa71cd3b5613d105b1a081cec23b2a51842867 /include/trace
parentda4d03020c2af32f73e8bfbab0a66620d85bb9bb (diff)
tracing: convert the sched trace points to the TRACE_EVENT macros
Impact: enhancement This patch converts the rest of the sched trace points to use the new more powerful TRACE_EVENT macro. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/sched_event_types.h322
1 files changed, 246 insertions, 76 deletions
diff --git a/include/trace/sched_event_types.h b/include/trace/sched_event_types.h
index aa77fb754038..0bbbf410e01f 100644
--- a/include/trace/sched_event_types.h
+++ b/include/trace/sched_event_types.h
@@ -8,59 +8,137 @@
8#undef TRACE_SYSTEM 8#undef TRACE_SYSTEM
9#define TRACE_SYSTEM sched 9#define TRACE_SYSTEM sched
10 10
11TRACE_EVENT_FORMAT(sched_kthread_stop, 11/*
12 * Tracepoint for calling kthread_stop, performed to end a kthread:
13 */
14TRACE_EVENT(sched_kthread_stop,
15
12 TP_PROTO(struct task_struct *t), 16 TP_PROTO(struct task_struct *t),
17
13 TP_ARGS(t), 18 TP_ARGS(t),
14 TP_FMT("task %s:%d", t->comm, t->pid), 19
15 TRACE_STRUCT( 20 TP_STRUCT__entry(
16 TRACE_FIELD(pid_t, pid, t->pid) 21 __array( char, comm, TASK_COMM_LEN )
22 __field( pid_t, pid )
17 ), 23 ),
18 TP_RAW_FMT("task %d")
19 );
20 24
21TRACE_EVENT_FORMAT(sched_kthread_stop_ret, 25 TP_printk("task %s:%d", __entry->comm, __entry->pid),
26
27 TP_fast_assign(
28 memcpy(__entry->comm, t->comm, TASK_COMM_LEN);
29 __entry->pid = t->pid;
30 )
31);
32
33/*
34 * Tracepoint for the return value of the kthread stopping:
35 */
36TRACE_EVENT(sched_kthread_stop_ret,
37
22 TP_PROTO(int ret), 38 TP_PROTO(int ret),
39
23 TP_ARGS(ret), 40 TP_ARGS(ret),
24 TP_FMT("ret=%d", ret), 41
25 TRACE_STRUCT( 42 TP_STRUCT__entry(
26 TRACE_FIELD(int, ret, ret) 43 __field( int, ret )
27 ), 44 ),
28 TP_RAW_FMT("ret=%d")
29 );
30 45
31TRACE_EVENT_FORMAT(sched_wait_task, 46 TP_printk("ret %d", __entry->ret),
47
48 TP_fast_assign(
49 __entry->ret = ret;
50 )
51);
52
53/*
54 * Tracepoint for waiting on task to unschedule:
55 *
56 * (NOTE: the 'rq' argument is not used by generic trace events,
57 * but used by the latency tracer plugin. )
58 */
59TRACE_EVENT(sched_wait_task,
60
32 TP_PROTO(struct rq *rq, struct task_struct *p), 61 TP_PROTO(struct rq *rq, struct task_struct *p),
62
33 TP_ARGS(rq, p), 63 TP_ARGS(rq, p),
34 TP_FMT("task %s:%d", p->comm, p->pid), 64
35 TRACE_STRUCT( 65 TP_STRUCT__entry(
36 TRACE_FIELD(pid_t, pid, p->pid) 66 __array( char, comm, TASK_COMM_LEN )
67 __field( pid_t, pid )
68 __field( int, prio )
37 ), 69 ),
38 TP_RAW_FMT("task %d")
39 );
40 70
41TRACE_EVENT_FORMAT(sched_wakeup, 71 TP_printk("task %s:%d [%d]",
72 __entry->comm, __entry->pid, __entry->prio),
73
74 TP_fast_assign(
75 memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
76 __entry->pid = p->pid;
77 __entry->prio = p->prio;
78 )
79);
80
81/*
82 * Tracepoint for waking up a task:
83 *
84 * (NOTE: the 'rq' argument is not used by generic trace events,
85 * but used by the latency tracer plugin. )
86 */
87TRACE_EVENT(sched_wakeup,
88
42 TP_PROTO(struct rq *rq, struct task_struct *p, int success), 89 TP_PROTO(struct rq *rq, struct task_struct *p, int success),
90
43 TP_ARGS(rq, p, success), 91 TP_ARGS(rq, p, success),
44 TP_FMT("task %s:%d %s", 92
45 p->comm, p->pid, success ? "succeeded" : "failed"), 93 TP_STRUCT__entry(
46 TRACE_STRUCT( 94 __array( char, comm, TASK_COMM_LEN )
47 TRACE_FIELD(pid_t, pid, p->pid) 95 __field( pid_t, pid )
48 TRACE_FIELD(int, success, success) 96 __field( int, prio )
97 __field( int, success )
49 ), 98 ),
50 TP_RAW_FMT("task %d success=%d")
51 );
52 99
53TRACE_EVENT_FORMAT(sched_wakeup_new, 100 TP_printk("task %s:%d [%d] success=%d",
101 __entry->comm, __entry->pid, __entry->prio,
102 __entry->success),
103
104 TP_fast_assign(
105 memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
106 __entry->pid = p->pid;
107 __entry->prio = p->prio;
108 __entry->success = success;
109 )
110);
111
112/*
113 * Tracepoint for waking up a new task:
114 *
115 * (NOTE: the 'rq' argument is not used by generic trace events,
116 * but used by the latency tracer plugin. )
117 */
118TRACE_EVENT(sched_wakeup_new,
119
54 TP_PROTO(struct rq *rq, struct task_struct *p, int success), 120 TP_PROTO(struct rq *rq, struct task_struct *p, int success),
121
55 TP_ARGS(rq, p, success), 122 TP_ARGS(rq, p, success),
56 TP_FMT("task %s:%d", 123
57 p->comm, p->pid, success ? "succeeded" : "failed"), 124 TP_STRUCT__entry(
58 TRACE_STRUCT( 125 __array( char, comm, TASK_COMM_LEN )
59 TRACE_FIELD(pid_t, pid, p->pid) 126 __field( pid_t, pid )
60 TRACE_FIELD(int, success, success) 127 __field( int, prio )
128 __field( int, success )
61 ), 129 ),
62 TP_RAW_FMT("task %d success=%d") 130
63 ); 131 TP_printk("task %s:%d [%d] success=%d",
132 __entry->comm, __entry->pid, __entry->prio,
133 __entry->success),
134
135 TP_fast_assign(
136 memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
137 __entry->pid = p->pid;
138 __entry->prio = p->prio;
139 __entry->success = success;
140 )
141);
64 142
65/* 143/*
66 * Tracepoint for task switches, performed by the scheduler: 144 * Tracepoint for task switches, performed by the scheduler:
@@ -98,70 +176,162 @@ TRACE_EVENT(sched_switch,
98 ) 176 )
99); 177);
100 178
101TRACE_EVENT_FORMAT(sched_migrate_task, 179/*
180 * Tracepoint for a task being migrated:
181 */
182TRACE_EVENT(sched_migrate_task,
183
102 TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu), 184 TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu),
185
103 TP_ARGS(p, orig_cpu, dest_cpu), 186 TP_ARGS(p, orig_cpu, dest_cpu),
104 TP_FMT("task %s:%d from: %d to: %d", 187
105 p->comm, p->pid, orig_cpu, dest_cpu), 188 TP_STRUCT__entry(
106 TRACE_STRUCT( 189 __array( char, comm, TASK_COMM_LEN )
107 TRACE_FIELD(pid_t, pid, p->pid) 190 __field( pid_t, pid )
108 TRACE_FIELD(int, orig_cpu, orig_cpu) 191 __field( int, prio )
109 TRACE_FIELD(int, dest_cpu, dest_cpu) 192 __field( int, orig_cpu )
193 __field( int, dest_cpu )
110 ), 194 ),
111 TP_RAW_FMT("task %d from: %d to: %d")
112 );
113 195
114TRACE_EVENT_FORMAT(sched_process_free, 196 TP_printk("task %s:%d [%d] from: %d to: %d",
197 __entry->comm, __entry->pid, __entry->prio,
198 __entry->orig_cpu, __entry->dest_cpu),
199
200 TP_fast_assign(
201 memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
202 __entry->pid = p->pid;
203 __entry->prio = p->prio;
204 __entry->orig_cpu = orig_cpu;
205 __entry->dest_cpu = dest_cpu;
206 )
207);
208
209/*
210 * Tracepoint for freeing a task:
211 */
212TRACE_EVENT(sched_process_free,
213
115 TP_PROTO(struct task_struct *p), 214 TP_PROTO(struct task_struct *p),
215
116 TP_ARGS(p), 216 TP_ARGS(p),
117 TP_FMT("task %s:%d", p->comm, p->pid), 217
118 TRACE_STRUCT( 218 TP_STRUCT__entry(
119 TRACE_FIELD(pid_t, pid, p->pid) 219 __array( char, comm, TASK_COMM_LEN )
220 __field( pid_t, pid )
221 __field( int, prio )
120 ), 222 ),
121 TP_RAW_FMT("task %d")
122 );
123 223
124TRACE_EVENT_FORMAT(sched_process_exit, 224 TP_printk("task %s:%d [%d]",
225 __entry->comm, __entry->pid, __entry->prio),
226
227 TP_fast_assign(
228 memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
229 __entry->pid = p->pid;
230 __entry->prio = p->prio;
231 )
232);
233
234/*
235 * Tracepoint for a task exiting:
236 */
237TRACE_EVENT(sched_process_exit,
238
125 TP_PROTO(struct task_struct *p), 239 TP_PROTO(struct task_struct *p),
240
126 TP_ARGS(p), 241 TP_ARGS(p),
127 TP_FMT("task %s:%d", p->comm, p->pid), 242
128 TRACE_STRUCT( 243 TP_STRUCT__entry(
129 TRACE_FIELD(pid_t, pid, p->pid) 244 __array( char, comm, TASK_COMM_LEN )
245 __field( pid_t, pid )
246 __field( int, prio )
130 ), 247 ),
131 TP_RAW_FMT("task %d")
132 );
133 248
134TRACE_EVENT_FORMAT(sched_process_wait, 249 TP_printk("task %s:%d [%d]",
250 __entry->comm, __entry->pid, __entry->prio),
251
252 TP_fast_assign(
253 memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
254 __entry->pid = p->pid;
255 __entry->prio = p->prio;
256 )
257);
258
259/*
260 * Tracepoint for a waiting task:
261 */
262TRACE_EVENT(sched_process_wait,
263
135 TP_PROTO(struct pid *pid), 264 TP_PROTO(struct pid *pid),
265
136 TP_ARGS(pid), 266 TP_ARGS(pid),
137 TP_FMT("pid %d", pid_nr(pid)), 267
138 TRACE_STRUCT( 268 TP_STRUCT__entry(
139 TRACE_FIELD(pid_t, pid, pid_nr(pid)) 269 __array( char, comm, TASK_COMM_LEN )
270 __field( pid_t, pid )
271 __field( int, prio )
140 ), 272 ),
141 TP_RAW_FMT("task %d")
142 );
143 273
144TRACE_EVENT_FORMAT(sched_process_fork, 274 TP_printk("task %s:%d [%d]",
275 __entry->comm, __entry->pid, __entry->prio),
276
277 TP_fast_assign(
278 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
279 __entry->pid = pid_nr(pid);
280 __entry->prio = current->prio;
281 )
282);
283
284/*
285 * Tracepoint for do_fork:
286 */
287TRACE_EVENT(sched_process_fork,
288
145 TP_PROTO(struct task_struct *parent, struct task_struct *child), 289 TP_PROTO(struct task_struct *parent, struct task_struct *child),
290
146 TP_ARGS(parent, child), 291 TP_ARGS(parent, child),
147 TP_FMT("parent %s:%d child %s:%d", 292
148 parent->comm, parent->pid, child->comm, child->pid), 293 TP_STRUCT__entry(
149 TRACE_STRUCT( 294 __array( char, parent_comm, TASK_COMM_LEN )
150 TRACE_FIELD(pid_t, parent, parent->pid) 295 __field( pid_t, parent_pid )
151 TRACE_FIELD(pid_t, child, child->pid) 296 __array( char, child_comm, TASK_COMM_LEN )
297 __field( pid_t, child_pid )
152 ), 298 ),
153 TP_RAW_FMT("parent %d child %d")
154 );
155 299
156TRACE_EVENT_FORMAT(sched_signal_send, 300 TP_printk("parent %s:%d child %s:%d",
301 __entry->parent_comm, __entry->parent_pid,
302 __entry->child_comm, __entry->child_pid),
303
304 TP_fast_assign(
305 memcpy(__entry->parent_comm, parent->comm, TASK_COMM_LEN);
306 __entry->parent_pid = parent->pid;
307 memcpy(__entry->child_comm, child->comm, TASK_COMM_LEN);
308 __entry->child_pid = child->pid;
309 )
310);
311
312/*
313 * Tracepoint for sending a signal:
314 */
315TRACE_EVENT(sched_signal_send,
316
157 TP_PROTO(int sig, struct task_struct *p), 317 TP_PROTO(int sig, struct task_struct *p),
318
158 TP_ARGS(sig, p), 319 TP_ARGS(sig, p),
159 TP_FMT("sig: %d task %s:%d", sig, p->comm, p->pid), 320
160 TRACE_STRUCT( 321 TP_STRUCT__entry(
161 TRACE_FIELD(int, sig, sig) 322 __field( int, sig )
162 TRACE_FIELD(pid_t, pid, p->pid) 323 __array( char, comm, TASK_COMM_LEN )
324 __field( pid_t, pid )
163 ), 325 ),
164 TP_RAW_FMT("sig: %d task %d") 326
165 ); 327 TP_printk("sig: %d task %s:%d",
328 __entry->sig, __entry->comm, __entry->pid),
329
330 TP_fast_assign(
331 memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
332 __entry->pid = p->pid;
333 __entry->sig = sig;
334 )
335);
166 336
167#undef TRACE_SYSTEM 337#undef TRACE_SYSTEM