]> git.proxmox.com Git - pve-common.git/commitdiff
read_proc_stat : initialize newer fields to 0
authorAlexandre Derumier <aderumier@odiso.com>
Mon, 10 Jan 2022 04:52:57 +0000 (05:52 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 13 Jan 2022 15:03:15 +0000 (16:03 +0100)
new fields has been added recently, but values are not initialized
https://git.proxmox.com/?p=pve-common.git;a=commit;h=5a82eb712e4c879a271686f07c589fadc0b09185

as total of all fields is compute later, this can give undef values

src/PVE/ProcFSTools.pm

index a75274a9faf03130c41376ec329a07098c4a58c6..c81613194ed2272bfa9ac3d5ec3e7303f117d341 100644 (file)
@@ -162,7 +162,7 @@ sub read_pressure {
 my $last_proc_stat;
 
 sub read_proc_stat {
-    my $res = { user => 0, nice => 0, system => 0, idle => 0 , sum => 0};
+    my $res = { user => 0, nice => 0, system => 0, idle => 0 , iowait => 0, irq => 0, softirq => 0, steal => 0, guest => 0, guest_nice => 0, sum => 0};
 
     my $cpucount = 0;