fix for wakeup count excessive.

This commit is contained in:
Harald Hope 2023-09-27 14:39:56 -07:00
parent 76610709bd
commit 42b2f08398

13
pinxi
View file

@ -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;