From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 6 08:39:43 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 172611065670 for ; Sat, 6 Mar 2010 08:39:43 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id 732A68FC0A for ; Sat, 6 Mar 2010 08:39:42 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id o268dH07012235 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 6 Mar 2010 09:39:17 +0100 (CET) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1267864760; bh=QJI9NxcAy3OxGVFxyAfDCYCzO6ceLLh33zea8JLMTwI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=ulZOiToF1eS4NDXSPm8nSQZsfHFDzHFiLVzIB+XeTkaIaR8VR20lgCG40j4K2h1I6 VF251kjovgp460u0lllzVC4K1P4y9eTRLI1dcEd1ySr9BoSnXuNM8Ahi04DdspVv/x vp9X2azd9b0pinvdD4zoqrTs8591rBKfObpzrfr8= Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o268dHND012232; Sat, 6 Mar 2010 09:39:17 +0100 (CET) (envelope-from uqs@spoerlein.net) Date: Sat, 6 Mar 2010 09:39:17 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Xin LI Message-ID: <20100306083916.GI21344@acme.spoerlein.net> Mail-Followup-To: Xin LI , Alexander Best , freebsd-hackers@freebsd.org References: <4B916BD0.7030501@delphij.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B916BD0.7030501@delphij.net> User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on acme.spoerlein.net Cc: Alexander Best , freebsd-hackers@freebsd.org Subject: Re: tiny lib/libkvm/kvm_proc.c correction X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2010 08:39:43 -0000 On Fri, 05.03.2010 at 12:38:40 -0800, Xin LI wrote: > On 2010/03/05 11:59, Alexander Best wrote: > > Xin LI schrieb am 2010-03-05: > > On 2010/03/05 11:26, Alexander Best wrote: > >>>> hi there. does this look right? > > > > Not to me, the value is not to be used this way and the comments > > above the code explained the same thing. > > > > I think we should use cputick2usec but it's not available to userland > > (one have to copy cpu_tick_frequency and friends). > > > >> damn you're right. i completely overlooked that comment. would it be worth > >> making cputick2usec available to userland? is kvm_proc.c the only candidate in > >> need of converting cpu ticks to usecs? > > I'm not sure how to do that unfortunately, is there a way to expose a > kernel variable to userland which also works on a crash dump? ticks *is* available to libkvm, not sure what happens on crashdumps, though. The following patchset has not been tested: https://www.spoerlein.net/gitweb/?p=freebsd.work/.git;a=commitdiff;h=d500a051eb75dd234166bb11485c0a953aefce1d Regards, Uli