summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2016-04-06 17:15:55 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-04-07 16:18:32 -0400
commit5a63426e2a18775ed05b20e3bc90c68bacb1f68a (patch)
tree851ad05e09e5b5a865a6284b1d0538f17b3e1afc /tools
parent8ae7225591fd15aac89769cbebb3b5ecc8b12fe5 (diff)
tools/power turbostat: print IRTL MSRs
Some processors use the Interrupt Response Time Limit (IRTL) MSR value to describe the maximum IRQ response time latency for deep package C-states. (Though others have the register, but do not use it) Lets print it out to give insight into the cases where it is used. IRTL begain in SNB, with PC3/PC6/PC7, and HSW added PC8/PC9/PC10. Signed-off-by: Len Brown <len.brown@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/power/x86/turbostat/turbostat.c59
1 files changed, 56 insertions, 3 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index e2440df6029e..2f60fdbf9213 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -66,6 +66,8 @@ unsigned int do_slm_cstates;
66unsigned int use_c1_residency_msr; 66unsigned int use_c1_residency_msr;
67unsigned int has_aperf; 67unsigned int has_aperf;
68unsigned int has_epb; 68unsigned int has_epb;
69unsigned int do_irtl_snb;
70unsigned int do_irtl_hsw;
69unsigned int units = 1000000; /* MHz etc */ 71unsigned int units = 1000000; /* MHz etc */
70unsigned int genuine_intel; 72unsigned int genuine_intel;
71unsigned int has_invariant_tsc; 73unsigned int has_invariant_tsc;
@@ -1579,6 +1581,47 @@ dump_config_tdp(void)
1579 fprintf(outf, " lock=%d", (unsigned int)(msr >> 31) & 1); 1581 fprintf(outf, " lock=%d", (unsigned int)(msr >> 31) & 1);
1580 fprintf(outf, ")\n"); 1582 fprintf(outf, ")\n");
1581} 1583}
1584
1585unsigned int irtl_time_units[] = {1, 32, 1024, 32768, 1048576, 33554432, 0, 0 };
1586
1587void print_irtl(void)
1588{
1589 unsigned long long msr;
1590
1591 get_msr(base_cpu, MSR_PKGC3_IRTL, &msr);
1592 fprintf(outf, "cpu%d: MSR_PKGC3_IRTL: 0x%08llx (", base_cpu, msr);
1593 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT",
1594 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]);
1595
1596 get_msr(base_cpu, MSR_PKGC6_IRTL, &msr);
1597 fprintf(outf, "cpu%d: MSR_PKGC6_IRTL: 0x%08llx (", base_cpu, msr);
1598 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT",
1599 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]);
1600
1601 get_msr(base_cpu, MSR_PKGC7_IRTL, &msr);
1602 fprintf(outf, "cpu%d: MSR_PKGC7_IRTL: 0x%08llx (", base_cpu, msr);
1603 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT",
1604 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]);
1605
1606 if (!do_irtl_hsw)
1607 return;
1608
1609 get_msr(base_cpu, MSR_PKGC8_IRTL, &msr);
1610 fprintf(outf, "cpu%d: MSR_PKGC8_IRTL: 0x%08llx (", base_cpu, msr);
1611 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT",
1612 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]);
1613
1614 get_msr(base_cpu, MSR_PKGC9_IRTL, &msr);
1615 fprintf(outf, "cpu%d: MSR_PKGC9_IRTL: 0x%08llx (", base_cpu, msr);
1616 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT",
1617 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]);
1618
1619 get_msr(base_cpu, MSR_PKGC10_IRTL, &msr);
1620 fprintf(outf, "cpu%d: MSR_PKGC10_IRTL: 0x%08llx (", base_cpu, msr);
1621 fprintf(outf, "%svalid, %lld ns)\n", msr & (1 << 15) ? "" : "NOT",
1622 (msr & 0x3FF) * irtl_time_units[(msr >> 10) & 0x3]);
1623
1624}
1582void free_fd_percpu(void) 1625void free_fd_percpu(void)
1583{ 1626{
1584 int i; 1627 int i;
@@ -2879,9 +2922,14 @@ int has_snb_msrs(unsigned int family, unsigned int model)
2879/* 2922/*
2880 * HSW adds support for additional MSRs: 2923 * HSW adds support for additional MSRs:
2881 * 2924 *
2882 * MSR_PKG_C8_RESIDENCY 0x00000630 2925 * MSR_PKG_C8_RESIDENCY 0x00000630
2883 * MSR_PKG_C9_RESIDENCY 0x00000631 2926 * MSR_PKG_C9_RESIDENCY 0x00000631
2884 * MSR_PKG_C10_RESIDENCY 0x00000632 2927 * MSR_PKG_C10_RESIDENCY 0x00000632
2928 *
2929 * MSR_PKGC8_IRTL 0x00000633
2930 * MSR_PKGC9_IRTL 0x00000634
2931 * MSR_PKGC10_IRTL 0x00000635
2932 *
2885 */ 2933 */
2886int has_hsw_msrs(unsigned int family, unsigned int model) 2934int has_hsw_msrs(unsigned int family, unsigned int model)
2887{ 2935{
@@ -3254,11 +3302,13 @@ void process_cpuid()
3254 3302
3255 do_nhm_platform_info = do_nhm_cstates = do_smi = probe_nhm_msrs(family, model); 3303 do_nhm_platform_info = do_nhm_cstates = do_smi = probe_nhm_msrs(family, model);
3256 do_snb_cstates = has_snb_msrs(family, model); 3304 do_snb_cstates = has_snb_msrs(family, model);
3305 do_irtl_snb = has_snb_msrs(family, model);
3257 do_pc2 = do_snb_cstates && (pkg_cstate_limit >= PCL__2); 3306 do_pc2 = do_snb_cstates && (pkg_cstate_limit >= PCL__2);
3258 do_pc3 = (pkg_cstate_limit >= PCL__3); 3307 do_pc3 = (pkg_cstate_limit >= PCL__3);
3259 do_pc6 = (pkg_cstate_limit >= PCL__6); 3308 do_pc6 = (pkg_cstate_limit >= PCL__6);
3260 do_pc7 = do_snb_cstates && (pkg_cstate_limit >= PCL__7); 3309 do_pc7 = do_snb_cstates && (pkg_cstate_limit >= PCL__7);
3261 do_c8_c9_c10 = has_hsw_msrs(family, model); 3310 do_c8_c9_c10 = has_hsw_msrs(family, model);
3311 do_irtl_hsw = has_hsw_msrs(family, model);
3262 do_skl_residency = has_skl_msrs(family, model); 3312 do_skl_residency = has_skl_msrs(family, model);
3263 do_slm_cstates = is_slm(family, model); 3313 do_slm_cstates = is_slm(family, model);
3264 do_knl_cstates = is_knl(family, model); 3314 do_knl_cstates = is_knl(family, model);
@@ -3564,6 +3614,9 @@ void turbostat_init()
3564 3614
3565 if (debug) 3615 if (debug)
3566 for_all_cpus(print_thermal, ODD_COUNTERS); 3616 for_all_cpus(print_thermal, ODD_COUNTERS);
3617
3618 if (debug && do_irtl_snb)
3619 print_irtl();
3567} 3620}
3568 3621
3569int fork_it(char **argv) 3622int fork_it(char **argv)