Memstats

Memstats Commit Details

Date:2021-11-26 08:19:41 (7 months 14 hours ago)
Author:Grégory Soutadé
Branch:master
Commit:449cf97d71e4b8ad1d56662b655f67d8e3cafd40
Parents: 4973e18ea1524ebb53520150fb64d0a530ba33d8
Message:Bugfix : Sometimes proccess are stopped between readir of /proc and analyze. This should not raise an error

Changes:
Mmemstats (2 diffs)

File differences

memstats
182182
183183
184184
185
185
186186
187187
188188
......
196196
197197
198198
199
199
200200
201201
202202
# Get owner name
my $uid = 0;
open(FIC,"</proc/$pid/status") or die $!;
open(FIC,"</proc/$pid/status") or next; # Processus may have stopped between readdir and analyze
while( defined( $l = <FIC> ) ) {
if ($l =~ /Uid:\s+([0-9]+)\s+.*/)
{
$quota,$comment,$gcos,$dir,$shell,$expire) = getpwuid($uid);
# Get infos
open(FIC,"</proc/$pid/stat") or die $!;
open(FIC,"</proc/$pid/stat") or next; # Processus may have stopped between readdir and analyze
my @infos = split(/ /, <FIC>);
close (FIC);

Archive Download the corresponding diff file

Branches