profile2linkerlist.pl 414 B

1234567891011121314151617181920
  1. #!/usr/bin/env perl
  2. # SPDX-License-Identifier: GPL-2.0
  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. #
  10. use strict;
  11. while (<>) {
  12. my $line = $_;
  13. $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/;
  14. print "*(.text.$1)\n"
  15. unless ($line =~ /unknown/) || ($line =~ /total/);
  16. }