clang format all of this

This commit is contained in:
2026-01-02 18:23:09 +01:00
parent 8c83bf9df1
commit 3a9b2647d1
9 changed files with 26 additions and 24 deletions

View File

@@ -11,21 +11,21 @@
namespace gpu {
const std::string rel_metrics_path = "/../../gpu_metrics"; // gpu_metrics path relative to hwmon path
constexpr uint16_t max_metrics_length = 512; // length of the metrics buffer
constexpr uint16_t max_metrics_length = 512; // length of the metrics buffer
/* takes pointer to a target gpu::sensors struct and updates its hwmon path and detects gpu_metrics */
void detectHwmon(gpuSensors* target, const std::string& pci) {
target->hwmon = utils::getFirstDir("/sys/bus/pci/devices/" + pci + "/hwmon");
applog(LOG::INF, "Detected path \"{}\"", target->hwmon);
if(utils::fileExists(target->hwmon + rel_metrics_path)) {
if (utils::fileExists(target->hwmon + rel_metrics_path)) {
applog(LOG::INF, "found gpu_metrics");
target->hasGpuMetrics = true;
}
}
/* some metrics are missing in gpu_metrics, we always fill them from fs, unused metrics are commented out */
void fillMissingMetrics(gpuSensors* g) {;
void fillMissingMetrics(gpuSensors* g) {
static std::array<char, 32> buf;
utils::fastReadNum<1000>(g->hwmon + "/in0_input", buf, g->vcore);
// g->fan_pwm = std::stoi(readFile(g->hwmon + "/pwm1", 4)) * 100 / 256;