turbostat.c (1e9042b9c8d46ada9ee7b3339a31f50d12e5d291) turbostat.c (9cfa8e042f7cbb1994cc5923e46c78b36f6054f4)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * turbostat -- show CPU frequency and C-state residency
4 * on modern Intel and AMD processors.
5 *
6 * Copyright (c) 2013 Intel Corporation.
7 * Len Brown <len.brown@intel.com>
8 */

--- 4017 unchanged lines hidden (view full) ---

4026
4027 if (get_msr(base_cpu, MSR_RAPL_PWR_UNIT, &msr))
4028 return;
4029
4030 rapl_time_units = ldexp(1.0, -(msr >> 16 & 0xf));
4031 rapl_energy_units = ldexp(1.0, -(msr >> 8 & 0x1f));
4032 rapl_power_units = ldexp(1.0, -(msr & 0xf));
4033
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * turbostat -- show CPU frequency and C-state residency
4 * on modern Intel and AMD processors.
5 *
6 * Copyright (c) 2013 Intel Corporation.
7 * Len Brown <len.brown@intel.com>
8 */

--- 4017 unchanged lines hidden (view full) ---

4026
4027 if (get_msr(base_cpu, MSR_RAPL_PWR_UNIT, &msr))
4028 return;
4029
4030 rapl_time_units = ldexp(1.0, -(msr >> 16 & 0xf));
4031 rapl_energy_units = ldexp(1.0, -(msr >> 8 & 0x1f));
4032 rapl_power_units = ldexp(1.0, -(msr & 0xf));
4033
4034 tdp = get_tdp_amd(model);
4034 tdp = get_tdp_amd(family);
4035
4036 rapl_joule_counter_range = 0xFFFFFFFF * rapl_energy_units / tdp;
4037 if (!quiet)
4038 fprintf(outf, "RAPL: %.0f sec. Joule Counter Range, at %.0f Watts\n", rapl_joule_counter_range, tdp);
4039}
4040
4041/*
4042 * rapl_probe()

--- 1749 unchanged lines hidden ---
4035
4036 rapl_joule_counter_range = 0xFFFFFFFF * rapl_energy_units / tdp;
4037 if (!quiet)
4038 fprintf(outf, "RAPL: %.0f sec. Joule Counter Range, at %.0f Watts\n", rapl_joule_counter_range, tdp);
4039}
4040
4041/*
4042 * rapl_probe()

--- 1749 unchanged lines hidden ---