https://github.com/torvalds/linux
Raw File
Tip revision: e44a21b7268a022c7749f521c06214145bd161e4 authored by Linus Torvalds on 06 June 2010, 03:43:24 UTC
Linux 2.6.35-rc2
Tip revision: e44a21b
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