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
29 use Getopt::Long qw(:config no_auto_abbrev);
30 use Config;
42 # Kernel addresses vary by architecture. We can only auto-detect the following
43 # architectures (using `uname -m`). (flag --32-bit overrides auto-detection.)
57 my $opt_32bit = 0; # Scan 32-bit kernel.
58 my $page_offset_32bit = 0; # Page offset for 32-bit kernel.
62 # Skip these absolute paths.
65 '/proc/device-tree',
72 # Skip these under any subdirectory.
95 -o, --output-raw=<file> Save results for future processing.
96 -i, --input-raw=<file> Read results from file instead of scanning.
97 --raw Show raw results (default).
98 --suppress-dmesg Do not show dmesg results.
99 --squash-by-path Show one result per unique path.
100 --squash-by-filename Show one result per unique filename.
101 --kernel-config-file=<file> Kernel configuration file (e.g /boot/config)
102 --kallsyms=<file> Read kernel symbol addresses from file (for
104 --32-bit Scan 32-bit kernel.
105 --page-offset-32-bit=o Page offset (for 32-bit kernel 0xABCD1234).
106 -d, --debug Display debugging output.
107 -h, --help Display this help and exit.
118 'o|output-raw=s' => \$output_raw,
119 'i|input-raw=s' => \$input_raw,
120 'suppress-dmesg' => \$suppress_dmesg,
121 'squash-by-path' => \$squash_by_path,
122 'squash-by-filename' => \$squash_by_filename,
125 'kernel-config-file=s' => \$kernel_config_file,
126 '32-bit' => \$opt_32bit,
127 'page-offset-32-bit=o' => \$page_offset_32bit,
138 printf "\nSummary reporting only available with --input-raw=<file>\n";
139 printf "(First run scan with --output-raw=<file>.)\n";
151 printf("If you are running a 32-bit architecture you may use:\n");
152 printf("\n\t--32-bit or --page-offset-32-bit=<page offset>\n\n");
154 my $archname = `uname -m`;
155 printf("Machine hardware name (`uname -m`): %s\n", $archname);
201 # Allow --32-bit or --page-offset-32-bit to override
211 state $arch = `uname -m`;
223 my $arch = `uname -m`;
244 # Gets config option value from kernel config file.
245 # Returns "" on error or if config option not found.
254 # Allow --kernel-config-file to override.
257 } elsif (-R "/proc/config.gz") {
258 ($tmp_fh, $tmp_file) = tempfile("config.gz-XXXXXX",
261 if (system("gunzip < /proc/config.gz > $tmp_file")) {
262 dprint("system(gunzip < /proc/config.gz) failed\n");
268 my $file = '/boot/config-' . `uname -r`;
270 @config_files = ($file, '/boot/config');
274 dprint("parsing config file: $file\n");
313 # 0xfffffffffffffff[0-f]
315 if ($match =~ '\b(0x)?(f|F){15}[0-9a-f]\b' or
332 if ($match =~ '\b(0x)?(f|F){7}[0-9a-f]\b') {
349 # Allow --page-offset-32bit to override.
419 # CONFIG_PGTABLE_LEVELS. If config file parsing fails or config option
432 open my $cmd, '-|', 'dmesg';
441 # True if we should skip this path.
442 sub skip subroutine
485 my $addr = $entry->[0];
486 my $symbol = $entry->[1];
488 if ($offset != -1) {
498 if (! -R $file) {
502 if (! -T $file) {
549 next if (-l $path);
551 # skip /proc/PID except /proc/1
552 next if (($path =~ /^\/proc\/[0-9]+$/) &&
555 next if (skip($path));
559 if (-d $path) {
669 my $lines = $ref->{$_};
682 $index += 2; # skip ': '
694 $index += 2; # skip ': '
702 if (!$cache->{$key}) {
703 $cache->{$key} = ();
705 push @{$cache->{$key}}, $value;