From 73a7a7fd10ebcbfc4fce78b97ec7dcf945a614a7 Mon Sep 17 00:00:00 2001 From: Navid Yaghoobi Date: Sun, 15 Sep 2024 11:55:46 +1000 Subject: [PATCH] added /sys/class/power_supply/ Signed-off-by: Navid Yaghoobi --- FEATURES.md | 92 ++++++- examples/power_supply.rs | 14 ++ src/sysfs/class_power_supply.rs | 434 ++++++++++++++++++++++++++++++++ src/sysfs/mod.rs | 1 + test_data/fixtures.ttar | 329 ++++++++++++++++++++++++ 5 files changed, 860 insertions(+), 10 deletions(-) create mode 100644 examples/power_supply.rs create mode 100644 src/sysfs/class_power_supply.rs diff --git a/FEATURES.md b/FEATURES.md index e804850..604808e 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -10,10 +10,11 @@ Supported Features * limits * root * ns - * net/ - * netstat - * snmp - * snmp6 + +* ✅ `/proc//net` + * netstat + * snmp + * snmp6 * ✅ `/proc/buddyinfo` @@ -25,9 +26,9 @@ Supported Features * ✅ `/proc/meminfo` -* ✅ `/proc/net/dev` - -* ✅ `/proc/net/protocols` +* ✅ `/proc/net/` + * dev + * protocols * ✅ `/proc/sys/kernel/random` * entropy_avail @@ -61,19 +62,90 @@ Supported Features * product_uuid * sys_vendor -* ✅ `/sys/thermal/cooling_device` +* ✅ `/sys/class/power_supply/` + * authentic + * calibrate + * capacity + * capacity_alert_max + * capacity_alert_min + * capacity_level + * charge_avg + * charge_control_limit + * charge_control_limit_max + * charge_counter + * charge_empty + * charge_empty_design + * charge_start_threshold + * charge_stop_threshold + * charge_full + * charge_full_design + * charge_now + * charge_term_current + * charge_type + * constant_charge_current + * constant_charge_current_max + * constant_charge_voltage + * constant_charge_voltage_max + * current_avg + * current_boot + * current_max + * current_now + * cycle_count + * energy_avg + * energy_empty + * energy_empty_design + * energy_full + * energy_full_design + * energy_now + * health + * input_current_limit + * manufacturer + * model_name + * online + * power_avg + * power_now + * precharge_current + * present + * scope + * serial_number + * status + * technology + * temp + * temp_alert_max + * temp_alert_min + * temp_ambient + * temp_ambient_max + * temp_ambient_min + * temp_max + * temp_min + * time_to_empty_avg + * time_to_empty_now + * time_to_full_avg + * time_to_full_now + * type + * usb_type + * voltage_avg + * voltage_boot + * voltage_max + * voltage_max_design + * voltage_min + * voltage_min_design + * voltage_now + * voltage_ocv + +* ✅ `/sys/class/thermal/cooling_device` * type * max_state * cur_state -* ✅ `/sys/thermal/thermal_zone` +* ✅ `/sys/class/thermal/thermal_zone` * type * temp * policy * mode * passive -* ✅ `/sys/watchdog/` +* ✅ `/sys/class/watchdog/` * bootstatus * options * fw_version diff --git a/examples/power_supply.rs b/examples/power_supply.rs new file mode 100644 index 0000000..5339c77 --- /dev/null +++ b/examples/power_supply.rs @@ -0,0 +1,14 @@ +use procsys::sysfs; + +fn main() { + let power_supplies = sysfs::class_power_supply::collect().expect("power supplies information"); + + // print all power supplies information in json output + match serde_json::to_string_pretty(&power_supplies) { + Ok(output) => println!("{}", output), + Err(err) => { + log::error!("{}", err); + std::process::exit(1); + } + } +} diff --git a/src/sysfs/class_power_supply.rs b/src/sysfs/class_power_supply.rs new file mode 100644 index 0000000..8288282 --- /dev/null +++ b/src/sysfs/class_power_supply.rs @@ -0,0 +1,434 @@ +use std::{collections::HashMap, path::PathBuf}; + +use serde::Serialize; + +use crate::{error::CollectResult, utils}; + +/// PowerSupply contains info from files in /sys/class/power_supply for a +// single power supply +#[derive(Debug, Serialize, Clone, Default)] +pub struct PowerSupply { + pub authentic: Option, + pub calibrate: Option, + pub capacity: Option, + pub capacity_alert_max: Option, + pub capacity_alert_min: Option, + pub capacity_level: Option, + pub charge_avg: Option, + pub charge_control_limit: Option, + pub charge_control_limit_max: Option, + pub charge_counter: Option, + pub charge_empty: Option, + pub charge_empty_design: Option, + pub charge_start_threshold: Option, + pub charge_stop_threshold: Option, + pub charge_full: Option, + pub charge_full_design: Option, + pub charge_now: Option, + pub charge_term_current: Option, + pub charge_type: Option, + pub constant_charge_current: Option, + pub constant_charge_current_max: Option, + pub constant_charge_voltage: Option, + pub constant_charge_voltage_max: Option, + pub current_avg: Option, + pub current_boot: Option, + pub current_max: Option, + pub current_now: Option, + pub cycle_count: Option, + pub energy_avg: Option, + pub energy_empty: Option, + pub energy_empty_design: Option, + pub energy_full: Option, + pub energy_full_design: Option, + pub energy_now: Option, + pub health: Option, + pub input_current_limit: Option, + pub manufacturer: Option, + pub model_name: Option, + pub online: Option, + pub power_avg: Option, + pub power_now: Option, + pub precharge_current: Option, + pub present: Option, + pub scope: Option, + pub serial_number: Option, + pub status: Option, + pub technology: Option, + pub temp: Option, + pub temp_alert_max: Option, + pub temp_alert_min: Option, + pub temp_ambient: Option, + pub temp_ambient_max: Option, + pub temp_ambient_min: Option, + pub temp_max: Option, + pub temp_min: Option, + pub time_to_empty_avg: Option, + pub time_to_empty_now: Option, + pub time_to_full_avg: Option, + pub time_to_full_now: Option, + pub ps_type: Option, + pub usb_type: Option, + pub voltage_avg: Option, + pub voltage_boot: Option, + pub voltage_max: Option, + pub voltage_max_design: Option, + pub voltage_min: Option, + pub voltage_min_design: Option, + pub voltage_now: Option, + pub voltage_ocv: Option, +} + +impl PowerSupply { + fn new() -> Self { + Default::default() + } +} + +/// collects the the power supplies statistics +/// # Example +/// ``` +/// use procsys::sysfs::class_power_supply; +/// +/// let sys_power_supplies = class_power_supply::collect().expect("power supplies information"); +/// let json_output = serde_json::to_string_pretty(&sys_power_supplies).unwrap(); +/// println!("{}", json_output); +/// +/// ``` +pub fn collect() -> CollectResult> { + collect_from("/sys/class/power_supply/") +} + +fn collect_from(filename: &str) -> CollectResult> { + let mut power_supplies: HashMap = HashMap::new(); + + let proc_ps_path = PathBuf::from(filename); + + for ps_item in utils::list_dir_content(&proc_ps_path, "", "power_supply") { + let mut ps_item_path = proc_ps_path.clone(); + ps_item_path.push(&ps_item); + + let mut power_supply = PowerSupply::new(); + power_supply.authentic = utils::collect_info_i64("authentic", &ps_item_path)?; + + power_supply.calibrate = utils::collect_info_i64("calibrate", &ps_item_path)?; + + power_supply.capacity = utils::collect_info_i64("capacity", &ps_item_path)?; + + power_supply.capacity_alert_max = + utils::collect_info_i64("capacity_alert_max", &ps_item_path)?; + + power_supply.capacity_alert_min = + utils::collect_info_i64("capacity_alert_min", &ps_item_path)?; + + power_supply.capacity_level = utils::collect_info_string("capacity_level", &ps_item_path)?; + + power_supply.charge_avg = utils::collect_info_i64("charge_avg", &ps_item_path)?; + + power_supply.charge_control_limit = + utils::collect_info_i64("charge_control_limit", &ps_item_path)?; + + power_supply.charge_control_limit_max = + utils::collect_info_i64("charge_control_limit_max", &ps_item_path)?; + + power_supply.charge_counter = utils::collect_info_i64("charge_counter", &ps_item_path)?; + + power_supply.charge_empty = utils::collect_info_i64("charge_empty", &ps_item_path)?; + + power_supply.charge_empty_design = + utils::collect_info_i64("charge_empty_design", &ps_item_path)?; + + power_supply.charge_start_threshold = + utils::collect_info_i64("charge_start_threshold", &ps_item_path)?; + + power_supply.charge_stop_threshold = + utils::collect_info_i64("charge_stop_threshold", &ps_item_path)?; + + power_supply.charge_full = utils::collect_info_i64("charge_full", &ps_item_path)?; + + power_supply.charge_full_design = + utils::collect_info_i64("charge_full_design", &ps_item_path)?; + + power_supply.charge_now = utils::collect_info_i64("charge_now", &ps_item_path)?; + + power_supply.charge_term_current = + utils::collect_info_i64("charge_term_current", &ps_item_path)?; + + power_supply.charge_type = utils::collect_info_string("charge_type", &ps_item_path)?; + + power_supply.constant_charge_current = + utils::collect_info_i64("constant_charge_current", &ps_item_path)?; + + power_supply.constant_charge_current_max = + utils::collect_info_i64("constant_charge_current_max", &ps_item_path)?; + + power_supply.constant_charge_voltage = + utils::collect_info_i64("constant_charge_voltage", &ps_item_path)?; + + power_supply.constant_charge_voltage_max = + utils::collect_info_i64("constant_charge_voltage_max", &ps_item_path)?; + + power_supply.current_avg = utils::collect_info_i64("current_avg", &ps_item_path)?; + + power_supply.current_boot = utils::collect_info_i64("current_boot", &ps_item_path)?; + + power_supply.current_max = utils::collect_info_i64("current_max", &ps_item_path)?; + + power_supply.current_now = utils::collect_info_i64("current_now", &ps_item_path)?; + + power_supply.cycle_count = utils::collect_info_i64("cycle_count", &ps_item_path)?; + + power_supply.energy_avg = utils::collect_info_i64("energy_avg", &ps_item_path)?; + + power_supply.energy_empty = utils::collect_info_i64("energy_empty", &ps_item_path)?; + + power_supply.energy_empty_design = + utils::collect_info_i64("energy_empty_design", &ps_item_path)?; + + power_supply.energy_full = utils::collect_info_i64("energy_full", &ps_item_path)?; + + power_supply.energy_full_design = + utils::collect_info_i64("energy_full_design", &ps_item_path)?; + + power_supply.energy_now = utils::collect_info_i64("energy_now", &ps_item_path)?; + + power_supply.health = utils::collect_info_string("health", &ps_item_path)?; + + power_supply.input_current_limit = + utils::collect_info_i64("input_current_limit", &ps_item_path)?; + + power_supply.manufacturer = utils::collect_info_string("manufacturer", &ps_item_path)?; + + power_supply.model_name = utils::collect_info_string("model_name", &ps_item_path)?; + + power_supply.online = utils::collect_info_i64("online", &ps_item_path)?; + + power_supply.power_avg = utils::collect_info_i64("power_avg", &ps_item_path)?; + + power_supply.power_now = utils::collect_info_i64("power_now", &ps_item_path)?; + + power_supply.precharge_current = + utils::collect_info_i64("precharge_current", &ps_item_path)?; + + power_supply.present = utils::collect_info_i64("present", &ps_item_path)?; + + power_supply.scope = utils::collect_info_string("scope", &ps_item_path)?; + + power_supply.serial_number = utils::collect_info_string("serial_number", &ps_item_path)?; + + power_supply.status = utils::collect_info_string("status", &ps_item_path)?; + + power_supply.technology = utils::collect_info_string("technology", &ps_item_path)?; + + power_supply.temp = utils::collect_info_i64("temp", &ps_item_path)?; + + power_supply.temp_alert_max = utils::collect_info_i64("temp_alert_max", &ps_item_path)?; + + power_supply.temp_alert_min = utils::collect_info_i64("temp_alert_min", &ps_item_path)?; + + power_supply.temp_ambient = utils::collect_info_i64("temp_ambient", &ps_item_path)?; + + power_supply.temp_ambient_max = utils::collect_info_i64("temp_ambient_max", &ps_item_path)?; + + power_supply.temp_ambient_min = utils::collect_info_i64("temp_ambient_min", &ps_item_path)?; + + power_supply.temp_max = utils::collect_info_i64("temp_max", &ps_item_path)?; + + power_supply.temp_min = utils::collect_info_i64("temp_min", &ps_item_path)?; + + power_supply.time_to_empty_avg = + utils::collect_info_i64("time_to_empty_avg", &ps_item_path)?; + + power_supply.time_to_empty_now = + utils::collect_info_i64("time_to_empty_now", &ps_item_path)?; + + power_supply.time_to_full_avg = utils::collect_info_i64("time_to_full_avg", &ps_item_path)?; + + power_supply.time_to_full_now = utils::collect_info_i64("time_to_full_now", &ps_item_path)?; + + power_supply.ps_type = utils::collect_info_string("type", &ps_item_path)?; + + power_supply.usb_type = utils::collect_info_string("usb_type", &ps_item_path)?; + + power_supply.voltage_avg = utils::collect_info_i64("voltage_avg", &ps_item_path)?; + + power_supply.voltage_boot = utils::collect_info_i64("voltage_boot", &ps_item_path)?; + + power_supply.voltage_max = utils::collect_info_i64("voltage_max", &ps_item_path)?; + + power_supply.voltage_max_design = + utils::collect_info_i64("voltage_max_design", &ps_item_path)?; + + power_supply.voltage_min = utils::collect_info_i64("voltage_min", &ps_item_path)?; + + power_supply.voltage_min_design = + utils::collect_info_i64("voltage_min_design", &ps_item_path)?; + + power_supply.voltage_now = utils::collect_info_i64("voltage_now", &ps_item_path)?; + + power_supply.voltage_ocv = utils::collect_info_i64("voltage_ocv", &ps_item_path)?; + + power_supplies.insert(ps_item, power_supply); + } + + Ok(power_supplies) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn power_supplies() { + let power_supplies = collect_from("test_data/fixtures/sys/class/power_supply/") + .expect("collecting system power supplies information"); + + for (ps_name, ps_info) in &power_supplies { + match ps_name.as_str() { + "AC" => { + assert_eq!(ps_info.authentic, None); + assert_eq!(ps_info.calibrate, None); + assert_eq!(ps_info.capacity, None); + assert_eq!(ps_info.capacity_alert_max, None); + assert_eq!(ps_info.capacity_alert_min, None); + assert_eq!(ps_info.capacity_level, None); + assert_eq!(ps_info.charge_avg, None); + assert_eq!(ps_info.charge_control_limit, None); + assert_eq!(ps_info.charge_control_limit_max, None); + assert_eq!(ps_info.charge_counter, None); + assert_eq!(ps_info.charge_empty, None); + assert_eq!(ps_info.charge_empty_design, None); + assert_eq!(ps_info.charge_start_threshold, None); + assert_eq!(ps_info.charge_stop_threshold, None); + assert_eq!(ps_info.charge_full, None); + assert_eq!(ps_info.charge_full_design, None); + assert_eq!(ps_info.charge_now, None); + assert_eq!(ps_info.charge_term_current, None); + assert_eq!(ps_info.charge_type, None); + assert_eq!(ps_info.constant_charge_current, None); + assert_eq!(ps_info.constant_charge_current_max, None); + assert_eq!(ps_info.constant_charge_voltage, None); + assert_eq!(ps_info.constant_charge_voltage_max, None); + assert_eq!(ps_info.current_avg, None); + assert_eq!(ps_info.current_boot, None); + assert_eq!(ps_info.current_max, None); + assert_eq!(ps_info.current_now, None); + assert_eq!(ps_info.cycle_count, None); + assert_eq!(ps_info.energy_avg, None); + assert_eq!(ps_info.energy_empty, None); + assert_eq!(ps_info.energy_empty_design, None); + assert_eq!(ps_info.energy_full, None); + assert_eq!(ps_info.energy_full_design, None); + assert_eq!(ps_info.energy_now, None); + assert_eq!(ps_info.health, None); + assert_eq!(ps_info.input_current_limit, None); + assert_eq!(ps_info.manufacturer, None); + assert_eq!(ps_info.model_name, None); + assert_eq!(ps_info.online, Some(0)); + assert_eq!(ps_info.power_avg, None); + assert_eq!(ps_info.power_now, None); + assert_eq!(ps_info.precharge_current, None); + assert_eq!(ps_info.present, None); + assert_eq!(ps_info.scope, None); + assert_eq!(ps_info.serial_number, None); + assert_eq!(ps_info.status, None); + assert_eq!(ps_info.technology, None); + assert_eq!(ps_info.temp, None); + assert_eq!(ps_info.temp_alert_max, None); + assert_eq!(ps_info.temp_alert_min, None); + assert_eq!(ps_info.temp_ambient, None); + assert_eq!(ps_info.temp_ambient_max, None); + assert_eq!(ps_info.temp_ambient_min, None); + assert_eq!(ps_info.temp_max, None); + assert_eq!(ps_info.temp_min, None); + assert_eq!(ps_info.time_to_empty_avg, None); + assert_eq!(ps_info.time_to_empty_now, None); + assert_eq!(ps_info.time_to_full_avg, None); + assert_eq!(ps_info.time_to_full_now, None); + assert_eq!(ps_info.ps_type, Some(String::from("Mains"))); + assert_eq!(ps_info.usb_type, None); + assert_eq!(ps_info.voltage_avg, None); + assert_eq!(ps_info.voltage_boot, None); + assert_eq!(ps_info.voltage_max, None); + assert_eq!(ps_info.voltage_max_design, None); + assert_eq!(ps_info.voltage_min, None); + assert_eq!(ps_info.voltage_min_design, None); + assert_eq!(ps_info.voltage_now, None); + assert_eq!(ps_info.voltage_ocv, None); + } + "BAT0" => { + assert_eq!(ps_info.authentic, None); + assert_eq!(ps_info.calibrate, None); + assert_eq!(ps_info.capacity, Some(98)); + assert_eq!(ps_info.capacity_alert_max, None); + assert_eq!(ps_info.capacity_alert_min, None); + assert_eq!(ps_info.capacity_level, Some(String::from("Normal"))); + assert_eq!(ps_info.charge_avg, None); + assert_eq!(ps_info.charge_control_limit, None); + assert_eq!(ps_info.charge_control_limit_max, None); + assert_eq!(ps_info.charge_counter, None); + assert_eq!(ps_info.charge_empty, None); + assert_eq!(ps_info.charge_empty_design, None); + assert_eq!(ps_info.charge_start_threshold, Some(95)); + assert_eq!(ps_info.charge_stop_threshold, Some(100)); + assert_eq!(ps_info.charge_full, None); + assert_eq!(ps_info.charge_full_design, None); + assert_eq!(ps_info.charge_now, None); + assert_eq!(ps_info.charge_term_current, None); + assert_eq!(ps_info.charge_type, None); + assert_eq!(ps_info.constant_charge_current, None); + assert_eq!(ps_info.constant_charge_current_max, None); + assert_eq!(ps_info.constant_charge_voltage, None); + assert_eq!(ps_info.constant_charge_voltage_max, None); + assert_eq!(ps_info.current_avg, None); + assert_eq!(ps_info.current_boot, None); + assert_eq!(ps_info.current_max, None); + assert_eq!(ps_info.current_now, None); + assert_eq!(ps_info.cycle_count, Some(0)); + assert_eq!(ps_info.energy_avg, None); + assert_eq!(ps_info.energy_empty, None); + assert_eq!(ps_info.energy_empty_design, None); + assert_eq!(ps_info.energy_full, Some(50060000)); + assert_eq!(ps_info.energy_full_design, Some(47520000)); + assert_eq!(ps_info.energy_now, Some(49450000)); + assert_eq!(ps_info.health, None); + assert_eq!(ps_info.input_current_limit, None); + assert_eq!(ps_info.manufacturer, Some(String::from("LGC"))); + assert_eq!(ps_info.model_name, Some(String::from("LNV-45N1"))); + assert_eq!(ps_info.online, None); + assert_eq!(ps_info.power_avg, None); + assert_eq!(ps_info.power_now, Some(4830000)); + assert_eq!(ps_info.precharge_current, None); + assert_eq!(ps_info.present, Some(1)); + assert_eq!(ps_info.scope, None); + assert_eq!(ps_info.serial_number, Some(String::from("38109"))); + assert_eq!(ps_info.status, Some(String::from("Discharging"))); + assert_eq!(ps_info.technology, Some(String::from("Li-ion"))); + assert_eq!(ps_info.temp, None); + assert_eq!(ps_info.temp_alert_max, None); + assert_eq!(ps_info.temp_alert_min, None); + assert_eq!(ps_info.temp_ambient, None); + assert_eq!(ps_info.temp_ambient_max, None); + assert_eq!(ps_info.temp_ambient_min, None); + assert_eq!(ps_info.temp_max, None); + assert_eq!(ps_info.temp_min, None); + assert_eq!(ps_info.time_to_empty_avg, None); + assert_eq!(ps_info.time_to_empty_now, None); + assert_eq!(ps_info.time_to_full_avg, None); + assert_eq!(ps_info.time_to_full_now, None); + assert_eq!(ps_info.ps_type, Some(String::from("Battery"))); + assert_eq!(ps_info.usb_type, None); + assert_eq!(ps_info.voltage_avg, None); + assert_eq!(ps_info.voltage_boot, None); + assert_eq!(ps_info.voltage_max, None); + assert_eq!(ps_info.voltage_max_design, None); + assert_eq!(ps_info.voltage_min, None); + assert_eq!(ps_info.voltage_min_design, Some(10800000)); + assert_eq!(ps_info.voltage_now, Some(12229000)); + assert_eq!(ps_info.voltage_ocv, None); + } + _ => panic!("invalid power supply name: {}", ps_name), + } + } + } +} diff --git a/src/sysfs/mod.rs b/src/sysfs/mod.rs index 0648a53..8d0a376 100644 --- a/src/sysfs/mod.rs +++ b/src/sysfs/mod.rs @@ -1,5 +1,6 @@ pub mod class_cooling; pub mod class_dmi; +pub mod class_power_supply; pub mod class_thermal; pub mod class_watchdog; pub mod clocksource; diff --git a/test_data/fixtures.ttar b/test_data/fixtures.ttar index ff7e4bb..307ff31 100644 --- a/test_data/fixtures.ttar +++ b/test_data/fixtures.ttar @@ -1267,6 +1267,15 @@ Lines: 1 MODALIAS=dmi:bvnDellInc.:bvr2.2.4:bd04/12/2021:br2.2:svnDellInc.:pnPowerEdgeR6515:pvr:rvnDellInc.:rn07PXPY:rvrA01:cvnDellInc.:ct23:cvr: Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/class/power_supply +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/power_supply/AC +SymlinkTo: ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/power_supply/BAT0 +SymlinkTo: ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/class/thermal Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1434,6 +1443,326 @@ Mode: 755 Directory: fixtures/sys/devices Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/device +SymlinkTo: ../../../ACPI0003:00 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/online +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/async +Lines: 1 +disabled +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/autosuspend_delay_ms +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/control +Lines: 1 +auto +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_active_kids +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_active_time +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_enabled +Lines: 1 +disabled +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_status +Lines: 1 +unsupported +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_suspended_time +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/runtime_usage +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup +Lines: 1 +enabled +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_abort_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_active +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_active_count +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_expire_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_last_time_ms +Lines: 1 +10598 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_max_time_ms +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_prevent_sleep_time_ms +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/power/wakeup_total_time_ms +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/subsystem +SymlinkTo: ../../../../../../../../../class/power_supply +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/type +Lines: 1 +Mains +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/ACPI0003:00/power_supply/AC/uevent +Lines: 2 +POWER_SUPPLY_NAME=AC +POWER_SUPPLY_ONLINE=0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/alarm +Lines: 1 +2369000 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/capacity +Lines: 1 +98 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/capacity_level +Lines: 1 +Normal +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/charge_start_threshold +Lines: 1 +95 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/charge_stop_threshold +Lines: 1 +100 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/cycle_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/device +SymlinkTo: ../../../PNP0C0A:00 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/energy_full +Lines: 1 +50060000 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/energy_full_design +Lines: 1 +47520000 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/energy_now +Lines: 1 +49450000 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/manufacturer +Lines: 1 +LGC +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/model_name +Lines: 1 +LNV-45N1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/async +Lines: 1 +disabled +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/autosuspend_delay_ms +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/control +Lines: 1 +auto +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_active_kids +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_active_time +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_enabled +Lines: 1 +disabled +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_status +Lines: 1 +unsupported +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_suspended_time +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power/runtime_usage +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/power_now +Lines: 1 +4830000 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/present +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/serial_number +Lines: 1 +38109 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/status +Lines: 1 +Discharging +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/subsystem +SymlinkTo: ../../../../../../../../../class/power_supply +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/technology +Lines: 1 +Li-ion +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/type +Lines: 1 +Battery +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/uevent +Lines: 16 +POWER_SUPPLY_NAME=BAT0 +POWER_SUPPLY_STATUS=Discharging +POWER_SUPPLY_PRESENT=1 +POWER_SUPPLY_TECHNOLOGY=Li-ion +POWER_SUPPLY_CYCLE_COUNT=0 +POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000 +POWER_SUPPLY_VOLTAGE_NOW=11750000 +POWER_SUPPLY_POWER_NOW=5064000 +POWER_SUPPLY_ENERGY_FULL_DESIGN=47520000 +POWER_SUPPLY_ENERGY_FULL=47390000 +POWER_SUPPLY_ENERGY_NOW=40730000 +POWER_SUPPLY_CAPACITY=85 +POWER_SUPPLY_CAPACITY_LEVEL=Normal +POWER_SUPPLY_MODEL_NAME=LNV-45N1 +POWER_SUPPLY_MANUFACTURER=LGC +POWER_SUPPLY_SERIAL_NUMBER=38109 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/voltage_min_design +Lines: 1 +10800000 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0/voltage_now +Lines: 1 +12229000 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/devices/system Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -