https://jxself.org/git/linux-libre.git
Raw File
Tip revision: 12a63bf910bac07c1024db181e4e43873c8eb13b authored by Jason Self on 14 September 2013, 14:07:09 UTC
Linux-libre 3.11.1-gnu
Tip revision: 12a63bf
profile2linkerlist.pl
#!/usr/bin/perl

#
# Takes a (sorted) output of readprofile and turns it into a list suitable for
# linker scripts
#
# usage:
#	 readprofile | sort -rn | perl profile2linkerlist.pl > functionlist
#
use strict;

while (<>) {
  my $line = $_;

  $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/;

  print "*(.text.$1)\n"
      unless ($line =~ /unknown/) || ($line =~ /total/);
}
back to top