diff options
author | kn <kn@cvs.openbsd.org> | 2020-08-22 11:47:24 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2020-08-22 11:47:24 +0000 |
commit | 87c80d01c567a379e7a0312effb1e6e2b33b44d2 (patch) | |
tree | 67c239416b4356a4db19fd0b04bf4f87bc8ac0ba /sys/kern/kern_sysctl.c | |
parent | 857bbbd80d708df48a8181ebb60be6c7159686c0 (diff) |
Move sysctl(2) CTL_DEBUG from DEBUG to new DEBUG_SYSCTL
Adding "debug.my-knob" sysctls is really helpful to select different
code paths and/or log on demand during runtime without recompile,
but as this code is under DEBUG, lots of other noise comes with it
which is often undesired, at least when looking at specific subsystems
only.
Adding globals to the kernel and breaking into DDB to change them helps,
but that does not work over SSH, hence the need for debug sysctls.
Introduces DEBUG_SYSCTL to make use of the "debug" MIB without the rest of
DEBUG; it's DEBUG_SYSCTL and not SYSCTL_DEBUG because it's not a general
option for all of sysctl(2).
OK gnezdo
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r-- | sys/kern/kern_sysctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 7615cbbd28f..c948edc91af 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.376 2020/08/18 18:19:30 gnezdo Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.377 2020/08/22 11:47:23 kn Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -213,7 +213,7 @@ sys_sysctl(struct proc *p, void *v, register_t *retval) case CTL_MACHDEP: fn = cpu_sysctl; break; -#ifdef DEBUG +#ifdef DEBUG_SYSCTL case CTL_DEBUG: fn = debug_sysctl; break; @@ -809,7 +809,7 @@ hw_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, /* NOTREACHED */ } -#ifdef DEBUG +#ifdef DEBUG_SYSCTL /* * Debugging related system variables. */ @@ -848,7 +848,7 @@ debug_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, } /* NOTREACHED */ } -#endif /* DEBUG */ +#endif /* DEBUG_SYSCTL */ /* * Reads, or writes that lower the value |