Skip to contentSkip to conversation

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

PATCH Superseded Piotr Luc 1 participant 4 messages Oct 18, 2016 – Oct 24, 2016 Turbostat utility

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Piotr Luc

author
#0 lore raw

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

This patchset is rebased onto 08328814256d888634ff15ba8fb67e2ae4340b64.

First patch improves code style by replacing raw numbers of CPUID with descriptive macros of processor names.

The second patch adds Knights Mill (KNM) to the list of CPUIDs supported by turbostat.

Both patches come in new versions where trailing comments, which described CPUs, are removed because self-descriptive macros are used instead raw numbers.

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 | 250 ++++++++++++++++++----------------
 2 files changed, 131 insertions(+), 122 deletions(-)
Signature · 1 line
2.10.1
author
#1 lore raw

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

Use macros of Intel processor families instead of raw numbers.

Change-Id I033e40bcea6bde66284e2217e9231f856c827d20
Cc Borislav Petkov <[email protected]>
Cc Len Brown <[email protected]>

---
v2: Include Intel family header.
v3: Remove trailing comments.

 tools/power/x86/turbostat/Makefile    |   3 +-
 tools/power/x86/turbostat/turbostat.c | 243 +++++++++++++++++-----------------
 2 files changed, 124 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 +122 -121

372 lines not on this page · raw message

Signature · 1 line
2.10.1
author
#2 lore raw

PATCH v2 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.

Change-Id I616e3232e985fba4080a65e982604bd03d6dfb9f
Cc Borislav Petkov <[email protected]>
Cc Len Brown <[email protected]>

---
v2: Remove trailing comments.

 tools/power/x86/turbostat/turbostat.c | 7 +++++++
 1 file changed, 7 insertions(+)
tools/power/x86/turbostat/turbostat.c +7 -0
index a7e738d..1731e53 100644
@@ -2213,6 +2213,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:
+	case INTEL_FAM6_XEON_PHI_KNM:
 		pkg_cstate_limits = phi_pkg_cstate_limits;
 		break;
 	case INTEL_FAM6_ATOM_GOLDMONT:
@@ -2238,6 +2239,7 @@ int has_nhm_turbo_ratio_limit(unsigned int family, unsigned int model)
 	case INTEL_FAM6_NEHALEM_EX:
 	case INTEL_FAM6_WESTMERE_EX:
 	case INTEL_FAM6_XEON_PHI_KNL:
+	case INTEL_FAM6_XEON_PHI_KNM:
 		return 0;
 	default:
 		return 1;
@@ -2285,6 +2287,7 @@ int has_knl_turbo_ratio_limit(unsigned int family, unsigned int model)
 
 	switch (model) {
 	case INTEL_FAM6_XEON_PHI_KNL:
+	case INTEL_FAM6_XEON_PHI_KNM:
 		return 1;
 	default:
 		return 0;
@@ -2315,6 +2318,7 @@ int has_config_tdp(unsigned int family, unsigned int model)
 	case INTEL_FAM6_SKYLAKE_X:
 
 	case INTEL_FAM6_XEON_PHI_KNL:
+	case INTEL_FAM6_XEON_PHI_KNM:
 		return 1;
 	default:
 		return 0;
@@ -2616,6 +2620,7 @@ rapl_dram_energy_units_probe(int  model, double rapl_energy_units)
 	case INTEL_FAM6_BROADWELL_X:
 	case INTEL_FAM6_BROADWELL_XEON_D:
 	case INTEL_FAM6_XEON_PHI_KNL:
+	case INTEL_FAM6_XEON_PHI_KNM:
 		return (rapl_dram_energy_units = 15.3 / 1000000);
 	default:
 		return (rapl_energy_units);
@@ -2664,6 +2669,7 @@ void rapl_probe(unsigned int family, unsigned int model)
 	case INTEL_FAM6_BROADWELL_XEON_D:
 	case INTEL_FAM6_SKYLAKE_X:
 	case INTEL_FAM6_XEON_PHI_KNL:
+	case INTEL_FAM6_XEON_PHI_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:
@@ -3024,6 +3030,7 @@ int is_knl(unsigned int family, unsigned int model)
 		return 0;
 	switch (model) {
 	case INTEL_FAM6_XEON_PHI_KNL:
+	case INTEL_FAM6_XEON_PHI_KNM:
 		return 1;
 	}
 	return 0;
Signature · 1 line
2.10.1
author
#3 lore raw
In reply to Piotr Luc
Quoted 19 lines · Piotr Luc

This patchset is rebased onto
08328814256d888634ff15ba8fb67e2ae4340b64.

First patch improves code style by replacing raw numbers of CPUID with descriptive macros of processor names.

The second patch adds Knights Mill (KNM) to the list of CPUIDs supported
by turbostat.

Both patches come in new versions where trailing comments, which described CPUs, are removed because self-descriptive macros are used instead raw numbers.

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

Quoted 5 lines

 tools/power/x86/turbostat/Makefile    |   3 +- tools/power/x86/turbostat/turbostat.c | 250 ++++++++++++++++++----
------------

 2 files changed, 131 insertions(+), 122 deletions(-)

Hi

I wonder if you could share with me what I need to do more to make the patchset be accepted?

Regards,
Piotr