Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: Wire up HAVE_SYSCALL_TRACEPOINTS.

This is necessary to get ftrace syscall tracing working again.. a fairly
trivial and mechanical change. The one benefit is that this can also be
enabled on sh64, despite not having its own ftrace port.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+20 -13
+1
arch/sh/Kconfig
··· 20 20 select HAVE_KERNEL_GZIP 21 21 select HAVE_KERNEL_BZIP2 22 22 select HAVE_KERNEL_LZMA 23 + select HAVE_SYSCALL_TRACEPOINTS 23 24 select RTC_LIB 24 25 select GENERIC_ATOMIC64 25 26 help
+4 -4
arch/sh/include/asm/thread_info.h
··· 116 116 #define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */ 117 117 #define TIF_SECCOMP 6 /* secure computing */ 118 118 #define TIF_NOTIFY_RESUME 7 /* callback before returning to user */ 119 - #define TIF_SYSCALL_FTRACE 8 /* for ftrace syscall instrumentation */ 119 + #define TIF_SYSCALL_TRACEPOINT 8 /* for ftrace syscall instrumentation */ 120 120 #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 121 121 #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 122 122 #define TIF_MEMDIE 18 ··· 130 130 #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 131 131 #define _TIF_SECCOMP (1 << TIF_SECCOMP) 132 132 #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 133 - #define _TIF_SYSCALL_FTRACE (1 << TIF_SYSCALL_FTRACE) 133 + #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) 134 134 #define _TIF_USEDFPU (1 << TIF_USEDFPU) 135 135 #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 136 136 #define _TIF_FREEZE (1 << TIF_FREEZE) ··· 144 144 /* work to do in syscall trace */ 145 145 #define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \ 146 146 _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \ 147 - _TIF_SYSCALL_FTRACE) 147 + _TIF_SYSCALL_TRACEPOINT) 148 148 149 149 /* work to do on any return to u-space */ 150 150 #define _TIF_ALLWORK_MASK (_TIF_SYSCALL_TRACE | _TIF_SIGPENDING | \ 151 151 _TIF_NEED_RESCHED | _TIF_SYSCALL_AUDIT | \ 152 152 _TIF_SINGLESTEP | _TIF_RESTORE_SIGMASK | \ 153 - _TIF_NOTIFY_RESUME | _TIF_SYSCALL_FTRACE) 153 + _TIF_NOTIFY_RESUME | _TIF_SYSCALL_TRACEPOINT) 154 154 155 155 /* work to do on interrupt/exception return */ 156 156 #define _TIF_WORK_MASK (_TIF_ALLWORK_MASK & ~(_TIF_SYSCALL_TRACE | \
+6 -9
arch/sh/kernel/ptrace_32.c
··· 34 34 #include <asm/syscalls.h> 35 35 #include <asm/fpu.h> 36 36 37 - #include <trace/syscall.h> 37 + #define CREATE_TRACE_POINTS 38 + #include <trace/events/syscalls.h> 38 39 39 40 /* 40 41 * This routine will get a word off of the process kernel stack. ··· 462 461 */ 463 462 ret = -1L; 464 463 465 - #ifdef CONFIG_FTRACE_SYSCALLS 466 - if (unlikely(test_thread_flag(TIF_SYSCALL_FTRACE))) 467 - ftrace_syscall_enter(regs); 468 - #endif 464 + if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 465 + trace_sys_enter(regs, regs->regs[0]); 469 466 470 467 if (unlikely(current->audit_context)) 471 468 audit_syscall_entry(audit_arch(), regs->regs[3], ··· 481 482 audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]), 482 483 regs->regs[0]); 483 484 484 - #ifdef CONFIG_FTRACE_SYSCALLS 485 - if (unlikely(test_thread_flag(TIF_SYSCALL_FTRACE))) 486 - ftrace_syscall_exit(regs); 487 - #endif 485 + if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 486 + trace_sys_exit(regs, regs->regs[0]); 488 487 489 488 step = test_thread_flag(TIF_SINGLESTEP); 490 489 if (step || test_thread_flag(TIF_SYSCALL_TRACE))
+9
arch/sh/kernel/ptrace_64.c
··· 40 40 #include <asm/syscalls.h> 41 41 #include <asm/fpu.h> 42 42 43 + #define CREATE_TRACE_POINTS 44 + #include <trace/events/syscalls.h> 45 + 43 46 /* This mask defines the bits of the SR which the user is not allowed to 44 47 change, which are everything except S, Q, M, PR, SZ, FR. */ 45 48 #define SR_MASK (0xffff8cfd) ··· 441 438 */ 442 439 ret = -1LL; 443 440 441 + if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 442 + trace_sys_enter(regs, regs->regs[9]); 443 + 444 444 if (unlikely(current->audit_context)) 445 445 audit_syscall_entry(audit_arch(), regs->regs[1], 446 446 regs->regs[2], regs->regs[3], ··· 457 451 if (unlikely(current->audit_context)) 458 452 audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]), 459 453 regs->regs[9]); 454 + 455 + if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 456 + trace_sys_exit(regs, regs->regs[9]); 460 457 461 458 if (test_thread_flag(TIF_SYSCALL_TRACE)) 462 459 tracehook_report_syscall_exit(regs, 0);