Lines Matching +full:skip +full:- +full:config

2 # SPDX-License-Identifier: GPL-2.0-only
7 # - Scans dmesg output.
8 # - Walks directory tree and parses each file (for each directory in @DIRS).
10 # Use --debug to output path before parsing, this is useful to find files that
28 use Getopt::Long qw(:config no_auto_abbrev);
29 use Config;
41 # Kernel addresses vary by architecture. We can only auto-detect the following
42 # architectures (using `uname -m`). (flag --32-bit overrides auto-detection.)
55 my $opt_32bit = 0; # Scan 32-bit kernel.
56 my $page_offset_32bit = 0; # Page offset for 32-bit kernel.
58 # Skip these absolute paths.
61 '/proc/device-tree',
68 # Skip these under any subdirectory.
91 -o, --output-raw=<file> Save results for future processing.
92 -i, --input-raw=<file> Read results from file instead of scanning.
93 --raw Show raw results (default).
94 --suppress-dmesg Do not show dmesg results.
95 --squash-by-path Show one result per unique path.
96 --squash-by-filename Show one result per unique filename.
97 --kernel-config-file=<file> Kernel configuration file (e.g /boot/config)
98 --32-bit Scan 32-bit kernel.
99 --page-offset-32-bit=o Page offset (for 32-bit kernel 0xABCD1234).
100 -d, --debug Display debugging output.
101 -h, --help Display this help and exit.
112 'o|output-raw=s' => \$output_raw,
113 'i|input-raw=s' => \$input_raw,
114 'suppress-dmesg' => \$suppress_dmesg,
115 'squash-by-path' => \$squash_by_path,
116 'squash-by-filename' => \$squash_by_filename,
118 'kernel-config-file=s' => \$kernel_config_file,
119 '32-bit' => \$opt_32bit,
120 'page-offset-32-bit=o' => \$page_offset_32bit,
131 printf "\nSummary reporting only available with --input-raw=<file>\n";
132 printf "(First run scan with --output-raw=<file>.)\n";
144 printf("If you are running a 32-bit architecture you may use:\n");
145 printf("\n\t--32-bit or --page-offset-32-bit=<page offset>\n\n");
147 my $archname = `uname -m`;
148 printf("Machine hardware name (`uname -m`): %s\n", $archname);
175 # Allow --32-bit or --page-offset-32-bit to override
185 state $arch = `uname -m`;
197 my $arch = `uname -m`;
218 # Gets config option value from kernel config file.
219 # Returns "" on error or if config option not found.
227 # Allow --kernel-config-file to override.
230 } elsif (-R "/proc/config.gz") {
233 if (system("gunzip < /proc/config.gz > $tmp_file")) {
234 dprint("system(gunzip < /proc/config.gz) failed\n");
240 my $file = '/boot/config-' . `uname -r`;
242 @config_files = ($file, '/boot/config');
246 dprint("parsing config file: $file\n");
254 system("rm -f $tmp_file");
324 # Allow --page-offset-32bit to override.
389 # CONFIG_PGTABLE_LEVELS. If config file parsing fails or config option
402 open my $cmd, '-|', 'dmesg';
411 # True if we should skip this path.
412 sub skip subroutine
449 if (! -R $file) {
453 if (! -T $file) {
491 next if (-l $path);
493 # skip /proc/PID except /proc/1
494 next if (($path =~ /^\/proc\/[0-9]+$/) &&
497 next if (skip($path));
501 if (-d $path) {
611 my $lines = $ref->{$_};
624 $index += 2; # skip ': '
636 $index += 2; # skip ': '
644 if (!$cache->{$key}) {
645 $cache->{$key} = ();
647 push @{$cache->{$key}}, $value;