Track tcc and tjmax in power.csv

This commit is contained in:
Jeremy Soller 2020-06-06 13:12:16 -06:00
parent 39cd014f7b
commit da2a166ded
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1

View File

@ -26,6 +26,8 @@ do
F="${F}\tCPU PL1"
F="${F}\tCPU PL2"
F="${F}\tCPU C"
F="${F}\tCPU TCC"
F="${F}\tCPU TJM"
F="${F}\tCPU FAN"
if [ "${has_dgpu}" == "1" ]
then
@ -62,6 +64,12 @@ do
C="$(echo "${T}/1000" | bc -lq)"
F="${F}\t$(printf "%.1f" "${C}")"
TJMAX="$(sudo rdmsr -c 0x1A2 --bitfield 23:16)"
TCC_OFF="$(sudo rdmsr -c 0x1A2 --bitfield 31:24)"
TCC="$(python3 -c "print(hex(${TJMAX}-${TCC_OFF}))")"
F="${F}\t$(printf "%d" "${TCC}")"
F="${F}\t$(printf "%d" "${TJMAX}")"
D="$(sudo tool/target/release/system76_ectool fan 0)"
P="$(echo "(${D} * 100)/255" | bc -lq)"
F="${F}\t$(printf "%.0f" "${P}")"