ptrace_multi: speedup for virtual machines (and debuggers) running on ptrace
Subsystems (3)
PATCH 1/2 ptrace_multi: speedup for virtual machines (and debuggers) running on ptrace
This patch implements PTRACE_MULTI.
Several ptrace requests can be packed up and sent together to the kernel. This speeds up Virtual Machines and, if you like, debuggers.
Signed-off-by Renzo Davoli <[email protected]>
---
include/linux/mm.h +1 -0
@@ -804,6 +804,7 @@extern int make_pages_present (unsigned long addr,unsigned long end);extern int access_process_vm (struct task_struct *tsk,unsigned long addr,void *buf,int len,int write); +extern int access_process_vm_user (struct task_struct *tsk,unsigned long addr,char __user *ubuf,int len,int write,int string);int get_user_pages (struct task_struct *tsk,struct mm_struct *mm,unsigned long start,int len,int write,int force,struct page **pages,struct vm_area_struct **vmas);
include/linux/ptrace.h +13 -0
@@ -27,6 +27,18 @@#define PTRACE_GETSIGINFO 0x4202#define PTRACE_SETSIGINFO 0x4203 +#define PTRACE_MULTI 0x4300 +#define PTRACE_PEEKCHARDATA 0x4301 +#define PTRACE_POKECHARDATA 0x4302 +#define PTRACE_PEEKSTRINGDATA 0x4303 + +struct ptrace_multi { +long request; +long addr; +void *localaddr; +long length; +}; +/* options set using PTRACE_SETOPTIONS */ #define PTRACE_O_TRACESYSGOOD 0x00000001#define PTRACE_O_TRACEFORK 0x00000002
@@ -84,6 +96,7 @@extern struct task_struct *ptrace_get_task_struct (pid_t pid);extern int ptrace_traceme (void );extern int ptrace_readdata (struct task_struct *tsk,unsigned long src,char __user *dst,int len); +extern int ptrace_readstringdata (struct task_struct *tsk,unsigned long src,char __user *dst,int len);extern int ptrace_writedata (struct task_struct *tsk,char __user *src,unsigned long dst,int len);extern int ptrace_attach (struct task_struct *tsk);extern int ptrace_detach (struct task_struct *,unsigned int );
kernel/ptrace.c +118 -46
205 lines not on this page · raw message
mm/memory.c +68 -0
74 lines not on this page · raw message
patch-linux-2.6.25.5-ptrace_vm +1 -0
@@ -0,0 +1 @@ +diff -Naur linux-2.6.25.5 linux-2.6.25.5.ptrace_vm