https://github.com/torvalds/linux
Raw File
Tip revision: dcb99fd9b08cfe1afe426af4d8d3cbc429190f15 authored by Linus Torvalds on 17 March 2014, 01:51:24 UTC
Linux 3.14-rc7
Tip revision: dcb99fd
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