lkml.org 
[lkml]   [2008]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [1/3] Provide rdtscll() asm/msr.h for user space
Andi Kleen wrote:
>
>> I would suggest writing a <sys/tsc.h> header file and submitting to the
>> glibc people, instead, or perhaps even better, start a libarch/libx86 tree.
>
> That wouldn't work on old kernels. asm/msr.h has been the traditional
> interface for this and rdtsc has worked forever (at least dating back to 2.0)
> rdtscll is a bit newer, but still in Linux terms ancient (2.4)
>

It would definitely work on older kernels. Just don't stomp on the
kernel's namespace and you can do whatever you want.

> Also in my experience distributions are extremly slow at keeping up
> with glibc, so even if this was added to glibc it would be probably
> years before it would be actually usable :/ And I see about zero
> point in changing a perfectly fine include name breaking everything old.

So ship the include file with your utility. Hardly a big deal. But
yes, that's part of why I'm mentioning the idea of putting it in a
separate library, which can also house other low-level constructs.

> Anyways if you insist I can probably deal without
> but I (and likely others) would think something nasty about you every time
> I have to cut'n'paste that code again. Do you really want to risk that? @)

If you're really incapable of maintaining a single user-mode header file
with a handful of one-liners in a sane way, then definitely.

-hpa


\
 
 \ /
  Last update: 2008-10-08 01:27    [from the cache]
©2003-2011 Jasper Spaans