dumping use of wakeup_count

This commit is contained in:
Harald Hope 2023-09-28 18:18:43 -07:00
parent c318847f35
commit 8df3eaad78

13
pinxi
View file

@ -51,7 +51,7 @@ use POSIX qw(ceil uname strftime ttyname);
my $self_name='pinxi'; my $self_name='pinxi';
my $self_version='3.3.30'; my $self_version='3.3.30';
my $self_date='2023-09-29'; my $self_date='2023-09-29';
my $self_patch='04'; my $self_patch='05';
## END INXI INFO ## ## END INXI INFO ##
my ($b_pledge,@pledges); my ($b_pledge,@pledges);
@ -36055,19 +36055,10 @@ sub process_power {
sub get_wakeups { sub get_wakeups {
eval $start if $b_log; eval $start if $b_log;
return if %risc; return if %risc;
my ($path,$suspend, $wakeups); my ($path,$wakeups);
# this increments on suspend, but 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'; $path = '/sys/power/suspend_stats/success';
$suspend = reader($path,'strip',0) if -r $path;
# not all systems had /success file
if (!defined $suspend){
$path = '/sys/power/wakeup_count';
$wakeups = reader($path,'strip',0) if -r $path; $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; eval $end if $b_log;
return $wakeups; return $wakeups;
} }