line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Linux::m68k::CPU; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
133662239
|
use strict; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
55
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
22
|
|
|
1
|
|
|
|
|
82
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
656
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
201
|
|
7
|
1
|
|
|
1
|
|
655
|
use FusionInventory::Agent::Tools::Linux; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
281
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
11
|
0
|
0
|
|
|
|
|
return 0 if $params{no_category}->{cpu}; |
12
|
0
|
|
|
|
|
|
return -r '/proc/cpuinfo'; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub doInventory { |
16
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
19
|
0
|
|
|
|
|
|
my $logger = $params{logger}; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
foreach my $cpu (_getCPUsFromProc( |
22
|
|
|
|
|
|
|
logger => $logger, file => '/proc/cpuinfo' |
23
|
|
|
|
|
|
|
)) { |
24
|
0
|
|
|
|
|
|
$inventory->addEntry( |
25
|
|
|
|
|
|
|
section => 'CPUS', |
26
|
|
|
|
|
|
|
entry => $cpu |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _getCPUsFromProc { |
32
|
0
|
|
|
0
|
|
|
my @cpus; |
33
|
0
|
|
|
|
|
|
foreach my $cpu (getCPUsFromProc(@_)) { |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
push @cpus, { |
36
|
|
|
|
|
|
|
ARCH => 'm68k', |
37
|
|
|
|
|
|
|
NAME => $cpu->{'cpu'}, |
38
|
0
|
|
|
|
|
|
SPEED => $cpu->{'clocking'} |
39
|
|
|
|
|
|
|
}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
return @cpus; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |