Re: Computing cpu's clock in cycles per second

2010-09-27 Thread Michael Miles
JD wrote: > > On 09/27/2010 07:34 AM, Wade Hampton wrote: > >> Did you look at using the RDTSC instruction to read the >> cycle counter? >> >> http://en.wikipedia.org/wiki/Time_Stamp_Counter >> >> Sample this over an interval to get an estimate >> of the clock frequency based on this counter. >

Re: Computing cpu's clock in cycles per second

2010-09-27 Thread JD
On 09/27/2010 07:34 AM, Wade Hampton wrote: > Did you look at using the RDTSC instruction to read the > cycle counter? > > http://en.wikipedia.org/wiki/Time_Stamp_Counter > > Sample this over an interval to get an estimate > of the clock frequency based on this counter. > > __inline__ unsigned lo

Re: Computing cpu's clock in cycles per second

2010-09-27 Thread Wade Hampton
Did you look at using the RDTSC instruction to read the cycle counter? http://en.wikipedia.org/wiki/Time_Stamp_Counter Sample this over an interval to get an estimate of the clock frequency based on this counter. __inline__ unsigned long long int rdtsc() { unsigned long long int x; __asm__ v

Re: Computing cpu's clock in cycles per second

2010-09-26 Thread Michael Miles
JD wrote: > > On 09/26/2010 01:21 PM, Tom Horsley wrote: > >> On Sun, 26 Sep 2010 13:10:34 -0700 >> JD wrote: >> >> >>> Since I have not been successful to determine the runtime >>> cpu frequency using the fedora tools: >>> >> How about cat /proc/cpuinfo | fgrep 'cpu MHz' >> >

Re: Computing cpu's clock in cycles per second

2010-09-26 Thread JD
On 09/26/2010 01:21 PM, Tom Horsley wrote: > On Sun, 26 Sep 2010 13:10:34 -0700 > JD wrote: > >>Since I have not been successful to determine the runtime >> cpu frequency using the fedora tools: > How about cat /proc/cpuinfo | fgrep 'cpu MHz' > > Of course, I have no idea where that number co

Re: Computing cpu's clock in cycles per second

2010-09-26 Thread Tom Horsley
On Sun, 26 Sep 2010 13:10:34 -0700 JD wrote: > Since I have not been successful to determine the runtime > cpu frequency using the fedora tools: How about cat /proc/cpuinfo | fgrep 'cpu MHz' Of course, I have no idea where that number comes from. I have some virtual machines which sometimes ge

Computing cpu's clock in cycles per second

2010-09-26 Thread JD
Since I have not been successful to determine the runtime cpu frequency using the fedora tools: $ sudo /usr/bin/cpufreq-info -f $ sudo /usr/bin/cpufreq-info -w $ They come up empty. So, I wrote a simple program to determine an approximate value for the number of cycles per second. The algorit