why is rdtsc reporting wrong cpu cycles?

From: Marco Correia
Date: Sat Jan 03 2004 - 10:49:04 EST


Hi,

I'm using the following function for getting the number of CPU cycles elapsed
since I rebooted:

/* Read Timer Stamp Counter */
unsigned long long int rdtsc(void)
{
unsigned long long int x;

__asm__ volatile(".byte 0x0f,0x31" : "=A" (x));
return x;
}

The problem is that the value I get dividing by my processor frequency (my
computer is a 650Mhz toshiba satellite pro 4340) is giving me about 1 hour
and I'm using the computer for about 4 fours.

Am I forgetting something obvious? I already googled around but I came to the
conclusion that only new P4 M processors are able to change speed.

I'm sorry if this is not the place to ask.

Thanks
Marco

ps: Please CC me as I'm not subscribed

--
Marco Correia <mvc@xxxxxxxxxx>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/