1
Fork 0
mirror of https://github.com/RGBCube/superfreq synced 2025-07-27 17:07:44 +00:00

cli: more command logic to a dedicated module; add debug cmd

This commit is contained in:
NotAShelf 2025-05-14 00:15:18 +03:00
parent ea84a2997b
commit dde938b638
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF
6 changed files with 254 additions and 3 deletions

View file

@ -417,7 +417,14 @@ pub fn get_cpu_global_info(cpu_cores: &[CpuCoreInfo]) -> CpuGlobalInfo {
None
};
let available_governors = get_platform_profiles().unwrap_or_else(|_| vec![]);
let available_governors = if cpufreq_base.join("scaling_available_governors").exists() {
read_sysfs_file_trimmed(cpufreq_base.join("scaling_available_governors")).map_or_else(
|_| vec![],
|s| s.split_whitespace().map(String::from).collect(),
)
} else {
vec![]
};
let turbo_status = if turbo_status_path.exists() {
// 0 means turbo enabled, 1 means disabled for intel_pstate