Merge tag 'for-linus-20180922' of git://git.kernel.dk/linux-block
[linux-2.6/btrfs-unstable.git] / scripts / profile2linkerlist.pl
blob316e71918ac86d1c3c69ae2647dfc674d0c2d750
1 #!/usr/bin/env perl
2 # SPDX-License-Identifier: GPL-2.0
5 # Takes a (sorted) output of readprofile and turns it into a list suitable for
6 # linker scripts
8 # usage:
9 # readprofile | sort -rn | perl profile2linkerlist.pl > functionlist
11 use strict;
13 while (<>) {
14 my $line = $_;
16 $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/;
18 print "*(.text.$1)\n"
19 unless ($line =~ /unknown/) || ($line =~ /total/);