diff --git a/README.md b/README.md index 27b668c..0be5bd3 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,8 @@ I also created a nice little command line tool called [mmon][mmon-github-url] (m | | governor | X | | | | | e.g. 'powersave' | | | cores | X | X | X | X | | # cores | | | physicalCores | X | X | X | X | | # physical cores | +| | efficiencyCores | | | X | | | # efficiancy cores (ARM only) | +| | performanceCores | | | X | | | # performance cores (ARM only) | | | processors | X | X | X | X | | # processors | | | socket | X | X | | X | | socket type e.g. "LGA1356" | | | vendor | X | X | X | X | | vendor ID | diff --git a/docs/cpu.html b/docs/cpu.html index 64b29e6..22272fd 100644 --- a/docs/cpu.html +++ b/docs/cpu.html @@ -155,6 +155,26 @@ # physical cores + + + efficiencyCores + + + X + + + # efficiency cores (ARM only) + + + + performanceCores + + + X + + + # performance cores (ARM only) + processors diff --git a/lib/cpu.js b/lib/cpu.js index e334894..4939076 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -15,6 +15,7 @@ const os = require('os'); const exec = require('child_process').exec; +const execSync = require('child_process').execSync; const fs = require('fs'); const util = require('./util'); @@ -432,7 +433,12 @@ function getCpu() { const countCores = util.getValue(lines, 'hw.physicalcpu_max'); const countThreads = util.getValue(lines, 'hw.ncpu'); if (os.arch === 'arm64') { + const clusters = execSync('ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type').toString().split('\n'); + const efficiencyCores = clusters.filter(line => line.indexOf('"E"') >= 0).length; + const performanceCores = clusters.filter(line => line.indexOf('"P"') >= 0).length; result.socket = 'SOC'; + result.efficiencyCores = efficiencyCores; + result.performanceCores = performanceCores; } if (countProcessors) { result.processors = parseInt(countProcessors) || 1; diff --git a/lib/index.d.ts b/lib/index.d.ts index 8179aec..f426e08 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -73,6 +73,8 @@ export namespace Systeminformation { governor: string; cores: number; physicalCores: number; + efficiencyCores?: number; + performanceCores?: number; processors: number; socket: string; cache: CpuCacheData;