diff options
author | Len Brown <len.brown@intel.com> | 2015-11-23 02:30:51 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2016-02-17 01:42:20 -0500 |
commit | 61a87ba7893a256d86c7eea6a7ab10d38ccac9b2 (patch) | |
tree | 2a7e6bf3e94d6bd6218bc31658ecca669c1faf6d /tools | |
parent | 69807a638f91524ed75027f808cd277417ecee7a (diff) |
tools/power turbostat: CPUID(0x16) leaf shows base, max, and bus frequency
This CPUID leaf is available on Skylake:
CPUID(0x16): base_mhz: 1500 max_mhz: 2200 bus_mhz: 100
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/power/x86/turbostat/turbostat.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 7ef8b9feb7f2..4c4470f3ac65 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c | |||
@@ -2688,7 +2688,7 @@ void decode_misc_enable_msr(void) | |||
2688 | 2688 | ||
2689 | void process_cpuid() | 2689 | void process_cpuid() |
2690 | { | 2690 | { |
2691 | unsigned int eax, ebx, ecx, edx, max_level; | 2691 | unsigned int eax, ebx, ecx, edx, max_level, max_extended_level; |
2692 | unsigned int fms, family, model, stepping; | 2692 | unsigned int fms, family, model, stepping; |
2693 | 2693 | ||
2694 | eax = ebx = ecx = edx = 0; | 2694 | eax = ebx = ecx = edx = 0; |
@@ -2732,9 +2732,9 @@ void process_cpuid() | |||
2732 | * This check is valid for both Intel and AMD. | 2732 | * This check is valid for both Intel and AMD. |
2733 | */ | 2733 | */ |
2734 | ebx = ecx = edx = 0; | 2734 | ebx = ecx = edx = 0; |
2735 | __get_cpuid(0x80000000, &max_level, &ebx, &ecx, &edx); | 2735 | __get_cpuid(0x80000000, &max_extended_level, &ebx, &ecx, &edx); |
2736 | 2736 | ||
2737 | if (max_level >= 0x80000007) { | 2737 | if (max_extended_level >= 0x80000007) { |
2738 | 2738 | ||
2739 | /* | 2739 | /* |
2740 | * Non-Stop TSC is advertised by CPUID.EAX=0x80000007: EDX.bit8 | 2740 | * Non-Stop TSC is advertised by CPUID.EAX=0x80000007: EDX.bit8 |
@@ -2765,7 +2765,7 @@ void process_cpuid() | |||
2765 | if (debug) | 2765 | if (debug) |
2766 | decode_misc_enable_msr(); | 2766 | decode_misc_enable_msr(); |
2767 | 2767 | ||
2768 | if (max_level > 0x15) { | 2768 | if (max_level >= 0x15) { |
2769 | unsigned int eax_crystal; | 2769 | unsigned int eax_crystal; |
2770 | unsigned int ebx_tsc; | 2770 | unsigned int ebx_tsc; |
2771 | 2771 | ||
@@ -2799,6 +2799,19 @@ void process_cpuid() | |||
2799 | } | 2799 | } |
2800 | } | 2800 | } |
2801 | } | 2801 | } |
2802 | if (max_level >= 0x16) { | ||
2803 | unsigned int base_mhz, max_mhz, bus_mhz, edx; | ||
2804 | |||
2805 | /* | ||
2806 | * CPUID 16H Base MHz, Max MHz, Bus MHz | ||
2807 | */ | ||
2808 | base_mhz = max_mhz = bus_mhz = edx = 0; | ||
2809 | |||
2810 | __get_cpuid(0x16, &base_mhz, &max_mhz, &bus_mhz, &edx); | ||
2811 | if (debug) | ||
2812 | fprintf(stderr, "CPUID(0x16): base_mhz: %d max_mhz: %d bus_mhz: %d\n", | ||
2813 | base_mhz, max_mhz, bus_mhz); | ||
2814 | } | ||
2802 | 2815 | ||
2803 | if (has_aperf) | 2816 | if (has_aperf) |
2804 | aperf_mperf_multiplier = get_aperf_mperf_multiplier(family, model); | 2817 | aperf_mperf_multiplier = get_aperf_mperf_multiplier(family, model); |
@@ -3151,7 +3164,7 @@ int get_and_dump_counters(void) | |||
3151 | } | 3164 | } |
3152 | 3165 | ||
3153 | void print_version() { | 3166 | void print_version() { |
3154 | fprintf(stderr, "turbostat version 4.8 26-Sep, 2015" | 3167 | fprintf(stderr, "turbostat version 4.9 22 Nov, 2015" |
3155 | " - Len Brown <lenb@kernel.org>\n"); | 3168 | " - Len Brown <lenb@kernel.org>\n"); |
3156 | } | 3169 | } |
3157 | 3170 | ||