Kamil Rytarowski | cb77f0d | 2017-05-07 23:25:26 +0200 | [diff] [blame] | 1 | #!/usr/bin/env perl |
Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 2 | # SPDX-License-Identifier: GPL-2.0 |
Arjan van de Ven | 4bdc3b7 | 2006-03-25 16:30:49 +0100 | [diff] [blame] | 3 | |
| 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 Hemminger | 9c49fd3 | 2010-02-22 15:17:20 -0800 | [diff] [blame] | 11 | use strict; |
Arjan van de Ven | 4bdc3b7 | 2006-03-25 16:30:49 +0100 | [diff] [blame] | 12 | |
| 13 | while (<>) { |
| 14 | my $line = $_; |
| 15 | |
| 16 | $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/; |
| 17 | |
Stephen Hemminger | 9c49fd3 | 2010-02-22 15:17:20 -0800 | [diff] [blame] | 18 | print "*(.text.$1)\n" |
| 19 | unless ($line =~ /unknown/) || ($line =~ /total/); |
Arjan van de Ven | 4bdc3b7 | 2006-03-25 16:30:49 +0100 | [diff] [blame] | 20 | } |