summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2013-12-03 02:19:19 -0500
committerLen Brown <len.brown@intel.com>2014-01-18 22:34:22 -0500
commite6f9bb3cc63346e457405ef30209b3d2e18c5992 (patch)
tree4349c2a7956a2a667be138ce1620ee4d4d012d62 /tools
parent7ade7f48b1ffb21387d3694f1666f488c070860d (diff)
turbostat: run on HSX
Haswell Xeon has slightly different RAPL support than client HSW, which prevented the previous version of turbostat from running on HSX. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/power/x86/turbostat/turbostat.c42
1 files changed, 31 insertions, 11 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index c8cce5dcc823..02afe35d8770 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -80,14 +80,32 @@ unsigned int tcc_activation_temp_override;
double rapl_power_units, rapl_energy_units, rapl_time_units;
double rapl_joule_counter_range;
-#define RAPL_PKG (1 << 0)
-#define RAPL_CORES (1 << 1)
-#define RAPL_GFX (1 << 2)
-#define RAPL_DRAM (1 << 3)
-#define RAPL_PKG_PERF_STATUS (1 << 4)
-#define RAPL_DRAM_PERF_STATUS (1 << 5)
-#define RAPL_PKG_POWER_INFO (1 << 6)
-#define RAPL_CORE_POLICY (1 << 7)
+#define RAPL_PKG (1 << 0)
+ /* 0x610 MSR_PKG_POWER_LIMIT */
+ /* 0x611 MSR_PKG_ENERGY_STATUS */
+#define RAPL_PKG_PERF_STATUS (1 << 1)
+ /* 0x613 MSR_PKG_PERF_STATUS */
+#define RAPL_PKG_POWER_INFO (1 << 2)
+ /* 0x614 MSR_PKG_POWER_INFO */
+
+#define RAPL_DRAM (1 << 3)
+ /* 0x618 MSR_DRAM_POWER_LIMIT */
+ /* 0x619 MSR_DRAM_ENERGY_STATUS */
+ /* 0x61c MSR_DRAM_POWER_INFO */
+#define RAPL_DRAM_PERF_STATUS (1 << 4)
+ /* 0x61b MSR_DRAM_PERF_STATUS */
+
+#define RAPL_CORES (1 << 5)
+ /* 0x638 MSR_PP0_POWER_LIMIT */
+ /* 0x639 MSR_PP0_ENERGY_STATUS */
+#define RAPL_CORE_POLICY (1 << 6)
+ /* 0x63a MSR_PP0_POLICY */
+
+
+#define RAPL_GFX (1 << 7)
+ /* 0x640 MSR_PP1_POWER_LIMIT */
+ /* 0x641 MSR_PP1_ENERGY_STATUS */
+ /* 0x642 MSR_PP1_POLICY */
#define TJMAX_DEFAULT 100
#define MAX(a, b) ((a) > (b) ? (a) : (b))
@@ -1449,7 +1467,7 @@ int has_nehalem_turbo_ratio_limit(unsigned int family, unsigned int model)
case 0x3A: /* IVB */
case 0x3E: /* IVB Xeon */
case 0x3C: /* HSW */
- case 0x3F: /* HSW */
+ case 0x3F: /* HSX */
case 0x45: /* HSW */
case 0x46: /* HSW */
case 0x37: /* BYT */
@@ -1565,11 +1583,13 @@ void rapl_probe(unsigned int family, unsigned int model)
case 0x2A:
case 0x3A:
case 0x3C: /* HSW */
- case 0x3F: /* HSW */
case 0x45: /* HSW */
case 0x46: /* HSW */
do_rapl = RAPL_PKG | RAPL_CORES | RAPL_CORE_POLICY | RAPL_GFX | RAPL_PKG_POWER_INFO;
break;
+ case 0x3F: /* HSX */
+ do_rapl = RAPL_PKG | RAPL_DRAM | RAPL_DRAM_PERF_STATUS | RAPL_PKG_PERF_STATUS | RAPL_PKG_POWER_INFO;
+ break;
case 0x2D:
case 0x3E:
do_rapl = RAPL_PKG | RAPL_CORES | RAPL_CORE_POLICY | RAPL_DRAM | RAPL_PKG_PERF_STATUS | RAPL_DRAM_PERF_STATUS | RAPL_PKG_POWER_INFO;
@@ -2366,7 +2386,7 @@ int main(int argc, char **argv)
cmdline(argc, argv);
if (verbose)
- fprintf(stderr, "turbostat v3.5 April 26, 2013"
+ fprintf(stderr, "turbostat v3.6 Dec 2, 2013"
" - Len Brown <lenb@kernel.org>\n");
turbostat_init();