Skip to content
Snippets Groups Projects
Select Git revision
  • f1f0f330b1d0ac1bcc38d7c84d439f4fde341a9c
  • master default
  • radxa-v6.1-vendor-kernel
  • b4/phy-realtek-clock-fix
  • b4/rk3576-rock4d-phy-timings
  • b4/dw-wdt-fix-initial-timeout
  • b4/fusb302-race-condition-fix
  • b4/rk3576-rock4d-phy-handling-fixes
  • b4/rk3588-evb1-hdmi-rx
  • b4/rk3576-fix-fspi-pmdomain
  • b4/usbc-for-rock5bp
  • b4/rock5bp-for-upstream
  • rockchip-devel
  • rk3588-test
  • rk3588-test-vendor-cam
  • lf-6.6.y_6.6.23-2.0.0_var01-panfrost
  • rk3588-linked-clk-gate-for-upstream
  • rk3588-gpu-pwr-domain-for-upstream
  • rk3588-rock5b-usbc-for-upstream
  • rk3588-evb1-for-upstream
  • imx95-upstream-with-vendor-display-stack
  • v5.17
  • v5.17-rc8
  • v5.17-rc7
  • v5.17-rc6
  • v5.17-rc5
  • v5.17-rc4
  • v5.17-rc3
  • v5.17-rc2
  • v5.17-rc1
  • v5.16
  • v5.16-rc8
  • v5.16-rc7
  • v5.16-rc6
  • v5.16-rc5
  • v5.16-rc4
  • v5.16-rc3
  • v5.16-rc2
  • v5.16-rc1
  • v5.15
  • v5.15-rc7
41 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);
    }