whole lotta shit clion made me do
This commit is contained in:
17
src/cpu.cpp
17
src/cpu.cpp
@@ -34,8 +34,7 @@ void update(cpuSensors* c) {
|
||||
// read power from intel-rapl? works on amd too, btop uses this trick, seems accurate
|
||||
// it tracks with "socket power" in hwinfo on windows, its actually the same thing i had in lcdsmartie
|
||||
curr.ts = std::chrono::steady_clock::now();
|
||||
// utils::fastReadNum("/sys/class/powercap/intel-rapl:0/energy_uj", curr.energy);
|
||||
curr.energy = utils::fastReadNum("/sys/class/powercap/intel-rapl:0/energy_uj", buf);
|
||||
utils::fastReadNum("/sys/class/powercap/intel-rapl:0/energy_uj", buf, curr.energy);
|
||||
c->ptotal = static_cast<float>(curr.energy - prev.energy) / static_cast<float>(std::chrono::duration_cast<std::chrono::microseconds>(curr.ts - prev.ts).count());
|
||||
prev = curr;
|
||||
|
||||
@@ -51,14 +50,14 @@ void update(cpuSensors* c) {
|
||||
|
||||
// commented out unused values so its faster
|
||||
if (c->zenpower) {
|
||||
c->tdie = utils::fastReadNum(c->hwmon + "/temp1_input", buf) / 1000;
|
||||
c->tctl = utils::fastReadNum(c->hwmon + "/temp2_input", buf) / 1000;
|
||||
c->tccd1 = utils::fastReadNum(c->hwmon + "/temp3_input", buf) / 1000;
|
||||
c->vcore = utils::fastReadNum(c->hwmon + "/in1_input", buf) / 1000.0;
|
||||
c->vsoc = utils::fastReadNum(c->hwmon + "/in2_input", buf) / 1000.0;
|
||||
utils::fastReadNumDiv<1000>(c->hwmon + "/temp1_input", buf, c->tdie);
|
||||
utils::fastReadNumDiv<1000>(c->hwmon + "/temp2_input", buf, c->tctl);
|
||||
utils::fastReadNumDiv<1000>(c->hwmon + "/temp3_input", buf, c->tccd1);
|
||||
utils::fastReadNumDiv<1000>(c->hwmon + "/in1_input", buf, c->vcore);
|
||||
utils::fastReadNumDiv<1000>(c->hwmon + "/in2_input", buf, c->vsoc);
|
||||
} else {
|
||||
c->tctl = utils::fastReadNum(c->hwmon + "/temp1_input", buf) / 1000;
|
||||
c->tccd1 = utils::fastReadNum(c->hwmon + "/temp3_input", buf) / 1000;
|
||||
utils::fastReadNumDiv<1000>(c->hwmon + "/temp1_input", buf, c->tctl);
|
||||
utils::fastReadNumDiv<1000>(c->hwmon + "/temp3_input", buf, c->tccd1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user