From ea6d4d2733ab4497602af00f43ded761916d908e Mon Sep 17 00:00:00 2001 From: Ilya Zlobintsev Date: Fri, 5 Jan 2024 13:10:15 +0200 Subject: [PATCH] feat: include 7000 series fan control files in sysfs snapshot --- lact-daemon/src/server/handler.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lact-daemon/src/server/handler.rs b/lact-daemon/src/server/handler.rs index 39591bf..a40dcec 100644 --- a/lact-daemon/src/server/handler.rs +++ b/lact-daemon/src/server/handler.rs @@ -58,6 +58,13 @@ const SNAPSHOT_DEVICE_FILES: &[&str] = &[ "current_link_speed", "current_link_width", ]; +const SNAPSHOT_FAN_CTRL_FILES: &[&str] = &[ + "fan_curve", + "acoustic_limit_rpm_threshold", + "acoustic_target_rpm_threshold", + "fan_minimum_pwm", + "fan_target_temperature", +]; const SNAPSHOT_HWMON_FILE_PREFIXES: &[&str] = &["fan", "pwm", "power", "temp", "freq", "in"]; #[derive(Clone)] @@ -435,6 +442,12 @@ impl<'a> Handler { add_path_to_archive(&mut archive, &full_path)?; } + let fan_ctrl_path = controller_path.join("gpu_od").join("fan_ctrl"); + for fan_ctrl_file in SNAPSHOT_FAN_CTRL_FILES { + let full_path = fan_ctrl_path.join(fan_ctrl_file); + add_path_to_archive(&mut archive, &full_path)?; + } + for hw_mon in &controller.handle.hw_monitors { let hw_mon_path = hw_mon.get_path(); let hw_mon_entries =