diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-06 12:30:52 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-06 12:30:52 -0400 |
| commit | 4aed2fd8e3181fea7c09ba79cf64e7e3f4413bf9 (patch) | |
| tree | 1f69733e5daab4915a76a41de0e4d1dc61e12cfb /include/trace/ftrace.h | |
| parent | 3a3527b6461b1298cc53ce72f336346739297ac8 (diff) | |
| parent | fc9ea5a1e53ee54f681e226d735008e2a6f8f470 (diff) | |
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (162 commits)
tracing/kprobes: unregister_trace_probe needs to be called under mutex
perf: expose event__process function
perf events: Fix mmap offset determination
perf, powerpc: fsl_emb: Restore setting perf_sample_data.period
perf, powerpc: Convert the FSL driver to use local64_t
perf tools: Don't keep unreferenced maps when unmaps are detected
perf session: Invalidate last_match when removing threads from rb_tree
perf session: Free the ref_reloc_sym memory at the right place
x86,mmiotrace: Add support for tracing STOS instruction
perf, sched migration: Librarize task states and event headers helpers
perf, sched migration: Librarize the GUI class
perf, sched migration: Make the GUI class client agnostic
perf, sched migration: Make it vertically scrollable
perf, sched migration: Parameterize cpu height and spacing
perf, sched migration: Fix key bindings
perf, sched migration: Ignore unhandled task states
perf, sched migration: Handle ignored migrate out events
perf: New migration tool overview
tracing: Drop cpparg() macro
perf: Use tracepoint_synchronize_unregister() to flush any pending tracepoint call
...
Fix up trivial conflicts in Makefile and drivers/cpufreq/cpufreq.c
Diffstat (limited to 'include/trace/ftrace.h')
| -rw-r--r-- | include/trace/ftrace.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 5a64905d7278..a9377c0083ad 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
| @@ -75,15 +75,12 @@ | |||
| 75 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 75 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
| 76 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | 76 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) |
| 77 | 77 | ||
| 78 | #undef __cpparg | ||
| 79 | #define __cpparg(arg...) arg | ||
| 80 | |||
| 81 | /* Callbacks are meaningless to ftrace. */ | 78 | /* Callbacks are meaningless to ftrace. */ |
| 82 | #undef TRACE_EVENT_FN | 79 | #undef TRACE_EVENT_FN |
| 83 | #define TRACE_EVENT_FN(name, proto, args, tstruct, \ | 80 | #define TRACE_EVENT_FN(name, proto, args, tstruct, \ |
| 84 | assign, print, reg, unreg) \ | 81 | assign, print, reg, unreg) \ |
| 85 | TRACE_EVENT(name, __cpparg(proto), __cpparg(args), \ | 82 | TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \ |
| 86 | __cpparg(tstruct), __cpparg(assign), __cpparg(print)) \ | 83 | PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \ |
| 87 | 84 | ||
| 88 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 85 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 89 | 86 | ||
| @@ -145,7 +142,7 @@ | |||
| 145 | * struct trace_seq *s = &iter->seq; | 142 | * struct trace_seq *s = &iter->seq; |
| 146 | * struct ftrace_raw_<call> *field; <-- defined in stage 1 | 143 | * struct ftrace_raw_<call> *field; <-- defined in stage 1 |
| 147 | * struct trace_entry *entry; | 144 | * struct trace_entry *entry; |
| 148 | * struct trace_seq *p; | 145 | * struct trace_seq *p = &iter->tmp_seq; |
| 149 | * int ret; | 146 | * int ret; |
| 150 | * | 147 | * |
| 151 | * entry = iter->ent; | 148 | * entry = iter->ent; |
| @@ -157,12 +154,10 @@ | |||
| 157 | * | 154 | * |
| 158 | * field = (typeof(field))entry; | 155 | * field = (typeof(field))entry; |
| 159 | * | 156 | * |
| 160 | * p = &get_cpu_var(ftrace_event_seq); | ||
| 161 | * trace_seq_init(p); | 157 | * trace_seq_init(p); |
| 162 | * ret = trace_seq_printf(s, "%s: ", <call>); | 158 | * ret = trace_seq_printf(s, "%s: ", <call>); |
| 163 | * if (ret) | 159 | * if (ret) |
| 164 | * ret = trace_seq_printf(s, <TP_printk> "\n"); | 160 | * ret = trace_seq_printf(s, <TP_printk> "\n"); |
| 165 | * put_cpu(); | ||
| 166 | * if (!ret) | 161 | * if (!ret) |
| 167 | * return TRACE_TYPE_PARTIAL_LINE; | 162 | * return TRACE_TYPE_PARTIAL_LINE; |
| 168 | * | 163 | * |
| @@ -216,7 +211,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | |||
| 216 | struct trace_seq *s = &iter->seq; \ | 211 | struct trace_seq *s = &iter->seq; \ |
| 217 | struct ftrace_raw_##call *field; \ | 212 | struct ftrace_raw_##call *field; \ |
| 218 | struct trace_entry *entry; \ | 213 | struct trace_entry *entry; \ |
| 219 | struct trace_seq *p; \ | 214 | struct trace_seq *p = &iter->tmp_seq; \ |
| 220 | int ret; \ | 215 | int ret; \ |
| 221 | \ | 216 | \ |
| 222 | event = container_of(trace_event, struct ftrace_event_call, \ | 217 | event = container_of(trace_event, struct ftrace_event_call, \ |
| @@ -231,12 +226,10 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | |||
| 231 | \ | 226 | \ |
| 232 | field = (typeof(field))entry; \ | 227 | field = (typeof(field))entry; \ |
| 233 | \ | 228 | \ |
| 234 | p = &get_cpu_var(ftrace_event_seq); \ | ||
| 235 | trace_seq_init(p); \ | 229 | trace_seq_init(p); \ |
| 236 | ret = trace_seq_printf(s, "%s: ", event->name); \ | 230 | ret = trace_seq_printf(s, "%s: ", event->name); \ |
| 237 | if (ret) \ | 231 | if (ret) \ |
| 238 | ret = trace_seq_printf(s, print); \ | 232 | ret = trace_seq_printf(s, print); \ |
| 239 | put_cpu(); \ | ||
| 240 | if (!ret) \ | 233 | if (!ret) \ |
| 241 | return TRACE_TYPE_PARTIAL_LINE; \ | 234 | return TRACE_TYPE_PARTIAL_LINE; \ |
| 242 | \ | 235 | \ |
| @@ -255,7 +248,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | |||
| 255 | struct trace_seq *s = &iter->seq; \ | 248 | struct trace_seq *s = &iter->seq; \ |
| 256 | struct ftrace_raw_##template *field; \ | 249 | struct ftrace_raw_##template *field; \ |
| 257 | struct trace_entry *entry; \ | 250 | struct trace_entry *entry; \ |
| 258 | struct trace_seq *p; \ | 251 | struct trace_seq *p = &iter->tmp_seq; \ |
| 259 | int ret; \ | 252 | int ret; \ |
| 260 | \ | 253 | \ |
| 261 | entry = iter->ent; \ | 254 | entry = iter->ent; \ |
| @@ -267,12 +260,10 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | |||
| 267 | \ | 260 | \ |
| 268 | field = (typeof(field))entry; \ | 261 | field = (typeof(field))entry; \ |
| 269 | \ | 262 | \ |
| 270 | p = &get_cpu_var(ftrace_event_seq); \ | ||
| 271 | trace_seq_init(p); \ | 263 | trace_seq_init(p); \ |
| 272 | ret = trace_seq_printf(s, "%s: ", #call); \ | 264 | ret = trace_seq_printf(s, "%s: ", #call); \ |
| 273 | if (ret) \ | 265 | if (ret) \ |
| 274 | ret = trace_seq_printf(s, print); \ | 266 | ret = trace_seq_printf(s, print); \ |
| 275 | put_cpu(); \ | ||
| 276 | if (!ret) \ | 267 | if (!ret) \ |
| 277 | return TRACE_TYPE_PARTIAL_LINE; \ | 268 | return TRACE_TYPE_PARTIAL_LINE; \ |
| 278 | \ | 269 | \ |
| @@ -439,6 +430,7 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
| 439 | * .fields = LIST_HEAD_INIT(event_class_##call.fields), | 430 | * .fields = LIST_HEAD_INIT(event_class_##call.fields), |
| 440 | * .raw_init = trace_event_raw_init, | 431 | * .raw_init = trace_event_raw_init, |
| 441 | * .probe = ftrace_raw_event_##call, | 432 | * .probe = ftrace_raw_event_##call, |
| 433 | * .reg = ftrace_event_reg, | ||
| 442 | * }; | 434 | * }; |
| 443 | * | 435 | * |
| 444 | * static struct ftrace_event_call __used | 436 | * static struct ftrace_event_call __used |
| @@ -567,6 +559,7 @@ static struct ftrace_event_class __used event_class_##call = { \ | |||
| 567 | .fields = LIST_HEAD_INIT(event_class_##call.fields),\ | 559 | .fields = LIST_HEAD_INIT(event_class_##call.fields),\ |
| 568 | .raw_init = trace_event_raw_init, \ | 560 | .raw_init = trace_event_raw_init, \ |
| 569 | .probe = ftrace_raw_event_##call, \ | 561 | .probe = ftrace_raw_event_##call, \ |
| 562 | .reg = ftrace_event_reg, \ | ||
| 570 | _TRACE_PERF_INIT(call) \ | 563 | _TRACE_PERF_INIT(call) \ |
| 571 | }; | 564 | }; |
| 572 | 565 | ||
| @@ -705,7 +698,7 @@ perf_trace_##call(void *__data, proto) \ | |||
| 705 | int __data_size; \ | 698 | int __data_size; \ |
| 706 | int rctx; \ | 699 | int rctx; \ |
| 707 | \ | 700 | \ |
| 708 | perf_fetch_caller_regs(&__regs, 1); \ | 701 | perf_fetch_caller_regs(&__regs); \ |
| 709 | \ | 702 | \ |
| 710 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | 703 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ |
| 711 | __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ | 704 | __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ |
