1 // SPDX-License-Identifier: MIT
3 * Copyright © 2020 Intel Corporation
10 u64
librapl_energy_uJ(void)
12 unsigned long long power
;
15 if (rdmsrl_safe(MSR_RAPL_POWER_UNIT
, &power
))
18 units
= (power
& 0x1f00) >> 8;
20 if (rdmsrl_safe(MSR_PP1_ENERGY_STATUS
, &power
))
23 return (1000000 * power
) >> units
; /* convert to uJ */