From owner-freebsd-hackers@FreeBSD.ORG Mon May 7 17:17:35 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 452F216A402 for ; Mon, 7 May 2007 17:17:35 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from mh2.centtech.com (moat3.centtech.com [64.129.166.50]) by mx1.freebsd.org (Postfix) with ESMTP id 0DB0413C483 for ; Mon, 7 May 2007 17:17:34 +0000 (UTC) (envelope-from anderson@freebsd.org) Received: from neutrino.centtech.com (neutrino.centtech.com [10.177.171.220]) by mh2.centtech.com (8.13.8/8.13.8) with ESMTP id l47HHP4h059911; Mon, 7 May 2007 12:17:26 -0500 (CDT) (envelope-from anderson@freebsd.org) Message-ID: <463F5F25.5030201@freebsd.org> Date: Mon, 07 May 2007 12:17:25 -0500 From: Eric Anderson User-Agent: Thunderbird 2.0.0.0 (X11/20070420) MIME-Version: 1.0 To: Ivan Voras References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.88.4/3216/Mon May 7 02:36:02 2007 on mh2.centtech.com X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=8.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.6 X-Spam-Checker-Version: SpamAssassin 3.1.6 (2006-10-03) on mh2.centtech.com Cc: freebsd-hackers@freebsd.org Subject: Re: MIME-ifying sysctl types X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 May 2007 17:17:35 -0000 On 05/07/07 11:39, Ivan Voras wrote: > In the output of sysctl -oa I see values like: > > kern.proc.all: Format:S,proc Length:75264 > Dump:0x00030000000000002011fac380d4fec3... > kern.proc.proc_td: Format:N Length:75264 > Dump:0x00030000000000002011fac380d4fec3... > kern.file: Format:S,xfile Length:18616 > Dump:0x340000003e0c0000e803000006000000... > vfs.nfs.diskless_rootaddr: Format:%Ssockaddr_in Length:16 > Dump:0x00000000000000000000000000000000... > debug.hashstat.rawnchash: Format:S,int Length:262144 > Dump:0x00000000000000000000000000000000... > > , etc., and some like: > > kern.ipc.msqids: Format: Length:3520 > Dump:0x00000000000000000000000000000000... > kern.ipc.sema: Format: Length:600 Dump:0x00000000000000000000000000000000... > > and even some like: > machdep.consdev: Format:T,struct cdev * Length:4 Dump:0x00000000... > > The first group has widely nonuniform "Format" fields, the second don't > have it at all, and the third just looks wrong (is that a NULL pointer > being exported from the kernel, just in case the userland doesn't have > it? :) ). > > My proposal is to MIME-ify the Format fields, best presented in examples: > > "S,proc" -> "x-struct/proc" > "S,xfile" -> "x-struct/xfile" > > Etc. > > GEOM tree is the easiest, it's just "text/xml", and the already present > text fields would be "text/plain". > > If possible, the types should conform to > http://www.iana.org/assignments/media-types/ - but except for text and > XML types they usually won't. > > The next step, obviously, but of dubious benefit, would be to stop > exporting binary data from the kernel and do it via XML, but that's > another thing, possibly another GSoC proposal :) > > I can provide the patches for the format names. At this time I'm looking > for input: is this idea sane? Are there any utilities that actually > parse the type name? > > The benefit of this conversion is that MIME types are easier on the eyes > and will help unfamiliar users understand what's going on. > How about adding a -m switch to sysctl that outputs the MIME compatible format, leaving the other formats unchanged to avoid breaking something someone is expecting? Eric