From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 6 10:51:17 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 A163D1065672 for ; Sat, 6 Mar 2010 10:51:17 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay1.uni-muenster.de (ZIVM-EXRELAY1.UNI-MUENSTER.DE [128.176.192.14]) by mx1.freebsd.org (Postfix) with ESMTP id EBBC68FC14 for ; Sat, 6 Mar 2010 10:51:16 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.49,593,1262559600"; d="scan'208";a="298401572" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER01.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay1.uni-muenster.de with ESMTP; 06 Mar 2010 11:51:14 +0100 Received: by ZIVMAILUSER01.UNI-MUENSTER.DE (Postfix, from userid 149459) id 403011B0768; Sat, 6 Mar 2010 11:51:14 +0100 (CET) Date: Sat, 06 Mar 2010 11:51:13 +0100 (CET) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Ulrich =?iso-8859-1?Q?Sp=F6rlein?= , Xin LI Message-ID: In-Reply-To: <20100306083916.GI21344@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: 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 10:51:17 -0000 Ulrich Sp=F6rlein schrieb am 2010-03-06: > 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: very nice, but wouldn't it be better to define cputick2usec() somewhere els= e so other userland code can make use of it? even if right now libkvm is the only source in need of such a conversion function, in the future other code might benefit from userland cputick2usec(). now where would be a good place= to put this in? alex ps: did anybody look @ {net|open|dragonfly}bsd, linux, solaris, etc. so see= if they have a userland cputick2usec() and where it's defined? > https://www.spoerlein.net/gitweb/?p=3Dfreebsd.work/.git;a=3Dcommitdiff;h= =3Dd500a051eb75dd234166bb11485c0a953aefce1d > Regards, > Uli