diff options
Diffstat (limited to 'arch/tile/kernel/ptrace.c')
-rw-r--r-- | arch/tile/kernel/ptrace.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/arch/tile/kernel/ptrace.c b/arch/tile/kernel/ptrace.c index 9835312d5a91..0f83ed4602b2 100644 --- a/arch/tile/kernel/ptrace.c +++ b/arch/tile/kernel/ptrace.c | |||
@@ -21,9 +21,13 @@ | |||
21 | #include <linux/uaccess.h> | 21 | #include <linux/uaccess.h> |
22 | #include <linux/regset.h> | 22 | #include <linux/regset.h> |
23 | #include <linux/elf.h> | 23 | #include <linux/elf.h> |
24 | #include <linux/tracehook.h> | ||
24 | #include <asm/traps.h> | 25 | #include <asm/traps.h> |
25 | #include <arch/chip.h> | 26 | #include <arch/chip.h> |
26 | 27 | ||
28 | #define CREATE_TRACE_POINTS | ||
29 | #include <trace/events/syscalls.h> | ||
30 | |||
27 | void user_enable_single_step(struct task_struct *child) | 31 | void user_enable_single_step(struct task_struct *child) |
28 | { | 32 | { |
29 | set_tsk_thread_flag(child, TIF_SINGLESTEP); | 33 | set_tsk_thread_flag(child, TIF_SINGLESTEP); |
@@ -246,29 +250,26 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
246 | } | 250 | } |
247 | #endif | 251 | #endif |
248 | 252 | ||
249 | void do_syscall_trace(void) | 253 | int do_syscall_trace_enter(struct pt_regs *regs) |
250 | { | 254 | { |
251 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 255 | if (test_thread_flag(TIF_SYSCALL_TRACE)) { |
252 | return; | 256 | if (tracehook_report_syscall_entry(regs)) |
257 | regs->regs[TREG_SYSCALL_NR] = -1; | ||
258 | } | ||
253 | 259 | ||
254 | if (!(current->ptrace & PT_PTRACED)) | 260 | if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) |
255 | return; | 261 | trace_sys_enter(regs, regs->regs[TREG_SYSCALL_NR]); |
256 | 262 | ||
257 | /* | 263 | return regs->regs[TREG_SYSCALL_NR]; |
258 | * The 0x80 provides a way for the tracing parent to distinguish | 264 | } |
259 | * between a syscall stop and SIGTRAP delivery | ||
260 | */ | ||
261 | ptrace_notify(SIGTRAP|((current->ptrace & PT_TRACESYSGOOD) ? 0x80 : 0)); | ||
262 | 265 | ||
263 | /* | 266 | void do_syscall_trace_exit(struct pt_regs *regs) |
264 | * this isn't the same as continuing with a signal, but it will do | 267 | { |
265 | * for normal use. strace only continues with a signal if the | 268 | if (test_thread_flag(TIF_SYSCALL_TRACE)) |
266 | * stopping signal is not SIGTRAP. -brl | 269 | tracehook_report_syscall_exit(regs, 0); |
267 | */ | 270 | |
268 | if (current->exit_code) { | 271 | if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) |
269 | send_sig(current->exit_code, current, 1); | 272 | trace_sys_exit(regs, regs->regs[0]); |
270 | current->exit_code = 0; | ||
271 | } | ||
272 | } | 273 | } |
273 | 274 | ||
274 | void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code) | 275 | void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code) |