cvs commit: src/sys/kern kern_mutex.c

John Baldwin jhb at FreeBSD.org
Fri Apr 8 11:15:54 PDT 2005


On Friday 08 April 2005 11:24 am, Poul-Henning Kamp wrote:
> In message <20050409002141.V48108 at delplex.bde.org>, Bruce Evans writes:
> >On Fri, 8 Apr 2005, Gleb Smirnoff wrote:
> >> glebius     2005-04-08 14:14:09 UTC
> >>
> >>  FreeBSD src repository
> >>
> >>  Modified files:
> >>    sys/kern             kern_mutex.c
> >>  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.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the cvs-src mailing list