From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 16 08:11:10 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B54837B405 for ; Wed, 16 Apr 2003 08:11:10 -0700 (PDT) Received: from mail-pm.star.spb.ru (mail-pm.star.spb.ru [217.195.82.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B77343F93 for ; Wed, 16 Apr 2003 08:11:08 -0700 (PDT) (envelope-from nkritsky@star.spb.ru) Received: from pink.star.spb.ru ([217.195.82.10]) by mail-pm.star.spb.ru (8.12.9/8.12.8) with ESMTP id h3GFASaY011364; Wed, 16 Apr 2003 19:10:28 +0400 (MSD) Received: from IBMKA ([217.195.82.7]) by pink.star.spb.ru with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 20SVDW6F; Wed, 16 Apr 2003 19:10:28 +0400 Date: Wed, 16 Apr 2003 19:10:35 +0400 From: "Nickolay A. Kritsky" X-Mailer: The Bat! (v1.49) Personal X-Priority: 3 (Normal) Message-ID: <10695996045.20030416191035@star.spb.ru> To: Igor Pokrovsky In-reply-To: <20030416121406.GA229@exmatis1.cnrm.meteo.fr> References: <1222010669.20030415223730@star.spb.ru> <20030416073329.GB298@exmatis1.cnrm.meteo.fr> <2377892423.20030416140852@star.spb.ru> <20030416121406.GA229@exmatis1.cnrm.meteo.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re[2]: Kernel variables - where is TFM? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Nickolay A. Kritsky" List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2003 15:11:10 -0000 Hello Igor, Wednesday, April 16, 2003, 4:14:06 PM, you wrote: >> IP> sysctl -a | grep hz >> On my 4.6 system it gives me: >> kern.clockrate: { hz = 100, tick = 10000, tickadj = 5, profhz = 1024, stathz = 128 } >> What does that mean? hz is the IRQ0 frequency? Then, what is tick? and >> what is ticks (note the trailing `s') ? IP> Where did you find 'ticks'? in /usr/src/sys/netinet/tcp_syncache.c it is mentioned quite often. As I understood it is some sort of counter incremented tickly. From Epoch or from uptime, I don't know. >>From /usr/include/sys/time.h : IP> -- snip -- IP> /* IP> * Getkerninfo clock information structure IP> */ IP> struct clockinfo { IP> int hz; /* clock frequency */ IP> int tick; /* micro-seconds per hz tick */ IP> int tickadj; /* clock skew rate for adjtime() */ IP> int stathz; /* statistics clock frequency */ IP> int profhz; /* profiling clock frequency */ IP> }; IP> -- snip -- Hmm. Looks funny. Why keep both hz and tick if tick=(10^6)/hz ? Or am i missing something? >> IP> sysctl(8) >> sysctl. Well, this is great, but here comes another question: >> in /usr/src/sys/netinet/tcp_syncache_c one can see: >> ;-----------------Begin clipboard-------------------------- >> SYSCTL_INT(_net_inet_tcp, OID_AUTO, syncookies, CTLFLAG_RW, >> &tcp_syncookies, 0, >> "Use TCP SYN cookies if the syncache overflows"); >> ;-------------------End clipboard-------------------------- >> Is it the place where sysctl is added to kernel state MIB? If yes, I >> assume that every sysctl can have a `description' (the last parameter >> in SYSCTL_INT macro). Is there an interface to read such descriptions? IP> The only place where you can see all descriptions AFAIK is IP> sysctl(3) (note '3', not '8') Still cant find it. sysctl() - get or set value of state. sysctlbyname() - find variable by name. sysctlnametomib() - find array of variables by name. Looks like the only interface to look up sysctl description is grep(1) :-\ -- Best regards, ; Nickolay A. Kritsky ; SysAdmin STAR SPb ; mailto:nkritsky@star.spb.ru