From 0c52fa62cbdb0e23bf35782c396ac0cc155c224a Mon Sep 17 00:00:00 2001 From: "Samuel J. Greear" Date: Tue, 30 Nov 2010 04:42:32 +0000 Subject: [PATCH] kernel - Provide descriptions for lwkt.* and debug.* sysctl's * Take the opportunity to chop a few dead sysctl's as well Submitted-by: Taras Klaskovsky Sponsored-by: Google Code-In --- sys/dev/disk/md/md.c | 3 +- sys/dev/disk/ncr/ncr.c | 3 +- sys/dev/netif/fwe/if_fwe.c | 3 +- sys/kern/imgact_elf.c | 3 +- sys/kern/init_main.c | 3 +- sys/kern/kern_conf.c | 5 +-- sys/kern/kern_descrip.c | 4 +- sys/kern/kern_event.c | 6 ++- sys/kern/kern_mplock.c | 6 ++- sys/kern/kern_slaballoc.c | 3 +- sys/kern/kern_spinlock.c | 12 ++++-- sys/kern/lwkt_ipiq.c | 18 ++++++--- sys/kern/lwkt_serialize.c | 7 ++-- sys/kern/lwkt_thread.c | 22 +++++++---- sys/kern/lwkt_token.c | 76 ++++++++++++++++++---------------------- sys/kern/tty_compat.c | 3 +- sys/kern/usched_bsd4.c | 6 ++- sys/kern/vfs_cache.c | 30 +++++++++++----- sys/kern/vfs_lock.c | 4 +- sys/kern/vfs_subr.c | 3 +- sys/net/bpf.c | 4 +- sys/net/tun/if_tun.c | 3 +- sys/platform/pc32/apm/apm.c | 3 +- sys/platform/pc32/i386/vm86.c | 3 +- sys/platform/pc64/apm/apm.c | 3 +- sys/vfs/ufs/ffs_softdep.c | 36 +++++++++++++------ sys/vfs/ufs/ufs_lookup.c | 3 +- 27 files changed, 162 insertions(+), 113 deletions(-) diff --git a/sys/dev/disk/md/md.c b/sys/dev/disk/md/md.c index 762598a..df90e30 100644 --- a/sys/dev/disk/md/md.c +++ b/sys/dev/disk/md/md.c @@ -36,7 +36,8 @@ MALLOC_DEFINE(M_MD, "MD disk", "Memory Disk"); MALLOC_DEFINE(M_MDSECT, "MD sectors", "Memory Disk Sectors"); static int md_debug; -SYSCTL_INT(_debug, OID_AUTO, mddebug, CTLFLAG_RW, &md_debug, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, mddebug, CTLFLAG_RW, &md_debug, 0, + "Enable debug output for memory disk devices"); #if defined(MD_ROOT) && defined(MD_ROOT_SIZE) /* Image gets put here: */ diff --git a/sys/dev/disk/ncr/ncr.c b/sys/dev/disk/ncr/ncr.c index 73bb88d..2e9f8ef 100644 --- a/sys/dev/disk/ncr/ncr.c +++ b/sys/dev/disk/ncr/ncr.c @@ -1312,7 +1312,8 @@ static const u_long ncr_version = NCR_VERSION * 11 #ifdef _KERNEL static int ncr_debug = SCSI_NCR_DEBUG; -SYSCTL_INT(_debug, OID_AUTO, ncr_debug, CTLFLAG_RW, &ncr_debug, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, ncr_debug, CTLFLAG_RW, &ncr_debug, 0, + "Driver debug flags"); static int ncr_cache; /* to be aligned _NOT_ static */ diff --git a/sys/dev/netif/fwe/if_fwe.c b/sys/dev/netif/fwe/if_fwe.c index 7da8fa3..2681eff 100644 --- a/sys/dev/netif/fwe/if_fwe.c +++ b/sys/dev/netif/fwe/if_fwe.c @@ -87,7 +87,8 @@ static int tx_speed = 2; static int rx_queue_len = FWMAXQUEUE; MALLOC_DEFINE(M_FWE, "if_fwe", "Ethernet over FireWire interface"); -SYSCTL_INT(_debug, OID_AUTO, if_fwe_debug, CTLFLAG_RW, &fwedebug, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, if_fwe_debug, CTLFLAG_RW, &fwedebug, 0, + "Enable debug output"); SYSCTL_DECL(_hw_firewire); SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0, "Ethernet emulation subsystem"); diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index d56f1f9..767c61a 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -88,7 +88,8 @@ static int elf_trace = 0; SYSCTL_INT(_debug, OID_AUTO, elf_trace, CTLFLAG_RW, &elf_trace, 0, ""); static int elf_legacy_coredump = 0; SYSCTL_INT(_debug, OID_AUTO, elf_legacy_coredump, CTLFLAG_RW, - &elf_legacy_coredump, 0, ""); + &elf_legacy_coredump, 0, + "Do not dump inaccessible mappings, legacy coredump mode"); static int dragonfly_match_abi_note(const Elf_Note *); static int freebsd_match_abi_note(const Elf_Note *); diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index ea8744c..d2c1e6b 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -100,7 +100,8 @@ extern struct user *proc0paddr; extern int fallback_elf_brand; int boothowto = 0; /* initialized so that it can be patched */ -SYSCTL_INT(_debug, OID_AUTO, boothowto, CTLFLAG_RD, &boothowto, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, boothowto, CTLFLAG_RD, &boothowto, 0, + "Reboot flags, from console subsystem"); /* * This ensures that there is at least one entry so that the sysinit_set diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 036a573..2753dea 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -53,10 +53,9 @@ MALLOC_DEFINE(M_DEVT, "cdev_t", "dev_t storage"); -static int free_devt; -SYSCTL_INT(_debug, OID_AUTO, free_devt, CTLFLAG_RW, &free_devt, 0, ""); int dev_ref_debug = 0; -SYSCTL_INT(_debug, OID_AUTO, dev_refs, CTLFLAG_RW, &dev_ref_debug, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, dev_refs, CTLFLAG_RW, &dev_ref_debug, 0, + "Toggle device reference debug output"); /* * cdev_t and u_dev_t primitives. Note that the major number is always diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index e940313..cc6c210 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -987,8 +987,8 @@ sys_fpathconf(struct fpathconf_args *uap) } static int fdexpand; -SYSCTL_INT(_debug, OID_AUTO, fdexpand, CTLFLAG_RD, &fdexpand, - 0, ""); +SYSCTL_INT(_debug, OID_AUTO, fdexpand, CTLFLAG_RD, &fdexpand, 0, + "Number of times a file table has been expanded"); /* * Grow the file table so it can hold through descriptor (want). diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 27bdf98..1aefd31 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -62,9 +62,11 @@ */ struct lwkt_token kq_token = LWKT_TOKEN_UP_INITIALIZER(kq_token); SYSCTL_INT(_lwkt, OID_AUTO, kq_mpsafe, - CTLFLAG_RW, &kq_token.t_flags, 0, ""); + CTLFLAG_RW, &kq_token.t_flags, 0, + "Require MP lock for kq_token"); SYSCTL_LONG(_lwkt, OID_AUTO, kq_collisions, - CTLFLAG_RW, &kq_token.t_collisions, 0, ""); + CTLFLAG_RW, &kq_token.t_collisions, 0, + "Collision counter of kq_token"); MALLOC_DEFINE(M_KQUEUE, "kqueue", "memory for kqueue system"); diff --git a/sys/kern/kern_mplock.c b/sys/kern/kern_mplock.c index 018df78..ee6ee9f 100644 --- a/sys/kern/kern_mplock.c +++ b/sys/kern/kern_mplock.c @@ -59,8 +59,10 @@ static int chain_mplock = 0; static int bgl_yield = 10; static __int64_t mplock_contention_count = 0; -SYSCTL_INT(_lwkt, OID_AUTO, chain_mplock, CTLFLAG_RW, &chain_mplock, 0, ""); -SYSCTL_INT(_lwkt, OID_AUTO, bgl_yield_delay, CTLFLAG_RW, &bgl_yield, 0, ""); +SYSCTL_INT(_lwkt, OID_AUTO, chain_mplock, CTLFLAG_RW, &chain_mplock, 0, + "Chain IPI's to other CPU's potentially needing the MP lock when it is yielded"); +SYSCTL_INT(_lwkt, OID_AUTO, bgl_yield_delay, CTLFLAG_RW, &bgl_yield, 0, + "Duration of delay when MP lock is temporarily yielded"); SYSCTL_QUAD(_lwkt, OID_AUTO, mplock_contention_count, CTLFLAG_RW, &mplock_contention_count, 0, "spinning due to MPLOCK contention"); diff --git a/sys/kern/kern_slaballoc.c b/sys/kern/kern_slaballoc.c index 4abf476..e690d3c 100644 --- a/sys/kern/kern_slaballoc.c +++ b/sys/kern/kern_slaballoc.c @@ -220,7 +220,8 @@ SYSINIT(kmem, SI_BOOT1_ALLOCATOR, SI_ORDER_FIRST, kmeminit, NULL) */ static int use_malloc_pattern; SYSCTL_INT(_debug, OID_AUTO, use_malloc_pattern, CTLFLAG_RW, - &use_malloc_pattern, 0, ""); + &use_malloc_pattern, 0, + "Initialize memory to -1 if M_ZERO not specified"); #endif SYSCTL_INT(_kern, OID_AUTO, zone_big_alloc, CTLFLAG_RD, &ZoneBigAlloc, 0, ""); diff --git a/sys/kern/kern_spinlock.c b/sys/kern/kern_spinlock.c index fb785ba..6afc8d7 100644 --- a/sys/kern/kern_spinlock.c +++ b/sys/kern/kern_spinlock.c @@ -83,15 +83,18 @@ static int spin_lock_test_mode; static int64_t spinlocks_contested1; SYSCTL_QUAD(_debug, OID_AUTO, spinlocks_contested1, CTLFLAG_RD, - &spinlocks_contested1, 0, ""); + &spinlocks_contested1, 0, + "Spinlock contention count due to collisions with exclusive lock holders"); static int64_t spinlocks_contested2; SYSCTL_QUAD(_debug, OID_AUTO, spinlocks_contested2, CTLFLAG_RD, - &spinlocks_contested2, 0, ""); + &spinlocks_contested2, 0, + "Serious spinlock contention count"); static int spinlocks_backoff_limit = BACKOFF_LIMIT; SYSCTL_INT(_debug, OID_AUTO, spinlocks_bolim, CTLFLAG_RW, - &spinlocks_backoff_limit, 0, ""); + &spinlocks_backoff_limit, 0, + "Contested spinlock backoff limit"); struct exponential_backoff { int backoff; @@ -236,7 +239,8 @@ exponential_backoff(struct exponential_backoff *bo) #ifdef INVARIANTS static int spin_test_count = 10000000; -SYSCTL_INT(_debug, OID_AUTO, spin_test_count, CTLFLAG_RW, &spin_test_count, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, spin_test_count, CTLFLAG_RW, &spin_test_count, 0, + "Number of iterations to use for spinlock wait code test"); static int sysctl_spin_lock_test(SYSCTL_HANDLER_ARGS) diff --git a/sys/kern/lwkt_ipiq.c b/sys/kern/lwkt_ipiq.c index 4cecadd..d96fbb8 100644 --- a/sys/kern/lwkt_ipiq.c +++ b/sys/kern/lwkt_ipiq.c @@ -83,12 +83,18 @@ static int panic_ipiq_count = 100; #endif #ifdef SMP -SYSCTL_QUAD(_lwkt, OID_AUTO, ipiq_count, CTLFLAG_RW, &ipiq_count, 0, ""); -SYSCTL_QUAD(_lwkt, OID_AUTO, ipiq_fifofull, CTLFLAG_RW, &ipiq_fifofull, 0, ""); -SYSCTL_QUAD(_lwkt, OID_AUTO, ipiq_avoided, CTLFLAG_RW, &ipiq_avoided, 0, ""); -SYSCTL_QUAD(_lwkt, OID_AUTO, ipiq_passive, CTLFLAG_RW, &ipiq_passive, 0, ""); -SYSCTL_QUAD(_lwkt, OID_AUTO, ipiq_cscount, CTLFLAG_RW, &ipiq_cscount, 0, ""); -SYSCTL_INT(_lwkt, OID_AUTO, ipiq_optimized, CTLFLAG_RW, &ipiq_optimized, 0, ""); +SYSCTL_QUAD(_lwkt, OID_AUTO, ipiq_count, CTLFLAG_RW, &ipiq_count, 0, + "Number of IPI's sent"); +SYSCTL_QUAD(_lwkt, OID_AUTO, ipiq_fifofull, CTLFLAG_RW, &ipiq_fifofull, 0, + "Number of fifo full conditions detected"); +SYSCTL_QUAD(_lwkt, OID_AUTO, ipiq_avoided, CTLFLAG_RW, &ipiq_avoided, 0, + "Number of IPI's avoided by interlock with target cpu"); +SYSCTL_QUAD(_lwkt, OID_AUTO, ipiq_passive, CTLFLAG_RW, &ipiq_passive, 0, + "Number of passive IPI messages sent"); +SYSCTL_QUAD(_lwkt, OID_AUTO, ipiq_cscount, CTLFLAG_RW, &ipiq_cscount, 0, + "Number of cpu synchronizations"); +SYSCTL_INT(_lwkt, OID_AUTO, ipiq_optimized, CTLFLAG_RW, &ipiq_optimized, 0, + ""); #ifdef PANIC_DEBUG SYSCTL_INT(_lwkt, OID_AUTO, panic_ipiq_cpu, CTLFLAG_RW, &panic_ipiq_cpu, 0, ""); SYSCTL_INT(_lwkt, OID_AUTO, panic_ipiq_count, CTLFLAG_RW, &panic_ipiq_count, 0, ""); diff --git a/sys/kern/lwkt_serialize.c b/sys/kern/lwkt_serialize.c index 3ad0eb3..e1e39b9 100644 --- a/sys/kern/lwkt_serialize.c +++ b/sys/kern/lwkt_serialize.c @@ -104,16 +104,17 @@ static void lwkt_serialize_adaptive_sleep(void *bo); static int slz_backoff_limit = 128; SYSCTL_INT(_debug, OID_AUTO, serialize_bolimit, CTLFLAG_RW, - &slz_backoff_limit, 0, ""); + &slz_backoff_limit, 0, "Backoff limit"); static int slz_backoff_shift = 1; SYSCTL_INT(_debug, OID_AUTO, serialize_boshift, CTLFLAG_RW, - &slz_backoff_shift, 0, ""); + &slz_backoff_shift, 0, "Backoff shift"); static int slz_backoff_round; TUNABLE_INT("debug.serialize_boround", &slz_backoff_round); SYSCTL_INT(_debug, OID_AUTO, serialize_boround, CTLFLAG_RW, - &slz_backoff_round, 0, ""); + &slz_backoff_round, 0, + "Backoff rounding"); #endif /* SMP */ void diff --git a/sys/kern/lwkt_thread.c b/sys/kern/lwkt_thread.c index 193da2c..b22286a 100644 --- a/sys/kern/lwkt_thread.c +++ b/sys/kern/lwkt_thread.c @@ -114,24 +114,30 @@ extern void cpu_idle_restore(void); TUNABLE_INT("lwkt.use_spin_port", &lwkt_use_spin_port); #ifdef INVARIANTS -SYSCTL_INT(_lwkt, OID_AUTO, panic_on_cscount, CTLFLAG_RW, &panic_on_cscount, 0, ""); +SYSCTL_INT(_lwkt, OID_AUTO, panic_on_cscount, CTLFLAG_RW, &panic_on_cscount, 0, + "Panic if attempting to switch lwkt's while mastering cpusync"); #endif -SYSCTL_QUAD(_lwkt, OID_AUTO, switch_count, CTLFLAG_RW, &switch_count, 0, ""); +SYSCTL_QUAD(_lwkt, OID_AUTO, switch_count, CTLFLAG_RW, &switch_count, 0, + "Number of switched threads"); SYSCTL_QUAD(_lwkt, OID_AUTO, preempt_hit, CTLFLAG_RW, &preempt_hit, 0, - "Successful preemption events"); + "Successful preemption events"); SYSCTL_QUAD(_lwkt, OID_AUTO, preempt_miss, CTLFLAG_RW, &preempt_miss, 0, - "Failed preemption events"); -SYSCTL_QUAD(_lwkt, OID_AUTO, preempt_weird, CTLFLAG_RW, &preempt_weird, 0, ""); + "Failed preemption events"); +SYSCTL_QUAD(_lwkt, OID_AUTO, preempt_weird, CTLFLAG_RW, &preempt_weird, 0, + "Number of preempted threads."); #ifdef INVARIANTS SYSCTL_QUAD(_lwkt, OID_AUTO, token_contention_count, CTLFLAG_RW, &token_contention_count, 0, "spinning due to token contention"); #endif static int fairq_enable = 1; -SYSCTL_INT(_lwkt, OID_AUTO, fairq_enable, CTLFLAG_RW, &fairq_enable, 0, ""); +SYSCTL_INT(_lwkt, OID_AUTO, fairq_enable, CTLFLAG_RW, &fairq_enable, 0, + "Turn on fairq priority accumulators"); static int user_pri_sched = 0; -SYSCTL_INT(_lwkt, OID_AUTO, user_pri_sched, CTLFLAG_RW, &user_pri_sched, 0, ""); +SYSCTL_INT(_lwkt, OID_AUTO, user_pri_sched, CTLFLAG_RW, &user_pri_sched, 0, + ""); static int preempt_enable = 1; -SYSCTL_INT(_lwkt, OID_AUTO, preempt_enable, CTLFLAG_RW, &preempt_enable, 0, ""); +SYSCTL_INT(_lwkt, OID_AUTO, preempt_enable, CTLFLAG_RW, &preempt_enable, 0, + "Enable preemption"); /* diff --git a/sys/kern/lwkt_token.c b/sys/kern/lwkt_token.c index 41ccfed..18a930a 100644 --- a/sys/kern/lwkt_token.c +++ b/sys/kern/lwkt_token.c @@ -81,10 +81,6 @@ #endif #define LWKT_MASK_POOL_TOKENS (LWKT_NUM_POOL_TOKENS - 1) -#ifdef INVARIANTS -static int token_debug = 0; -#endif - static lwkt_token pool_tokens[LWKT_NUM_POOL_TOKENS]; #define TOKEN_STRING "REF=%p TOK=%p TD=%p" @@ -110,10 +106,6 @@ KTR_INFO(KTR_TOKENS, tokens, contention_stop, 7, UNCONTENDED_STRING, sizeof(void #define logtoken(name, ref) \ KTR_LOG(tokens_ ## name, ref, ref->tr_tok, curthread) -#ifdef INVARIANTS -SYSCTL_INT(_lwkt, OID_AUTO, token_debug, CTLFLAG_RW, &token_debug, 0, ""); -#endif - /* * Global tokens. These replace the MP lock for major subsystem locking. * These tokens are initially used to lockup both global and individual @@ -138,46 +130,46 @@ struct lwkt_token tty_token = LWKT_TOKEN_UP_INITIALIZER(tty_token); struct lwkt_token vnode_token = LWKT_TOKEN_UP_INITIALIZER(vnode_token); struct lwkt_token vmobj_token = LWKT_TOKEN_UP_INITIALIZER(vmobj_token); -SYSCTL_INT(_lwkt, OID_AUTO, pmap_mpsafe, - CTLFLAG_RW, &pmap_token.t_flags, 0, ""); -SYSCTL_INT(_lwkt, OID_AUTO, dev_mpsafe, - CTLFLAG_RW, &dev_token.t_flags, 0, ""); -SYSCTL_INT(_lwkt, OID_AUTO, vm_mpsafe, - CTLFLAG_RW, &vm_token.t_flags, 0, ""); -SYSCTL_INT(_lwkt, OID_AUTO, vmspace_mpsafe, - CTLFLAG_RW, &vmspace_token.t_flags, 0, ""); -SYSCTL_INT(_lwkt, OID_AUTO, kvm_mpsafe, - CTLFLAG_RW, &kvm_token.t_flags, 0, ""); -SYSCTL_INT(_lwkt, OID_AUTO, proc_mpsafe, - CTLFLAG_RW, &proc_token.t_flags, 0, ""); -SYSCTL_INT(_lwkt, OID_AUTO, tty_mpsafe, - CTLFLAG_RW, &tty_token.t_flags, 0, ""); -SYSCTL_INT(_lwkt, OID_AUTO, vnode_mpsafe, - CTLFLAG_RW, &vnode_token.t_flags, 0, ""); -SYSCTL_INT(_lwkt, OID_AUTO, vmobj_mpsafe, - CTLFLAG_RW, &vmobj_token.t_flags, 0, ""); +SYSCTL_INT(_lwkt, OID_AUTO, pmap_mpsafe, CTLFLAG_RW, + &pmap_token.t_flags, 0, "Require MP lock for pmap_token"); +SYSCTL_INT(_lwkt, OID_AUTO, dev_mpsafe, CTLFLAG_RW, + &dev_token.t_flags, 0, "Require MP lock for dev_token"); +SYSCTL_INT(_lwkt, OID_AUTO, vm_mpsafe, CTLFLAG_RW, + &vm_token.t_flags, 0, "Require MP lock for vm_token"); +SYSCTL_INT(_lwkt, OID_AUTO, vmspace_mpsafe, CTLFLAG_RW, + &vmspace_token.t_flags, 0, "Require MP lock for vmspace_token"); +SYSCTL_INT(_lwkt, OID_AUTO, kvm_mpsafe, CTLFLAG_RW, + &kvm_token.t_flags, 0, "Require MP lock for kvm_token"); +SYSCTL_INT(_lwkt, OID_AUTO, proc_mpsafe, CTLFLAG_RW, + &proc_token.t_flags, 0, "Require MP lock for proc_token"); +SYSCTL_INT(_lwkt, OID_AUTO, tty_mpsafe, CTLFLAG_RW, + &tty_token.t_flags, 0, "Require MP lock for tty_token"); +SYSCTL_INT(_lwkt, OID_AUTO, vnode_mpsafe, CTLFLAG_RW, + &vnode_token.t_flags, 0, "Require MP lock for vnode_token"); +SYSCTL_INT(_lwkt, OID_AUTO, vmobj_mpsafe, CTLFLAG_RW, + &vmobj_token.t_flags, 0, "Require MP lock for vmobj_token"); /* * The collision count is bumped every time the LWKT scheduler fails * to acquire needed tokens in addition to a normal lwkt_gettoken() * stall. */ -SYSCTL_LONG(_lwkt, OID_AUTO, pmap_collisions, - CTLFLAG_RW, &pmap_token.t_collisions, 0, ""); -SYSCTL_LONG(_lwkt, OID_AUTO, dev_collisions, - CTLFLAG_RW, &dev_token.t_collisions, 0, ""); -SYSCTL_LONG(_lwkt, OID_AUTO, vm_collisions, - CTLFLAG_RW, &vm_token.t_collisions, 0, ""); -SYSCTL_LONG(_lwkt, OID_AUTO, vmspace_collisions, - CTLFLAG_RW, &vmspace_token.t_collisions, 0, ""); -SYSCTL_LONG(_lwkt, OID_AUTO, kvm_collisions, - CTLFLAG_RW, &kvm_token.t_collisions, 0, ""); -SYSCTL_LONG(_lwkt, OID_AUTO, proc_collisions, - CTLFLAG_RW, &proc_token.t_collisions, 0, ""); -SYSCTL_LONG(_lwkt, OID_AUTO, tty_collisions, - CTLFLAG_RW, &tty_token.t_collisions, 0, ""); -SYSCTL_LONG(_lwkt, OID_AUTO, vnode_collisions, - CTLFLAG_RW, &vnode_token.t_collisions, 0, ""); +SYSCTL_LONG(_lwkt, OID_AUTO, pmap_collisions, CTLFLAG_RW, + &pmap_token.t_collisions, 0, "Collision counter of pmap_token"); +SYSCTL_LONG(_lwkt, OID_AUTO, dev_collisions, CTLFLAG_RW, + &dev_token.t_collisions, 0, "Collision counter of dev_token"); +SYSCTL_LONG(_lwkt, OID_AUTO, vm_collisions, CTLFLAG_RW, + &vm_token.t_collisions, 0, "Collision counter of vm_token"); +SYSCTL_LONG(_lwkt, OID_AUTO, vmspace_collisions, CTLFLAG_RW, + &vmspace_token.t_collisions, 0, "Collision counter of vmspace_token"); +SYSCTL_LONG(_lwkt, OID_AUTO, kvm_collisions, CTLFLAG_RW, + &kvm_token.t_collisions, 0, "Collision counter of kvm_token"); +SYSCTL_LONG(_lwkt, OID_AUTO, proc_collisions, CTLFLAG_RW, + &proc_token.t_collisions, 0, "Collision counter of proc_token"); +SYSCTL_LONG(_lwkt, OID_AUTO, tty_collisions, CTLFLAG_RW, + &tty_token.t_collisions, 0, "Collision counter of tty_token"); +SYSCTL_LONG(_lwkt, OID_AUTO, vnode_collisions, CTLFLAG_RW, + &vnode_token.t_collisions, 0, "Collision counter of vnode_token"); /* * Return a pool token given an address diff --git a/sys/kern/tty_compat.c b/sys/kern/tty_compat.c index cc48bfe..52f4e69 100644 --- a/sys/kern/tty_compat.c +++ b/sys/kern/tty_compat.c @@ -55,7 +55,8 @@ static void ttcompatsetlflags (struct tty *tp, struct termios *t); static int ttcompatspeedtab (int speed, struct speedtab *table); static int ttydebug = 0; -SYSCTL_INT(_debug, OID_AUTO, ttydebug, CTLFLAG_RW, &ttydebug, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, ttydebug, CTLFLAG_RW, &ttydebug, 0, + "tty debugging"); static struct speedtab compatspeeds[] = { #define MAX_SPEED 17 diff --git a/sys/kern/usched_bsd4.c b/sys/kern/usched_bsd4.c index 0494e91..ae1ce84 100644 --- a/sys/kern/usched_bsd4.c +++ b/sys/kern/usched_bsd4.c @@ -159,7 +159,8 @@ static volatile int bsd4_scancpu; static struct spinlock bsd4_spin; static struct usched_bsd4_pcpu bsd4_pcpu[MAXCPU]; -SYSCTL_INT(_debug, OID_AUTO, bsd4_runqcount, CTLFLAG_RD, &bsd4_runqcount, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, bsd4_runqcount, CTLFLAG_RD, &bsd4_runqcount, 0, + "Number of run queues"); #ifdef INVARIANTS static int usched_nonoptimal; SYSCTL_INT(_debug, OID_AUTO, usched_nonoptimal, CTLFLAG_RW, @@ -169,7 +170,8 @@ SYSCTL_INT(_debug, OID_AUTO, usched_optimal, CTLFLAG_RW, &usched_optimal, 0, "acquire_curproc() was optimal"); #endif static int usched_debug = -1; -SYSCTL_INT(_debug, OID_AUTO, scdebug, CTLFLAG_RW, &usched_debug, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, scdebug, CTLFLAG_RW, &usched_debug, 0, + "Print debug information for this pid"); #ifdef SMP static int remote_resched_nonaffinity; static int remote_resched_affinity; diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index df8ddd1..eb60e11 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -151,25 +151,33 @@ static struct spinlock ncspin; * have a namecache record, even if it does have one. */ static int ncvp_debug; -SYSCTL_INT(_debug, OID_AUTO, ncvp_debug, CTLFLAG_RW, &ncvp_debug, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, ncvp_debug, CTLFLAG_RW, &ncvp_debug, 0, + "Namecache debug level (0-3)"); static u_long nchash; /* size of hash table */ -SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0, ""); +SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0, + "Size of namecache hash table"); static int ncnegfactor = 16; /* ratio of negative entries */ -SYSCTL_INT(_debug, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0, + "Ratio of namecache negative entries"); static int nclockwarn; /* warn on locked entries in ticks */ -SYSCTL_INT(_debug, OID_AUTO, nclockwarn, CTLFLAG_RW, &nclockwarn, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, nclockwarn, CTLFLAG_RW, &nclockwarn, 0, + "Warn on locked namecache entries in ticks"); static int numdefered; /* number of cache entries allocated */ -SYSCTL_INT(_debug, OID_AUTO, numdefered, CTLFLAG_RD, &numdefered, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, numdefered, CTLFLAG_RD, &numdefered, 0, + "Number of cache entries allocated"); static int ncposlimit; /* number of cache entries allocated */ -SYSCTL_INT(_debug, OID_AUTO, ncposlimit, CTLFLAG_RW, &ncposlimit, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, ncposlimit, CTLFLAG_RW, &ncposlimit, 0, + "Number of cache entries allocated"); -SYSCTL_INT(_debug, OID_AUTO, vnsize, CTLFLAG_RD, 0, sizeof(struct vnode), ""); -SYSCTL_INT(_debug, OID_AUTO, ncsize, CTLFLAG_RD, 0, sizeof(struct namecache), ""); +SYSCTL_INT(_debug, OID_AUTO, vnsize, CTLFLAG_RD, 0, sizeof(struct vnode), + "sizeof(struct vnode)"); +SYSCTL_INT(_debug, OID_AUTO, ncsize, CTLFLAG_RD, 0, sizeof(struct namecache), + "sizeof(struct namecache)"); int cache_mpsafe = 1; SYSCTL_INT(_vfs, OID_AUTO, cache_mpsafe, CTLFLAG_RW, &cache_mpsafe, 0, ""); @@ -3003,7 +3011,8 @@ cache_purgevfs(struct mount *mp) #endif static int disablecwd; -SYSCTL_INT(_debug, OID_AUTO, disablecwd, CTLFLAG_RW, &disablecwd, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, disablecwd, CTLFLAG_RW, &disablecwd, 0, + "Disable getcwd"); static u_long numcwdcalls; STATNODE(CTLFLAG_RD, numcwdcalls, &numcwdcalls); static u_long numcwdfail1; STATNODE(CTLFLAG_RD, numcwdfail1, &numcwdfail1); @@ -3154,7 +3163,8 @@ done: static int disablefullpath; SYSCTL_INT(_debug, OID_AUTO, disablefullpath, CTLFLAG_RW, - &disablefullpath, 0, ""); + &disablefullpath, 0, + "Disable fullpath lookups"); STATNODE(numfullpathcalls); STATNODE(numfullpathfail1); diff --git a/sys/kern/vfs_lock.c b/sys/kern/vfs_lock.c index a7ecabe..95501aa 100644 --- a/sys/kern/vfs_lock.c +++ b/sys/kern/vfs_lock.c @@ -95,10 +95,10 @@ static enum { ROVER_MID1, ROVER_MID2 } rover_state = ROVER_MID2; int freevnodes = 0; SYSCTL_INT(_debug, OID_AUTO, freevnodes, CTLFLAG_RD, - &freevnodes, 0, ""); + &freevnodes, 0, "Number of free nodes"); static int wantfreevnodes = 25; SYSCTL_INT(_debug, OID_AUTO, wantfreevnodes, CTLFLAG_RW, - &wantfreevnodes, 0, ""); + &wantfreevnodes, 0, "Desired number of free vnodes"); #ifdef TRACKVNODE static ulong trackvnode; SYSCTL_ULONG(_debug, OID_AUTO, trackvnode, CTLFLAG_RW, diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index dda2cfc..52a8f3a 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -91,7 +91,8 @@ static MALLOC_DEFINE(M_NETADDR, "Export Host", "Export host address structure"); int numvnodes; -SYSCTL_INT(_debug, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0, + "Number of vnodes allocated"); enum vtype iftovt_tab[16] = { VNON, VFIFO, VCHR, VNON, VDIR, VNON, VBLK, VNON, diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 5d88214..71e67a9 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -99,10 +99,10 @@ DEVFS_DECLARE_CLONE_BITMAP(bpf); */ static int bpf_bufsize = BPF_DEFAULTBUFSIZE; SYSCTL_INT(_debug, OID_AUTO, bpf_bufsize, CTLFLAG_RW, - &bpf_bufsize, 0, ""); + &bpf_bufsize, 0, "Current size of bpf buffer"); int bpf_maxbufsize = BPF_MAXBUFSIZE; SYSCTL_INT(_debug, OID_AUTO, bpf_maxbufsize, CTLFLAG_RW, - &bpf_maxbufsize, 0, ""); + &bpf_maxbufsize, 0, "Maximum size of bpf buffer"); /* * bpf_iflist is the list of interfaces; each corresponds to an ifnet diff --git a/sys/net/tun/if_tun.c b/sys/net/tun/if_tun.c index ad4ef23..7d57239 100644 --- a/sys/net/tun/if_tun.c +++ b/sys/net/tun/if_tun.c @@ -69,7 +69,8 @@ static void tuncreate (cdev_t dev); #define TUNDEBUG if (tundebug) if_printf static int tundebug = 0; -SYSCTL_INT(_debug, OID_AUTO, if_tun_debug, CTLFLAG_RW, &tundebug, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, if_tun_debug, CTLFLAG_RW, &tundebug, 0, + "Enable debug output"); static int tunoutput (struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *rt); diff --git a/sys/platform/pc32/apm/apm.c b/sys/platform/pc32/apm/apm.c index 7a8fef9..fd181f9 100644 --- a/sys/platform/pc32/apm/apm.c +++ b/sys/platform/pc32/apm/apm.c @@ -107,7 +107,8 @@ static int apm_debug = 0; SYSCTL_INT(_machdep, OID_AUTO, apm_suspend_delay, CTLFLAG_RW, &apm_suspend_delay, 1, ""); SYSCTL_INT(_machdep, OID_AUTO, apm_standby_delay, CTLFLAG_RW, &apm_standby_delay, 1, ""); -SYSCTL_INT(_debug, OID_AUTO, apm_debug, CTLFLAG_RW, &apm_debug, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, apm_debug, CTLFLAG_RW, &apm_debug, 0, + "Enable debug output"); /* * return 0 if the function successfull, diff --git a/sys/platform/pc32/i386/vm86.c b/sys/platform/pc32/i386/vm86.c index b393fa3..be479d0 100644 --- a/sys/platform/pc32/i386/vm86.c +++ b/sys/platform/pc32/i386/vm86.c @@ -115,7 +115,8 @@ static void vm86_clear_timer_fault(void); static int vm86_blew_up_timer; static int timer_warn = 1; -SYSCTL_INT(_debug, OID_AUTO, timer_warn, CTLFLAG_RW, &timer_warn, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, timer_warn, CTLFLAG_RW, &timer_warn, 0, + "Warn if BIOS has played with the 8254 timer"); static __inline caddr_t MAKE_ADDR(u_short sel, u_short off) diff --git a/sys/platform/pc64/apm/apm.c b/sys/platform/pc64/apm/apm.c index 1ab9a63..8efdb32 100644 --- a/sys/platform/pc64/apm/apm.c +++ b/sys/platform/pc64/apm/apm.c @@ -107,7 +107,8 @@ static int apm_debug = 0; SYSCTL_INT(_machdep, OID_AUTO, apm_suspend_delay, CTLFLAG_RW, &apm_suspend_delay, 1, ""); SYSCTL_INT(_machdep, OID_AUTO, apm_standby_delay, CTLFLAG_RW, &apm_standby_delay, 1, ""); -SYSCTL_INT(_debug, OID_AUTO, apm_debug, CTLFLAG_RW, &apm_debug, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, apm_debug, CTLFLAG_RW, &apm_debug, 0, + "Enable debug output"); /* * return 0 if the function successfull, diff --git a/sys/vfs/ufs/ffs_softdep.c b/sys/vfs/ufs/ffs_softdep.c index 289a00ef..919db55 100644 --- a/sys/vfs/ufs/ffs_softdep.c +++ b/sys/vfs/ufs/ffs_softdep.c @@ -529,18 +529,30 @@ static int stat_dir_entry; /* bufs redirtied as dir entry cannot write */ #ifdef DEBUG #include #include -SYSCTL_INT(_debug, OID_AUTO, max_softdeps, CTLFLAG_RW, &max_softdeps, 0, ""); -SYSCTL_INT(_debug, OID_AUTO, tickdelay, CTLFLAG_RW, &tickdelay, 0, ""); -SYSCTL_INT(_debug, OID_AUTO, worklist_push, CTLFLAG_RW, &stat_worklist_push, 0,""); -SYSCTL_INT(_debug, OID_AUTO, blk_limit_push, CTLFLAG_RW, &stat_blk_limit_push, 0,""); -SYSCTL_INT(_debug, OID_AUTO, ino_limit_push, CTLFLAG_RW, &stat_ino_limit_push, 0,""); -SYSCTL_INT(_debug, OID_AUTO, blk_limit_hit, CTLFLAG_RW, &stat_blk_limit_hit, 0, ""); -SYSCTL_INT(_debug, OID_AUTO, ino_limit_hit, CTLFLAG_RW, &stat_ino_limit_hit, 0, ""); -SYSCTL_INT(_debug, OID_AUTO, sync_limit_hit, CTLFLAG_RW, &stat_sync_limit_hit, 0, ""); -SYSCTL_INT(_debug, OID_AUTO, indir_blk_ptrs, CTLFLAG_RW, &stat_indir_blk_ptrs, 0, ""); -SYSCTL_INT(_debug, OID_AUTO, inode_bitmap, CTLFLAG_RW, &stat_inode_bitmap, 0, ""); -SYSCTL_INT(_debug, OID_AUTO, direct_blk_ptrs, CTLFLAG_RW, &stat_direct_blk_ptrs, 0, ""); -SYSCTL_INT(_debug, OID_AUTO, dir_entry, CTLFLAG_RW, &stat_dir_entry, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, max_softdeps, CTLFLAG_RW, &max_softdeps, 0, + "Maximum soft dependencies before slowdown occurs"); +SYSCTL_INT(_debug, OID_AUTO, tickdelay, CTLFLAG_RW, &tickdelay, 0, + "Ticks to delay before allocating during slowdown"); +SYSCTL_INT(_debug, OID_AUTO, worklist_push, CTLFLAG_RW, &stat_worklist_push, 0, + "Number of worklist cleanups"); +SYSCTL_INT(_debug, OID_AUTO, blk_limit_push, CTLFLAG_RW, &stat_blk_limit_push, 0, + "Number of times block limit neared"); +SYSCTL_INT(_debug, OID_AUTO, ino_limit_push, CTLFLAG_RW, &stat_ino_limit_push, 0, + "Number of times inode limit neared"); +SYSCTL_INT(_debug, OID_AUTO, blk_limit_hit, CTLFLAG_RW, &stat_blk_limit_hit, 0, + "Number of times block slowdown imposed"); +SYSCTL_INT(_debug, OID_AUTO, ino_limit_hit, CTLFLAG_RW, &stat_ino_limit_hit, 0, + "Number of times inode slowdown imposed "); +SYSCTL_INT(_debug, OID_AUTO, sync_limit_hit, CTLFLAG_RW, &stat_sync_limit_hit, 0, + "Number of synchronous slowdowns imposed"); +SYSCTL_INT(_debug, OID_AUTO, indir_blk_ptrs, CTLFLAG_RW, &stat_indir_blk_ptrs, 0, + "Bufs redirtied as indir ptrs not written"); +SYSCTL_INT(_debug, OID_AUTO, inode_bitmap, CTLFLAG_RW, &stat_inode_bitmap, 0, + "Bufs redirtied as inode bitmap not written"); +SYSCTL_INT(_debug, OID_AUTO, direct_blk_ptrs, CTLFLAG_RW, &stat_direct_blk_ptrs, 0, + "Bufs redirtied as direct ptrs not written"); +SYSCTL_INT(_debug, OID_AUTO, dir_entry, CTLFLAG_RW, &stat_dir_entry, 0, + "Bufs redirtied as dir entry cannot write"); #endif /* DEBUG */ /* diff --git a/sys/vfs/ufs/ufs_lookup.c b/sys/vfs/ufs/ufs_lookup.c index 9f1c571..e514383 100644 --- a/sys/vfs/ufs/ufs_lookup.c +++ b/sys/vfs/ufs/ufs_lookup.c @@ -72,7 +72,8 @@ int dirchk = 1; int dirchk = 0; #endif -SYSCTL_INT(_debug, OID_AUTO, dircheck, CTLFLAG_RW, &dirchk, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, dircheck, CTLFLAG_RW, &dirchk, 0, + "Enable full validation checks of directory"); /* true if old FS format...*/ #define OFSFMT(vp) ((vp)->v_mount->mnt_maxsymlinklen <= 0) -- 1.7.7.2