diff options
author | Len Brown <len.brown@intel.com> | 2013-12-03 02:19:19 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2014-01-18 22:34:22 -0500 |
commit | e6f9bb3cc63346e457405ef30209b3d2e18c5992 (patch) | |
tree | 4349c2a7956a2a667be138ce1620ee4d4d012d62 /tools | |
parent | 7ade7f48b1ffb21387d3694f1666f488c070860d (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.c | 42 |
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; | |||
80 | double rapl_power_units, rapl_energy_units, rapl_time_units; | 80 | double rapl_power_units, rapl_energy_units, rapl_time_units; |
81 | double rapl_joule_counter_range; | 81 | double rapl_joule_counter_range; |
82 | 82 | ||
83 | #define RAPL_PKG (1 << 0) | 83 | #define RAPL_PKG (1 << 0) |
84 | #define RAPL_CORES (1 << 1) | 84 | /* 0x610 MSR_PKG_POWER_LIMIT */ |
85 | #define RAPL_GFX (1 << 2) | 85 | /* 0x611 MSR_PKG_ENERGY_STATUS */ |
86 | #define RAPL_DRAM (1 << 3) | 86 | #define RAPL_PKG_PERF_STATUS (1 << 1) |
87 | #define RAPL_PKG_PERF_STATUS (1 << 4) | 87 | /* 0x613 MSR_PKG_PERF_STATUS */ |
88 | #define RAPL_DRAM_PERF_STATUS (1 << 5) | 88 | #define RAPL_PKG_POWER_INFO (1 << 2) |
89 | #define RAPL_PKG_POWER_INFO (1 << 6) | 89 | /* 0x614 MSR_PKG_POWER_INFO */ |
90 | #define RAPL_CORE_POLICY (1 << 7) | 90 | |
91 | #define RAPL_DRAM (1 << 3) | ||
92 | /* 0x618 MSR_DRAM_POWER_LIMIT */ | ||
93 | /* 0x619 MSR_DRAM_ENERGY_STATUS */ | ||
94 | /* 0x61c MSR_DRAM_POWER_INFO */ | ||
95 | #define RAPL_DRAM_PERF_STATUS (1 << 4) | ||
96 | /* 0x61b MSR_DRAM_PERF_STATUS */ | ||
97 | |||
98 | #define RAPL_CORES (1 << 5) | ||
99 | /* 0x638 MSR_PP0_POWER_LIMIT */ | ||
100 | /* 0x639 MSR_PP0_ENERGY_STATUS */ | ||
101 | #define RAPL_CORE_POLICY (1 << 6) | ||
102 | /* 0x63a MSR_PP0_POLICY */ | ||
103 | |||
104 | |||
105 | #define RAPL_GFX (1 << 7) | ||
106 | /* 0x640 MSR_PP1_POWER_LIMIT */ | ||
107 | /* 0x641 MSR_PP1_ENERGY_STATUS */ | ||
108 | /* 0x642 MSR_PP1_POLICY */ | ||
91 | #define TJMAX_DEFAULT 100 | 109 | #define TJMAX_DEFAULT 100 |
92 | 110 | ||
93 | #define MAX(a, b) ((a) > (b) ? (a) : (b)) | 111 | #define MAX(a, b) ((a) > (b) ? (a) : (b)) |
@@ -1449,7 +1467,7 @@ int has_nehalem_turbo_ratio_limit(unsigned int family, unsigned int model) | |||
1449 | case 0x3A: /* IVB */ | 1467 | case 0x3A: /* IVB */ |
1450 | case 0x3E: /* IVB Xeon */ | 1468 | case 0x3E: /* IVB Xeon */ |
1451 | case 0x3C: /* HSW */ | 1469 | case 0x3C: /* HSW */ |
1452 | case 0x3F: /* HSW */ | 1470 | case 0x3F: /* HSX */ |
1453 | case 0x45: /* HSW */ | 1471 | case 0x45: /* HSW */ |
1454 | case 0x46: /* HSW */ | 1472 | case 0x46: /* HSW */ |
1455 | case 0x37: /* BYT */ | 1473 | case 0x37: /* BYT */ |
@@ -1565,11 +1583,13 @@ void rapl_probe(unsigned int family, unsigned int model) | |||
1565 | case 0x2A: | 1583 | case 0x2A: |
1566 | case 0x3A: | 1584 | case 0x3A: |
1567 | case 0x3C: /* HSW */ | 1585 | case 0x3C: /* HSW */ |
1568 | case 0x3F: /* HSW */ | ||
1569 | case 0x45: /* HSW */ | 1586 | case 0x45: /* HSW */ |
1570 | case 0x46: /* HSW */ | 1587 | case 0x46: /* HSW */ |
1571 | do_rapl = RAPL_PKG | RAPL_CORES | RAPL_CORE_POLICY | RAPL_GFX | RAPL_PKG_POWER_INFO; | 1588 | do_rapl = RAPL_PKG | RAPL_CORES | RAPL_CORE_POLICY | RAPL_GFX | RAPL_PKG_POWER_INFO; |
1572 | break; | 1589 | break; |
1590 | case 0x3F: /* HSX */ | ||
1591 | do_rapl = RAPL_PKG | RAPL_DRAM | RAPL_DRAM_PERF_STATUS | RAPL_PKG_PERF_STATUS | RAPL_PKG_POWER_INFO; | ||
1592 | break; | ||
1573 | case 0x2D: | 1593 | case 0x2D: |
1574 | case 0x3E: | 1594 | case 0x3E: |
1575 | do_rapl = RAPL_PKG | RAPL_CORES | RAPL_CORE_POLICY | RAPL_DRAM | RAPL_PKG_PERF_STATUS | RAPL_DRAM_PERF_STATUS | RAPL_PKG_POWER_INFO; | 1595 | 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) | |||
2366 | cmdline(argc, argv); | 2386 | cmdline(argc, argv); |
2367 | 2387 | ||
2368 | if (verbose) | 2388 | if (verbose) |
2369 | fprintf(stderr, "turbostat v3.5 April 26, 2013" | 2389 | fprintf(stderr, "turbostat v3.6 Dec 2, 2013" |
2370 | " - Len Brown <lenb@kernel.org>\n"); | 2390 | " - Len Brown <lenb@kernel.org>\n"); |
2371 | 2391 | ||
2372 | turbostat_init(); | 2392 | turbostat_init(); |