diff options
Diffstat (limited to 'include/linux/syscalls.h')
| -rw-r--r-- | include/linux/syscalls.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 18cd0684fc4e..98664db1be47 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -125,39 +125,37 @@ extern struct trace_event_functions enter_syscall_print_funcs; | |||
| 125 | extern struct trace_event_functions exit_syscall_print_funcs; | 125 | extern struct trace_event_functions exit_syscall_print_funcs; |
| 126 | 126 | ||
| 127 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | 127 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ |
| 128 | static struct syscall_metadata \ | 128 | static struct syscall_metadata __syscall_meta_##sname; \ |
| 129 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ | ||
| 130 | static struct ftrace_event_call __used \ | 129 | static struct ftrace_event_call __used \ |
| 131 | __attribute__((__aligned__(4))) \ | ||
| 132 | __attribute__((section("_ftrace_events"))) \ | ||
| 133 | event_enter_##sname = { \ | 130 | event_enter_##sname = { \ |
| 134 | .name = "sys_enter"#sname, \ | 131 | .name = "sys_enter"#sname, \ |
| 135 | .class = &event_class_syscall_enter, \ | 132 | .class = &event_class_syscall_enter, \ |
| 136 | .event.funcs = &enter_syscall_print_funcs, \ | 133 | .event.funcs = &enter_syscall_print_funcs, \ |
| 137 | .data = (void *)&__syscall_meta_##sname,\ | 134 | .data = (void *)&__syscall_meta_##sname,\ |
| 138 | }; \ | 135 | }; \ |
| 136 | static struct ftrace_event_call __used \ | ||
| 137 | __attribute__((section("_ftrace_events"))) \ | ||
| 138 | *__event_enter_##sname = &event_enter_##sname; \ | ||
| 139 | __TRACE_EVENT_FLAGS(enter_##sname, TRACE_EVENT_FL_CAP_ANY) | 139 | __TRACE_EVENT_FLAGS(enter_##sname, TRACE_EVENT_FL_CAP_ANY) |
| 140 | 140 | ||
| 141 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 141 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
| 142 | static struct syscall_metadata \ | 142 | static struct syscall_metadata __syscall_meta_##sname; \ |
| 143 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ | ||
| 144 | static struct ftrace_event_call __used \ | 143 | static struct ftrace_event_call __used \ |
| 145 | __attribute__((__aligned__(4))) \ | ||
| 146 | __attribute__((section("_ftrace_events"))) \ | ||
| 147 | event_exit_##sname = { \ | 144 | event_exit_##sname = { \ |
| 148 | .name = "sys_exit"#sname, \ | 145 | .name = "sys_exit"#sname, \ |
| 149 | .class = &event_class_syscall_exit, \ | 146 | .class = &event_class_syscall_exit, \ |
| 150 | .event.funcs = &exit_syscall_print_funcs, \ | 147 | .event.funcs = &exit_syscall_print_funcs, \ |
| 151 | .data = (void *)&__syscall_meta_##sname,\ | 148 | .data = (void *)&__syscall_meta_##sname,\ |
| 152 | }; \ | 149 | }; \ |
| 150 | static struct ftrace_event_call __used \ | ||
| 151 | __attribute__((section("_ftrace_events"))) \ | ||
| 152 | *__event_exit_##sname = &event_exit_##sname; \ | ||
| 153 | __TRACE_EVENT_FLAGS(exit_##sname, TRACE_EVENT_FL_CAP_ANY) | 153 | __TRACE_EVENT_FLAGS(exit_##sname, TRACE_EVENT_FL_CAP_ANY) |
| 154 | 154 | ||
| 155 | #define SYSCALL_METADATA(sname, nb) \ | 155 | #define SYSCALL_METADATA(sname, nb) \ |
| 156 | SYSCALL_TRACE_ENTER_EVENT(sname); \ | 156 | SYSCALL_TRACE_ENTER_EVENT(sname); \ |
| 157 | SYSCALL_TRACE_EXIT_EVENT(sname); \ | 157 | SYSCALL_TRACE_EXIT_EVENT(sname); \ |
| 158 | static struct syscall_metadata __used \ | 158 | static struct syscall_metadata __used \ |
| 159 | __attribute__((__aligned__(4))) \ | ||
| 160 | __attribute__((section("__syscalls_metadata"))) \ | ||
| 161 | __syscall_meta_##sname = { \ | 159 | __syscall_meta_##sname = { \ |
| 162 | .name = "sys"#sname, \ | 160 | .name = "sys"#sname, \ |
| 163 | .nb_args = nb, \ | 161 | .nb_args = nb, \ |
| @@ -166,14 +164,15 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
| 166 | .enter_event = &event_enter_##sname, \ | 164 | .enter_event = &event_enter_##sname, \ |
| 167 | .exit_event = &event_exit_##sname, \ | 165 | .exit_event = &event_exit_##sname, \ |
| 168 | .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \ | 166 | .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \ |
| 169 | }; | 167 | }; \ |
| 168 | static struct syscall_metadata __used \ | ||
| 169 | __attribute__((section("__syscalls_metadata"))) \ | ||
| 170 | *__p_syscall_meta_##sname = &__syscall_meta_##sname; | ||
| 170 | 171 | ||
| 171 | #define SYSCALL_DEFINE0(sname) \ | 172 | #define SYSCALL_DEFINE0(sname) \ |
| 172 | SYSCALL_TRACE_ENTER_EVENT(_##sname); \ | 173 | SYSCALL_TRACE_ENTER_EVENT(_##sname); \ |
| 173 | SYSCALL_TRACE_EXIT_EVENT(_##sname); \ | 174 | SYSCALL_TRACE_EXIT_EVENT(_##sname); \ |
| 174 | static struct syscall_metadata __used \ | 175 | static struct syscall_metadata __used \ |
| 175 | __attribute__((__aligned__(4))) \ | ||
| 176 | __attribute__((section("__syscalls_metadata"))) \ | ||
| 177 | __syscall_meta__##sname = { \ | 176 | __syscall_meta__##sname = { \ |
| 178 | .name = "sys_"#sname, \ | 177 | .name = "sys_"#sname, \ |
| 179 | .nb_args = 0, \ | 178 | .nb_args = 0, \ |
| @@ -181,6 +180,9 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
| 181 | .exit_event = &event_exit__##sname, \ | 180 | .exit_event = &event_exit__##sname, \ |
| 182 | .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \ | 181 | .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \ |
| 183 | }; \ | 182 | }; \ |
| 183 | static struct syscall_metadata __used \ | ||
| 184 | __attribute__((section("__syscalls_metadata"))) \ | ||
| 185 | *__p_syscall_meta_##sname = &__syscall_meta__##sname; \ | ||
| 184 | asmlinkage long sys_##sname(void) | 186 | asmlinkage long sys_##sname(void) |
| 185 | #else | 187 | #else |
| 186 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) | 188 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) |
