Skip to content
Snippets Groups Projects
Select Git revision
  • cb9b55d21fe06ca5e4ba244bb5aac0afeb745c8e
  • drm-misc-templates default
  • wip/final/kci-gitlab-lava-v1
  • wip/vignesh/kci-lava-gitlab-runner
  • kci-gitlab-igt-v8
  • kci-gitlab-igt-v4
  • drm-misc-fixes-2024-10-02
  • drm-misc-next-2024-09-26
  • drm-misc-fixes-2024-09-26
  • drm-misc-next-2024-09-20
  • drm-misc-fixes-2024-09-12
  • drm-misc-fixes-2024-09-05
  • drm-misc-next-fixes-2024-09-05
  • drm-misc-fixes-2024-08-29
  • drm-misc-next-2024-08-29
  • drm-misc-next-2024-08-22
  • drm-misc-fixes-2024-08-22
  • drm-misc-next-2024-08-16
  • drm-misc-fixes-2024-08-15
  • drm-misc-next-2024-08-09
  • drm-misc-fixes-2024-08-08
  • drm-misc-next-2024-08-01
  • drm-misc-fixes-2024-08-01
  • drm-misc-next-fixes-2024-07-25
  • drm-misc-next-fixes-2024-07-19
  • drm-misc-next-fixes-2024-07-11
26 results

export_report.pl

Blame
  • user avatar
    Matthias Maennich authored and Jessica Yu committed
    Add support for symbols that are exported into namespaces. For that,
    extract any namespace suffix from the symbol name. In addition, emit a
    warning whenever a module refers to an exported symbol without
    explicitly importing the namespace that it is defined in. This patch
    consistently adds the namespace suffix to symbol names exported into
    Module.symvers.
    
    Example warning emitted by modpost in case of the above violation:
    
     WARNING: module ums-usbat uses symbol usb_stor_resume from namespace
     USB_STORAGE, but does not import it.
    
    Co-developed-by: default avatarMartijn Coenen <maco@android.com>
    Signed-off-by: default avatarMartijn Coenen <maco@android.com>
    Reviewed-by: default avatarJoel Fernandes (Google) <joel@joelfernandes.org>
    Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarMatthias Maennich <maennich@google.com>
    Signed-off-by: default avatarJessica Yu <jeyu@kernel.org>
    cb9b55d2
    History
    export_report.pl 4.50 KiB
    #!/usr/bin/env perl
    # SPDX-License-Identifier: GPL-2.0-only
    #
    # (C) Copyright IBM Corporation 2006.
    #	Author : Ram Pai (linuxram@us.ibm.com)
    #
    # Usage: export_report.pl -k Module.symvers [-o report_file ] -f *.mod.c
    #
    
    use warnings;
    use Getopt::Std;
    use strict;
    
    sub numerically {
    	my $no1 = (split /\s+/, $a)[1];
    	my $no2 = (split /\s+/, $b)[1];
    	return $no1 <=> $no2;
    }
    
    sub alphabetically {
    	my ($module1, $value1) = @{$a};
    	my ($module2, $value2) = @{$b};
    	return $value1 <=> $value2 || $module2 cmp $module1;
    }
    
    sub print_depends_on {
    	my ($href) = @_;
    	print "\n";
    	for my $mod (sort keys %$href) {
    		my $list = $href->{$mod};
    		print "\t$mod:\n";
    		foreach my $sym (sort numerically @{$list}) {
    			my ($symbol, $no) = split /\s+/, $sym;
    			printf("\t\t%-25s\n", $symbol);
    		}
    		print "\n";
    	}
    	print "\n";
    	print "~"x80 , "\n";
    }
    
    sub usage {
            print "Usage: @_ -h -k Module.symvers  [ -o outputfile ] \n",
    	      "\t-f: treat all the non-option argument as .mod.c files. ",
    	      "Recommend using this as the last option\n",
    	      "\t-h: print detailed help\n",
    	      "\t-k: the path to Module.symvers file. By default uses ",
    	      "the file from the current directory\n",
    	      "\t-o outputfile: output the report to outputfile\n";
    	exit 0;
    }
    
    sub collectcfiles {
        my @file;
        open my $fh, '< modules.order' or die "cannot open modules.order: $!\n";
        while (<$fh>) {
    	s/\.ko$/.mod.c/;
    	push (@file, $_)
        }
        close($fh);
        chomp @file;
        return @file;
    }
    
    my (%SYMBOL, %MODULE, %opt, @allcfiles);
    
    if (not getopts('hk:o:f',\%opt) or defined $opt{'h'}) {
            usage($0);
    }