Subject: {sys,}trace_enter and retval arg
To: None <tech-kern@netbsd.org>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-kern
Date: 10/27/2003 12:14:39
Folks,

trace_enter() and systrace_enter() don't use the return val arg
parsed to them.  Anyone mind if I remove them?  A mechanical diff
is below - I've test-compiled on a few archs so far without errors.

Simon.
--
Simon Burge                                   <simonb@wasabisystems.com>
NetBSD Development, Support and Service:   http://www.wasabisystems.com/


Index: sys/systm.h
===================================================================
RCS file: /cvsroot/src/sys/sys/systm.h,v
retrieving revision 1.167
diff -d -p -u -r1.167 systm.h
--- sys/systm.h	26 Oct 2003 10:45:03 -0000	1.167
+++ sys/systm.h	27 Oct 2003 01:08:56 -0000
@@ -338,7 +338,7 @@ void	doforkhooks __P((struct proc *, str
  * kernel syscall tracing/debugging hooks.
  */
 int	trace_enter __P((struct lwp *, register_t, register_t,
-	    const struct sysent *, void *, register_t []));
+	    const struct sysent *, void *));
 void	trace_exit __P((struct lwp *, register_t, void *, register_t [], int));
 
 int	uiomove __P((void *, size_t, struct uio *));
Index: sys/systrace.h
===================================================================
RCS file: /cvsroot/src/sys/sys/systrace.h,v
retrieving revision 1.11
diff -d -p -u -r1.11 systrace.h
--- sys/systrace.h	25 Aug 2003 09:12:42 -0000	1.11
+++ sys/systrace.h	27 Oct 2003 01:08:56 -0000
@@ -210,7 +210,7 @@ struct fsystrace {
 
 /* Internal prototypes */
 
-int systrace_enter(struct proc *, register_t, void *, register_t []);
+int systrace_enter(struct proc *, register_t, void *);
 void systrace_namei(struct nameidata *);
 void systrace_exit(struct proc *, register_t, void *, register_t [], int);
 void systrace_sys_exit(struct proc *);
Index: kern/kern_subr.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_subr.c,v
retrieving revision 1.106
diff -d -p -u -r1.106 kern_subr.c
--- kern/kern_subr.c	25 Oct 2003 18:31:59 -0000	1.106
+++ kern/kern_subr.c	27 Oct 2003 01:08:56 -0000
@@ -1270,8 +1270,7 @@ format_bytes(buf, len, bytes)
  */
 int
 trace_enter(struct lwp *l, register_t code,
-	register_t realcode, const struct sysent *callp, void *args,
-	register_t rval[])
+	register_t realcode, const struct sysent *callp, void *args)
 {
 #if defined(KTRACE) || defined(SYSTRACE)
 	struct proc *p = l->l_proc;
@@ -1288,7 +1287,7 @@ trace_enter(struct lwp *l, register_t co
 
 #ifdef SYSTRACE
 	if (ISSET(p->p_flag, P_SYSTRACE))
-		return systrace_enter(p, code, args, rval);
+		return systrace_enter(p, code, args);
 #endif
 	return 0;
 }
Index: kern/kern_systrace.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_systrace.c,v
retrieving revision 1.32
diff -d -p -u -r1.32 kern_systrace.c
--- kern/kern_systrace.c	13 Sep 2003 08:32:14 -0000	1.32
+++ kern/kern_systrace.c	27 Oct 2003 01:08:56 -0000
@@ -688,7 +688,7 @@ systrace_sys_fork(struct proc *oldproc, 
 }
 
 int
-systrace_enter(struct proc *p, register_t code, void *v, register_t retval[])
+systrace_enter(struct proc *p, register_t code, void *v)
 {
 	const struct sysent *callp;
 	struct str_process *strp;
Index: arch/alpha/alpha/linux_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/alpha/linux_syscall.c,v
retrieving revision 1.10
diff -d -p -u -r1.10 linux_syscall.c
--- arch/alpha/alpha/linux_syscall.c	17 Jan 2003 22:11:18 -0000	1.10
+++ arch/alpha/alpha/linux_syscall.c	27 Oct 2003 01:08:56 -0000
@@ -320,7 +320,7 @@ linux_syscall_fancy(struct lwp *l, u_int
 	args += hidden;
 
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/alpha/alpha/osf1_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/alpha/osf1_syscall.c,v
retrieving revision 1.12
diff -d -p -u -r1.12 osf1_syscall.c
--- arch/alpha/alpha/osf1_syscall.c	17 Jan 2003 22:11:18 -0000	1.12
+++ arch/alpha/alpha/osf1_syscall.c	27 Oct 2003 01:08:56 -0000
@@ -315,7 +315,7 @@ osf1_syscall_fancy(struct lwp *l, u_int6
 	}
 	args += hidden;
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/alpha/alpha/syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/alpha/syscall.c,v
retrieving revision 1.10
diff -d -p -u -r1.10 syscall.c
--- arch/alpha/alpha/syscall.c	24 Aug 2003 16:36:10 -0000	1.10
+++ arch/alpha/alpha/syscall.c	27 Oct 2003 01:08:56 -0000
@@ -321,7 +321,7 @@ syscall_fancy(struct lwp *l, u_int64_t c
 	}
 	args += hidden;
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/amd64/amd64/netbsd32_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/amd64/netbsd32_syscall.c,v
retrieving revision 1.3
diff -d -p -u -r1.3 netbsd32_syscall.c
--- arch/amd64/amd64/netbsd32_syscall.c	20 Aug 2003 21:48:48 -0000	1.3
+++ arch/amd64/amd64/netbsd32_syscall.c	27 Oct 2003 01:08:56 -0000
@@ -246,7 +246,7 @@ netbsd32_syscall_fancy(frame)
 		for (i = 0; i < (argsize >> 2); i++)
 			args64[i] = args[i];
 		/* XXX we need to pass argsize << 1 here? */
-		if ((error = trace_enter(l, code, code, NULL, args64, rval)) != 0)
+		if ((error = trace_enter(l, code, code, NULL, args64)) != 0)
 			goto bad;
 	}
 #endif
Index: arch/amd64/amd64/syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/amd64/syscall.c,v
retrieving revision 1.4
diff -d -p -u -r1.4 syscall.c
--- arch/amd64/amd64/syscall.c	14 Oct 2003 18:54:34 -0000	1.4
+++ arch/amd64/amd64/syscall.c	27 Oct 2003 01:08:56 -0000
@@ -266,7 +266,7 @@ syscall_fancy(frame)
 	}
 
 	KERNEL_PROC_LOCK(l);
-	if ((error = trace_enter(l, code, code, NULL, argp, rval)) != 0) {
+	if ((error = trace_enter(l, code, code, NULL, argp)) != 0) {
 		KERNEL_PROC_UNLOCK(l);
 		goto bad;
 	}
Index: arch/arm/arm/linux_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/arm/linux_syscall.c,v
retrieving revision 1.9
diff -d -p -u -r1.9 linux_syscall.c
--- arch/arm/arm/linux_syscall.c	1 Mar 2003 04:36:38 -0000	1.9
+++ arch/arm/arm/linux_syscall.c	27 Oct 2003 01:08:56 -0000
@@ -199,7 +199,7 @@ linux_syscall_fancy(trapframe_t *frame, 
 	callp = p->p_emul->e_sysent + code;
 	nargs = callp->sy_argsize / sizeof(register_t);
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/arm/arm/syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/arm/syscall.c,v
retrieving revision 1.21
diff -d -p -u -r1.21 syscall.c
--- arch/arm/arm/syscall.c	26 Oct 2003 23:11:15 -0000	1.21
+++ arch/arm/arm/syscall.c	27 Oct 2003 01:08:57 -0000
@@ -414,7 +414,7 @@ syscall_fancy(struct trapframe *frame, s
 		args = copyargs;
 	}
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/hppa/hppa/trap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hppa/hppa/trap.c,v
retrieving revision 1.11
diff -d -p -u -r1.11 trap.c
--- arch/hppa/hppa/trap.c	21 Oct 2003 00:49:34 -0000	1.11
+++ arch/hppa/hppa/trap.c	27 Oct 2003 01:08:57 -0000
@@ -1086,7 +1086,7 @@ syscall(frame, args)
 		callp += code;
 	argsize = callp->sy_argsize;
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/i386/i386/freebsd_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/freebsd_syscall.c,v
retrieving revision 1.13
diff -d -p -u -r1.13 freebsd_syscall.c
--- arch/i386/i386/freebsd_syscall.c	20 Aug 2003 21:48:36 -0000	1.13
+++ arch/i386/i386/freebsd_syscall.c	27 Oct 2003 01:08:57 -0000
@@ -236,7 +236,7 @@ freebsd_syscall_fancy(frame)
 	}
 
 	KERNEL_PROC_LOCK(l);
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/i386/i386/ibcs2_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/ibcs2_syscall.c,v
retrieving revision 1.22
diff -d -p -u -r1.22 ibcs2_syscall.c
--- arch/i386/i386/ibcs2_syscall.c	20 Aug 2003 21:48:36 -0000	1.22
+++ arch/i386/i386/ibcs2_syscall.c	27 Oct 2003 01:08:57 -0000
@@ -231,7 +231,7 @@ ibcs2_syscall_fancy(frame)
 	}
 
 	KERNEL_PROC_LOCK(l);
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/i386/i386/linux_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/linux_syscall.c,v
retrieving revision 1.25
diff -d -p -u -r1.25 linux_syscall.c
--- arch/i386/i386/linux_syscall.c	20 Aug 2003 21:48:37 -0000	1.25
+++ arch/i386/i386/linux_syscall.c	27 Oct 2003 01:08:57 -0000
@@ -236,7 +236,7 @@ linux_syscall_fancy(frame)
 	}
 	KERNEL_PROC_LOCK(l);
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/i386/i386/mach_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/mach_syscall.c,v
retrieving revision 1.9
diff -d -p -u -r1.9 mach_syscall.c
--- arch/i386/i386/mach_syscall.c	20 Aug 2003 21:48:38 -0000	1.9
+++ arch/i386/i386/mach_syscall.c	27 Oct 2003 01:08:57 -0000
@@ -247,8 +247,7 @@ mach_syscall_fancy(frame)
 			goto bad;
 	}
 
-	if ((error = trace_enter(l, code, realcode, 
-	    callp - code, args, rval)) != 0)
+	if ((error = trace_enter(l, code, realcode, callp - code, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/i386/i386/svr4_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/svr4_syscall.c,v
retrieving revision 1.21
diff -d -p -u -r1.21 svr4_syscall.c
--- arch/i386/i386/svr4_syscall.c	20 Aug 2003 21:48:42 -0000	1.21
+++ arch/i386/i386/svr4_syscall.c	27 Oct 2003 01:08:57 -0000
@@ -226,7 +226,7 @@ svr4_syscall_fancy(frame)
 	}
 
 	KERNEL_PROC_LOCK(l);
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/i386/i386/syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/syscall.c,v
retrieving revision 1.25
diff -d -p -u -r1.25 syscall.c
--- arch/i386/i386/syscall.c	26 Oct 2003 10:48:08 -0000	1.25
+++ arch/i386/i386/syscall.c	27 Oct 2003 01:08:57 -0000
@@ -240,7 +240,7 @@ syscall_fancy(frame)
 	}
 
 	KERNEL_PROC_LOCK(l);
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0) {
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0) {
 		KERNEL_PROC_UNLOCK(l);
 		goto bad;
 	}
Index: arch/m68k/m68k/linux_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/m68k/m68k/linux_syscall.c,v
retrieving revision 1.6
diff -d -p -u -r1.6 linux_syscall.c
--- arch/m68k/m68k/linux_syscall.c	7 Aug 2003 16:28:17 -0000	1.6
+++ arch/m68k/m68k/linux_syscall.c	27 Oct 2003 01:08:57 -0000
@@ -287,7 +287,7 @@ linux_syscall_fancy(register_t code, str
 		break;
 	}
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/m68k/m68k/m68k_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/m68k/m68k/m68k_syscall.c,v
retrieving revision 1.12
diff -d -p -u -r1.12 m68k_syscall.c
--- arch/m68k/m68k/m68k_syscall.c	22 Sep 2003 14:18:42 -0000	1.12
+++ arch/m68k/m68k/m68k_syscall.c	27 Oct 2003 01:08:57 -0000
@@ -413,7 +413,7 @@ syscall_fancy(register_t code, struct lw
 			goto bad;
 	}
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/m68k/m68k/sunos_syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/m68k/m68k/sunos_syscall.c,v
retrieving revision 1.6
diff -d -p -u -r1.6 sunos_syscall.c
--- arch/m68k/m68k/sunos_syscall.c	7 Aug 2003 16:28:19 -0000	1.6
+++ arch/m68k/m68k/sunos_syscall.c	27 Oct 2003 01:08:57 -0000
@@ -340,7 +340,7 @@ sunos_syscall_fancy(register_t code, str
 			goto bad;
 	}
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/mips/mips/syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/mips/syscall.c,v
retrieving revision 1.17
diff -d -p -u -r1.17 syscall.c
--- arch/mips/mips/syscall.c	7 Aug 2003 16:28:34 -0000	1.17
+++ arch/mips/mips/syscall.c	27 Oct 2003 01:08:57 -0000
@@ -440,7 +440,7 @@ EMULNAME(syscall_fancy)(struct lwp *l, u
 		break;
 	}
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 #if !defined(_MIPS_BSD_API) || _MIPS_BSD_API == _MIPS_BSD_API_LP32
Index: arch/pc532/pc532/trap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/pc532/pc532/trap.c,v
retrieving revision 1.57
diff -d -p -u -r1.57 trap.c
--- arch/pc532/pc532/trap.c	21 Oct 2003 00:49:34 -0000	1.57
+++ arch/pc532/pc532/trap.c	27 Oct 2003 01:08:57 -0000
@@ -589,7 +589,7 @@ syscall(frame)
 			goto bad;
 	}
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/powerpc/powerpc/syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/powerpc/syscall.c,v
retrieving revision 1.22
diff -d -p -u -r1.22 syscall.c
--- arch/powerpc/powerpc/syscall.c	10 Jul 2003 04:18:01 -0000	1.22
+++ arch/powerpc/powerpc/syscall.c	27 Oct 2003 01:08:57 -0000
@@ -277,8 +277,7 @@ EMULNAME(syscall_fancy)(struct trapframe
 		params = args;
 	}
 
-	if ((error = trace_enter(l, code, realcode, 
-	    callp - code, params, rval)) != 0)
+	if ((error = trace_enter(l, code, realcode, callp - code, params)) != 0)
 		goto syscall_bad;
 
 	rval[0] = 0;
Index: arch/sh3/sh3/exception.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sh3/sh3/exception.c,v
retrieving revision 1.12
diff -d -p -u -r1.12 exception.c
--- arch/sh3/sh3/exception.c	22 Oct 2003 21:10:15 -0000	1.12
+++ arch/sh3/sh3/exception.c	27 Oct 2003 01:08:57 -0000
@@ -331,7 +331,7 @@ syscall(struct lwp *l, struct trapframe 
 	if (error)
 		goto bad;
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/sh5/sh5/syscall.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sh5/sh5/syscall.c,v
retrieving revision 1.11
diff -d -p -u -r1.11 syscall.c
--- arch/sh5/sh5/syscall.c	15 Jul 2003 03:36:01 -0000	1.11
+++ arch/sh5/sh5/syscall.c	27 Oct 2003 01:08:58 -0000
@@ -348,7 +348,7 @@ syscall_fancy(struct lwp *l, struct trap
 
 	args += hidden;
 
-	if ((error = trace_enter(l, code, code, NULL, args, rval)) != 0)
+	if ((error = trace_enter(l, code, code, NULL, args)) != 0)
 		goto bad;
 
 	rval[0] = 0;
Index: arch/sparc/sparc/trap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/sparc/trap.c,v
retrieving revision 1.147
diff -d -p -u -r1.147 trap.c
--- arch/sparc/sparc/trap.c	15 Oct 2003 07:49:41 -0000	1.147
+++ arch/sparc/sparc/trap.c	27 Oct 2003 01:08:58 -0000
@@ -1477,7 +1477,7 @@ syscall(code, tf, pc)
 	if ((callp->sy_flags & SYCALL_MPSAFE) == 0)
 		KERNEL_PROC_LOCK(l);
 
-	if ((error = trace_enter(l, code, code, NULL, args.i, rval)) != 0) {
+	if ((error = trace_enter(l, code, code, NULL, args.i)) != 0) {
 		if ((callp->sy_flags & SYCALL_MPSAFE) == 0)
 			KERNEL_PROC_UNLOCK(l);
 		goto bad;
Index: arch/vax/vax/trap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/vax/vax/trap.c,v
retrieving revision 1.87
diff -d -p -u -r1.87 trap.c
--- arch/vax/vax/trap.c	18 Oct 2003 12:07:44 -0000	1.87
+++ arch/vax/vax/trap.c	27 Oct 2003 01:08:58 -0000
@@ -447,7 +447,7 @@ if(startsysc)printf("trap syscall %s pc 
 			goto bad;
 	}
 
-	if ((err = trace_enter(l, frame->code, frame->code, NULL, args, rval)) != 0)
+	if ((err = trace_enter(l, frame->code, frame->code, NULL, args)) != 0)
 		goto bad;
 
 	err = (*callp->sy_call)(curlwp, args, rval);