]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/mips/kernel/ptrace.c
Merge remote-tracking branch 'net-next/master'
[karo-tx-linux.git] / arch / mips / kernel / ptrace.c
index 7341318dd2d830655067b83dff91436e7265c0fc..b52e1d2b33e03836002b495328124225ebba29db 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/tracehook.h>
 #include <linux/audit.h>
 #include <linux/seccomp.h>
+#include <linux/ftrace.h>
 
 #include <asm/byteorder.h>
 #include <asm/cpu.h>
@@ -43,6 +44,9 @@
 #include <asm/bootinfo.h>
 #include <asm/reg.h>
 
+#define CREATE_TRACE_POINTS
+#include <trace/events/syscalls.h>
+
 /*
  * Called by kernel/ptrace.c when detaching..
  *
@@ -654,13 +658,18 @@ long arch_ptrace(struct task_struct *child, long request,
  */
 asmlinkage void syscall_trace_enter(struct pt_regs *regs)
 {
+       long ret = 0;
        user_exit();
 
        /* do the secure computing check first */
        secure_computing_strict(regs->regs[2]);
 
-       if (test_thread_flag(TIF_SYSCALL_TRACE))
-               ptrace_report_syscall(regs);
+       if (test_thread_flag(TIF_SYSCALL_TRACE) &&
+           tracehook_report_syscall_entry(regs))
+               ret = -1;
+
+       if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
+               trace_sys_enter(regs, regs->regs[2]);
 
        audit_syscall_entry(__syscall_get_arch(),
                            regs->regs[2],
@@ -683,6 +692,9 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs)
 
        audit_syscall_exit(regs);
 
+       if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
+               trace_sys_exit(regs, regs->regs[2]);
+
        if (test_thread_flag(TIF_SYSCALL_TRACE))
                tracehook_report_syscall_exit(regs, 0);