scripts/kconfig/kconfig-sym-check.pl
Source file repositories/reference/linux-study-clean/scripts/kconfig/kconfig-sym-check.pl
File Facts
- System
- Linux kernel
- Corpus path
scripts/kconfig/kconfig-sym-check.pl- Extension
.pl- Size
- 2846 bytes
- Lines
- 133
- Domain
- Support Tooling And Documentation
- Bucket
- scripts
- Inferred role
- Support Tooling And Documentation: scripts
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
while (/\\\s*$/) {
s/\\\s*$/ /;
my $cont = <F> // last;
chomp $cont;
$_ .= $cont;
}
next if /^\s*$/;
next if /^\s*#/;
/^(\s*)/;
$level = indent_depth($1);
if ($help && $level < $help_level) {
$help = 0;
}
next if ($help);
if (/^\s*(help|\-\-\-help\-\-\-)$/) {
$help = 1;
my $next;
while (defined($next = <F>)) {
last unless $next =~ /^\s*(?:#.*)?$/;
}
last unless defined $next;
$next =~ /^(\s*)/;
if (indent_depth($1) >= $level) {
$help_level = indent_depth($1);
} else {
$help = 0;
}
$_ = $next;
redo;
}
if (/^\s*(config|menuconfig)\s+([a-zA-Z0-9_]+)\s*(#.*)?$/) {
$configs{$2}++;
next;
}
if (/^\s*(default|def_bool|def_tristate|select|depends\s+on|imply|visible\s+if|range|if|bool|tristate|int|hex|string|prompt)\s+(.+)\s*$/) {
my $s = $2;
$s =~ s/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'//g;
$s =~ s/#.*//;
$s =~ s/\$\((?:[^()]*|\((?:[^()]*|\([^()]*\))*\))*\)//g;
$s =~ s/%%[^%]*%%//g;
my @syms = split /[^a-zA-Z0-9_]+/, $s;
map {
$refs{$_}++ if (/[a-zA-Z]/ && $_ ne "if" && $_ ne "y" && $_ ne "n" && $_ ne "m" && !/^0[xX][0-9a-fA-F]+$/);
} @syms
}
}
close F;
}
my %known_syms = ();
if (defined $kconfig_sym_check_excludes) {
my $file = $kconfig_sym_check_excludes;
open(F, "<", $file) or die "Cannot open $file: $!";
while (<F>) {
chomp;
next if /^\s*$/;
next if /^\s*#/;
$known_syms{$1}++ if (/^\s*([a-zA-Z0-9_]+)\s*(#.*)?$/);
}
}
my $ret = 0;
Annotation
- Atlas domain: Support Tooling And Documentation / scripts.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.