FillZpp / sys-info-rs

Get system information in Rust.
MIT License
168 stars 57 forks source link

getting cpu speed sometimes (ppc64 / ppc64le) still fails #25

Closed ignatenkobrain closed 5 years ago

ignatenkobrain commented 6 years ago
[ignatenkobrain@ppc64-test ~][PROD]$ lscpu
Architecture:        ppc64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Big Endian
CPU(s):              2
On-line CPU(s) list: 0,1
Thread(s) per core:  1
Core(s) per socket:  1
Socket(s):           2
NUMA node(s):        1
Model:               2.1 (pvr 004b 0201)
Model name:          POWER8 (architected), altivec supported
Hypervisor vendor:   KVM
Virtualization type: para
L1d cache:           64K
L1i cache:           32K
NUMA node0 CPU(s):   0,1

there is no bogomips or mhz....

FillZpp commented 6 years ago

Last time, i add 'BogoMIPS' field in cpu_speed(), and update to v0.5.4, because i see it in your previous issue #23 . Could you print the output of cat /proc/cpuinfo ?

ignatenkobrain commented 6 years ago

Actually those servers got updated during Christmas...

[ignatenkobrain@ppc64-test ~][PROD]$ cat /proc/cpuinfo 
processor   : 0
cpu     : POWER8 (architected), altivec supported
clock       : 3425.000000MHz
revision    : 2.1 (pvr 004b 0201)

processor   : 1
cpu     : POWER8 (architected), altivec supported
clock       : 3425.000000MHz
revision    : 2.1 (pvr 004b 0201)

timebase    : 512000000
platform    : pSeries
model       : IBM pSeries (emulated by qemu)
machine     : CHRP IBM pSeries (emulated by qemu)
MMU     : Hash
ignatenkobrain commented 6 years ago

Looking at kernel sources...

➜  arch git:(master) grep -ri "seq_printf.*MHz"              
arc/kernel/setup.c:     seq_printf(m, "CPU speed\t: %lu.%02lu Mhz\n",
blackfin/kernel/setup.c:    seq_printf(m, "model name\t: ADSP-%s %lu(MHz CCLK) %lu(MHz SCLK) (%s)\n"
blackfin/kernel/setup.c:    seq_printf(m, "\ncpu MHz\t\t: %lu.%06lu/%lu.%06lu\n",
frv/kernel/setup.c: seq_printf(m, "Clock-" TAG ":\t%lu.%2.2lu MHz\n", VAR / 1000000, (VAR / 10000) % 100)
m32r/kernel/setup.c:    seq_printf(m, name " clock\t: %d.%02dMHz\n",        \
parisc/kernel/processor.c:      seq_printf(m, "cpu MHz\t\t: %d.%06d\n",
powerpc/kernel/setup-common.c:      seq_printf(m, "clock\t\t: %lu.%06luMHz\n",
s390/kernel/processor.c:    seq_printf(m, "cpu MHz dynamic : %d\n", c->cpu_mhz_dynamic);
s390/kernel/processor.c:    seq_printf(m, "cpu MHz static  : %d\n", c->cpu_mhz_static);
tile/kernel/proc.c:     seq_printf(m, "cpu MHz\t\t: %llu.%06llu\n",
x86/kernel/cpu/proc.c:      seq_printf(m, "cpu MHz\t\t: %u.%03u\n",
ignatenkobrain commented 6 years ago

Ping?

ignatenkobrain commented 5 years ago

@FillZpp any news here?

FillZpp commented 5 years ago

@ignatenkobrain How about this #40