From c5ba45e0ebe4061c5f8778aebf46f8e3164ea045 Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Wed, 27 Sep 2023 17:32:56 -0700 Subject: [PATCH] wakeups --- pinxi | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pinxi b/pinxi index 0c4d05d..031f3cc 100755 --- a/pinxi +++ b/pinxi @@ -36048,11 +36048,16 @@ sub process_power { sub get_wakeups { eval $start if $b_log; return if %risc; - my ($wakeups); + my ($path,$suspend, $wakeups); # this increments on suspend, but since you can't see it until wake, numbers # work. - my $path = '/sys/power/suspend_stats/success'; + $path = '/sys/power/suspend_stats/success'; + $suspend = reader($path,'strip',0) if -r $path; + # not all systems had /success file + $path = '/sys/power/wakeup_count'; $wakeups = reader($path,'strip',0) if -r $path; + # wakeup_count is not understood, sometimes == success, other times not at all + $wakeups = $suspend if defined $suspend; eval $end if $b_log; return $wakeups; }