line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package P9Y::ProcessTable::Table; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:BBYRD'; # AUTHORITY |
4
|
|
|
|
|
|
|
our $VERSION = '1.08'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
############################################################################# |
7
|
|
|
|
|
|
|
# Modules |
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
15
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
69
|
|
10
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
67
|
|
11
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
|
2346
|
use Module::Runtime (); |
|
3
|
|
|
|
|
5397
|
|
|
3
|
|
|
|
|
65
|
|
13
|
3
|
|
|
3
|
|
2133
|
use Path::Class (); |
|
3
|
|
|
|
|
150668
|
|
|
3
|
|
|
|
|
75
|
|
14
|
|
|
|
|
|
|
|
15
|
3
|
|
|
3
|
|
2587
|
use Moo; |
|
3
|
|
|
|
|
37401
|
|
|
3
|
|
|
|
|
18
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Figure out which OS role we should consume |
18
|
|
|
|
|
|
|
my %OS_TRANSLATE = ( |
19
|
|
|
|
|
|
|
cygwin => 'MSWin32', |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $role_base = 'P9Y::ProcessTable::Role::Table::'; |
23
|
|
|
|
|
|
|
my $role = 'OS::'.($OS_TRANSLATE{$^O} || $^O); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
$@ = ''; |
26
|
|
|
|
|
|
|
my $has_os_role = eval { Module::Runtime::require_module($role_base.$role) }; |
27
|
|
|
|
|
|
|
die $@ if $@ and $@ !~ /^Can't locate /; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
unless ($has_os_role) { |
30
|
|
|
|
|
|
|
# let's hope they have /proc |
31
|
|
|
|
|
|
|
if ( -d '/proc' and @{[ glob('/proc/*') ]} ) { $role = 'ProcFS'; } |
32
|
|
|
|
|
|
|
# ...or that Proc::ProcessTable can handle it |
33
|
|
|
|
|
|
|
else { $role = 'PPT'; } |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# This here first, so that it gets overloaded |
37
|
|
|
|
|
|
|
extends 'P9Y::ProcessTable::Table::Base'; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
with $role_base.$role; |
40
|
|
|
|
|
|
|
|
41
|
3
|
|
|
3
|
|
7229
|
use P9Y::ProcessTable::Process; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
143
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
42; |