diff options
| author | manu <manu@NetBSD.org> | 2006-09-23 22:11:59 +0000 |
|---|---|---|
| committer | manu <manu@NetBSD.org> | 2006-09-23 22:11:59 +0000 |
| commit | 63ac93df54cd459cfecfc28db459efb55f78bb02 (patch) | |
| tree | 44f6dd4751a21004633a7f90aac7f59b4b53c5ee /sys/compat/linux32/common/linux32_sysctl.c | |
| parent | f5b68de4eb5c9449947b5e81ca1c6a2347fe9b55 (diff) | |
Add sysctl tracing to emulations.
While we are there, fix a bug in FreeBSD sysctl emulation: use copyin for
moving data to the kernel
Diffstat (limited to 'sys/compat/linux32/common/linux32_sysctl.c')
| -rw-r--r-- | sys/compat/linux32/common/linux32_sysctl.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/sys/compat/linux32/common/linux32_sysctl.c b/sys/compat/linux32/common/linux32_sysctl.c index 3c0d77cce94..d93f69841d7 100644 --- a/sys/compat/linux32/common/linux32_sysctl.c +++ b/sys/compat/linux32/common/linux32_sysctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_sysctl.c,v 1.2 2006/09/05 17:12:19 manu Exp $ */ +/* $NetBSD: linux32_sysctl.c,v 1.3 2006/09/23 22:12:00 manu Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -31,7 +31,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux32_sysctl.c,v 1.2 2006/09/05 17:12:19 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_sysctl.c,v 1.3 2006/09/23 22:12:00 manu Exp $"); + +#include "opt_ktrace.h" #include <sys/param.h> #include <sys/systm.h> @@ -41,6 +43,9 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_sysctl.c,v 1.2 2006/09/05 17:12:19 manu Exp #include <sys/sysctl.h> #include <sys/sa.h> #include <sys/syscallargs.h> +#ifdef KTRACE +#include <sys/ktrace.h> +#endif #include <compat/netbsd32/netbsd32.h> @@ -194,19 +199,11 @@ linux32_sys___sysctl(l, v, retval) ls32.nlen * sizeof(int))) != 0) return error; -#ifdef DEBUG_LINUX - { - int i = 0; - - printf("linux32_sysctl(%p, %d, %p, %p, %p, %d) [", - NETBSD32PTR64(ls32.name), ls32.nlen, - NETBSD32PTR64(ls32.oldval), NETBSD32PTR64(ls32.oldlenp), - NETBSD32PTR64(ls32.newval), ls32.newlen); - for (i = 0; i < ls32.nlen; i++) - printf("%d ", name[i]); - printf("]\n"); - } +#ifdef KTRACE + if (KTRPOINT(l->l_proc, KTR_MIB)) + ktrmib(l, name, ls32.nlen); #endif + if ((error = sysctl_lock(l, NETBSD32PTR64(ls32.oldval), savelen)) != 0) return error; |
