Comments (4)
Thank you for the report!
I confirmed about could not get CPUInfo on ARM v7, ubuntu 15.04 by using https://www.scaleway.com/.
I prefer more widely used way. I think your a) lscpu
approach is major than b). I would appreciate you if you make some PR. Thank you.
from gopsutil.
@shirou awesome. i would love to contribute :-)
Question: lscpu output is fairly different than /proc/cpuinfo ,
- it does not have things like flags, cpu family etc.
- fields are inconsistent across arch. I'm posting examples of intel and arm
lscpu
data. e.g. CPU MHz has min & max fields on arm - lscpu data is aggregate output. i.e. unlike cpuinfo which has one entry per core, lscpu is summary of all cpu
- fields are inconsistent across arch. I'm posting examples of intel and arm
I am thinking of several things, but not sure which one is best.
- introduce a separate struct to expose lscpu info (consumer codes need to be updated)
- interpret and build a array of CPUStats from lscpu data (not sure we'll get all logic right, or we;ll have all data.)
comments?
Intel lscpu output
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 58
Stepping: 9
CPU MHz: 2932.519
BogoMIPS: 4988.38
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 4096K
NUMA node0 CPU(s): 0-3
arm lscpu output
Architecture: armv7l
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Model name: ARMv7 Processor rev 5 (v7l)
CPU max MHz: 900.0000
CPU min MHz: 600.0000
from gopsutil.
@ranjib Thank you for the information. On my understanding, only ARM can not get information from /proc/cpuinfo
. So I think how about separating into two files cpu_linux.go
and cpu_linux_arm.go
such as
- for amd, get from
/proc/cpuinfo
- for ARM, get from
lscpu
Will that work?
from gopsutil.
@shirou That sounds good to me! I am not familiar with arm on linux outside of Rasbpian but that's my primary use case for this feature. Let me know if you need help with this.
from gopsutil.
Related Issues (20)
- ProcTotal Inaccurate in `MiscStats` HOT 4
- : Optimization Request: Reducing the Number of windows.OpenProcess Calls When Gathering Name, CreateTime, and PPID HOT 1
- docker container monitor host resource and usage HOT 3
- [invoker] set the `WaitDelay` to avoid getting indefinitely blocking wait() HOT 2
- Calling disk.Partitions(false) produces different list on Linux to "df" HOT 1
- `ExeWithContext` returns an error with a Go binary on newer versions of macOS HOT 6
- Inaccurate readings of cpu.Percent HOT 1
- Allow path to net/dev to not be under HOST_PROC
- Windows interrupt signal errror HOT 1
- Crash in createTimeWithContext when run on FreeBSD arm64 HOT 18
- runtime: program exceeds 10000-thread limit HOT 2
- Builds for netbsd arm fail with `undefined: cpuTimes` HOT 4
- Get current working directory on openbsd HOT 3
- TestDisk_partitions fails when there are no physical drives mounted HOT 1
- AIX Uptime parsing fails, returns error HOT 2
- AIX Runtime Panic in Host HOT 2
- deprecated and not defined error on Apple Silicon CPUs HOT 1
- host.PlatformInformation() not precise on Ubuntu HOT 3
- Better IPv6 Support
- Improper types can get assigned
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gopsutil.