From owner-freebsd-current@FreeBSD.ORG Mon Jan 14 04:40:02 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7684616A46B for ; Mon, 14 Jan 2008 04:40:02 +0000 (UTC) (envelope-from nslay@comcast.net) Received: from QMTA01.westchester.pa.mail.comcast.net (qmta01.westchester.pa.mail.comcast.net [76.96.62.16]) by mx1.freebsd.org (Postfix) with ESMTP id DD6D113C4EC for ; Mon, 14 Jan 2008 04:40:01 +0000 (UTC) (envelope-from nslay@comcast.net) Received: from OMTA04.westchester.pa.mail.comcast.net ([76.96.62.35]) by QMTA01.westchester.pa.mail.comcast.net with comcast id cjqA1Y00C0ldTLk050b400; Mon, 14 Jan 2008 04:40:01 +0000 Received: from ANTENNA.LOCAL ([68.35.224.189]) by OMTA04.westchester.pa.mail.comcast.net with comcast id csfs1Y00145o48c3Q00000; Mon, 14 Jan 2008 04:39:54 +0000 X-Authority-Analysis: v=1.0 c=1 a=BZmrEeO8dF8A:10 a=6I5d2MoRAAAA:8 a=7809mWcuXHhVBeVzHGoA:9 a=NR26xvuNWwWaFKy3d7cA:7 a=Gonuy6shnLc4jPPQvVFoZImzVFgA:4 a=SV7veod9ZcQA:10 a=a24e7YDjOykA:10 Message-ID: <478AE741.1000105@comcast.net> Date: Sun, 13 Jan 2008 23:38:25 -0500 From: Nathan Lay User-Agent: Thunderbird 2.0.0.9 (X11/20071230) MIME-Version: 1.0 To: Igor Mozolevsky References: <1200197787.67286.13.camel@shumai.marcuscom.com> <20080113182457.GN929@server.vk2pj.dyndns.org> <200801141254.20400.doconnor@gsoft.com.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: current , freebsd-current@freebsd.org, Joe Marcus Clarke , Peter Jeremy , Kostik Belousov Subject: Re: RFC: Adding a hw.features[2] sysctl X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2008 04:40:02 -0000 Igor Mozolevsky wrote: > On 14/01/2008, Daniel O'Connor wrote: > >> On Mon, 14 Jan 2008, Igor Mozolevsky wrote: >> >>> On 13/01/2008, Peter Jeremy wrote: >>> >>>> IMHO, no. Virtually all similar FreeBSD information is exported >>>> via sysctl and this sort of information fits neatly into the >>>> existing MIB tree as either dev.cpu.N.features or hw.cpu.features >>>> >>> /dev/sndstat? >>> >> A single handy counter example to the many many that are sysctls :) >> >> >>> If it's in /dev you can do neat tricks like ioctl-ing queries (like >>> ioctl(/dev/cpuinfo, CINFOCTL_HAS_FEATURES, CINFO_SSE3|CINFO_SSSE3)) >>> instead of having *every* app parse the result of a sysctl; most of >>> the time you'd only want to check for specific feature , it's much >>> easier to do an ioctl that returns a boolean. >>> >> Except you can't do that from a shell script. >> (eg wrapper script to run optimised binaries) >> > > cat /dev/cpuinfo and parse away! > > > Igor > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > > I have to agree with Daniel here. ioctl is probably inappropriate. sysctl is already intended for gathering or setting system information by both programs and/or people. cat'ing /dev/cpuinfo sounds reminiscent to Linux /proc. sysctl() could fill a cpu features bitmask for programs. sysctl dev.cpu.features (or something like that) could output those features in human readable format. Best Regards, Nathan Lay