diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-28 13:17:55 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-28 13:17:55 -0500 |
| commit | e0d272429a34ff143bfa04ee8e29dd4eed2964c7 (patch) | |
| tree | 5a719135b245811b5d61ed084d7b8c1bc2e87031 /include | |
| parent | d25e8dbdab203ed8b4fd0a174bb5259e35ecd87c (diff) | |
| parent | 480917427b0b6ff39de55ffc81391055472e6c26 (diff) | |
Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (28 commits)
ftrace: Add function names to dangling } in function graph tracer
tracing: Simplify memory recycle of trace_define_field
tracing: Remove unnecessary variable in print_graph_return
tracing: Fix typo of info text in trace_kprobe.c
tracing: Fix typo in prof_sysexit_enable()
tracing: Remove CONFIG_TRACE_POWER from kernel config
tracing: Fix ftrace_event_call alignment for use with gcc 4.5
ftrace: Remove memory barriers from NMI code when not needed
tracing/kprobes: Add short documentation for HAVE_REGS_AND_STACK_ACCESS_API
s390: Add pt_regs register and stack access API
tracing/kprobes: Make Kconfig dependencies generic
tracing: Unify arch_syscall_addr() implementations
tracing: Add notrace to TRACE_EVENT implementation functions
ftrace: Allow to remove a single function from function graph filter
tracing: Add correct/incorrect to sort keys for branch annotation output
tracing: Simplify test for function_graph tracing start point
tracing: Drop the tr check from the graph tracing path
tracing: Add stack dump to trace_printk if stacktrace option is set
tracing: Use appropriate perl constructs in recordmcount.pl
tracing: optimize recordmcount.pl for offsets-handling
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/ftrace.h | 6 | ||||
| -rw-r--r-- | include/linux/ftrace_event.h | 3 | ||||
| -rw-r--r-- | include/linux/syscalls.h | 12 | ||||
| -rw-r--r-- | include/trace/ftrace.h | 195 | ||||
| -rw-r--r-- | include/trace/syscall.h | 4 |
5 files changed, 66 insertions, 154 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 0b4f97d24d7f..1cbb36f2759c 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -511,4 +511,10 @@ static inline void trace_hw_branch_oops(void) {} | |||
| 511 | 511 | ||
| 512 | #endif /* CONFIG_HW_BRANCH_TRACER */ | 512 | #endif /* CONFIG_HW_BRANCH_TRACER */ |
| 513 | 513 | ||
| 514 | #ifdef CONFIG_FTRACE_SYSCALLS | ||
| 515 | |||
| 516 | unsigned long arch_syscall_addr(int nr); | ||
| 517 | |||
| 518 | #endif /* CONFIG_FTRACE_SYSCALLS */ | ||
| 519 | |||
| 514 | #endif /* _LINUX_FTRACE_H */ | 520 | #endif /* _LINUX_FTRACE_H */ |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 2233c98d80df..84a5629adfd8 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -121,9 +121,8 @@ struct ftrace_event_call { | |||
| 121 | int (*regfunc)(struct ftrace_event_call *); | 121 | int (*regfunc)(struct ftrace_event_call *); |
| 122 | void (*unregfunc)(struct ftrace_event_call *); | 122 | void (*unregfunc)(struct ftrace_event_call *); |
| 123 | int id; | 123 | int id; |
| 124 | const char *print_fmt; | ||
| 124 | int (*raw_init)(struct ftrace_event_call *); | 125 | int (*raw_init)(struct ftrace_event_call *); |
| 125 | int (*show_format)(struct ftrace_event_call *, | ||
| 126 | struct trace_seq *); | ||
| 127 | int (*define_fields)(struct ftrace_event_call *); | 126 | int (*define_fields)(struct ftrace_event_call *); |
| 128 | struct list_head fields; | 127 | struct list_head fields; |
| 129 | int filter_active; | 128 | int filter_active; |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 207466a49f3d..91bd7d78a07d 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -132,7 +132,8 @@ struct perf_event_attr; | |||
| 132 | 132 | ||
| 133 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | 133 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ |
| 134 | static const struct syscall_metadata __syscall_meta_##sname; \ | 134 | static const struct syscall_metadata __syscall_meta_##sname; \ |
| 135 | static struct ftrace_event_call event_enter_##sname; \ | 135 | static struct ftrace_event_call \ |
| 136 | __attribute__((__aligned__(4))) event_enter_##sname; \ | ||
| 136 | static struct trace_event enter_syscall_print_##sname = { \ | 137 | static struct trace_event enter_syscall_print_##sname = { \ |
| 137 | .trace = print_syscall_enter, \ | 138 | .trace = print_syscall_enter, \ |
| 138 | }; \ | 139 | }; \ |
| @@ -143,8 +144,7 @@ struct perf_event_attr; | |||
| 143 | .name = "sys_enter"#sname, \ | 144 | .name = "sys_enter"#sname, \ |
| 144 | .system = "syscalls", \ | 145 | .system = "syscalls", \ |
| 145 | .event = &enter_syscall_print_##sname, \ | 146 | .event = &enter_syscall_print_##sname, \ |
| 146 | .raw_init = trace_event_raw_init, \ | 147 | .raw_init = init_syscall_trace, \ |
| 147 | .show_format = syscall_enter_format, \ | ||
| 148 | .define_fields = syscall_enter_define_fields, \ | 148 | .define_fields = syscall_enter_define_fields, \ |
| 149 | .regfunc = reg_event_syscall_enter, \ | 149 | .regfunc = reg_event_syscall_enter, \ |
| 150 | .unregfunc = unreg_event_syscall_enter, \ | 150 | .unregfunc = unreg_event_syscall_enter, \ |
| @@ -154,7 +154,8 @@ struct perf_event_attr; | |||
| 154 | 154 | ||
| 155 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 155 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
| 156 | static const struct syscall_metadata __syscall_meta_##sname; \ | 156 | static const struct syscall_metadata __syscall_meta_##sname; \ |
| 157 | static struct ftrace_event_call event_exit_##sname; \ | 157 | static struct ftrace_event_call \ |
| 158 | __attribute__((__aligned__(4))) event_exit_##sname; \ | ||
| 158 | static struct trace_event exit_syscall_print_##sname = { \ | 159 | static struct trace_event exit_syscall_print_##sname = { \ |
| 159 | .trace = print_syscall_exit, \ | 160 | .trace = print_syscall_exit, \ |
| 160 | }; \ | 161 | }; \ |
| @@ -165,8 +166,7 @@ struct perf_event_attr; | |||
| 165 | .name = "sys_exit"#sname, \ | 166 | .name = "sys_exit"#sname, \ |
| 166 | .system = "syscalls", \ | 167 | .system = "syscalls", \ |
| 167 | .event = &exit_syscall_print_##sname, \ | 168 | .event = &exit_syscall_print_##sname, \ |
| 168 | .raw_init = trace_event_raw_init, \ | 169 | .raw_init = init_syscall_trace, \ |
| 169 | .show_format = syscall_exit_format, \ | ||
| 170 | .define_fields = syscall_exit_define_fields, \ | 170 | .define_fields = syscall_exit_define_fields, \ |
| 171 | .regfunc = reg_event_syscall_exit, \ | 171 | .regfunc = reg_event_syscall_exit, \ |
| 172 | .unregfunc = unreg_event_syscall_exit, \ | 172 | .unregfunc = unreg_event_syscall_exit, \ |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index c6fe03e902ca..f23a0ca6910a 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
| @@ -65,7 +65,8 @@ | |||
| 65 | }; | 65 | }; |
| 66 | #undef DEFINE_EVENT | 66 | #undef DEFINE_EVENT |
| 67 | #define DEFINE_EVENT(template, name, proto, args) \ | 67 | #define DEFINE_EVENT(template, name, proto, args) \ |
| 68 | static struct ftrace_event_call event_##name | 68 | static struct ftrace_event_call \ |
| 69 | __attribute__((__aligned__(4))) event_##name | ||
| 69 | 70 | ||
| 70 | #undef DEFINE_EVENT_PRINT | 71 | #undef DEFINE_EVENT_PRINT |
| 71 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 72 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
| @@ -131,130 +132,6 @@ | |||
| 131 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 132 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 132 | 133 | ||
| 133 | /* | 134 | /* |
| 134 | * Setup the showing format of trace point. | ||
| 135 | * | ||
| 136 | * int | ||
| 137 | * ftrace_format_##call(struct trace_seq *s) | ||
| 138 | * { | ||
| 139 | * struct ftrace_raw_##call field; | ||
| 140 | * int ret; | ||
| 141 | * | ||
| 142 | * ret = trace_seq_printf(s, #type " " #item ";" | ||
| 143 | * " offset:%u; size:%u;\n", | ||
| 144 | * offsetof(struct ftrace_raw_##call, item), | ||
| 145 | * sizeof(field.type)); | ||
| 146 | * | ||
| 147 | * } | ||
| 148 | */ | ||
| 149 | |||
| 150 | #undef TP_STRUCT__entry | ||
| 151 | #define TP_STRUCT__entry(args...) args | ||
| 152 | |||
| 153 | #undef __field | ||
| 154 | #define __field(type, item) \ | ||
| 155 | ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ | ||
| 156 | "offset:%u;\tsize:%u;\tsigned:%u;\n", \ | ||
| 157 | (unsigned int)offsetof(typeof(field), item), \ | ||
| 158 | (unsigned int)sizeof(field.item), \ | ||
| 159 | (unsigned int)is_signed_type(type)); \ | ||
| 160 | if (!ret) \ | ||
| 161 | return 0; | ||
| 162 | |||
| 163 | #undef __field_ext | ||
| 164 | #define __field_ext(type, item, filter_type) __field(type, item) | ||
| 165 | |||
| 166 | #undef __array | ||
| 167 | #define __array(type, item, len) \ | ||
| 168 | ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ | ||
| 169 | "offset:%u;\tsize:%u;\tsigned:%u;\n", \ | ||
| 170 | (unsigned int)offsetof(typeof(field), item), \ | ||
| 171 | (unsigned int)sizeof(field.item), \ | ||
| 172 | (unsigned int)is_signed_type(type)); \ | ||
| 173 | if (!ret) \ | ||
| 174 | return 0; | ||
| 175 | |||
| 176 | #undef __dynamic_array | ||
| 177 | #define __dynamic_array(type, item, len) \ | ||
| 178 | ret = trace_seq_printf(s, "\tfield:__data_loc " #type "[] " #item ";\t"\ | ||
| 179 | "offset:%u;\tsize:%u;\tsigned:%u;\n", \ | ||
| 180 | (unsigned int)offsetof(typeof(field), \ | ||
| 181 | __data_loc_##item), \ | ||
| 182 | (unsigned int)sizeof(field.__data_loc_##item), \ | ||
| 183 | (unsigned int)is_signed_type(type)); \ | ||
| 184 | if (!ret) \ | ||
| 185 | return 0; | ||
| 186 | |||
| 187 | #undef __string | ||
| 188 | #define __string(item, src) __dynamic_array(char, item, -1) | ||
| 189 | |||
| 190 | #undef __entry | ||
| 191 | #define __entry REC | ||
| 192 | |||
| 193 | #undef __print_symbolic | ||
| 194 | #undef __get_dynamic_array | ||
| 195 | #undef __get_str | ||
| 196 | |||
| 197 | #undef TP_printk | ||
| 198 | #define TP_printk(fmt, args...) "\"%s\", %s\n", fmt, __stringify(args) | ||
| 199 | |||
| 200 | #undef TP_fast_assign | ||
| 201 | #define TP_fast_assign(args...) args | ||
| 202 | |||
| 203 | #undef TP_perf_assign | ||
| 204 | #define TP_perf_assign(args...) | ||
| 205 | |||
| 206 | #undef DECLARE_EVENT_CLASS | ||
| 207 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \ | ||
| 208 | static int \ | ||
| 209 | ftrace_format_setup_##call(struct ftrace_event_call *unused, \ | ||
| 210 | struct trace_seq *s) \ | ||
| 211 | { \ | ||
| 212 | struct ftrace_raw_##call field __attribute__((unused)); \ | ||
| 213 | int ret = 0; \ | ||
| 214 | \ | ||
| 215 | tstruct; \ | ||
| 216 | \ | ||
| 217 | return ret; \ | ||
| 218 | } \ | ||
| 219 | \ | ||
| 220 | static int \ | ||
| 221 | ftrace_format_##call(struct ftrace_event_call *unused, \ | ||
| 222 | struct trace_seq *s) \ | ||
| 223 | { \ | ||
| 224 | int ret = 0; \ | ||
| 225 | \ | ||
| 226 | ret = ftrace_format_setup_##call(unused, s); \ | ||
| 227 | if (!ret) \ | ||
| 228 | return ret; \ | ||
| 229 | \ | ||
| 230 | ret = trace_seq_printf(s, "\nprint fmt: " print); \ | ||
| 231 | \ | ||
| 232 | return ret; \ | ||
| 233 | } | ||
| 234 | |||
| 235 | #undef DEFINE_EVENT | ||
| 236 | #define DEFINE_EVENT(template, name, proto, args) | ||
| 237 | |||
| 238 | #undef DEFINE_EVENT_PRINT | ||
| 239 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
| 240 | static int \ | ||
| 241 | ftrace_format_##name(struct ftrace_event_call *unused, \ | ||
| 242 | struct trace_seq *s) \ | ||
| 243 | { \ | ||
| 244 | int ret = 0; \ | ||
| 245 | \ | ||
| 246 | ret = ftrace_format_setup_##template(unused, s); \ | ||
| 247 | if (!ret) \ | ||
| 248 | return ret; \ | ||
| 249 | \ | ||
| 250 | trace_seq_printf(s, "\nprint fmt: " print); \ | ||
| 251 | \ | ||
| 252 | return ret; \ | ||
| 253 | } | ||
| 254 | |||
| 255 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
| 256 | |||
| 257 | /* | ||
| 258 | * Stage 3 of the trace events. | 135 | * Stage 3 of the trace events. |
| 259 | * | 136 | * |
| 260 | * Override the macros in <trace/trace_events.h> to include the following: | 137 | * Override the macros in <trace/trace_events.h> to include the following: |
| @@ -323,7 +200,7 @@ ftrace_format_##name(struct ftrace_event_call *unused, \ | |||
| 323 | 200 | ||
| 324 | #undef DECLARE_EVENT_CLASS | 201 | #undef DECLARE_EVENT_CLASS |
| 325 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 202 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| 326 | static enum print_line_t \ | 203 | static notrace enum print_line_t \ |
| 327 | ftrace_raw_output_id_##call(int event_id, const char *name, \ | 204 | ftrace_raw_output_id_##call(int event_id, const char *name, \ |
| 328 | struct trace_iterator *iter, int flags) \ | 205 | struct trace_iterator *iter, int flags) \ |
| 329 | { \ | 206 | { \ |
| @@ -356,7 +233,7 @@ ftrace_raw_output_id_##call(int event_id, const char *name, \ | |||
| 356 | 233 | ||
| 357 | #undef DEFINE_EVENT | 234 | #undef DEFINE_EVENT |
| 358 | #define DEFINE_EVENT(template, name, proto, args) \ | 235 | #define DEFINE_EVENT(template, name, proto, args) \ |
| 359 | static enum print_line_t \ | 236 | static notrace enum print_line_t \ |
| 360 | ftrace_raw_output_##name(struct trace_iterator *iter, int flags) \ | 237 | ftrace_raw_output_##name(struct trace_iterator *iter, int flags) \ |
| 361 | { \ | 238 | { \ |
| 362 | return ftrace_raw_output_id_##template(event_##name.id, \ | 239 | return ftrace_raw_output_id_##template(event_##name.id, \ |
| @@ -365,7 +242,7 @@ ftrace_raw_output_##name(struct trace_iterator *iter, int flags) \ | |||
| 365 | 242 | ||
| 366 | #undef DEFINE_EVENT_PRINT | 243 | #undef DEFINE_EVENT_PRINT |
| 367 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ | 244 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ |
| 368 | static enum print_line_t \ | 245 | static notrace enum print_line_t \ |
| 369 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | 246 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ |
| 370 | { \ | 247 | { \ |
| 371 | struct trace_seq *s = &iter->seq; \ | 248 | struct trace_seq *s = &iter->seq; \ |
| @@ -431,7 +308,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
| 431 | 308 | ||
| 432 | #undef DECLARE_EVENT_CLASS | 309 | #undef DECLARE_EVENT_CLASS |
| 433 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \ | 310 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \ |
| 434 | static int \ | 311 | static int notrace \ |
| 435 | ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | 312 | ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ |
| 436 | { \ | 313 | { \ |
| 437 | struct ftrace_raw_##call field; \ | 314 | struct ftrace_raw_##call field; \ |
| @@ -479,7 +356,7 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | |||
| 479 | 356 | ||
| 480 | #undef DECLARE_EVENT_CLASS | 357 | #undef DECLARE_EVENT_CLASS |
| 481 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 358 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| 482 | static inline int ftrace_get_offsets_##call( \ | 359 | static inline notrace int ftrace_get_offsets_##call( \ |
| 483 | struct ftrace_data_offsets_##call *__data_offsets, proto) \ | 360 | struct ftrace_data_offsets_##call *__data_offsets, proto) \ |
| 484 | { \ | 361 | { \ |
| 485 | int __data_size = 0; \ | 362 | int __data_size = 0; \ |
| @@ -526,12 +403,14 @@ static inline int ftrace_get_offsets_##call( \ | |||
| 526 | \ | 403 | \ |
| 527 | static void ftrace_profile_##name(proto); \ | 404 | static void ftrace_profile_##name(proto); \ |
| 528 | \ | 405 | \ |
| 529 | static int ftrace_profile_enable_##name(struct ftrace_event_call *unused)\ | 406 | static notrace int \ |
| 407 | ftrace_profile_enable_##name(struct ftrace_event_call *unused) \ | ||
| 530 | { \ | 408 | { \ |
| 531 | return register_trace_##name(ftrace_profile_##name); \ | 409 | return register_trace_##name(ftrace_profile_##name); \ |
| 532 | } \ | 410 | } \ |
| 533 | \ | 411 | \ |
| 534 | static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | 412 | static notrace void \ |
| 413 | ftrace_profile_disable_##name(struct ftrace_event_call *unused) \ | ||
| 535 | { \ | 414 | { \ |
| 536 | unregister_trace_##name(ftrace_profile_##name); \ | 415 | unregister_trace_##name(ftrace_profile_##name); \ |
| 537 | } | 416 | } |
| @@ -622,7 +501,6 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
| 622 | * .raw_init = trace_event_raw_init, | 501 | * .raw_init = trace_event_raw_init, |
| 623 | * .regfunc = ftrace_reg_event_<call>, | 502 | * .regfunc = ftrace_reg_event_<call>, |
| 624 | * .unregfunc = ftrace_unreg_event_<call>, | 503 | * .unregfunc = ftrace_unreg_event_<call>, |
| 625 | * .show_format = ftrace_format_<call>, | ||
| 626 | * } | 504 | * } |
| 627 | * | 505 | * |
| 628 | */ | 506 | */ |
| @@ -657,10 +535,17 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
| 657 | #define __assign_str(dst, src) \ | 535 | #define __assign_str(dst, src) \ |
| 658 | strcpy(__get_str(dst), src); | 536 | strcpy(__get_str(dst), src); |
| 659 | 537 | ||
| 538 | #undef TP_fast_assign | ||
| 539 | #define TP_fast_assign(args...) args | ||
| 540 | |||
| 541 | #undef TP_perf_assign | ||
| 542 | #define TP_perf_assign(args...) | ||
| 543 | |||
| 660 | #undef DECLARE_EVENT_CLASS | 544 | #undef DECLARE_EVENT_CLASS |
| 661 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 545 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| 662 | \ | 546 | \ |
| 663 | static void ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ | 547 | static notrace void \ |
| 548 | ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ | ||
| 664 | proto) \ | 549 | proto) \ |
| 665 | { \ | 550 | { \ |
| 666 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 551 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
| @@ -697,17 +582,19 @@ static void ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ | |||
| 697 | #undef DEFINE_EVENT | 582 | #undef DEFINE_EVENT |
| 698 | #define DEFINE_EVENT(template, call, proto, args) \ | 583 | #define DEFINE_EVENT(template, call, proto, args) \ |
| 699 | \ | 584 | \ |
| 700 | static void ftrace_raw_event_##call(proto) \ | 585 | static notrace void ftrace_raw_event_##call(proto) \ |
| 701 | { \ | 586 | { \ |
| 702 | ftrace_raw_event_id_##template(&event_##call, args); \ | 587 | ftrace_raw_event_id_##template(&event_##call, args); \ |
| 703 | } \ | 588 | } \ |
| 704 | \ | 589 | \ |
| 705 | static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\ | 590 | static notrace int \ |
| 591 | ftrace_raw_reg_event_##call(struct ftrace_event_call *unused) \ | ||
| 706 | { \ | 592 | { \ |
| 707 | return register_trace_##call(ftrace_raw_event_##call); \ | 593 | return register_trace_##call(ftrace_raw_event_##call); \ |
| 708 | } \ | 594 | } \ |
| 709 | \ | 595 | \ |
| 710 | static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\ | 596 | static notrace void \ |
| 597 | ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused) \ | ||
| 711 | { \ | 598 | { \ |
| 712 | unregister_trace_##call(ftrace_raw_event_##call); \ | 599 | unregister_trace_##call(ftrace_raw_event_##call); \ |
| 713 | } \ | 600 | } \ |
| @@ -722,8 +609,20 @@ static struct trace_event ftrace_event_type_##call = { \ | |||
| 722 | 609 | ||
| 723 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 610 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 724 | 611 | ||
| 612 | #undef __entry | ||
| 613 | #define __entry REC | ||
| 614 | |||
| 615 | #undef __print_flags | ||
| 616 | #undef __print_symbolic | ||
| 617 | #undef __get_dynamic_array | ||
| 618 | #undef __get_str | ||
| 619 | |||
| 620 | #undef TP_printk | ||
| 621 | #define TP_printk(fmt, args...) "\"" fmt "\", " __stringify(args) | ||
| 622 | |||
| 725 | #undef DECLARE_EVENT_CLASS | 623 | #undef DECLARE_EVENT_CLASS |
| 726 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) | 624 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| 625 | static const char print_fmt_##call[] = print; | ||
| 727 | 626 | ||
| 728 | #undef DEFINE_EVENT | 627 | #undef DEFINE_EVENT |
| 729 | #define DEFINE_EVENT(template, call, proto, args) \ | 628 | #define DEFINE_EVENT(template, call, proto, args) \ |
| @@ -737,7 +636,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
| 737 | .raw_init = trace_event_raw_init, \ | 636 | .raw_init = trace_event_raw_init, \ |
| 738 | .regfunc = ftrace_raw_reg_event_##call, \ | 637 | .regfunc = ftrace_raw_reg_event_##call, \ |
| 739 | .unregfunc = ftrace_raw_unreg_event_##call, \ | 638 | .unregfunc = ftrace_raw_unreg_event_##call, \ |
| 740 | .show_format = ftrace_format_##template, \ | 639 | .print_fmt = print_fmt_##template, \ |
| 741 | .define_fields = ftrace_define_fields_##template, \ | 640 | .define_fields = ftrace_define_fields_##template, \ |
| 742 | _TRACE_PROFILE_INIT(call) \ | 641 | _TRACE_PROFILE_INIT(call) \ |
| 743 | } | 642 | } |
| @@ -745,6 +644,8 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
| 745 | #undef DEFINE_EVENT_PRINT | 644 | #undef DEFINE_EVENT_PRINT |
| 746 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ | 645 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ |
| 747 | \ | 646 | \ |
| 647 | static const char print_fmt_##call[] = print; \ | ||
| 648 | \ | ||
| 748 | static struct ftrace_event_call __used \ | 649 | static struct ftrace_event_call __used \ |
| 749 | __attribute__((__aligned__(4))) \ | 650 | __attribute__((__aligned__(4))) \ |
| 750 | __attribute__((section("_ftrace_events"))) event_##call = { \ | 651 | __attribute__((section("_ftrace_events"))) event_##call = { \ |
| @@ -754,7 +655,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
| 754 | .raw_init = trace_event_raw_init, \ | 655 | .raw_init = trace_event_raw_init, \ |
| 755 | .regfunc = ftrace_raw_reg_event_##call, \ | 656 | .regfunc = ftrace_raw_reg_event_##call, \ |
| 756 | .unregfunc = ftrace_raw_unreg_event_##call, \ | 657 | .unregfunc = ftrace_raw_unreg_event_##call, \ |
| 757 | .show_format = ftrace_format_##call, \ | 658 | .print_fmt = print_fmt_##call, \ |
| 758 | .define_fields = ftrace_define_fields_##template, \ | 659 | .define_fields = ftrace_define_fields_##template, \ |
| 759 | _TRACE_PROFILE_INIT(call) \ | 660 | _TRACE_PROFILE_INIT(call) \ |
| 760 | } | 661 | } |
| @@ -837,6 +738,16 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
| 837 | 738 | ||
| 838 | #ifdef CONFIG_EVENT_PROFILE | 739 | #ifdef CONFIG_EVENT_PROFILE |
| 839 | 740 | ||
| 741 | #undef __entry | ||
| 742 | #define __entry entry | ||
| 743 | |||
| 744 | #undef __get_dynamic_array | ||
| 745 | #define __get_dynamic_array(field) \ | ||
| 746 | ((void *)__entry + (__entry->__data_loc_##field & 0xffff)) | ||
| 747 | |||
| 748 | #undef __get_str | ||
| 749 | #define __get_str(field) (char *)__get_dynamic_array(field) | ||
| 750 | |||
| 840 | #undef __perf_addr | 751 | #undef __perf_addr |
| 841 | #define __perf_addr(a) __addr = (a) | 752 | #define __perf_addr(a) __addr = (a) |
| 842 | 753 | ||
| @@ -845,7 +756,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
| 845 | 756 | ||
| 846 | #undef DECLARE_EVENT_CLASS | 757 | #undef DECLARE_EVENT_CLASS |
| 847 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ | 758 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
| 848 | static void \ | 759 | static notrace void \ |
| 849 | ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \ | 760 | ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \ |
| 850 | proto) \ | 761 | proto) \ |
| 851 | { \ | 762 | { \ |
| @@ -915,7 +826,7 @@ end_recursion: \ | |||
| 915 | 826 | ||
| 916 | #undef DEFINE_EVENT | 827 | #undef DEFINE_EVENT |
| 917 | #define DEFINE_EVENT(template, call, proto, args) \ | 828 | #define DEFINE_EVENT(template, call, proto, args) \ |
| 918 | static void ftrace_profile_##call(proto) \ | 829 | static notrace void ftrace_profile_##call(proto) \ |
| 919 | { \ | 830 | { \ |
| 920 | struct ftrace_event_call *event_call = &event_##call; \ | 831 | struct ftrace_event_call *event_call = &event_##call; \ |
| 921 | \ | 832 | \ |
diff --git a/include/trace/syscall.h b/include/trace/syscall.h index 961fda3556bb..8cd410254456 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h | |||
| @@ -34,10 +34,6 @@ struct syscall_metadata { | |||
| 34 | extern unsigned long arch_syscall_addr(int nr); | 34 | extern unsigned long arch_syscall_addr(int nr); |
| 35 | extern int init_syscall_trace(struct ftrace_event_call *call); | 35 | extern int init_syscall_trace(struct ftrace_event_call *call); |
| 36 | 36 | ||
| 37 | extern int syscall_enter_format(struct ftrace_event_call *call, | ||
| 38 | struct trace_seq *s); | ||
| 39 | extern int syscall_exit_format(struct ftrace_event_call *call, | ||
| 40 | struct trace_seq *s); | ||
| 41 | extern int syscall_enter_define_fields(struct ftrace_event_call *call); | 37 | extern int syscall_enter_define_fields(struct ftrace_event_call *call); |
| 42 | extern int syscall_exit_define_fields(struct ftrace_event_call *call); | 38 | extern int syscall_exit_define_fields(struct ftrace_event_call *call); |
| 43 | extern int reg_event_syscall_enter(struct ftrace_event_call *call); | 39 | extern int reg_event_syscall_enter(struct ftrace_event_call *call); |
