blob: 316e71918ac86d1c3c69ae2647dfc674d0c2d750 [file] [log] [blame]
Kamil Rytarowskicb77f0d2017-05-07 23:25:26 +02001#!/usr/bin/env perl
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01002# SPDX-License-Identifier: GPL-2.0
Arjan van de Ven4bdc3b72006-03-25 16:30:49 +01003
4#
5# Takes a (sorted) output of readprofile and turns it into a list suitable for
6# linker scripts
7#
8# usage:
9# readprofile | sort -rn | perl profile2linkerlist.pl > functionlist
10#
Stephen Hemminger9c49fd32010-02-22 15:17:20 -080011use strict;
Arjan van de Ven4bdc3b72006-03-25 16:30:49 +010012
13while (<>) {
14 my $line = $_;
15
16 $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/;
17
Stephen Hemminger9c49fd32010-02-22 15:17:20 -080018 print "*(.text.$1)\n"
19 unless ($line =~ /unknown/) || ($line =~ /total/);
Arjan van de Ven4bdc3b72006-03-25 16:30:49 +010020}