Skip to content
This repository has been archived by the owner on Oct 12, 2018. It is now read-only.

add frequency and multiplier sensors for all cores #399

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CPUSensors/CPUSensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,22 @@ bool CPUSensors::start(IOService *provider)
if (!addSensor(KEY_FAKESMC_CPU_PACKAGE_FREQUENCY, SMC_TYPE_UI32, SMC_TYPE_UI32_SIZE, kCPUSensorsFrequencyPackage, 0))
HWSensorsWarningLog("failed to add package frequency sensor");

// add multipler and frequency sensors for all cores
for (uint32_t i = 0; i < cpuid_info()->core_count; i++) {
char key[5];

snprintf(key, 5, KEY_FAKESMC_FORMAT_CPU_MULTIPLIER, i);

if (!addSensor(key, SMC_TYPE_FP88, SMC_TYPE_FPXX_SIZE, kCPUSensorsMultiplierCore, i))
HWSensorsWarningLog("failed to add multiplier sensor");

snprintf(key, 5, KEY_FAKESMC_FORMAT_CPU_FREQUENCY, i);

if (!addSensor(key, SMC_TYPE_UI32, SMC_TYPE_UI32_SIZE, kCPUSensorsFrequencyCore, i))
HWSensorsWarningLog("failed to add frequency sensor");

}

break;

case CPUFAMILY_INTEL_NEHALEM:
Expand Down