From owner-cvs-src@FreeBSD.ORG Sun Apr 10 15:05:00 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 903CE16A4CE; Sun, 10 Apr 2005 15:05:00 +0000 (GMT) Received: from cyrus.watson.org (cyrus.watson.org [204.156.12.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3025743D2F; Sun, 10 Apr 2005 15:05:00 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by cyrus.watson.org (Postfix) with ESMTP id 71FC946B16; Sun, 10 Apr 2005 11:04:59 -0400 (EDT) Date: Sun, 10 Apr 2005 16:04:54 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <200504081237.17789.jhb@FreeBSD.org> Message-ID: <20050410160253.J3036@fledge.watson.org> References: <19069.1112973882@critter.freebsd.dk> <200504081237.17789.jhb@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: src-committers@FreeBSD.org cc: Bruce Evans cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org cc: Poul-Henning Kamp cc: Gleb Smirnoff Subject: Re: cvs commit: src/sys/kern kern_mutex.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2005 15:05:00 -0000 On Fri, 8 Apr 2005, John Baldwin wrote: >>>> Log: >>>> Add additional newline to debug.mutex.prof.stats header, so that >>>> column names are printed exactly above the columns. >>> >>> This is bogus, as is the existence of sysctls that format data (*). >>> >>> (*) Formatted output is not too bad for sysctls in the debug tree, but >>> for general-purpose sysctls it is just a bug. >> >> I disagree. > > It's a lot easier to parse a structured binary blob than to parse > formatted text so that you can display it differently. Note that I > would consider XML ala GEOM to be more of the blob style since the > whitespace isn't significant. It should be up to userland to do whatever > formatting of data is required. For small things like 'current > timecounter' or 'list of valid CPU frequencies' simple strings with > space delimiting is probably fine though. Trying to format complex data > into multiple lines with columns and headers doesn't belong in the > kernel outside of ddb IMO. FWIW, I ran precisely into the "formatted text sysctl" problem recently when looking at adapting netstat -mb to use UMA's statistics output rather than mbuf-specific sysctls. In order to extract the mbuf entries from the current sysctl, you have to do some text parsing and munging. However, finding a useful middle ground is non-trivial. XML is one possibility, but we can probably get away with something simpler. I was chatting with Poul-Henning about this on Friday, and he wondered about exporting the column list as one sysctl, and then all of the raws separated by \t's and \n's in another sysctl. It still requires a bit of text frobbing, but doesn't require the kernel to do the formatting, etc. Robert N M Watson