lkml.org 
[lkml]   [2001]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: strange nonmonotonic behavior of gettimeoftheday
>
> on AMD K6, VIA Technologies VT 82C586, Compaq Presario XL119.
> [snip]
> gives following result on box in question
> root@******:# ./clo
> Leap found: -1687 msec
> and prints nothing on all other my boxes.

Perhaps APM or SMI problems?
Could you run the attached program?

--
Manfred#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include <time.h>

static unsigned long long get_tsc(void)
{
unsigned long v1;
unsigned long v2;
__asm__ __volatile__(
"rdtsc\n\t"
: "=a" (v1), "=d" (v2));
return (((unsigned long long)v2)<<32)+v1;
}

int main(int argc, char** argv)
{
unsigned long long t1;
unsigned long long t2;

printf("RDTSC tester\n");
t1 = get_tsc();
for(;;) {
t2 = get_tsc();
if(t1 > t2) {
printf("tsc jumped backwards: from %lld to %lld.\n",
t1, t2);
}
#if 0
printf("diff is %lld-%lld=%d.\n",t2,t1,t2-t1);
#endif
t1 = t2;

}
return 1;
}

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.066 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site