From 467b38fd23bb90be6ab629d84956e957fe4dedc9 Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Wed, 27 Sep 2023 17:43:30 -0700 Subject: [PATCH] wakeups --- pinxi | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pinxi b/pinxi index 031f3cc..5afb2de 100755 --- a/pinxi +++ b/pinxi @@ -36049,15 +36049,18 @@ sub get_wakeups { eval $start if $b_log; return if %risc; my ($path,$suspend, $wakeups); - # this increments on suspend, but since you can't see it until wake, numbers - # work. + # this increments on suspend, but you can't see it until wake, numbers work. $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; + if (!defined $suspend){ + $path = '/sys/power/wakeup_count'; + $wakeups = reader($path,'strip',0) if -r $path; + } + # wakeup_count is not understood, sometimes == success, other times != + else { + $wakeups = $suspend; + } eval $end if $b_log; return $wakeups; }