ptrace.c (5632a9fbcd451892332d45553ce8b831d5143691) | ptrace.c (fc79168a7c75423047d60a033dc4844955ccae0b) |
---|---|
1/* 2 * Kernel support for the ptrace() and syscall tracing interfaces. 3 * 4 * Copyright (C) 2000 Hewlett-Packard Co, Linuxcare Inc. 5 * Copyright (C) 2000 Matthew Wilcox <matthew@wil.cx> 6 * Copyright (C) 2000 David Huggins-Daines <dhd@debian.org> 7 * Copyright (C) 2008 Helge Deller <deller@gmx.de> 8 */ --- 16 unchanged lines hidden (view full) --- 25#include <asm/uaccess.h> 26#include <asm/pgtable.h> 27#include <asm/processor.h> 28#include <asm/asm-offsets.h> 29 30/* PSW bits we allow the debugger to modify */ 31#define USER_PSW_BITS (PSW_N | PSW_B | PSW_V | PSW_CB) 32 | 1/* 2 * Kernel support for the ptrace() and syscall tracing interfaces. 3 * 4 * Copyright (C) 2000 Hewlett-Packard Co, Linuxcare Inc. 5 * Copyright (C) 2000 Matthew Wilcox <matthew@wil.cx> 6 * Copyright (C) 2000 David Huggins-Daines <dhd@debian.org> 7 * Copyright (C) 2008 Helge Deller <deller@gmx.de> 8 */ --- 16 unchanged lines hidden (view full) --- 25#include <asm/uaccess.h> 26#include <asm/pgtable.h> 27#include <asm/processor.h> 28#include <asm/asm-offsets.h> 29 30/* PSW bits we allow the debugger to modify */ 31#define USER_PSW_BITS (PSW_N | PSW_B | PSW_V | PSW_CB) 32 |
33#define CREATE_TRACE_POINTS 34#include <trace/events/syscalls.h> 35 |
|
33/* 34 * Called by kernel/ptrace.c when detaching.. 35 * 36 * Make sure single step bits etc are not set. 37 */ 38void ptrace_disable(struct task_struct *task) 39{ 40 clear_tsk_thread_flag(task, TIF_SINGLESTEP); --- 237 unchanged lines hidden (view full) --- 278 /* 279 * Tracing decided this syscall should not happen or the 280 * debugger stored an invalid system call number. Skip 281 * the system call and the system call restart handling. 282 */ 283 regs->gr[20] = -1UL; 284 goto out; 285 } | 36/* 37 * Called by kernel/ptrace.c when detaching.. 38 * 39 * Make sure single step bits etc are not set. 40 */ 41void ptrace_disable(struct task_struct *task) 42{ 43 clear_tsk_thread_flag(task, TIF_SINGLESTEP); --- 237 unchanged lines hidden (view full) --- 281 /* 282 * Tracing decided this syscall should not happen or the 283 * debugger stored an invalid system call number. Skip 284 * the system call and the system call restart handling. 285 */ 286 regs->gr[20] = -1UL; 287 goto out; 288 } |
289#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS 290 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 291 trace_sys_enter(regs, regs->gr[20]); 292#endif |
|
286 287#ifdef CONFIG_64BIT 288 if (!is_compat_task()) 289 audit_syscall_entry(regs->gr[20], regs->gr[26], regs->gr[25], 290 regs->gr[24], regs->gr[23]); 291 else 292#endif 293 audit_syscall_entry(regs->gr[20] & 0xffffffff, --- 12 unchanged lines hidden (view full) --- 306 307void do_syscall_trace_exit(struct pt_regs *regs) 308{ 309 int stepping = test_thread_flag(TIF_SINGLESTEP) || 310 test_thread_flag(TIF_BLOCKSTEP); 311 312 audit_syscall_exit(regs); 313 | 293 294#ifdef CONFIG_64BIT 295 if (!is_compat_task()) 296 audit_syscall_entry(regs->gr[20], regs->gr[26], regs->gr[25], 297 regs->gr[24], regs->gr[23]); 298 else 299#endif 300 audit_syscall_entry(regs->gr[20] & 0xffffffff, --- 12 unchanged lines hidden (view full) --- 313 314void do_syscall_trace_exit(struct pt_regs *regs) 315{ 316 int stepping = test_thread_flag(TIF_SINGLESTEP) || 317 test_thread_flag(TIF_BLOCKSTEP); 318 319 audit_syscall_exit(regs); 320 |
321#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS 322 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 323 trace_sys_exit(regs, regs->gr[20]); 324#endif 325 |
|
314 if (stepping || test_thread_flag(TIF_SYSCALL_TRACE)) 315 tracehook_report_syscall_exit(regs, stepping); 316} | 326 if (stepping || test_thread_flag(TIF_SYSCALL_TRACE)) 327 tracehook_report_syscall_exit(regs, stepping); 328} |