home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / src / linux-headers-2.6.17-6-686 / scripts / profile2linkerlist.pl < prev    next >
Encoding:
Perl Script  |  2006-08-11  |  378 b   |  22 lines

  1. #!/usr/bin/perl
  2.  
  3. #
  4. # Takes a (sorted) output of readprofile and turns it into a list suitable for
  5. # linker scripts
  6. #
  7. # usage:
  8. #     readprofile | sort -rn | perl profile2linkerlist.pl > functionlist
  9. #
  10.  
  11. while (<>) {
  12.   my $line = $_;
  13.  
  14.   $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/;
  15.  
  16.   if ( ($line =~ /unknown/) || ($line =~ /total/)) {
  17.  
  18.   } else {
  19.     print "*(.text.$1)\n";
  20.   }
  21. }
  22.