From owner-freebsd-current@FreeBSD.ORG Mon Jan 14 02:38:31 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E42616A418 for ; Mon, 14 Jan 2008 02:38:31 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by mx1.freebsd.org (Postfix) with ESMTP id D522413C45A for ; Mon, 14 Jan 2008 02:38:30 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: by ug-out-1314.google.com with SMTP id y2so1170072uge.37 for ; Sun, 13 Jan 2008 18:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=NF6R0eBem//ThlV+bkCMTmvW0mQJF7Iv2sUkVo3+rxY=; b=QBOesgPq8V6tkUx8vXzbQunPcKc3P6lLB0W6SQUhtEcLY6meoOO75fQN7h9fckCmLlLkVyoyeFSem+CUTcSFOVR+zzKHf5kkBgl0PJfV0Nh44kw0KvZ6/tkSQieGL8aV6j6l+y/MU0gTTZVRIPt1mpGNnIAMrc6CaHL4zEm5gtQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=uQIrPxGsW8a62t1D9rN3mKpS1Yr2t3yx9BgHb85Cgn7yDtlKtK1w/QS3VtjvfPdX5eJilVyGPRcF+tzidwMOz6vQ9lGqM+5P4A4n66OLIL1ItlvlCGM36R9vXeWP0X3cGJW4s/jQKNF7WCGvEKn14TdBIYf4Fbjvx3O2CTl8jPk= Received: by 10.67.23.5 with SMTP id a5mr3372284ugj.8.1200278309473; Sun, 13 Jan 2008 18:38:29 -0800 (PST) Received: by 10.66.248.11 with HTTP; Sun, 13 Jan 2008 18:38:29 -0800 (PST) Message-ID: Date: Mon, 14 Jan 2008 02:38:29 +0000 From: "Igor Mozolevsky" Sender: mozolevsky@gmail.com To: "Daniel O'Connor" In-Reply-To: <200801141254.20400.doconnor@gsoft.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1200197787.67286.13.camel@shumai.marcuscom.com> <20080113182457.GN929@server.vk2pj.dyndns.org> <200801141254.20400.doconnor@gsoft.com.au> X-Google-Sender-Auth: 3faf58ad78338795 Cc: Kostik Belousov , Peter Jeremy , freebsd-current@freebsd.org, Joe Marcus Clarke , current 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 02:38:31 -0000 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