From owner-cvs-sys Wed Nov 8 00:30:39 1995 Return-Path: owner-cvs-sys Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id AAA27199 for cvs-sys-outgoing; Wed, 8 Nov 1995 00:30:39 -0800 Received: from tfs.com (tfs.com [140.145.250.1]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id AAA27193 ; Wed, 8 Nov 1995 00:30:31 -0800 Received: from critter.tfs.com by tfs.com (smail3.1.28.1) with SMTP id m0tD5tu-0003vwC; Wed, 8 Nov 95 00:30 PST Received: from localhost (localhost [127.0.0.1]) by critter.tfs.com (8.6.11/8.6.9) with SMTP id JAA01074; Wed, 8 Nov 1995 09:30:28 +0100 X-Authentication-Warning: critter.tfs.com: Host localhost didn't use HELO protocol To: CVS-commiters@freefall.freebsd.org, cvs-sys@freefall.freebsd.org Subject: Re: cvs commit: src/sys/kern kern_sysctl.c In-reply-to: Your message of "Wed, 08 Nov 1995 04:41:50 +1100." <199511071741.EAA12200@godzilla.zeta.org.au> Date: Wed, 08 Nov 1995 09:30:27 +0100 Message-ID: <1072.815819427@critter.tfs.com> From: Poul-Henning Kamp Sender: owner-cvs-sys@FreeBSD.org Precedence: bulk Bruce I share most of your concerns, but disagree on the cure. Some specifics: Yes, I rely on compiler magic for the sysctl variables. I live in the nineties, and we have to move forward. I looked at other options, and they were uglier. #ifdef TERRY_MODE The only thing we could possibly do which would be a benefit, would be to make an intelligent FreeBSD preprocessor that ran over all the sources first and did some of all the grunt work we presently overload cpp with. This would for instance allow us to split data into two classes, one of which could be returned to malloc/free when it wasn't used anymore, allow us to make pinned/unpinned sections of drivers so that we could page part of the kernel (!) and so on... #endif /* TERRY_MODE */ I have included a string for description of the variables, which is presently not instatiated in the kernel. My idea was to have a program do a find /usr/src/sys -type f -print | xargs gronk_out_sysctl_info > foo and proceed from there. It is overkill to expand the (possibly rather lengthy) descriptions into the kernel unless we want to have them available in the user-config, and the descriptions belong in the source, with the definition of the variable. I do plan to (have somebody else) add sysctl-variables to the userconfig editor. I anticipate a "bulk" operator for sysctl, either working along the lines of readv(2), SNMP's getbulk or by allowing one to fetch entire subtrees at a time, like "kern.vm.*". Yes, I would really love to kill the "struct" variables in the sense of everything interesting in them be available as simple variables too. But I still think we need three types: Int, Text, and Opaque. I don't like the concept of converting big structures to ascii and back again, and there are some legitimate uses of entire structures. Maybe we should simply adopt the SNMP types without the ASN.1 encoding. I would also love to convert from the int[] names to "char *" at some later time. For now, I'm only working on step one, replace the current definition- method with something more flexible, comprehensive and usable. Functional enhancements will follow later. -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@ref.tfs.com TRW Financial Systems, Inc. Future will arrive by its own means, progress not so.