Date: Thu, 11 Mar 2010 14:13:13 +0100 (CET) From: Alexander Best <alexbestms@wwu.de> To: John Baldwin <jhb@freebsd.org>, <freebsd-hackers@freebsd.org> Cc: Ulrich =?iso-8859-1?Q?Sp=F6rlein?= <uqs@spoerlein.net>, Xin LI <delphij@delphij.net> Subject: Re: tiny lib/libkvm/kvm_proc.c correction Message-ID: <permail-20100311131313f7e55a9d00005789-a_best01@message-id.uni-muenster.de> In-Reply-To: <201003080947.58027.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
John Baldwin schrieb am 2010-03-08: > On Saturday 06 March 2010 3:39:17 am Ulrich Sp=F6rlein wrote: > > 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: i've just had a look at the overall use of bintime2timeval in the src. it's not used very often. i only found a handful of calls and in fact with the exception of kvm_proc.c bintime2timeval() always gets used with a proper struct bintime. so i guess it's okay to import cputick2usec() exclusively to kvm_proc.c. cheers. alex > https://www.spoerlein.net/gitweb/?p=3Dfreebsd.work/.git;a=3Dcommitdiff;h= =3Dd500a051eb75dd234166bb11485c0a953aefce1d > I'm fine with this patch so long as you are reading 'ticks' from the > crash > dump.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?permail-20100311131313f7e55a9d00005789-a_best01>