diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-07-23 03:10:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-07-23 03:10:29 -0400 |
commit | 3a01736e70a7d629140695ba46a901266b4460cc (patch) | |
tree | 49ff8ce1e7c6a267f0ce84b5daddbe6666bc4253 /include | |
parent | 4c21adf26f8fcf86a755b9b9f55c2e9fd241e1fb (diff) | |
parent | 24a461d537f49f9da6533d83100999ea08c6c755 (diff) |
Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/core
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ftrace.h | 5 | ||||
-rw-r--r-- | include/linux/ftrace_event.h | 12 | ||||
-rw-r--r-- | include/trace/ftrace.h | 12 |
3 files changed, 16 insertions, 13 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 41e46330d9be..dcd6a7c3a435 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -1,3 +1,8 @@ | |||
1 | /* | ||
2 | * Ftrace header. For implementation details beyond the random comments | ||
3 | * scattered below, see: Documentation/trace/ftrace-design.txt | ||
4 | */ | ||
5 | |||
1 | #ifndef _LINUX_FTRACE_H | 6 | #ifndef _LINUX_FTRACE_H |
2 | #define _LINUX_FTRACE_H | 7 | #define _LINUX_FTRACE_H |
3 | 8 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 01df7ca4ead7..02b8b24f8f51 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -11,8 +11,6 @@ struct trace_array; | |||
11 | struct tracer; | 11 | struct tracer; |
12 | struct dentry; | 12 | struct dentry; |
13 | 13 | ||
14 | DECLARE_PER_CPU(struct trace_seq, ftrace_event_seq); | ||
15 | |||
16 | struct trace_print_flags { | 14 | struct trace_print_flags { |
17 | unsigned long mask; | 15 | unsigned long mask; |
18 | const char *name; | 16 | const char *name; |
@@ -58,6 +56,9 @@ struct trace_iterator { | |||
58 | struct ring_buffer_iter *buffer_iter[NR_CPUS]; | 56 | struct ring_buffer_iter *buffer_iter[NR_CPUS]; |
59 | unsigned long iter_flags; | 57 | unsigned long iter_flags; |
60 | 58 | ||
59 | /* trace_seq for __print_flags() and __print_symbolic() etc. */ | ||
60 | struct trace_seq tmp_seq; | ||
61 | |||
61 | /* The below is zeroed out in pipe_read */ | 62 | /* The below is zeroed out in pipe_read */ |
62 | struct trace_seq seq; | 63 | struct trace_seq seq; |
63 | struct trace_entry *ent; | 64 | struct trace_entry *ent; |
@@ -152,11 +153,13 @@ extern int ftrace_event_reg(struct ftrace_event_call *event, | |||
152 | enum { | 153 | enum { |
153 | TRACE_EVENT_FL_ENABLED_BIT, | 154 | TRACE_EVENT_FL_ENABLED_BIT, |
154 | TRACE_EVENT_FL_FILTERED_BIT, | 155 | TRACE_EVENT_FL_FILTERED_BIT, |
156 | TRACE_EVENT_FL_RECORDED_CMD_BIT, | ||
155 | }; | 157 | }; |
156 | 158 | ||
157 | enum { | 159 | enum { |
158 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), | 160 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), |
159 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), | 161 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), |
162 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), | ||
160 | }; | 163 | }; |
161 | 164 | ||
162 | struct ftrace_event_call { | 165 | struct ftrace_event_call { |
@@ -174,6 +177,7 @@ struct ftrace_event_call { | |||
174 | * 32 bit flags: | 177 | * 32 bit flags: |
175 | * bit 1: enabled | 178 | * bit 1: enabled |
176 | * bit 2: filter_active | 179 | * bit 2: filter_active |
180 | * bit 3: enabled cmd record | ||
177 | * | 181 | * |
178 | * Changes to flags must hold the event_mutex. | 182 | * Changes to flags must hold the event_mutex. |
179 | * | 183 | * |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 55c1fd1bbc3d..fb783d94fc54 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -145,7 +145,7 @@ | |||
145 | * struct trace_seq *s = &iter->seq; | 145 | * struct trace_seq *s = &iter->seq; |
146 | * struct ftrace_raw_<call> *field; <-- defined in stage 1 | 146 | * struct ftrace_raw_<call> *field; <-- defined in stage 1 |
147 | * struct trace_entry *entry; | 147 | * struct trace_entry *entry; |
148 | * struct trace_seq *p; | 148 | * struct trace_seq *p = &iter->tmp_seq; |
149 | * int ret; | 149 | * int ret; |
150 | * | 150 | * |
151 | * entry = iter->ent; | 151 | * entry = iter->ent; |
@@ -157,12 +157,10 @@ | |||
157 | * | 157 | * |
158 | * field = (typeof(field))entry; | 158 | * field = (typeof(field))entry; |
159 | * | 159 | * |
160 | * p = &get_cpu_var(ftrace_event_seq); | ||
161 | * trace_seq_init(p); | 160 | * trace_seq_init(p); |
162 | * ret = trace_seq_printf(s, "%s: ", <call>); | 161 | * ret = trace_seq_printf(s, "%s: ", <call>); |
163 | * if (ret) | 162 | * if (ret) |
164 | * ret = trace_seq_printf(s, <TP_printk> "\n"); | 163 | * ret = trace_seq_printf(s, <TP_printk> "\n"); |
165 | * put_cpu(); | ||
166 | * if (!ret) | 164 | * if (!ret) |
167 | * return TRACE_TYPE_PARTIAL_LINE; | 165 | * return TRACE_TYPE_PARTIAL_LINE; |
168 | * | 166 | * |
@@ -216,7 +214,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | |||
216 | struct trace_seq *s = &iter->seq; \ | 214 | struct trace_seq *s = &iter->seq; \ |
217 | struct ftrace_raw_##call *field; \ | 215 | struct ftrace_raw_##call *field; \ |
218 | struct trace_entry *entry; \ | 216 | struct trace_entry *entry; \ |
219 | struct trace_seq *p; \ | 217 | struct trace_seq *p = &iter->tmp_seq; \ |
220 | int ret; \ | 218 | int ret; \ |
221 | \ | 219 | \ |
222 | event = container_of(trace_event, struct ftrace_event_call, \ | 220 | event = container_of(trace_event, struct ftrace_event_call, \ |
@@ -231,12 +229,10 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | |||
231 | \ | 229 | \ |
232 | field = (typeof(field))entry; \ | 230 | field = (typeof(field))entry; \ |
233 | \ | 231 | \ |
234 | p = &get_cpu_var(ftrace_event_seq); \ | ||
235 | trace_seq_init(p); \ | 232 | trace_seq_init(p); \ |
236 | ret = trace_seq_printf(s, "%s: ", event->name); \ | 233 | ret = trace_seq_printf(s, "%s: ", event->name); \ |
237 | if (ret) \ | 234 | if (ret) \ |
238 | ret = trace_seq_printf(s, print); \ | 235 | ret = trace_seq_printf(s, print); \ |
239 | put_cpu(); \ | ||
240 | if (!ret) \ | 236 | if (!ret) \ |
241 | return TRACE_TYPE_PARTIAL_LINE; \ | 237 | return TRACE_TYPE_PARTIAL_LINE; \ |
242 | \ | 238 | \ |
@@ -255,7 +251,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | |||
255 | struct trace_seq *s = &iter->seq; \ | 251 | struct trace_seq *s = &iter->seq; \ |
256 | struct ftrace_raw_##template *field; \ | 252 | struct ftrace_raw_##template *field; \ |
257 | struct trace_entry *entry; \ | 253 | struct trace_entry *entry; \ |
258 | struct trace_seq *p; \ | 254 | struct trace_seq *p = &iter->tmp_seq; \ |
259 | int ret; \ | 255 | int ret; \ |
260 | \ | 256 | \ |
261 | entry = iter->ent; \ | 257 | entry = iter->ent; \ |
@@ -267,12 +263,10 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | |||
267 | \ | 263 | \ |
268 | field = (typeof(field))entry; \ | 264 | field = (typeof(field))entry; \ |
269 | \ | 265 | \ |
270 | p = &get_cpu_var(ftrace_event_seq); \ | ||
271 | trace_seq_init(p); \ | 266 | trace_seq_init(p); \ |
272 | ret = trace_seq_printf(s, "%s: ", #call); \ | 267 | ret = trace_seq_printf(s, "%s: ", #call); \ |
273 | if (ret) \ | 268 | if (ret) \ |
274 | ret = trace_seq_printf(s, print); \ | 269 | ret = trace_seq_printf(s, print); \ |
275 | put_cpu(); \ | ||
276 | if (!ret) \ | 270 | if (!ret) \ |
277 | return TRACE_TYPE_PARTIAL_LINE; \ | 271 | return TRACE_TYPE_PARTIAL_LINE; \ |
278 | \ | 272 | \ |