diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-13 20:48:13 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-13 20:48:13 +0200 |
| commit | bd095a1b9a2027a1ff43fe4b6fa04d0354ca062c (patch) | |
| tree | ed4c8fad86c1b8347cc86020e0793822ae76a788 /lib/Loadbars/Main.pm | |
| parent | 20e3db5bcb04bc57377432126404b5e99d0b0a92 (diff) | |
Convert POD documentation to Markdown and migrate to Justfile
- Convert all POD files to Markdown format
- Replace Makefile with justfile for build automation
- Remove deprecated Debian packaging files and related directories
- Update copyright year from 2013 to 2026 in Constants.pm and loadbars
- Remove obsolete docs directory (bugs, wishlist, and generated files)
- Fix sum() function in Utils.pm to handle undef values properly
Diffstat (limited to 'lib/Loadbars/Main.pm')
| -rw-r--r-- | lib/Loadbars/Main.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Loadbars/Main.pm b/lib/Loadbars/Main.pm index f53bad8..4b750dc 100644 --- a/lib/Loadbars/Main.pm +++ b/lib/Loadbars/Main.pm @@ -60,15 +60,17 @@ sub cpu_parse_line ($) { my $line = shift; my ( $name, %load ); - ( $name, @load{qw(user nice system idle iowait irq softirq steal guest)} ) = + # Modern kernels (2.6.33+) have 10 fields: user nice system idle iowait irq softirq steal guest guest_nice + ( $name, @load{qw(user nice system idle iowait irq softirq steal guest guest_nice)} ) = split ' ', $line; - # Not all kernels support this + # Not all kernels support these fields $load{steal} = 0 unless defined $load{steal}; $load{guest} = 0 unless defined $load{guest}; + $load{guest_nice} = 0 unless defined $load{guest_nice}; $load{TOTAL} = - sum( @load{qw(user nice system idle iowait irq softirq steal guest)} ); + sum( @load{qw(user nice system idle iowait irq softirq steal guest guest_nice)} ); return ( $name, \%load ); } |
