/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/ptrace/ |
H A D | Makefile | 3 TM_TESTS := ptrace-tm-gpr 4 TM_TESTS += ptrace-tm-spd-gpr 5 TM_TESTS += ptrace-tm-spd-tar 6 TM_TESTS += ptrace-tm-spd-vsx 7 TM_TESTS += ptrace-tm-spr 8 TM_TESTS += ptrace-tm-tar 9 TM_TESTS += ptrace-tm-vsx 14 TESTS_64 += ptrace-hwbreak 15 TESTS_64 += ptrace-perf-hwbreak 16 TESTS_64 += ptrace [all...] |
H A D | ptrace.h | 17 #include <sys/ptrace.h> 63 /* Basic ptrace operations */ 68 ret = ptrace(PTRACE_ATTACH, child, NULL, NULL); in start_trace() 70 perror("ptrace(PTRACE_ATTACH) failed"); in start_trace() 85 ret = ptrace(PTRACE_DETACH, child, NULL, NULL); in stop_trace() 87 perror("ptrace(PTRACE_DETACH) failed"); in stop_trace() 97 ret = ptrace(PTRACE_CONT, child, NULL, NULL); in cont_trace() 99 perror("ptrace(PTRACE_CONT) failed"); in cont_trace() 116 ret = ptrace(PTRACE_GETREGSET, child, type, &iov); in ptrace_read_regs() 136 ret = ptrace(PTRACE_SETREGSE in ptrace_write_regs() [all...] |
H A D | ptrace-syscall.c | 3 * A ptrace test for testing PTRACE_SYSEMU, PTRACE_SETREGS and 13 #include <sys/ptrace.h> 66 * Child process is running 4 syscalls after ptrace. in test_ptrace_syscall_restart() 74 if (ptrace(PTRACE_TRACEME, 0, 0, 0) != 0) in test_ptrace_syscall_restart() 92 if (ptrace(PTRACE_SYSEMU, chld, 0, 0) != 0) in test_ptrace_syscall_restart() 96 if (ptrace(PTRACE_GETREGS, chld, 0, ®s) != 0) in test_ptrace_syscall_restart() 127 if (ptrace(PTRACE_SETREGS, chld, 0, ®s) != 0) in test_ptrace_syscall_restart() 130 if (ptrace(PTRACE_SYSEMU, chld, 0, 0) != 0) in test_ptrace_syscall_restart() 134 if (ptrace(PTRACE_GETREGS, chld, 0, ®s) != 0) in test_ptrace_syscall_restart() 170 if (ptrace(PTRACE_SETREG in test_ptrace_syscall_restart() [all...] |
H A D | ptrace-hwbreak.c | 9 * types of ptrace enabled breakpoints 14 #include <sys/ptrace.h> 25 #include "ptrace.h" 54 if (ptrace(PPC_PTRACE_GETHWDBGINFO, child_pid, NULL, dbginfo)) { in get_dbginfo() 121 if (ptrace(PTRACE_TRACEME, 0, NULL, 0)) { in test_workload() 224 ptrace(PTRACE_GETSIGINFO, child_pid, NULL, &siginfo); in check_success() 237 * For ptrace registered watchpoint, signal is generated in check_success() 241 ptrace(PTRACE_SINGLESTEP, child_pid, NULL, 0); in check_success() 248 if (ptrace(PTRACE_SET_DEBUGREG, child_pid, 0, wp_addr)) { in ptrace_set_debugreg() 256 int wh = ptrace(PPC_PTRACE_SETHWDEBU in ptrace_sethwdebug() [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/ptrace/ |
H A D | Makefile | 2 TEST_GEN_PROGS := ptrace-gpr ptrace-tm-gpr ptrace-tm-spd-gpr \ 3 ptrace-tar ptrace-tm-tar ptrace-tm-spd-tar ptrace-vsx ptrace-tm-vsx \ 4 ptrace-tm-spd-vsx ptrace [all...] |
H A D | ptrace.h | 14 #include <sys/ptrace.h> 59 /* Basic ptrace operations */ 64 ret = ptrace(PTRACE_ATTACH, child, NULL, NULL); in start_trace() 66 perror("ptrace(PTRACE_ATTACH) failed"); in start_trace() 81 ret = ptrace(PTRACE_DETACH, child, NULL, NULL); in stop_trace() 83 perror("ptrace(PTRACE_DETACH) failed"); in stop_trace() 93 ret = ptrace(PTRACE_CONT, child, NULL, NULL); in cont_trace() 95 perror("ptrace(PTRACE_CONT) failed"); in cont_trace() 112 ret = ptrace(PTRACE_GETREGSET, child, type, &iov); in ptrace_read_regs() 132 ret = ptrace(PTRACE_SETREGSE in ptrace_write_regs() [all...] |
H A D | ptrace-hwbreak.c | 9 * types of ptrace enabled breakpoints 14 #include <sys/ptrace.h> 25 #include "ptrace.h" 53 if (ptrace(PPC_PTRACE_GETHWDBGINFO, child_pid, NULL, dbginfo)) { in get_dbginfo() 120 if (ptrace(PTRACE_TRACEME, 0, NULL, 0)) { in test_workload() 211 ptrace(PTRACE_GETSIGINFO, child_pid, NULL, &siginfo); in check_success() 224 * For ptrace registered watchpoint, signal is generated in check_success() 228 ptrace(PTRACE_SINGLESTEP, child_pid, NULL, 0); in check_success() 235 if (ptrace(PTRACE_SET_DEBUGREG, child_pid, 0, wp_addr)) { in ptrace_set_debugreg() 243 int wh = ptrace(PPC_PTRACE_SETHWDEBU in ptrace_sethwdebug() [all...] |
H A D | ptrace-syscall.c | 3 * A ptrace test for testing PTRACE_SYSEMU, PTRACE_SETREGS and 13 #include <sys/ptrace.h> 66 * Child process is running 4 syscalls after ptrace. in test_ptrace_syscall_restart() 74 if (ptrace(PTRACE_TRACEME, 0, 0, 0) != 0) in test_ptrace_syscall_restart() 92 if (ptrace(PTRACE_SYSEMU, chld, 0, 0) != 0) in test_ptrace_syscall_restart() 96 if (ptrace(PTRACE_GETREGS, chld, 0, ®s) != 0) in test_ptrace_syscall_restart() 127 if (ptrace(PTRACE_SETREGS, chld, 0, ®s) != 0) in test_ptrace_syscall_restart() 130 if (ptrace(PTRACE_SYSEMU, chld, 0, 0) != 0) in test_ptrace_syscall_restart() 134 if (ptrace(PTRACE_GETREGS, chld, 0, ®s) != 0) in test_ptrace_syscall_restart() 170 if (ptrace(PTRACE_SETREG in test_ptrace_syscall_restart() [all...] |
/kernel/linux/linux-5.10/tools/perf/arch/x86/tests/ |
H A D | bp-modify.c | 11 #include <sys/ptrace.h> 12 #include <asm/ptrace.h> 40 int err = ptrace(PTRACE_TRACEME, 0, NULL, NULL); in spawn_child() 81 if (ptrace(PTRACE_POKEUSER, child, in bp_modify1() 88 if (ptrace(PTRACE_POKEUSER, child, in bp_modify1() 95 if (ptrace(PTRACE_POKEUSER, child, in bp_modify1() 101 if (ptrace(PTRACE_CONT, child, NULL, NULL)) { in bp_modify1() 112 rip = ptrace(PTRACE_PEEKUSER, child, in bp_modify1() 123 if (ptrace(PTRACE_DETACH, child, NULL, NULL)) { in bp_modify1() 158 if (ptrace(PTRACE_POKEUSE in bp_modify2() [all...] |
/kernel/linux/linux-6.6/tools/perf/arch/x86/tests/ |
H A D | bp-modify.c | 11 #include <sys/ptrace.h> 12 #include <asm/ptrace.h> 40 int err = ptrace(PTRACE_TRACEME, 0, NULL, NULL); in spawn_child() 81 if (ptrace(PTRACE_POKEUSER, child, in bp_modify1() 88 if (ptrace(PTRACE_POKEUSER, child, in bp_modify1() 95 if (ptrace(PTRACE_POKEUSER, child, in bp_modify1() 101 if (ptrace(PTRACE_CONT, child, NULL, NULL)) { in bp_modify1() 112 rip = ptrace(PTRACE_PEEKUSER, child, in bp_modify1() 123 if (ptrace(PTRACE_DETACH, child, NULL, NULL)) { in bp_modify1() 158 if (ptrace(PTRACE_POKEUSE in bp_modify2() [all...] |
/kernel/linux/linux-6.6/include/linux/ |
H A D | ptrace.h | 11 #include <uapi/linux/ptrace.h> 26 * The owner ship rules for task->ptrace which holds the ptrace 27 * flags is simple. When a task is running it owns it's task->ptrace 28 * flags. When the a task is stopped the ptracer owns task->ptrace. 86 * process_vm_writev or ptrace (and should use the real credentials). 97 if (unlikely(child->ptrace)) in ptrace_unlink() 119 if (unlikely(task->ptrace)) in ptrace_parent() 125 * ptrace_event_enabled - test whether a ptrace event is enabled 135 return task->ptrace in ptrace_event_enabled() 200 ptrace_init_task(struct task_struct *child, bool ptrace) ptrace_init_task() argument 409 int ptrace = current->ptrace; ptrace_report_syscall() local [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/arm64/abi/ |
H A D | ptrace.c | 14 #include <sys/ptrace.h> 19 #include <asm/ptrace.h> 45 ret = ptrace(PTRACE_GETREGSET, child, NT_ARM_TLS, &read_iov); in test_tpidr() 51 ret = ptrace(PTRACE_SETREGSET, child, NT_ARM_TLS, &write_iov); in test_tpidr() 55 ret = ptrace(PTRACE_GETREGSET, child, NT_ARM_TLS, &read_iov); in test_tpidr() 61 ret = ptrace(PTRACE_GETREGSET, child, NT_ARM_TLS, &read_iov); in test_tpidr() 82 ret = ptrace(PTRACE_SETREGSET, child, NT_ARM_TLS, &write_iov); in test_tpidr() 90 ret = ptrace(PTRACE_GETREGSET, child, NT_ARM_TLS, &read_iov); in test_tpidr() 112 ret = ptrace(PTRACE_SETREGSET, child, NT_ARM_TLS, &write_iov); in test_tpidr() 117 ret = ptrace(PTRACE_GETREGSE in test_tpidr() [all...] |
/kernel/linux/linux-5.10/arch/x86/um/os-Linux/ |
H A D | registers.c | 9 #include <sys/ptrace.h> 23 if (ptrace(PTRACE_GETFPREGS, pid, 0, fp_regs) < 0) in save_i387_registers() 36 if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) < 0) in save_fp_registers() 46 if (ptrace(PTRACE_SETFPREGS, pid, 0, fp_regs) < 0) in restore_i387_registers() 58 if (ptrace(PTRACE_SETREGSET, pid, NT_X86_XSTATE, &iov) < 0) in restore_fp_registers() 70 if (ptrace(PTRACE_GETFPXREGS, pid, 0, fp_regs) < 0) in save_fpx_registers() 77 if (ptrace(PTRACE_SETFPXREGS, pid, 0, fp_regs) < 0) in restore_fpx_registers() 103 err = ptrace(PTRACE_GETFPXREGS, pid, 0, &fpx_regs); in arch_init_registers() 137 if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) == 0) in arch_init_registers()
|
/kernel/linux/linux-6.6/arch/x86/um/os-Linux/ |
H A D | registers.c | 9 #include <sys/ptrace.h> 24 if (ptrace(PTRACE_GETFPREGS, pid, 0, fp_regs) < 0) in save_i387_registers() 37 if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) < 0) in save_fp_registers() 47 if (ptrace(PTRACE_SETFPREGS, pid, 0, fp_regs) < 0) in restore_i387_registers() 59 if (ptrace(PTRACE_SETREGSET, pid, NT_X86_XSTATE, &iov) < 0) in restore_fp_registers() 71 if (ptrace(PTRACE_GETFPXREGS, pid, 0, fp_regs) < 0) in save_fpx_registers() 78 if (ptrace(PTRACE_SETFPXREGS, pid, 0, fp_regs) < 0) in restore_fpx_registers() 104 err = ptrace(PTRACE_GETFPXREGS, pid, 0, &fpx_regs); in arch_init_registers() 138 if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) == 0) in arch_init_registers()
|
/kernel/linux/linux-6.6/tools/testing/selftests/arm64/fp/ |
H A D | Makefile | 9 sve-ptrace sve-probe-vls \ 11 za-fork za-ptrace 17 zt-ptrace \ 31 $(OUTPUT)/sve-ptrace: sve-ptrace.c 43 $(OUTPUT)/za-ptrace: za-ptrace.c 46 $(OUTPUT)/zt-ptrace: zt-ptrace.c
|
/kernel/linux/linux-5.10/include/linux/ |
H A D | ptrace.h | 11 #include <uapi/linux/ptrace.h> 26 * The owner ship rules for task->ptrace which holds the ptrace 27 * flags is simple. When a task is running it owns it's task->ptrace 28 * flags. When the a task is stopped the ptracer owns task->ptrace. 86 * process_vm_writev or ptrace (and should use the real credentials). 97 if (unlikely(child->ptrace)) in ptrace_unlink() 119 if (unlikely(task->ptrace)) in ptrace_parent() 125 * ptrace_event_enabled - test whether a ptrace event is enabled 135 return task->ptrace in ptrace_event_enabled() 201 ptrace_init_task(struct task_struct *child, bool ptrace) ptrace_init_task() argument [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/x86/ |
H A D | ptrace_syscall.c | 4 #include <sys/ptrace.h> 15 #include <asm/ptrace-abi.h> 183 if (ptrace(PTRACE_TRACEME, 0, 0, 0) != 0) in test_ptrace_syscall_restart() 204 if (ptrace(PTRACE_SYSEMU, chld, 0, 0) != 0) in test_ptrace_syscall_restart() 208 if (ptrace(PTRACE_GETREGS, chld, 0, ®s) != 0) in test_ptrace_syscall_restart() 227 * magical. It needs to work so that ptrace and syscall restart in test_ptrace_syscall_restart() 232 if (ptrace(PTRACE_SETREGS, chld, 0, ®s) != 0) in test_ptrace_syscall_restart() 235 if (ptrace(PTRACE_SYSEMU, chld, 0, 0) != 0) in test_ptrace_syscall_restart() 239 if (ptrace(PTRACE_GETREGS, chld, 0, ®s) != 0) in test_ptrace_syscall_restart() 264 if (ptrace(PTRACE_SETREG in test_ptrace_syscall_restart() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/x86/ |
H A D | ptrace_syscall.c | 4 #include <sys/ptrace.h> 15 #include <asm/ptrace-abi.h> 183 if (ptrace(PTRACE_TRACEME, 0, 0, 0) != 0) in test_ptrace_syscall_restart() 204 if (ptrace(PTRACE_SYSEMU, chld, 0, 0) != 0) in test_ptrace_syscall_restart() 208 if (ptrace(PTRACE_GETREGS, chld, 0, ®s) != 0) in test_ptrace_syscall_restart() 227 * magical. It needs to work so that ptrace and syscall restart in test_ptrace_syscall_restart() 232 if (ptrace(PTRACE_SETREGS, chld, 0, ®s) != 0) in test_ptrace_syscall_restart() 235 if (ptrace(PTRACE_SYSEMU, chld, 0, 0) != 0) in test_ptrace_syscall_restart() 239 if (ptrace(PTRACE_GETREGS, chld, 0, ®s) != 0) in test_ptrace_syscall_restart() 264 if (ptrace(PTRACE_SETREG in test_ptrace_syscall_restart() [all...] |
/kernel/linux/linux-5.10/arch/um/os-Linux/ |
H A D | registers.c | 9 #include <sys/ptrace.h> 10 #include <sysdep/ptrace.h> 18 err = ptrace(PTRACE_GETREGS, pid, 0, regs->gp); in save_registers() 28 err = ptrace(PTRACE_SETREGS, pid, 0, regs->gp); in restore_pid_registers() 43 err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); in init_pid_registers()
|
H A D | start_up.c | 36 ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) { in ptrace_child() 37 perror("ptrace"); in ptrace_child() 125 if (ptrace(PTRACE_CONT, pid, 0, 0) < 0) { in stop_ptraced_child() 126 perror("stop_ptraced_child : ptrace failed"); in stop_ptraced_child() 157 " Turns off syscall emulation patch for ptrace (SYSEMU).\n" 159 " behaviour of ptrace() and helps reduce host context switch rates.\n" 169 os_info("Checking syscall emulation patch for ptrace..."); in check_sysemu() 173 if (ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0) in check_sysemu() 183 if (ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) in check_sysemu() 191 n = ptrace(PTRACE_POKEUSE in check_sysemu() [all...] |
/kernel/linux/linux-6.6/arch/um/os-Linux/ |
H A D | registers.c | 9 #include <sys/ptrace.h> 10 #include <sysdep/ptrace.h> 18 err = ptrace(PTRACE_GETREGS, pid, 0, regs->gp); in save_registers() 28 err = ptrace(PTRACE_SETREGS, pid, 0, regs->gp); in restore_pid_registers() 43 err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); in init_pid_registers()
|
H A D | start_up.c | 36 ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) { in ptrace_child() 37 perror("ptrace"); in ptrace_child() 125 if (ptrace(PTRACE_CONT, pid, 0, 0) < 0) { in stop_ptraced_child() 126 perror("stop_ptraced_child : ptrace failed"); in stop_ptraced_child() 157 " Turns off syscall emulation patch for ptrace (SYSEMU).\n" 159 " behaviour of ptrace() and helps reduce host context switch rates.\n" 169 os_info("Checking syscall emulation patch for ptrace..."); in check_sysemu() 173 if (ptrace(PTRACE_SYSEMU, pid, 0, 0) < 0) in check_sysemu() 183 if (ptrace(PTRACE_GETREGS, pid, 0, regs) < 0) in check_sysemu() 191 n = ptrace(PTRACE_POKEUSE in check_sysemu() [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/breakpoints/ |
H A D | breakpoint_test.c | 9 #include <sys/ptrace.h> 46 ret = ptrace(PTRACE_POKEUSER, child_pid, in set_breakpoint_addr() 88 dr7 = ptrace(PTRACE_PEEKUSER, child_pid, in toggle_breakpoint() 108 ret = ptrace(PTRACE_POKEUSER, child_pid, in toggle_breakpoint() 209 ret = ptrace(PTRACE_TRACEME, 0, NULL, 0); in trigger_tests() 276 child_nr_tests = ptrace(PTRACE_PEEKDATA, child_pid, in check_success() 280 if (ptrace(PTRACE_POKEDATA, child_pid, &trapped, 1)) in check_success() 299 ptrace(PTRACE_CONT, child_pid, NULL, 0); in launch_instruction_breakpoints() 321 ptrace(PTRACE_CONT, child_pid, NULL, 0); in launch_watchpoints() 377 ptrace(PTRACE_CON in launch_tests() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/breakpoints/ |
H A D | breakpoint_test.c | 9 #include <sys/ptrace.h> 46 ret = ptrace(PTRACE_POKEUSER, child_pid, in set_breakpoint_addr() 88 dr7 = ptrace(PTRACE_PEEKUSER, child_pid, in toggle_breakpoint() 108 ret = ptrace(PTRACE_POKEUSER, child_pid, in toggle_breakpoint() 209 ret = ptrace(PTRACE_TRACEME, 0, NULL, 0); in trigger_tests() 276 child_nr_tests = ptrace(PTRACE_PEEKDATA, child_pid, in check_success() 280 if (ptrace(PTRACE_POKEDATA, child_pid, &trapped, 1)) in check_success() 299 ptrace(PTRACE_CONT, child_pid, NULL, 0); in launch_instruction_breakpoints() 321 ptrace(PTRACE_CONT, child_pid, NULL, 0); in launch_watchpoints() 377 ptrace(PTRACE_CON in launch_tests() [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/arm64/fp/ |
H A D | Makefile | 4 TEST_GEN_PROGS := sve-ptrace sve-probe-vls 11 sve-ptrace: sve-ptrace.o sve-ptrace-asm.o
|