blob: f23d7be943948df09dd037b9679c9cf0de5c6873 [file] [log] [blame]
Kamil Rytarowskicb77f0d2017-05-07 23:25:26 +02001#!/usr/bin/env perl
Arjan van de Ven4bdc3b72006-03-25 16:30:49 +01002
3#
4# Takes a (sorted) output of readprofile and turns it into a list suitable for
5# linker scripts
6#
7# usage:
8# readprofile | sort -rn | perl profile2linkerlist.pl > functionlist
9#
Stephen Hemminger9c49fd32010-02-22 15:17:20 -080010use strict;
Arjan van de Ven4bdc3b72006-03-25 16:30:49 +010011
12while (<>) {
13 my $line = $_;
14
15 $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/;
16
Stephen Hemminger9c49fd32010-02-22 15:17:20 -080017 print "*(.text.$1)\n"
18 unless ($line =~ /unknown/) || ($line =~ /total/);
Arjan van de Ven4bdc3b72006-03-25 16:30:49 +010019}