diff options
Diffstat (limited to 'scripts/export_report.pl')
| -rw-r--r-- | scripts/export_report.pl | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/scripts/export_report.pl b/scripts/export_report.pl index 04dce7c15f83..8f79b701de87 100644 --- a/scripts/export_report.pl +++ b/scripts/export_report.pl | |||
| @@ -25,11 +25,12 @@ sub alphabetically { | |||
| 25 | sub print_depends_on { | 25 | sub print_depends_on { |
| 26 | my ($href) = @_; | 26 | my ($href) = @_; |
| 27 | print "\n"; | 27 | print "\n"; |
| 28 | while (my ($mod, $list) = each %$href) { | 28 | for my $mod (sort keys %$href) { |
| 29 | my $list = $href->{$mod}; | ||
| 29 | print "\t$mod:\n"; | 30 | print "\t$mod:\n"; |
| 30 | foreach my $sym (sort numerically @{$list}) { | 31 | foreach my $sym (sort numerically @{$list}) { |
| 31 | my ($symbol, $no) = split /\s+/, $sym; | 32 | my ($symbol, $no) = split /\s+/, $sym; |
| 32 | printf("\t\t%-25s\t%-25d\n", $symbol, $no); | 33 | printf("\t\t%-25s\n", $symbol); |
| 33 | } | 34 | } |
| 34 | print "\n"; | 35 | print "\n"; |
| 35 | } | 36 | } |
| @@ -49,8 +50,14 @@ sub usage { | |||
| 49 | } | 50 | } |
| 50 | 51 | ||
| 51 | sub collectcfiles { | 52 | sub collectcfiles { |
| 52 | my @file | 53 | my @file; |
| 53 | = `cat .tmp_versions/*.mod | grep '.*\.ko\$' | sed s/\.ko$/.mod.c/`; | 54 | while (<.tmp_versions/*.mod>) { |
| 55 | open my $fh, '<', $_ or die "cannot open $_: $!\n"; | ||
| 56 | push (@file, | ||
| 57 | grep s/\.ko/.mod.c/, # change the suffix | ||
| 58 | grep m/.+\.ko/, # find the .ko path | ||
| 59 | <$fh>); # lines in opened file | ||
| 60 | } | ||
| 54 | chomp @file; | 61 | chomp @file; |
| 55 | return @file; | 62 | return @file; |
| 56 | } | 63 | } |
| @@ -95,6 +102,8 @@ close($module_symvers); | |||
| 95 | # | 102 | # |
| 96 | # collect the usage count of each symbol. | 103 | # collect the usage count of each symbol. |
| 97 | # | 104 | # |
| 105 | my $modversion_warnings = 0; | ||
| 106 | |||
| 98 | foreach my $thismod (@allcfiles) { | 107 | foreach my $thismod (@allcfiles) { |
| 99 | my $module; | 108 | my $module; |
| 100 | 109 | ||
| @@ -125,7 +134,8 @@ foreach my $thismod (@allcfiles) { | |||
| 125 | } | 134 | } |
| 126 | } | 135 | } |
| 127 | if ($state != 2) { | 136 | if ($state != 2) { |
| 128 | print "WARNING:$thismod is not built with CONFIG_MODVERSION enabled\n"; | 137 | warn "WARNING:$thismod is not built with CONFIG_MODVERSIONS enabled\n"; |
| 138 | $modversion_warnings++; | ||
| 129 | } | 139 | } |
| 130 | close($module); | 140 | close($module); |
| 131 | } | 141 | } |
| @@ -159,8 +169,12 @@ printf("SECTION 2:\n\tThis section reports export-symbol-usage of in-kernel | |||
| 159 | modules. Each module lists the modules, and the symbols from that module that | 169 | modules. Each module lists the modules, and the symbols from that module that |
| 160 | it uses. Each listed symbol reports the number of modules using it\n"); | 170 | it uses. Each listed symbol reports the number of modules using it\n"); |
| 161 | 171 | ||
| 172 | print "\nNOTE: Got $modversion_warnings CONFIG_MODVERSIONS warnings\n\n" | ||
| 173 | if $modversion_warnings; | ||
| 174 | |||
| 162 | print "~"x80 , "\n"; | 175 | print "~"x80 , "\n"; |
| 163 | while (my ($thismod, $list) = each %MODULE) { | 176 | for my $thismod (sort keys %MODULE) { |
| 177 | my $list = $MODULE{$thismod}; | ||
| 164 | my %depends; | 178 | my %depends; |
| 165 | $thismod =~ s/\.mod\.c/.ko/; | 179 | $thismod =~ s/\.mod\.c/.ko/; |
| 166 | print "\t\t\t$thismod\n"; | 180 | print "\t\t\t$thismod\n"; |
