https://github.com/torvalds/linux
Raw File
Tip revision: 69e273c0b0a3c337a521d083374c918dc52c666f authored by Linus Torvalds on 01 September 2014, 01:23:04 UTC
Linux 3.17-rc3
Tip revision: 69e273c
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