diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-03-10 12:41:38 -0400 |
---|---|---|
committer | Steven Rostedt <srostedt@redhat.com> | 2009-03-10 12:41:38 -0400 |
commit | 30a8fecc2d34f086df34fe2f2b926f080e002600 (patch) | |
tree | a6959a40a6a3065b61ddcf4954861dfd8892a843 | |
parent | 2314c4ae1461c9e8b26cf8b9a851f280bc5769e1 (diff) |
tracing: flip the TP_printk and TP_fast_assign in the TRACE_EVENT macro
Impact: clean up
In trying to stay consistant with the C style format in the TRACE_EVENT
macro, it makes more sense to do the printk after the assigning of
the variables.
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
-rw-r--r-- | include/linux/tracepoint.h | 2 | ||||
-rw-r--r-- | include/trace/irq_event_types.h | 8 | ||||
-rw-r--r-- | include/trace/sched_event_types.h | 102 | ||||
-rw-r--r-- | kernel/trace/trace_events_stage_1.h | 2 | ||||
-rw-r--r-- | kernel/trace/trace_events_stage_2.h | 4 | ||||
-rw-r--r-- | kernel/trace/trace_events_stage_3.h | 2 |
6 files changed, 60 insertions, 60 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 69b56988813d..c7b09452514b 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -157,7 +157,7 @@ static inline void tracepoint_synchronize_unregister(void) | |||
157 | #define TRACE_FORMAT(name, proto, args, fmt) \ | 157 | #define TRACE_FORMAT(name, proto, args, fmt) \ |
158 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 158 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
159 | 159 | ||
160 | #define TRACE_EVENT(name, proto, args, struct, print, assign) \ | 160 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
161 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 161 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
162 | 162 | ||
163 | #endif | 163 | #endif |
diff --git a/include/trace/irq_event_types.h b/include/trace/irq_event_types.h index 43bcb74dd49f..214bb928fe9e 100644 --- a/include/trace/irq_event_types.h +++ b/include/trace/irq_event_types.h | |||
@@ -31,13 +31,13 @@ TRACE_EVENT(irq_handler_exit, | |||
31 | __field( int, ret ) | 31 | __field( int, ret ) |
32 | ), | 32 | ), |
33 | 33 | ||
34 | TP_printk("irq=%d return=%s", | ||
35 | __entry->irq, __entry->ret ? "handled" : "unhandled"), | ||
36 | |||
37 | TP_fast_assign( | 34 | TP_fast_assign( |
38 | __entry->irq = irq; | 35 | __entry->irq = irq; |
39 | __entry->ret = ret; | 36 | __entry->ret = ret; |
40 | ) | 37 | ), |
38 | |||
39 | TP_printk("irq=%d return=%s", | ||
40 | __entry->irq, __entry->ret ? "handled" : "unhandled") | ||
41 | ); | 41 | ); |
42 | 42 | ||
43 | #undef TRACE_SYSTEM | 43 | #undef TRACE_SYSTEM |
diff --git a/include/trace/sched_event_types.h b/include/trace/sched_event_types.h index fb37af672c88..63547dc1125f 100644 --- a/include/trace/sched_event_types.h +++ b/include/trace/sched_event_types.h | |||
@@ -22,12 +22,12 @@ TRACE_EVENT(sched_kthread_stop, | |||
22 | __field( pid_t, pid ) | 22 | __field( pid_t, pid ) |
23 | ), | 23 | ), |
24 | 24 | ||
25 | TP_printk("task %s:%d", __entry->comm, __entry->pid), | ||
26 | |||
27 | TP_fast_assign( | 25 | TP_fast_assign( |
28 | memcpy(__entry->comm, t->comm, TASK_COMM_LEN); | 26 | memcpy(__entry->comm, t->comm, TASK_COMM_LEN); |
29 | __entry->pid = t->pid; | 27 | __entry->pid = t->pid; |
30 | ) | 28 | ), |
29 | |||
30 | TP_printk("task %s:%d", __entry->comm, __entry->pid) | ||
31 | ); | 31 | ); |
32 | 32 | ||
33 | /* | 33 | /* |
@@ -43,11 +43,11 @@ TRACE_EVENT(sched_kthread_stop_ret, | |||
43 | __field( int, ret ) | 43 | __field( int, ret ) |
44 | ), | 44 | ), |
45 | 45 | ||
46 | TP_printk("ret %d", __entry->ret), | ||
47 | |||
48 | TP_fast_assign( | 46 | TP_fast_assign( |
49 | __entry->ret = ret; | 47 | __entry->ret = ret; |
50 | ) | 48 | ), |
49 | |||
50 | TP_printk("ret %d", __entry->ret) | ||
51 | ); | 51 | ); |
52 | 52 | ||
53 | /* | 53 | /* |
@@ -68,14 +68,14 @@ TRACE_EVENT(sched_wait_task, | |||
68 | __field( int, prio ) | 68 | __field( int, prio ) |
69 | ), | 69 | ), |
70 | 70 | ||
71 | TP_printk("task %s:%d [%d]", | ||
72 | __entry->comm, __entry->pid, __entry->prio), | ||
73 | |||
74 | TP_fast_assign( | 71 | TP_fast_assign( |
75 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | 72 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
76 | __entry->pid = p->pid; | 73 | __entry->pid = p->pid; |
77 | __entry->prio = p->prio; | 74 | __entry->prio = p->prio; |
78 | ) | 75 | ), |
76 | |||
77 | TP_printk("task %s:%d [%d]", | ||
78 | __entry->comm, __entry->pid, __entry->prio) | ||
79 | ); | 79 | ); |
80 | 80 | ||
81 | /* | 81 | /* |
@@ -97,16 +97,16 @@ TRACE_EVENT(sched_wakeup, | |||
97 | __field( int, success ) | 97 | __field( int, success ) |
98 | ), | 98 | ), |
99 | 99 | ||
100 | TP_printk("task %s:%d [%d] success=%d", | ||
101 | __entry->comm, __entry->pid, __entry->prio, | ||
102 | __entry->success), | ||
103 | |||
104 | TP_fast_assign( | 100 | TP_fast_assign( |
105 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | 101 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
106 | __entry->pid = p->pid; | 102 | __entry->pid = p->pid; |
107 | __entry->prio = p->prio; | 103 | __entry->prio = p->prio; |
108 | __entry->success = success; | 104 | __entry->success = success; |
109 | ) | 105 | ), |
106 | |||
107 | TP_printk("task %s:%d [%d] success=%d", | ||
108 | __entry->comm, __entry->pid, __entry->prio, | ||
109 | __entry->success) | ||
110 | ); | 110 | ); |
111 | 111 | ||
112 | /* | 112 | /* |
@@ -128,16 +128,16 @@ TRACE_EVENT(sched_wakeup_new, | |||
128 | __field( int, success ) | 128 | __field( int, success ) |
129 | ), | 129 | ), |
130 | 130 | ||
131 | TP_printk("task %s:%d [%d] success=%d", | ||
132 | __entry->comm, __entry->pid, __entry->prio, | ||
133 | __entry->success), | ||
134 | |||
135 | TP_fast_assign( | 131 | TP_fast_assign( |
136 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | 132 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
137 | __entry->pid = p->pid; | 133 | __entry->pid = p->pid; |
138 | __entry->prio = p->prio; | 134 | __entry->prio = p->prio; |
139 | __entry->success = success; | 135 | __entry->success = success; |
140 | ) | 136 | ), |
137 | |||
138 | TP_printk("task %s:%d [%d] success=%d", | ||
139 | __entry->comm, __entry->pid, __entry->prio, | ||
140 | __entry->success) | ||
141 | ); | 141 | ); |
142 | 142 | ||
143 | /* | 143 | /* |
@@ -162,10 +162,6 @@ TRACE_EVENT(sched_switch, | |||
162 | __field( int, next_prio ) | 162 | __field( int, next_prio ) |
163 | ), | 163 | ), |
164 | 164 | ||
165 | TP_printk("task %s:%d [%d] ==> %s:%d [%d]", | ||
166 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, | ||
167 | __entry->next_comm, __entry->next_pid, __entry->next_prio), | ||
168 | |||
169 | TP_fast_assign( | 165 | TP_fast_assign( |
170 | memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); | 166 | memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); |
171 | __entry->prev_pid = prev->pid; | 167 | __entry->prev_pid = prev->pid; |
@@ -173,7 +169,11 @@ TRACE_EVENT(sched_switch, | |||
173 | memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); | 169 | memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); |
174 | __entry->next_pid = next->pid; | 170 | __entry->next_pid = next->pid; |
175 | __entry->next_prio = next->prio; | 171 | __entry->next_prio = next->prio; |
176 | ) | 172 | ), |
173 | |||
174 | TP_printk("task %s:%d [%d] ==> %s:%d [%d]", | ||
175 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, | ||
176 | __entry->next_comm, __entry->next_pid, __entry->next_prio) | ||
177 | ); | 177 | ); |
178 | 178 | ||
179 | /* | 179 | /* |
@@ -193,17 +193,17 @@ TRACE_EVENT(sched_migrate_task, | |||
193 | __field( int, dest_cpu ) | 193 | __field( int, dest_cpu ) |
194 | ), | 194 | ), |
195 | 195 | ||
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( | 196 | TP_fast_assign( |
201 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | 197 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
202 | __entry->pid = p->pid; | 198 | __entry->pid = p->pid; |
203 | __entry->prio = p->prio; | 199 | __entry->prio = p->prio; |
204 | __entry->orig_cpu = orig_cpu; | 200 | __entry->orig_cpu = orig_cpu; |
205 | __entry->dest_cpu = dest_cpu; | 201 | __entry->dest_cpu = dest_cpu; |
206 | ) | 202 | ), |
203 | |||
204 | TP_printk("task %s:%d [%d] from: %d to: %d", | ||
205 | __entry->comm, __entry->pid, __entry->prio, | ||
206 | __entry->orig_cpu, __entry->dest_cpu) | ||
207 | ); | 207 | ); |
208 | 208 | ||
209 | /* | 209 | /* |
@@ -221,14 +221,14 @@ TRACE_EVENT(sched_process_free, | |||
221 | __field( int, prio ) | 221 | __field( int, prio ) |
222 | ), | 222 | ), |
223 | 223 | ||
224 | TP_printk("task %s:%d [%d]", | ||
225 | __entry->comm, __entry->pid, __entry->prio), | ||
226 | |||
227 | TP_fast_assign( | 224 | TP_fast_assign( |
228 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | 225 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
229 | __entry->pid = p->pid; | 226 | __entry->pid = p->pid; |
230 | __entry->prio = p->prio; | 227 | __entry->prio = p->prio; |
231 | ) | 228 | ), |
229 | |||
230 | TP_printk("task %s:%d [%d]", | ||
231 | __entry->comm, __entry->pid, __entry->prio) | ||
232 | ); | 232 | ); |
233 | 233 | ||
234 | /* | 234 | /* |
@@ -246,14 +246,14 @@ TRACE_EVENT(sched_process_exit, | |||
246 | __field( int, prio ) | 246 | __field( int, prio ) |
247 | ), | 247 | ), |
248 | 248 | ||
249 | TP_printk("task %s:%d [%d]", | ||
250 | __entry->comm, __entry->pid, __entry->prio), | ||
251 | |||
252 | TP_fast_assign( | 249 | TP_fast_assign( |
253 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | 250 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
254 | __entry->pid = p->pid; | 251 | __entry->pid = p->pid; |
255 | __entry->prio = p->prio; | 252 | __entry->prio = p->prio; |
256 | ) | 253 | ), |
254 | |||
255 | TP_printk("task %s:%d [%d]", | ||
256 | __entry->comm, __entry->pid, __entry->prio) | ||
257 | ); | 257 | ); |
258 | 258 | ||
259 | /* | 259 | /* |
@@ -271,14 +271,14 @@ TRACE_EVENT(sched_process_wait, | |||
271 | __field( int, prio ) | 271 | __field( int, prio ) |
272 | ), | 272 | ), |
273 | 273 | ||
274 | TP_printk("task %s:%d [%d]", | ||
275 | __entry->comm, __entry->pid, __entry->prio), | ||
276 | |||
277 | TP_fast_assign( | 274 | TP_fast_assign( |
278 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | 275 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); |
279 | __entry->pid = pid_nr(pid); | 276 | __entry->pid = pid_nr(pid); |
280 | __entry->prio = current->prio; | 277 | __entry->prio = current->prio; |
281 | ) | 278 | ), |
279 | |||
280 | TP_printk("task %s:%d [%d]", | ||
281 | __entry->comm, __entry->pid, __entry->prio) | ||
282 | ); | 282 | ); |
283 | 283 | ||
284 | /* | 284 | /* |
@@ -297,16 +297,16 @@ TRACE_EVENT(sched_process_fork, | |||
297 | __field( pid_t, child_pid ) | 297 | __field( pid_t, child_pid ) |
298 | ), | 298 | ), |
299 | 299 | ||
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( | 300 | TP_fast_assign( |
305 | memcpy(__entry->parent_comm, parent->comm, TASK_COMM_LEN); | 301 | memcpy(__entry->parent_comm, parent->comm, TASK_COMM_LEN); |
306 | __entry->parent_pid = parent->pid; | 302 | __entry->parent_pid = parent->pid; |
307 | memcpy(__entry->child_comm, child->comm, TASK_COMM_LEN); | 303 | memcpy(__entry->child_comm, child->comm, TASK_COMM_LEN); |
308 | __entry->child_pid = child->pid; | 304 | __entry->child_pid = child->pid; |
309 | ) | 305 | ), |
306 | |||
307 | TP_printk("parent %s:%d child %s:%d", | ||
308 | __entry->parent_comm, __entry->parent_pid, | ||
309 | __entry->child_comm, __entry->child_pid) | ||
310 | ); | 310 | ); |
311 | 311 | ||
312 | /* | 312 | /* |
@@ -324,14 +324,14 @@ TRACE_EVENT(sched_signal_send, | |||
324 | __field( pid_t, pid ) | 324 | __field( pid_t, pid ) |
325 | ), | 325 | ), |
326 | 326 | ||
327 | TP_printk("sig: %d task %s:%d", | ||
328 | __entry->sig, __entry->comm, __entry->pid), | ||
329 | |||
330 | TP_fast_assign( | 327 | TP_fast_assign( |
331 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | 328 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); |
332 | __entry->pid = p->pid; | 329 | __entry->pid = p->pid; |
333 | __entry->sig = sig; | 330 | __entry->sig = sig; |
334 | ) | 331 | ), |
332 | |||
333 | TP_printk("sig: %d task %s:%d", | ||
334 | __entry->sig, __entry->comm, __entry->pid) | ||
335 | ); | 335 | ); |
336 | 336 | ||
337 | #undef TRACE_SYSTEM | 337 | #undef TRACE_SYSTEM |
diff --git a/kernel/trace/trace_events_stage_1.h b/kernel/trace/trace_events_stage_1.h index 15e9bf965a18..82f68443c556 100644 --- a/kernel/trace/trace_events_stage_1.h +++ b/kernel/trace/trace_events_stage_1.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #define TP_STRUCT__entry(args...) args | 27 | #define TP_STRUCT__entry(args...) args |
28 | 28 | ||
29 | #undef TRACE_EVENT | 29 | #undef TRACE_EVENT |
30 | #define TRACE_EVENT(name, proto, args, tstruct, print, assign) \ | 30 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ |
31 | struct ftrace_raw_##name { \ | 31 | struct ftrace_raw_##name { \ |
32 | struct trace_entry ent; \ | 32 | struct trace_entry ent; \ |
33 | tstruct \ | 33 | tstruct \ |
diff --git a/kernel/trace/trace_events_stage_2.h b/kernel/trace/trace_events_stage_2.h index d91bf4c56661..1ad9f8d2fe45 100644 --- a/kernel/trace/trace_events_stage_2.h +++ b/kernel/trace/trace_events_stage_2.h | |||
@@ -39,7 +39,7 @@ | |||
39 | #define TP_printk(fmt, args...) fmt "\n", args | 39 | #define TP_printk(fmt, args...) fmt "\n", args |
40 | 40 | ||
41 | #undef TRACE_EVENT | 41 | #undef TRACE_EVENT |
42 | #define TRACE_EVENT(call, proto, args, tstruct, print, assign) \ | 42 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ |
43 | enum print_line_t \ | 43 | enum print_line_t \ |
44 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | 44 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ |
45 | { \ | 45 | { \ |
@@ -115,7 +115,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
115 | #define TP_fast_assign(args...) args | 115 | #define TP_fast_assign(args...) args |
116 | 116 | ||
117 | #undef TRACE_EVENT | 117 | #undef TRACE_EVENT |
118 | #define TRACE_EVENT(call, proto, args, tstruct, print, func) \ | 118 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ |
119 | static int \ | 119 | static int \ |
120 | ftrace_format_##call(struct trace_seq *s) \ | 120 | ftrace_format_##call(struct trace_seq *s) \ |
121 | { \ | 121 | { \ |
diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h index 3ba55d4ab073..d6de06b9201a 100644 --- a/kernel/trace/trace_events_stage_3.h +++ b/kernel/trace/trace_events_stage_3.h | |||
@@ -148,7 +148,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
148 | #define __entry entry | 148 | #define __entry entry |
149 | 149 | ||
150 | #undef TRACE_EVENT | 150 | #undef TRACE_EVENT |
151 | #define TRACE_EVENT(call, proto, args, tstruct, print, assign) \ | 151 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ |
152 | \ | 152 | \ |
153 | static struct ftrace_event_call event_##call; \ | 153 | static struct ftrace_event_call event_##call; \ |
154 | \ | 154 | \ |