From d0a887332876c80bed80d884e3c9dc24eb28b0b9 Mon Sep 17 00:00:00 2001 From: Alyson Deives Pereira Date: Thu, 7 Nov 2024 11:09:31 -0300 Subject: [PATCH] Enable C1/C6 State Residency and Bus Clock speed to GraniteRapids-D Signed-off-by: Alyson Deives Pereira --- README.md | 1 + metrics.go | 1 + metrics_test.go | 1 + power.go | 1 + power_test.go | 3 ++- 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ba29b0..7e7e554 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,7 @@ The following processor properties are required by the library: | 0x8F | Intel Sapphire Rapids X | ✓ | | | ✓ | | 0xCF | Intel Emerald Rapids X | ✓ | | | ✓ | | 0xAD | Intel Granite Rapids X | ✓ | | | | + | 0xAE | Intel Granite Rapids D | ✓ | | | | | 0x8A | Intel Lakefield | ✓ | | ✓ | | | 0x97 | Intel AlderLake | ✓ | | ✓ | ✓ | | 0x9A | Intel AlderLake-L | ✓ | | ✓ | ✓ | diff --git a/metrics.go b/metrics.go index 61b822f..e67e5fe 100644 --- a/metrics.go +++ b/metrics.go @@ -112,6 +112,7 @@ func isC1C6BaseTempSupported(cpuModel int) bool { cpumodel.INTEL_FAM6_SAPPHIRERAPIDS_X, cpumodel.INTEL_FAM6_EMERALDRAPIDS_X, cpumodel.INTEL_FAM6_GRANITERAPIDS_X, + cpumodel.INTEL_FAM6_GRANITERAPIDS_D, cpumodel.INTEL_FAM6_LAKEFIELD, cpumodel.INTEL_FAM6_ALDERLAKE, cpumodel.INTEL_FAM6_ALDERLAKE_L, diff --git a/metrics_test.go b/metrics_test.go index 0050291..7fc8202 100644 --- a/metrics_test.go +++ b/metrics_test.go @@ -154,6 +154,7 @@ var ( 0x8F, // INTEL_FAM6_SAPPHIRERAPIDS_X 0xCF, // INTEL_FAM6_EMERALDRAPIDS_X 0xAD, // INTEL_FAM6_GRANITERAPIDS_X + 0xAE, // INTEL_FAM6_GRANITERAPIDS_D 0x8A, // INTEL_FAM6_LAKEFIELD 0x97, // INTEL_FAM6_ALDERLAKE 0x9A, // INTEL_FAM6_ALDERLAKE_L diff --git a/power.go b/power.go index ffa2714..d7d85c7 100644 --- a/power.go +++ b/power.go @@ -235,6 +235,7 @@ func (pt *PowerTelemetry) getBusClock(model int) (float64, error) { cpumodel.INTEL_FAM6_SAPPHIRERAPIDS_X, cpumodel.INTEL_FAM6_EMERALDRAPIDS_X, cpumodel.INTEL_FAM6_GRANITERAPIDS_X, + cpumodel.INTEL_FAM6_GRANITERAPIDS_D, cpumodel.INTEL_FAM6_LAKEFIELD, cpumodel.INTEL_FAM6_ALDERLAKE, cpumodel.INTEL_FAM6_ALDERLAKE_L, diff --git a/power_test.go b/power_test.go index b0fbf42..cbcc4bf 100644 --- a/power_test.go +++ b/power_test.go @@ -494,6 +494,7 @@ func TestGetBusClock(t *testing.T) { 0x8F, // INTEL_FAM6_SAPPHIRERAPIDS_X 0xCF, // INTEL_FAM6_EMERALDRAPIDS_X 0xAD, // INTEL_FAM6_GRANITERAPIDS_X + 0xAE, // INTEL_FAM6_GRANITERAPIDS_D 0x8A, // INTEL_FAM6_LAKEFIELD 0x97, // INTEL_FAM6_ALDERLAKE 0x9A, // INTEL_FAM6_ALDERLAKE_L @@ -829,7 +830,7 @@ func TestGetCPUTemperature(t *testing.T) { t.Run("ModelNotSupported", func(t *testing.T) { cpuID := 0 // CPU temp metric not supported by this model. - cpuModel := cpumodel.INTEL_FAM6_GRANITERAPIDS_D + cpuModel := cpumodel.INTEL_FAM6_CORE_YONAH tempExp := uint64(0)