aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/ptrace.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 13:48:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 13:48:34 -0400
commit8a72f3820c4d14b27ad5336aed00063a7a7f1bef (patch)
treec6806e79915ce5c04a7f2574208c4b2f179dd7b2 /arch/tile/kernel/ptrace.c
parentbf5d770bd234a1e66322dd79c4ae5b397cd2b9c1 (diff)
parent9fc1894c9883439245b225d16100d6a55b25373a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Pull tile arch changes from Chris Metcalf: "These are some minor new feature work and other changes that didn't merit getting pushed up after the 3.9 merge window closed. There should be a lot more activity in the 3.11 merge window" * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: arch/tile: Fix syscall return value passed to tracepoint tile: comment assumption about __insn_mtspr for <asm/irqflags.h> tile: ns2cycles should use __raw_get_cpu_var arch: remove KCORE_ELF again [tile] tile: remove two outdated Kconfig entries tile: support atomic64_dec_if_positive() tile: support TIF_SYSCALL_TRACEPOINT; select HAVE_SYSCALL_TRACEPOINTS tile: Add definition of NR_syscalls tile: move declaration of sys_call_table to <asm/syscall.h> arch/tile: Enable HAVE_ARCH_TRACEHOOK arch/tile: Call tracehook_report_syscall_{entry,exit} in syscall trace
Diffstat (limited to 'arch/tile/kernel/ptrace.c')
-rw-r--r--arch/tile/kernel/ptrace.c39
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
27void user_enable_single_step(struct task_struct *child) 31void 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
249void do_syscall_trace(void) 253int 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 /* 266void 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
274void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code) 275void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code)