]>
git.proxmox.com Git - pve-kernel.git/blob - abi-check
17 print "II: Checking ABI...\n";
20 print "WW: Explicitly asked to ignore ABI, running in no-fail mode\n";
26 #if ($prev_abinum != $abinum) {
27 # print "II: Different ABI's, running in no-fail mode\n";
32 if (not -f
"$abinew" or not -f
"$abiold") {
33 print "EE: Previous or current ABI file missing!\n";
34 print " $abinew\n" if not -f
"$abinew";
35 print " $abiold\n" if not -f
"$abiold";
37 # Exit if the ABI files are missing, but return status based on whether
38 # skip ABI was indicated.
39 if ("$abiskip" eq "1") {
51 # See if we have any ignores
53 print " Reading symbols/modules to ignore...";
55 for $file ("abi-blacklist") {
57 open(IGNORE
, "< $file") or
58 die "Could not open $file";
61 if ($_ =~ m/M: (.*)/) {
62 $modules_ignore{$1} = 1;
64 $symbols_ignore{$_} = 1;
71 print "read $ignore symbols/modules.\n";
76 die "Missing module name in is_ignored()" if not defined($mod);
77 die "Missing symbol name in is_ignored()" if not defined($sym);
79 if (defined($symbols_ignore{$sym}) or defined($modules_ignore{$mod})) {
86 print " Reading new symbols ($abinum)...";
88 open(NEW
, "< $abinew") or
89 die "Could not open $abinew";
92 m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
93 $symbols{$4}{'type'} = $1;
94 $symbols{$4}{'loc'} = $2;
95 $symbols{$4}{'hash'} = $3;
100 print "read $count symbols.\n";
102 # Now the old symbols, checking for missing ones
103 print " Reading old symbols...";
105 open(OLD
, "< $abiold") or
106 die "Could not open $abiold";
109 m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
110 $symbols{$4}{'old_type'} = $1;
111 $symbols{$4}{'old_loc'} = $2;
112 $symbols{$4}{'old_hash'} = $3;
117 print "read $count symbols.\n";
119 print "II: Checking for missing symbols in new ABI...";
121 foreach $sym (keys(%symbols)) {
122 if (!defined($symbols{$sym}{'type'})) {
123 print "\n" if not $count;
124 printf(" MISS : %s%s\n", $sym,
125 is_ignored
($symbols{$sym}{'old_loc'}, $sym) ?
" (ignored)" : "");
126 $count++ if !is_ignored
($symbols{$sym}{'old_loc'}, $sym);
130 print "found $count missing symbols\n";
132 print "$EE Symbols gone missing (what did you do!?!)\n";
137 print "II: Checking for new symbols in new ABI...";
139 foreach $sym (keys(%symbols)) {
140 if (!defined($symbols{$sym}{'old_type'})) {
141 print "\n" if not $count;
142 print " NEW : $sym\n";
147 print "found $count new symbols\n";
149 print "WW: Found new symbols. Not recommended unless ABI was bumped\n";
152 print "II: Checking for changes to ABI...\n";
155 my $changed_type = 0;
156 my $changed_hash = 0;
157 foreach $sym (keys(%symbols)) {
158 if (!defined($symbols{$sym}{'old_type'}) or
159 !defined($symbols{$sym}{'type'})) {
163 # Changes in location don't hurt us, but log it anyway
164 if ($symbols{$sym}{'loc'} ne $symbols{$sym}{'old_loc'}) {
165 printf(" MOVE : %-40s : %s => %s\n", $sym, $symbols{$sym}{'old_loc'},
166 $symbols{$sym}{'loc'});
170 # Changes to export type are only bad if new type isn't
171 # EXPORT_SYMBOL. Changing things to GPL are bad.
172 if ($symbols{$sym}{'type'} ne $symbols{$sym}{'old_type'}) {
173 printf(" TYPE : %-40s : %s => %s%s\n", $sym, $symbols{$sym}{'old_type'}.
174 $symbols{$sym}{'type'}, is_ignored
($symbols{$sym}{'loc'}, $sym)
175 ?
" (ignored)" : "");
176 $changed_type++ if $symbols{$sym}{'type'} ne "EXPORT_SYMBOL"
177 and !is_ignored
($symbols{$sym}{'loc'}, $sym);
180 # Changes to the hash are always bad
181 if ($symbols{$sym}{'hash'} ne $symbols{$sym}{'old_hash'}) {
182 printf(" HASH : %-40s : %s => %s%s\n", $sym, $symbols{$sym}{'old_hash'},
183 $symbols{$sym}{'hash'}, is_ignored
($symbols{$sym}{'loc'}, $sym)
184 ?
" (ignored)" : "");
185 $changed_hash++ if !is_ignored
($symbols{$sym}{'loc'}, $sym);
186 $module_syms{$symbols{$sym}{'loc'}}++;
190 print "WW: $moved symbols changed location\n" if $moved;
191 print "$EE $changed_type symbols changed export type and weren't ignored\n" if $changed_type;
192 print "$EE $changed_hash symbols changed hash and weren't ignored\n" if $changed_hash;
194 $errors++ if $changed_hash or $changed_type;
196 print "II: Module hash change summary...\n";
197 foreach $mod (sort { $module_syms{$b} <=> $module_syms{$a} } keys %module_syms) {
198 next if ! $module_syms{$mod};
199 printf(" %-40s: %d\n", $mod, $module_syms{$mod});