From e27382283c5b3fbff63f9d51c686cd11cbc94d23 Mon Sep 17 00:00:00 2001 From: Vlad Pronsky Date: Tue, 22 Oct 2024 02:52:14 +0300 Subject: [PATCH] chore: extra logs to debug command --- Cargo.lock | 2 +- Cargo.toml | 2 +- readme.md | 1 + src/debug.rs | 6 +++--- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1deabcb..b9ff47e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -315,7 +315,7 @@ dependencies = [ [[package]] name = "macmon" -version = "0.3.1" +version = "0.3.2" dependencies = [ "clap", "core-foundation", diff --git a/Cargo.toml b/Cargo.toml index 82a9451..433db81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "macmon" -version = "0.3.1" +version = "0.3.2" edition = "2021" [lints.rust] diff --git a/readme.md b/readme.md index 650e081..9a35c39 100644 --- a/readme.md +++ b/readme.md @@ -75,6 +75,7 @@ Options: Controls: c - change color + v - switch charts view: gauge / sparkline q - quit ``` diff --git a/src/debug.rs b/src/debug.rs index ee2e631..efeef18 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -1,8 +1,8 @@ use core_foundation::base::CFRelease; use crate::sources::{ - cfdict_keys, cfio_get_props, cfio_watts, get_dvfs_mhz, run_system_profiler, IOHIDSensors, - IOReport, IOServiceIterator, SMC, + cfdict_keys, cfio_get_props, cfio_get_residencies, cfio_watts, get_dvfs_mhz, run_system_profiler, + IOHIDSensors, IOReport, IOServiceIterator, SMC, }; type WithError = Result>; @@ -62,7 +62,7 @@ pub fn print_debug() -> WithError<()> { for x in ior.get_sample(dur) { let msg = format!("{} :: {} :: {} ({}) =", x.group, x.subgroup, x.channel, x.unit); match x.unit.as_str() { - "24Mticks" => println!("{}", msg), + "24Mticks" => println!("{} {:?}", msg, cfio_get_residencies(x.item)), _ => println!("{} {:.2}W", msg, cfio_watts(x.item, &x.unit, dur)?), } }