From: <ai...@us...> - 2003-10-05 07:54:51
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv22224 Modified Files: syscall.c entry.S Log Message: add syscall tracing Index: syscall.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/syscall.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- syscall.c 12 Feb 2003 02:37:33 -0000 1.11 +++ syscall.c 5 Oct 2003 07:54:43 -0000 1.12 @@ -31,6 +31,7 @@ Later we'll probably re-write this in asm. */ extern unsigned long *sys_call_table[256]; +extern void syscall_trace(void); void syscall_handler(struct pt_regs *regs, void *excep_info) { @@ -38,6 +39,9 @@ unsigned int *user_ap; unsigned int nr_args; + if (current->ptrace & PT_TRACESYS) + syscall_trace(); + chmk_arg = *(unsigned int *)(excep_info); if (chmk_arg >= NR_syscalls) { @@ -119,7 +123,8 @@ : "r0","r1","r2","r3","r4","r5" /* clobbers*/ ); // printk("syscall %d returned %ld (0x%08lx)\n", chmk_arg, regs->r0, regs->r0); - + if (current->ptrace & PT_TRACESYS) + syscall_trace(); return; } Index: entry.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/entry.S,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- entry.S 3 Oct 2003 11:47:06 -0000 1.10 +++ entry.S 5 Oct 2003 07:54:43 -0000 1.11 @@ -11,6 +11,8 @@ #include <linux/sys.h> #include <asm/mtpr.h> +tsk_ptrace = 24 + /* irqvec_handler is the generic handler for all interrupts and exceptions for which a driver (or other code) has registered a handler. Except machine checks. We are responsible for @@ -199,7 +201,16 @@ that we just scheduled away from on this CPU). */ pushl %r0 calls $1, schedule_tail + mfpr $0, %r0 + bicl2 $0x00001fff,%r0 + movl tsk_ptrace(%r0), %r0 + cmpl $0x02, %r0 + bneq tracesys_exit brb ret_from_syscall + +tracesys_exit: + calls $0, syscall_trace + brb ret_from_syscall /* irqvec_stray is the generic handler for all exceptions and interrupts for which there is no registered handler. We just save all registers, |