[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

why is rdtsc reporting wrong cpu cycles?


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 _at_ netcabo.pt>

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


この情報があなたの探していたものかどうか選択してください。
yes/まさにこれだ!   no/違うなぁ   part/一部見つかった   try/これで試してみる

あなたが探していた情報はどのようなことか、ご自由に記入下さい。特に「まさにこれだ!」と言う場合は記入をお願いします。
例:「複数のマシンからCATV経由でipmasqueradeを利用してWebを参照したい場合の設定について」
Follow-Ups: