line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Linux::SPARC::CPU; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
114851686
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
62
|
|
4
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
69
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
366
|
use FusionInventory::Agent::Tools; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
232
|
|
7
|
2
|
|
|
2
|
|
361
|
use FusionInventory::Agent::Tools::Linux; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
366
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
0
|
my (%params) = @_; |
11
|
0
|
0
|
|
|
|
0
|
return 0 if $params{no_category}->{cpu}; |
12
|
0
|
|
|
|
|
0
|
return -r '/proc/cpuinfo'; |
13
|
|
|
|
|
|
|
}; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub doInventory { |
16
|
0
|
|
|
0
|
0
|
0
|
my (%params) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
0
|
my $inventory = $params{inventory}; |
19
|
0
|
|
|
|
|
0
|
my $logger = $params{logger}; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
0
|
foreach my $cpu (_getCPUsFromProc( |
22
|
|
|
|
|
|
|
logger => $logger, file => '/proc/cpuinfo' |
23
|
|
|
|
|
|
|
)) { |
24
|
0
|
|
|
|
|
0
|
$inventory->addEntry( |
25
|
|
|
|
|
|
|
section => 'CPUS', |
26
|
|
|
|
|
|
|
entry => $cpu |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _getCPUsFromProc { |
33
|
1
|
|
|
1
|
|
193
|
my $cpu = (getCPUsFromProc(@_))[0]; |
34
|
|
|
|
|
|
|
|
35
|
1
|
50
|
33
|
|
|
5
|
return unless $cpu && $cpu->{'ncpus probed'}; |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
|
|
2
|
my @cpus; |
38
|
1
|
|
|
|
|
4
|
foreach (1 .. $cpu->{'ncpus probed'}) { |
39
|
|
|
|
|
|
|
push @cpus, { |
40
|
|
|
|
|
|
|
ARCH => 'SPARC', |
41
|
|
|
|
|
|
|
NAME => $cpu->{cpu}, |
42
|
2
|
|
|
|
|
5
|
}; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
5
|
return @cpus; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |