From owner-freebsd-hackers Sat Mar 24 5:42: 7 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from heechee.tobez.org (254.adsl0.ryv.worldonline.dk [213.237.10.254]) by hub.freebsd.org (Postfix) with ESMTP id 2B4B037B71E; Sat, 24 Mar 2001 05:41:52 -0800 (PST) (envelope-from tobez@tobez.org) Received: by heechee.tobez.org (Postfix, from userid 1001) id D9D95550E; Sat, 24 Mar 2001 14:41:50 +0100 (CET) Date: Sat, 24 Mar 2001 14:41:50 +0100 From: Anton Berezin To: Adrian Chadd Cc: Robert Watson , "Alexey V. Neyman" , "Michael C . Wu" , fs@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: tuning a VERY heavily (30.0) loaded s cerver Message-ID: <20010324144150.A59930@heechee.tobez.org> References: <20010323201103.A5828@roaming.cacheboy.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010323201103.A5828@roaming.cacheboy.net>; from adrian@FreeBSD.ORG on Fri, Mar 23, 2001 at 08:11:03PM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 23, 2001 at 08:11:03PM +0100, Adrian Chadd wrote: > A while back I started running through the undocumented sysctls and > documenting them. I didn't get through all of them, and the main reason > I stopped was because there wasn't a nifty way to extract the sysctls > short of writing a script to extract them from /usr/src. > > Someone did point out that you could stuff the sysctl's into an elf > segment and only load it when needed, but I don't know much about elf. > If someone would like to do this, I'm sure a small group of us > (Asmodai? :-P) could walk the sysctl tree again and figure out what > the undocumented sysctls are. :-) Some time ago I wrote such a script and even sent it to someone; never got any response, though. It is pretty minimal but does the job. I believe that the only sysctls it misses are those which use auxilliary defines to minimize the number of parameters (like #define P1B_SYSCTL in posix4/posix4_mib.c). FWIW, the script is attached. Cheers, &Anton. -- May the tuna salad be with you. --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=sysctl_find #! /usr/bin/perl -w use File::Find; use Text::ParseWords; sub check_file { return unless /\.c$/ && -r; local $/; open SRC, "< $_" or print( "can't open $File::Find::dir: $!"), return; my $src = ; # memory hog close SRC; my @found = ($src =~ /\nSYSCTL_(\w+\([^()]+\))/sg); return unless @found; print "$File::Find::dir/$_:\n"; for (@found) { tr/\n\t / /s; my ($type) = /^(\w+)\(/; next if $type eq "DECL"; s/^.*\(//; s/\)//; my @args = quotewords ',', 1, $_; #print "|@args|\n"; $args[0] =~ s/^\s*_//; $args[0] =~ s/\s+$//; $args[0] =~ tr/_/./; $args[2] =~ s/^\s+//; $args[2] =~ s/\s+$//; print "$type\t$args[0].$args[2]\t$args[-1]\n"; } } find( \&check_file, '/usr/src/sys'); --k+w/mQv8wyuph6w0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message