sanity check for power
This commit is contained in:
@@ -40,6 +40,8 @@ void cpu_update(struct cpu_sensors_t *c) {
|
||||
|
||||
c->ptotal = (float)(curr.energy - prev.energy) / (float)timespec_diff_us(&curr.ts, &prev.ts);
|
||||
prev = curr;
|
||||
if (c->ptotal > 500.0f || c->ptotal < 0.0f)
|
||||
c->ptotal = 0.0f;
|
||||
|
||||
// lots of reads but still faster than reading /proc/cpuinfo
|
||||
c->avg_freq = 0;
|
||||
|
||||
Reference in New Issue
Block a user