Back to home page

OSCL-LXR

 
 

    


0001 #!/usr/bin/env perl
0002 # SPDX-License-Identifier: GPL-2.0
0003 
0004 #
0005 # Takes a (sorted) output of readprofile and turns it into a list suitable for
0006 # linker scripts
0007 #
0008 # usage:
0009 #    readprofile | sort -rn | perl profile2linkerlist.pl > functionlist
0010 #
0011 use strict;
0012 
0013 while (<>) {
0014   my $line = $_;
0015 
0016   $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/;
0017 
0018   print "*(.text.$1)\n"
0019       unless ($line =~ /unknown/) || ($line =~ /total/);
0020 }