[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: get kernel time && data type
tks very much.
It seems to me jiffies isn't as accurate as i need.
I followed your advice and tried:
long t1;
rdtscl(ts);
but 4 bytes isn't enogh time (i get the same number aprox every 12 sec.),
I'd much rather use 8 bytes using an unsigned long long )
__asm__ volatile(".byte 0x0f,0x31" : "=A" (x));
but have been having trouble with the compilation when using an unsigned
long long int variable in the kernel source. The error message is:
mm/mm.o: In function `refresh_input':
mm/mm.o(.text+0xa0be): undefined reference to `__cmpdi2'
mm/mm.o: In function `NN_train':
mm/mm.o(.text+0xab0c): undefined reference to `__cmpdi2'
make: *** [vmlinux] Error 1
Alejandro
>On Wed, Mar 14, 2001 at 06:55:05AM -0600, alejandro alliana wrote:
> > I need to keep track of the time when a page is
> > swapped in (out), with a presicion of about
> > milliseconds or microseconds. I would like to know a
> > way to get the time when that happens and what data
> > type would be good for this and be reasonable easy to
> > do some arithmetic operations with it.
> >
> > I've been using so far jiffies (unsigned long) but
> > it seems the time presicion is not very good because i
> > always get the same time.
>
>Then you're doing something wrong because jiffies *is* updated every
>1/HZ second and quite a lot of drivers will break if it doesn't.
>
> > I also tried to read the
> > time stamp counter (to an unsigned long long )with the
> > line
> > __asm__ volatile(".byte 0x0f,0x31" : "=A" (x));
> > but have been having trouble with the compilation.
>
> #include <asm/msr.h>
>
> long t1;
> rdtscl(ts);
>
> > What other options do I have or am I on the right
> > track?
>
>Sounds to me like you're doing something wrong. I know that Adam
>Wiggins used exactly the same trick with jiffies to keep track of pages
>and TLB entries (for fast address space switching on StrongARM CPUs).
>
>
>Erik
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.surriel.com/kernelnewbies.shtml