Open santosh opened 2 years ago
Could you tell us /proc/cpuinfo
content? We want to know cpu MHz
line exists and the content of that line.
@shirou No, there is no such line with MHz
.
ubuntu@ip-10-2-1-38:~$ cat /proc/cpuinfo
processor : 0
BogoMIPS : 243.75
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x3
CPU part : 0xd0c
CPU revision : 1
processor : 1
BogoMIPS : 243.75
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x3
CPU part : 0xd0c
CPU revision : 1
However, output of dmidecode
has the info:
ubuntu@ip-10-2-1-38:~$ sudo dmidecode | grep MHz
Max Speed: 2500 MHz
Current Speed: 2500 MHz
Adding a fallback to dmidecode to get cpu frequencies was previously discussed in https://github.com/shirou/gopsutil/issues/282#issuecomment-287474911
It has too many drawbacks in my opinion to be valuable to add it as a fallback.
Describe the bug I am working on an application which has to deal with compute capacity of the host system. I am using gopsutil to get the capacity.
It works fine on amd64 machines. But when I tested on arm64 machine, the
mhz
field was 0.To Reproduce
Expected behavior On an arbitrary amd64 machine, I get output similar to this:
On an arm64 machine, I get this:
Environment (please complete the following information):
/etc/os-release
and the result ofuname -a
]Additional context
I am testing it on Ubuntu 22.04, but I have also tested the same thing on Ubuntu 18.04 and 20.04.