From owner-freebsd-arch@FreeBSD.ORG Tue Jul 10 22:23:46 2007 Return-Path: X-Original-To: freebsd-arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B0E116A421; Tue, 10 Jul 2007 22:23:46 +0000 (UTC) (envelope-from cnst@FreeBSD.org) Received: from mojo.ru (mojo.ru [84.252.152.63]) by mx1.freebsd.org (Postfix) with ESMTP id EDAC413C43E; Tue, 10 Jul 2007 22:23:45 +0000 (UTC) (envelope-from cnst@FreeBSD.org) Received: from [192.168.0.16] (nc-76-4-28-21.dhcp.embarqhsd.net [76.4.28.21]) (authenticated bits=0) by mojo.ru (8.12.11.20060308/8.12.10) with ESMTP id l6AMNduN012123 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 Jul 2007 02:23:42 +0400 Message-ID: <469406E0.3090206@FreeBSD.org> Date: Tue, 10 Jul 2007 18:23:28 -0400 From: "Constantine A. Murenin" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-gb, en-gb-oed, en, en-us, ru, ru-ru, ru-su MIME-Version: 1.0 To: Poul-Henning Kamp References: <53466.1184103823@critter.freebsd.dk> In-Reply-To: <53466.1184103823@critter.freebsd.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: Rui Paulo , Shteryana Shopova , "Constantine A. Murenin" , freebsd-arch@FreeBSD.org Subject: Re: Porting OpenBSD's sysctl hw.sensors framework to FreeBSD X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2007 22:23:46 -0000 On 10/07/2007 17:43, Poul-Henning Kamp wrote: > A number of observations: > > The main problem about hardware monitoring is the lack of a name-space. > > The OpenBSD sysctl doesn't get anywhere close to providing that. There is no lack in namespace, specifically after the recent redesign of the framework. When you do sysctl(3) calls in OpenBSD 4.1, you specify the type of the sensor that you want to look at in mib[3], and go through a combination of mib[2] (sensor device, i.e. lm0 or ipmi0) and mib[4] (sensor number of above type on above device) to query all devices and all sensors on all of these devices (mib[0] = CTL_HW; mib[1] = HW_SENSORS;). You can be 100% sure that every sensor returned with these calls is a sensor of type specified in mib[3]. Each sensor type has a well-defined unit and other properties. String descriptions are entirely optional, predefined sensor types is all that matters. Range for mib[4] is provided in the sensordev datastructure that can be accessed when mib[3] and mib[4] are omitted. How do you see this as a lack of a namespace? Cheers, Constantine.