Skip to contentSkip to conversation

tools/power turbostat: enable turbostat to support Knights Mill (KNM)

PATCH Superseded Piotr Luc 1 participant 3 messages Oct 12, 2016 Turbostat utility

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Piotr Luc

author
#0 lore raw

cover tools/power turbostat: enable turbostat to support Knights Mill (KNM)

The intention of this series is to add KNM CPU ID to turbostat. The first patch improves code style by replacing raw numbers of CPUIDs with descriptive macros of processor names.
The second patch enables turbostat to support KNM processor.

The second patch depends oni patch:
x86/cpu/intel: Add Knights Mill to Intel family
https://lkml.kernel.org/r/20161012180520.30976-1-piotr.luc () intel ! com

Piotr Luc (2):
tools/power turbostat: Use Intel family processor macros tools/power turbostat: enable turbostat to support Knights Mill (KNM)

 tools/power/x86/turbostat/Makefile    |   3 +-
 tools/power/x86/turbostat/turbostat.c | 249 +++++++++++++++++-----------------
 2 files changed, 130 insertions(+), 122 deletions(-)
Signature · 1 line
2.10.1
author
#1 lore raw

PATCH 1/2 tools/power turbostat: Use Intel family processor macros

Use macros of Intel processor families instead of raw numbers.

---
 tools/power/x86/turbostat/Makefile    |   3 +-
 tools/power/x86/turbostat/turbostat.c | 242 +++++++++++++++++-----------------
 2 files changed, 123 insertions(+), 122 deletions(-)
tools/power/x86/turbostat/Makefile +2 -1
index 8561e7d..20631f6 100644
@@ -9,7 +9,8 @@ endif
 
 turbostat : turbostat.c
 CFLAGS +=	-Wall
-CFLAGS +=	-DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"'
+CFLAGS +=	-DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' \
+		-DFAMILYHEADER='"../../../../arch/x86/include/asm/intel-family.h"'
 
 %: %.c
 	@mkdir -p $(BUILD_OUTPUT)
tools/power/x86/turbostat/turbostat.c +121 -121

365 lines not on this page · raw message

Signature · 1 line
2.10.1
author
#2 lore raw

PATCH 2/2 tools/power turbostat: enable turbostat to support Knights Mill (KNM)

In reply to Piotr Luc

Add Knights Mill (KNM) to the list of CPUIDs supported by turbostat.

---
Depends-on: x86/cpu/intel: Add Knights Mill to Intel family
https://lkml.kernel.org/r/20161012180520.30976-1-piotr.luc () intel ! com

 tools/power/x86/turbostat/turbostat.c | 7 +++++++
 1 file changed, 7 insertions(+)
tools/power/x86/turbostat/turbostat.c +7 -0
index cea7a76..19c31a7 100644
@@ -2212,6 +2212,7 @@ int probe_nhm_msrs(unsigned int family, unsigned int model)
 		pkg_cstate_limits = amt_pkg_cstate_limits;
 		break;
 	case INTEL_FAM6_XEON_PHI_KNL:		/* PHI */
+	case INTEL_FAM6_XEON_PHI_KNM:		/* PHI */
 		pkg_cstate_limits = phi_pkg_cstate_limits;
 		break;
 	case INTEL_FAM6_ATOM_GOLDMONT:		/* BXT */
@@ -2237,6 +2238,7 @@ int has_nhm_turbo_ratio_limit(unsigned int family, unsigned int model)
 	case INTEL_FAM6_NEHALEM_EX:		/* Nehalem-EX Xeon - Beckton */
 	case INTEL_FAM6_WESTMERE_EX:		/* Westmere-EX Xeon - Eagleton */
 	case INTEL_FAM6_XEON_PHI_KNL:		/* PHI - Knights Landing (different MSR definition) */
+	case INTEL_FAM6_XEON_PHI_KNM:		/* PHI - Knights Mill (similar to KNL) */
 		return 0;
 	default:
 		return 1;
@@ -2284,6 +2286,7 @@ int has_knl_turbo_ratio_limit(unsigned int family, unsigned int model)
 
 	switch (model) {
 	case INTEL_FAM6_XEON_PHI_KNL:		/* Knights Landing */
+	case INTEL_FAM6_XEON_PHI_KNM:		/* Knights Mill */
 		return 1;
 	default:
 		return 0;
@@ -2314,6 +2317,7 @@ int has_config_tdp(unsigned int family, unsigned int model)
 	case INTEL_FAM6_SKYLAKE_X:		/* SKX */
 
 	case INTEL_FAM6_XEON_PHI_KNL:		/* Knights Landing */
+	case INTEL_FAM6_XEON_PHI_KNM:		/* Knights Mill */
 		return 1;
 	default:
 		return 0;
@@ -2615,6 +2619,7 @@ rapl_dram_energy_units_probe(int  model, double rapl_energy_units)
 	case INTEL_FAM6_BROADWELL_X:		/* BDX */
 	case INTEL_FAM6_BROADWELL_XEON_D:	/* BDX-DE */
 	case INTEL_FAM6_XEON_PHI_KNL:		/* KNL */
+	case INTEL_FAM6_XEON_PHI_KNM:		/* KNM */
 		return (rapl_dram_energy_units = 15.3 / 1000000);
 	default:
 		return (rapl_energy_units);
@@ -2663,6 +2668,7 @@ void rapl_probe(unsigned int family, unsigned int model)
 	case INTEL_FAM6_BROADWELL_XEON_D:	/* BDX-DE */
 	case INTEL_FAM6_SKYLAKE_X:		/* SKX */
 	case INTEL_FAM6_XEON_PHI_KNL:		/* KNL */
+	case INTEL_FAM6_XEON_PHI_KNM:		/* KNM */
 		do_rapl = RAPL_PKG | RAPL_DRAM | RAPL_DRAM_POWER_INFO | RAPL_DRAM_PERF_STATUS | RAPL_PKG_PERF_STATUS | RAPL_PKG_POWER_INFO;
 		break;
 	case INTEL_FAM6_SANDYBRIDGE_X:
@@ -3023,6 +3029,7 @@ int is_knl(unsigned int family, unsigned int model)
 		return 0;
 	switch (model) {
 	case INTEL_FAM6_XEON_PHI_KNL:		/* KNL */
+	case INTEL_FAM6_XEON_PHI_KNM:		/* KNM */
 		return 1;
 	}
 	return 0;
Signature · 1 line
2.10.1