From 42b2f083981975eb3a217a89bcab7b2e4e1ba85e Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Wed, 27 Sep 2023 14:39:56 -0700 Subject: [PATCH] fix for wakeup count excessive. --- pinxi | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pinxi b/pinxi index c739933..0fd84cb 100755 --- a/pinxi +++ b/pinxi @@ -50,8 +50,8 @@ use POSIX qw(ceil uname strftime ttyname); ## INXI INFO ## my $self_name='pinxi'; my $self_version='3.3.30'; -my $self_date='2023-09-25'; -my $self_patch='01'; +my $self_date='2023-09-27'; +my $self_patch='02'; ## END INXI INFO ## my ($b_pledge,@pledges); @@ -36041,12 +36041,17 @@ sub process_power { } } -# note: seen instance in android where reading file hangs endlessly!!! +# note: seen android instance where reading file wakeup_count hangs endlessly. +# Some systems also report > 1 wakeup events per wakeup with +# /sys/power/wakeup_count, thus, we are using /sys/power/suspend_stats/success +# which does not appear to have that issue. sub get_wakeups { eval $start if $b_log; return if %risc; my ($wakeups); - my $path = '/sys/power/wakeup_count'; + # this increments on suspend, but since you can't see it until wake, numbers + # work. + my $path = '/sys/power/suspend_stats/success'; $wakeups = reader($path,'strip',0) if -r $path; eval $end if $b_log; return $wakeups;