structure thermal devices
[metriccd.git] / client / meter / locks
blobd8622827276334c1d267913a8492f953d973daea
1 #!/usr/bin/env perl
3 require "common.pl";
5 $Locks = {};
7 open $fh, '<', "/proc/locks";
8 while(<$fh>)
10 my $status = s/^(\S+:)\s*->/$1/ ? 'blocked' : 'held';
11 my ($n, $sys, $lock_type, $oper, $pid, $devmaj, $devmin, $inode, $begin, $end) = split /[\s:]+/;
12 $Locks->{lc $sys}{lc $lock_type}{lc $oper}{$status}++;
15 svlhk_dump($Locks, []);