https://github.com/torvalds/linux
Raw File
Tip revision: cfbf8d4857c26a8a307fb7cd258074c9dcd8c691 authored by Linus Torvalds on 24 February 2014, 01:40:03 UTC
Linux 3.14-rc4
Tip revision: cfbf8d4
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