whole lotta shit clion made me do

This commit is contained in:
2026-01-02 01:44:20 +01:00
parent d6a7179ba5
commit a54b89bce8
10 changed files with 87 additions and 79 deletions

View File

@@ -26,23 +26,23 @@ void detectHwmon(gpuSensors* target, const std::string& pci) {
/* some metrics are missing in gpu_metrics, we always fill them from fs, unused metrics are commented out */
void fillMissingMetrics(gpuSensors* g) {
static char buf[32];
g->vcore = utils::fastReadNum(g->hwmon + "/in0_input", buf) / 1000.0;
utils::fastReadNumDiv<1000>(g->hwmon + "/in0_input", buf, g->vcore);
// g->fan_pwm = std::stoi(readFile(g->hwmon + "/pwm1", 4)) * 100 / 256;
g->fan_speed = utils::fastReadNum(g->hwmon + "/fan1_input", buf);
g->power_cap = utils::fastReadNum(g->hwmon + "/power1_cap", buf) / 1000000;
utils::fastReadNum(g->hwmon + "/fan1_input", buf, g->fan_speed);
utils::fastReadNumDiv<1000000>(g->hwmon + "/power1_cap", buf, g->power_cap);
// utils::fastReadNum(g->hwmon + "/power1_cap_max", g->power_cap_max) / 1000000;
g->vram_used = utils::fastReadNum(g->hwmon + "/../../mem_info_vram_used", buf);
utils::fastReadNum(g->hwmon + "/../../mem_info_vram_used", buf, g->vram_used);
// utils::fastReadNum(g->hwmon + "/../../mem_info_vram_total", g->vram_total);
}
/* get sensors for pre-vega cards (rx480/580) */
void updateFromFs(gpuSensors* g) {
static char buf[32];
g->clock_core = utils::fastReadNum(g->hwmon + "/freq1_input", buf) / 1000000;
g->clock_mem = utils::fastReadNum(g->hwmon + "/freq2_input", buf) / 1000000;
g->power_avg = utils::fastReadNum(g->hwmon + "/power1_input", buf) / 1000000;
g->temp_edge = utils::fastReadNum(g->hwmon + "/temp1_input", buf) / 1000;
g->usage_core = utils::fastReadNum(g->hwmon + "/../../gpu_busy_percent", buf);
utils::fastReadNumDiv<1000000>(g->hwmon + "/freq1_input", buf, g->clock_core);
utils::fastReadNumDiv<1000000>(g->hwmon + "/freq2_input", buf, g->clock_mem);
utils::fastReadNumDiv<1000000>(g->hwmon + "/power1_input", buf, g->power_avg);
utils::fastReadNumDiv<1000>(g->hwmon + "/temp1_input", buf, g->temp_edge);
utils::fastReadNum(g->hwmon + "/../../gpu_busy_percent", buf, g->usage_core);
}
/* get sensors for vega and newer (rx5700xt, rx7800xt [*]) */