diff options
Diffstat (limited to 'kernel/trace/trace_syscalls.c')
-rw-r--r-- | kernel/trace/trace_syscalls.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index 4f5fae6fad90..8712ce3c6a0e 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -223,6 +223,7 @@ void ftrace_syscall_enter(struct pt_regs *regs, long id) | |||
223 | struct syscall_trace_enter *entry; | 223 | struct syscall_trace_enter *entry; |
224 | struct syscall_metadata *sys_data; | 224 | struct syscall_metadata *sys_data; |
225 | struct ring_buffer_event *event; | 225 | struct ring_buffer_event *event; |
226 | struct ring_buffer *buffer; | ||
226 | int size; | 227 | int size; |
227 | int syscall_nr; | 228 | int syscall_nr; |
228 | 229 | ||
@@ -238,8 +239,8 @@ void ftrace_syscall_enter(struct pt_regs *regs, long id) | |||
238 | 239 | ||
239 | size = sizeof(*entry) + sizeof(unsigned long) * sys_data->nb_args; | 240 | size = sizeof(*entry) + sizeof(unsigned long) * sys_data->nb_args; |
240 | 241 | ||
241 | event = trace_current_buffer_lock_reserve(sys_data->enter_id, size, | 242 | event = trace_current_buffer_lock_reserve(&buffer, sys_data->enter_id, |
242 | 0, 0); | 243 | size, 0, 0); |
243 | if (!event) | 244 | if (!event) |
244 | return; | 245 | return; |
245 | 246 | ||
@@ -247,8 +248,9 @@ void ftrace_syscall_enter(struct pt_regs *regs, long id) | |||
247 | entry->nr = syscall_nr; | 248 | entry->nr = syscall_nr; |
248 | syscall_get_arguments(current, regs, 0, sys_data->nb_args, entry->args); | 249 | syscall_get_arguments(current, regs, 0, sys_data->nb_args, entry->args); |
249 | 250 | ||
250 | if (!filter_current_check_discard(sys_data->enter_event, entry, event)) | 251 | if (!filter_current_check_discard(buffer, sys_data->enter_event, |
251 | trace_current_buffer_unlock_commit(event, 0, 0); | 252 | entry, event)) |
253 | trace_current_buffer_unlock_commit(buffer, event, 0, 0); | ||
252 | } | 254 | } |
253 | 255 | ||
254 | void ftrace_syscall_exit(struct pt_regs *regs, long ret) | 256 | void ftrace_syscall_exit(struct pt_regs *regs, long ret) |
@@ -256,6 +258,7 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret) | |||
256 | struct syscall_trace_exit *entry; | 258 | struct syscall_trace_exit *entry; |
257 | struct syscall_metadata *sys_data; | 259 | struct syscall_metadata *sys_data; |
258 | struct ring_buffer_event *event; | 260 | struct ring_buffer_event *event; |
261 | struct ring_buffer *buffer; | ||
259 | int syscall_nr; | 262 | int syscall_nr; |
260 | 263 | ||
261 | syscall_nr = syscall_get_nr(current, regs); | 264 | syscall_nr = syscall_get_nr(current, regs); |
@@ -268,7 +271,7 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret) | |||
268 | if (!sys_data) | 271 | if (!sys_data) |
269 | return; | 272 | return; |
270 | 273 | ||
271 | event = trace_current_buffer_lock_reserve(sys_data->exit_id, | 274 | event = trace_current_buffer_lock_reserve(&buffer, sys_data->exit_id, |
272 | sizeof(*entry), 0, 0); | 275 | sizeof(*entry), 0, 0); |
273 | if (!event) | 276 | if (!event) |
274 | return; | 277 | return; |
@@ -277,8 +280,9 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret) | |||
277 | entry->nr = syscall_nr; | 280 | entry->nr = syscall_nr; |
278 | entry->ret = syscall_get_return_value(current, regs); | 281 | entry->ret = syscall_get_return_value(current, regs); |
279 | 282 | ||
280 | if (!filter_current_check_discard(sys_data->exit_event, entry, event)) | 283 | if (!filter_current_check_discard(buffer, sys_data->exit_event, |
281 | trace_current_buffer_unlock_commit(event, 0, 0); | 284 | entry, event)) |
285 | trace_current_buffer_unlock_commit(buffer, event, 0, 0); | ||
282 | } | 286 | } |
283 | 287 | ||
284 | int reg_event_syscall_enter(void *ptr) | 288 | int reg_event_syscall_enter(void *ptr) |