turbostat.c (b7d8c1483bbf6ec9d2dd76d6a1c91a38c3f6ac35) | turbostat.c (58cc30a4e6086d542302e04eea39b2a438e4c5dd) |
---|---|
1/* 2 * turbostat -- show CPU frequency and C-state residency 3 * on modern Intel turbo-capable processors. 4 * 5 * Copyright (c) 2013 Intel Corporation. 6 * Len Brown <len.brown@intel.com> 7 * 8 * This program is free software; you can redistribute it and/or modify it --- 1973 unchanged lines hidden (view full) --- 1982 case 0x57: /* Knights Landing */ 1983 return 1; 1984 default: 1985 return 0; 1986 } 1987} 1988 1989static void | 1/* 2 * turbostat -- show CPU frequency and C-state residency 3 * on modern Intel turbo-capable processors. 4 * 5 * Copyright (c) 2013 Intel Corporation. 6 * Len Brown <len.brown@intel.com> 7 * 8 * This program is free software; you can redistribute it and/or modify it --- 1973 unchanged lines hidden (view full) --- 1982 case 0x57: /* Knights Landing */ 1983 return 1; 1984 default: 1985 return 0; 1986 } 1987} 1988 1989static void |
1990dump_cstate_pstate_config_info(family, model) | 1990dump_cstate_pstate_config_info(int family, int model) |
1991{ 1992 if (!do_nhm_platform_info) 1993 return; 1994 1995 dump_nhm_platform_info(); 1996 1997 if (has_hsw_turbo_ratio_limit(family, model)) 1998 dump_hsw_turbo_ratio_limits(); --- 246 unchanged lines hidden (view full) --- 2245 (msr & 1 << 27) ? "PkgPwrL2, " : ""); 2246 } 2247 return 0; 2248} 2249 2250#define RAPL_POWER_GRANULARITY 0x7FFF /* 15 bit power granularity */ 2251#define RAPL_TIME_GRANULARITY 0x3F /* 6 bit time granularity */ 2252 | 1991{ 1992 if (!do_nhm_platform_info) 1993 return; 1994 1995 dump_nhm_platform_info(); 1996 1997 if (has_hsw_turbo_ratio_limit(family, model)) 1998 dump_hsw_turbo_ratio_limits(); --- 246 unchanged lines hidden (view full) --- 2245 (msr & 1 << 27) ? "PkgPwrL2, " : ""); 2246 } 2247 return 0; 2248} 2249 2250#define RAPL_POWER_GRANULARITY 0x7FFF /* 15 bit power granularity */ 2251#define RAPL_TIME_GRANULARITY 0x3F /* 6 bit time granularity */ 2252 |
2253double get_tdp(model) | 2253double get_tdp(int model) |
2254{ 2255 unsigned long long msr; 2256 2257 if (do_rapl & RAPL_PKG_POWER_INFO) 2258 if (!get_msr(base_cpu, MSR_PKG_POWER_INFO, &msr)) 2259 return ((msr >> 0) & RAPL_POWER_GRANULARITY) * rapl_power_units; 2260 2261 switch (model) { --- 97 unchanged lines hidden (view full) --- 2359 2360 rapl_joule_counter_range = 0xFFFFFFFF * rapl_energy_units / tdp; 2361 if (debug) 2362 fprintf(outf, "RAPL: %.0f sec. Joule Counter Range, at %.0f Watts\n", rapl_joule_counter_range, tdp); 2363 2364 return; 2365} 2366 | 2254{ 2255 unsigned long long msr; 2256 2257 if (do_rapl & RAPL_PKG_POWER_INFO) 2258 if (!get_msr(base_cpu, MSR_PKG_POWER_INFO, &msr)) 2259 return ((msr >> 0) & RAPL_POWER_GRANULARITY) * rapl_power_units; 2260 2261 switch (model) { --- 97 unchanged lines hidden (view full) --- 2359 2360 rapl_joule_counter_range = 0xFFFFFFFF * rapl_energy_units / tdp; 2361 if (debug) 2362 fprintf(outf, "RAPL: %.0f sec. Joule Counter Range, at %.0f Watts\n", rapl_joule_counter_range, tdp); 2363 2364 return; 2365} 2366 |
2367void perf_limit_reasons_probe(family, model) | 2367void perf_limit_reasons_probe(int family, int model) |
2368{ 2369 if (!genuine_intel) 2370 return; 2371 2372 if (family != 6) 2373 return; 2374 2375 switch (model) { --- 593 unchanged lines hidden (view full) --- 2969 2970 if (debug) 2971 decode_misc_pwr_mgmt_msr(); 2972 2973 rapl_probe(family, model); 2974 perf_limit_reasons_probe(family, model); 2975 2976 if (debug) | 2368{ 2369 if (!genuine_intel) 2370 return; 2371 2372 if (family != 6) 2373 return; 2374 2375 switch (model) { --- 593 unchanged lines hidden (view full) --- 2969 2970 if (debug) 2971 decode_misc_pwr_mgmt_msr(); 2972 2973 rapl_probe(family, model); 2974 perf_limit_reasons_probe(family, model); 2975 2976 if (debug) |
2977 dump_cstate_pstate_config_info(); | 2977 dump_cstate_pstate_config_info(family, model); |
2978 2979 if (has_skl_msrs(family, model)) 2980 calculate_tsc_tweak(); 2981 2982 return; 2983} 2984 2985void help() --- 448 unchanged lines hidden --- | 2978 2979 if (has_skl_msrs(family, model)) 2980 calculate_tsc_tweak(); 2981 2982 return; 2983} 2984 2985void help() --- 448 unchanged lines hidden --- |