Lines Matching +full:error +full:- +full:counter

2 # SPDX-License-Identifier: GPL-2.0
14 my $nm = $ENV{'NM'} || die "$0: ERROR: NM not set?";
18 my $jobs = {}; # child process pid -> file handle
20 my $results = {}; # object index -> [ { level, secname }, ... ]
26 or die "$0: ERROR: failed to execute getconf: $!";
42 # sort by the counter value to ensure the order of initcalls within
44 foreach my $counter (sort { $a <=> $b } keys(%{$initcalls})) {
45 my $level = $initcalls->{$counter}->{'level'};
48 my $secname = $initcalls->{$counter}->{'module'} . '__' .
49 $counter . '_' .
50 $initcalls->{$counter}->{'line'} . '_' .
51 $initcalls->{$counter}->{'function'};
78 die "$0: ERROR: child process returned invalid data: $data\n";
83 if (!exists($results->{$index})) {
84 $results->{$index} = [];
87 push (@{$results->{$index}}, {
100 die "$0: ERROR: file $file doesn't exist?" if (! -f $file);
102 open(my $fh, "\"$nm\" --defined-only \"$file\" 2>/dev/null |")
103 or die "$0: ERROR: failed to execute \"$nm\": $!";
121 my ($module, $counter, $line, $symbol) = $_ =~
122 /[a-z]\s+__initcall__(\S*)__(\d+)_(\d+)_(.*)$/;
128 if (!defined($counter) ||
136 /^(.*)((early|rootfs|con|[0-9])s?)$/;
138 die "$0: ERROR: invalid initcall name $symbol in $file($path)"
141 $initcalls->{$counter} = {
161 foreach my $fh ($select->can_read(0)) {
167 $pid = waitpid(-1, WNOHANG);
169 if (!exists($jobs->{$pid})) {
173 my $fh = $jobs->{$pid};
174 $select->remove($fh);
181 delete($jobs->{$pid});
191 my $select = IO::Select->new();
195 my $pid = open(my $fh, '-|');
198 die "$0: ERROR: failed to fork: $!";
201 $select->add($fh);
202 $jobs->{$pid} = $fh;
205 STDOUT->autoflush(1);
227 my $sections = {}; # level -> [ secname, ...]
232 foreach my $result (@{$results->{$index}}) {
233 my $level = $result->{'level'};
235 if (!exists($sections->{$level})) {
236 $sections->{$level} = [];
239 push(@{$sections->{$level}}, $result->{'secname'});
243 die "$0: ERROR: no initcalls?" if (!keys(%{$sections}));
260 foreach my $secname (@{$sections->{$level}}) {