|
|
finding out cpu clk speed
Hi,
Is there a syscall which I can use within a C program to find out what is
the CPU frequency ? Reading /proc/cpuinfo doesn't work for my purposes :-(
--
Sayantan Sur
Graduate Research Assistant
Dept. of Computer Science
The Ohio State University.
|
|
0
|
|
|
|
Reply
|
surs.deletethis (24)
|
9/8/2003 4:37:54 PM |
|
On Mon, 08 Sep 2003 12:37:54 -0400, Sayantan Sur staggered into the
Black Sun and said:
> Is there a syscall which I can use within a C program to find out
> what is the CPU frequency ?
Nope. Clock frequency is calculated at boot time on the x86 via a tight
loop, and the information is stored in kernel data structures that are
accessible via /proc/cpuinfo . Why waste a syscall on information you
can get with open() and read() ?
> Reading /proc/cpuinfo doesn't work for my purposes
Why not? Explain more fully, please.
--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /
http://www.brainbench.com / "He is a rhythmic movement of the
-----------------------------/ penguins, is Tux." --MegaHAL
|
|
0
|
|
|
|
Reply
|
danceswithcrows (534)
|
9/8/2003 4:45:27 PM
|
|
>> Reading /proc/cpuinfo doesn't work for my purposes
>
> Why not? Explain more fully, please.
I found out that read() of /proc/cpuinfo does infact work for me. Here is
how,
f = popen("/bin/sed -n '/cpu MHz/s/[^:]*://p' /proc/cpuinfo", "r");
Thanks,
--
Sayantan Sur
Graduate Research Assistant
Dept. of Computer Science
The Ohio State University.
|
|
0
|
|
|
|
Reply
|
surs.deletethis (24)
|
9/8/2003 5:52:23 PM
|
|
On Mon, 08 Sep 2003 13:52:23 -0400, Sayantan Sur
<surs.deletethis@cis.ohio-state.edu> wrote:
>
>>> Reading /proc/cpuinfo doesn't work for my purposes
>>
>> Why not? Explain more fully, please.
>
>I found out that read() of /proc/cpuinfo does infact work for me. Here is
>how,
>
>f = popen("/bin/sed -n '/cpu MHz/s/[^:]*://p' /proc/cpuinfo", "r");
>
>Thanks,
Will produce unexpected results for smp machines. I suggest you add a
| head -1 to be certain.
Steve
|
|
0
|
|
|
|
Reply
|
steve1960 (42)
|
9/9/2003 4:15:06 PM
|
|
|
3 Replies
57 Views
(page loaded in 0.102 seconds)
Similiar Articles: HPGCC: How to speed up the CPU? - comp.sys.hp48how to find out what processes are taking up CPU resources ... solaris CPU speed via psp_cpu ... how to find ... hardware (CPU clock, CPU load ... Temperature and Fan Speed ... Adding a second CPU to a DS20E - comp.os.vms... the PN 54-30060-01. > > Thanks, > > Marc Marc, cpu speeds (or clock ... hosts, one in particular takes 1/4 second to ... how to find out what processes are taking up CPU ... Looking for CPU temperatures and fans speed - comp.sys.hp.hpux ...... all kinds of notebook hardware (CPU clock, CPU ... You really need to check NHC out and see ... CPU Temperature and Fan Speed | eHow.com The central processing unit (CPU) is a ... How to find out which instruction sets (mmx/sse/etc.) are used ...How to find out which instruction sets (mmx/sse/etc ... x86 mode) instruction set If you used "cpu P3", it would error out ... SSE4) instruction popcnt. ... to speed up ... CPU info - comp.unix.solaris... SUNW,Sun-Blade-1000 (UltraSPARC-III+) System clock ... Hello, this is part of a CPU-Speed-Detection Program ... How to find out which instruction sets (mmx/sse/etc.) are used ... High resolution timer. - comp.lang.asm.x86The time-of-day clock has sub-microsecond resolution, but is probably out of the question for Windows. ... updates RDTSC independently of the actual CPU clock speed and at ... Get CPU usage and temperature - comp.os.ms-windows.programmer ...... OUT PVOID SystemInformation ... and ... computer's central processing unit can ... temperatures and fans speed - comp.sys.hp.hpux ..... all kinds of notebook hardware (CPU clock ... AMD, or Intel? - comp.cad.solidworks... of CPU then you are probably not limited by CPU speed. ... at lower voltages, and a high enough default clock speed to ... (also less hair pulled out,.. more > changes... fewer ... How to get %CPU Utilization for performance testing using /proc in ...... my layer is run for a long time and i have to find out that at what %CPU ... Get CPU usage and temperature ... How to get fan speeds on X4200? - comp.unix.solaris Get CPU ... ntpd, boot time, and hot plugging - comp.protocols.time.ntp ...We're talking about speed of > acquistion of an initial "good enough ... You can easily find out whether the CPU clock is the culprit by starting ntpd with a "disable ntp ... How to Find Out the Clock Speed of the CPU of a Computer | eHow.comThe CPU or "Processor" is the main component in the computer. This device does most of the data processing, which runs programs and controls the functions of other ... How to Find Out the CPU Type & Speed | eHow.comMore Like This. How to Compare CPU Speed; How to Determine a CPU and the CPU Speed Amount of RAM; How to Find Out the Clock Speed of the CPU of a Computer 7/23/2012 6:19:24 PM
|
|
|
|
|
|
|
|
|