2

I have the following system :

$ uname -a
Linux <machine-name-snip> 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:58 EDT 2008 s390x s390x s390x GNU/Linux

$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.2 (Tikanga)

I need to find the cpu frequency, after a little bit of reading and referring to a links I tried

 cat /proc/cpuinfo
 vendor_id       : IBM/S390
 # processors    : 2
 bogomips per cpu: 6396.31
 features        : <some features>
 processor 0: version = FF,  identification = <some id>,  machine = 2827
 processor 1: version = FF,  identification = <some other id>,  machine = 2827

now I am not sure how to convert this bogomips per cpu into the cpu speed. I have already referred to this link, but I am not sure how I should convert the bogomips to cpu speed.

/sys/devices/system/cpu/cpu0/ -- > does not return cpu frequency for me to use this in order to get a response

Edit 1: I have tried all the answers mentioned below in most of cases either the command is not found, or the output does not contain any information regarding the cpu frequency. I am guessing there must be something wrong with the installation of the machine as a lot of the below mentioned commands are not found.

1
  • have you tried lspcu command ?
    – SHW
    Commented Mar 18, 2014 at 8:44

4 Answers 4

2

Try cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq command

2
  • the systems though it has 2 cpu's does not have above directory structure with the cpufreq dir. --------$ ls /sys/devices/system/cpu/cpu1 ---------result : crash_notes online topology
    – bhavs
    Commented Apr 3, 2014 at 15:14
  • For me it was cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq.
    – Onnonymous
    Commented Sep 2, 2019 at 12:31
2

cat /proc/cpuinfo

output also has the cpu MHz

sample out

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 42
model name  : Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
stepping    : 7
microcode   : 0x14
cpu MHz     : 3101.000
cache size  : 6144 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 4
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
...
2
  • 1
    on the particular zlinux machine that I am using there is no entry for cpu frenquency at all. This command would definitely help me to get the frequency in any other linux machine
    – bhavs
    Commented Apr 3, 2014 at 15:16
  • On s390 (mainframe) the /proc/cpuinfo does not contain the frequency
    – igiannak
    Commented Dec 23, 2020 at 18:57
1

Bogomips (see specially section 3.1 of the linked document) is a totally bogus measure of processor speed reported by the Linux kernel. Also different architectures (or even implementations of the same architecture) can't be compared just by "clock speed". E.g., it used to be that AMD CPUs at the same clock speed were much faster than the respective intel offerings. RISC CPUs used to be faster at the same clock speed than CISC processors.

For any specific workload, the exact mix of integer/floating point/other instructions, many/few branches, cache performance, and the list goes on for a long time passing through compiler savvy and device performance, have a relevant say on final performance.

0

There are various programs/files that give you this information:

  1. lscpu | grep -i MHz

  2. cat /proc/cpuinfo | grep -i mhz (though this information is apparently absent in your system)

  3. cpufreq-info, this one is the most comprehensive:

    $ cpufreq-info 
    cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
    Report errors and bugs to [email protected], please.
    analyzing CPU 0:
      driver: acpi-cpufreq
      CPUs which run at the same hardware frequency: 0
      CPUs which need to have their frequency coordinated by software: 0
      maximum transition latency: 10.0 us.
      hardware limits: 1.20 GHz - 2.67 GHz
      available frequency steps: 2.67 GHz, 2.67 GHz, 2.53 GHz, 2.40 GHz, 2.27 GHz, 2.13 GHz, 2.00 GHz, 1.87 GHz, 1.73 GHz, 1.60 GHz, 1.47 GHz, 1.33 GHz, 1.20 GHz
      available cpufreq governors: ondemand, performance
      current policy: frequency should be within 1.20 GHz and 2.67 GHz.
                      The governor "ondemand" may decide which speed to use
                      within this range.
      current CPU frequency is 1.20 GHz.
    analyzing CPU 1:
      driver: acpi-cpufreq
      CPUs which run at the same hardware frequency: 1
      CPUs which need to have their frequency coordinated by software: 1
      maximum transition latency: 10.0 us.
      hardware limits: 1.20 GHz - 2.67 GHz
      available frequency steps: 2.67 GHz, 2.67 GHz, 2.53 GHz, 2.40 GHz, 2.27 GHz, 2.13 GHz, 2.00 GHz, 1.87 GHz, 1.73 GHz, 1.60 GHz, 1.47 GHz, 1.33 GHz, 1.20 GHz
      available cpufreq governors: ondemand, performance
      current policy: frequency should be within 1.20 GHz and 2.67 GHz.
                      The governor "ondemand" may decide which speed to use
                      within this range.
      current CPU frequency is 1.20 GHz.
    analyzing CPU 2:
      driver: acpi-cpufreq
      CPUs which run at the same hardware frequency: 2
      CPUs which need to have their frequency coordinated by software: 2
      maximum transition latency: 10.0 us.
      hardware limits: 1.20 GHz - 2.67 GHz
      available frequency steps: 2.67 GHz, 2.67 GHz, 2.53 GHz, 2.40 GHz, 2.27 GHz, 2.13 GHz, 2.00 GHz, 1.87 GHz, 1.73 GHz, 1.60 GHz, 1.47 GHz, 1.33 GHz, 1.20 GHz
      available cpufreq governors: ondemand, performance
      current policy: frequency should be within 1.20 GHz and 2.67 GHz.
                      The governor "ondemand" may decide which speed to use
                      within this range.
      current CPU frequency is 1.20 GHz.
    analyzing CPU 3:
      driver: acpi-cpufreq
      CPUs which run at the same hardware frequency: 3
      CPUs which need to have their frequency coordinated by software: 3
      maximum transition latency: 10.0 us.
      hardware limits: 1.20 GHz - 2.67 GHz
      available frequency steps: 2.67 GHz, 2.67 GHz, 2.53 GHz, 2.40 GHz, 2.27 GHz, 2.13 GHz, 2.00 GHz, 1.87 GHz, 1.73 GHz, 1.60 GHz, 1.47 GHz, 1.33 GHz, 1.20 GHz
      available cpufreq governors: ondemand, performance
      current policy: frequency should be within 1.20 GHz and 2.67 GHz.
                      The governor "ondemand" may decide which speed to use
                      within this range.
      current CPU frequency is 1.20 GHz.
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .