Skip to content
Snippets Groups Projects
Select Git revision
  • 221cc2d27ddc49b3e06d4637db02bf78e70c573c
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

export_report.pl

Blame
  • export_report.pl 4.55 KiB
    #!/usr/bin/env perl
    #
    # (C) Copyright IBM Corporation 2006.
    #	Released under GPL v2.
    #	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;
        while (<.tmp_versions/*.mod>) {
    	open my $fh, '<', $_ or die "cannot open $_: $!\n";
    	push (@file,
    	      grep s/\.ko/.mod.c/,	# change the suffix
    	      grep m/.+\.ko/,		# find the .ko path
    	      <$fh>);			# lines in opened file
        }
        chomp @file;
        return @file;
    }
    
    my (%SYMBOL, %MODULE, %opt, @allcfiles);
    
    if (not getopts('hk:o:f',\%opt) or defined $opt{'h'}) {
            usage($0);
    }