tiny lib/libkvm/kvm_proc.c correction

Alexander Best alexbestms at wwu.de
Sat Mar 6 10:51:17 UTC 2010


Ulrich Spörlein 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 else
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=freebsd.work/.git;a=commitdiff;h=d500a051eb75dd234166bb11485c0a953aefce1d

> Regards,
> Uli


More information about the freebsd-hackers mailing list