author: Arjan van de Ven <arjan@infradead.org> 2006-03-25 16:30:49 +0100
committer: Linus Torvalds <torvalds@g5.osdl.org> 2006-03-25 09:10:56 -0800
commit: 4bdc3b7f1b730c07f5a6ccca77ee68e044036ffc
parent: 9b2a13b963dece8d45e07692b7872ae5a075ca2a
Commit Summary:
Diffstat:
1 file changed, 16 insertions, 0 deletions
diff --git a/scripts/profile2linkerlist.pl b/scripts/profile2linkerlist.pl
new file mode 100644
index 000000000000..cb4260ebdb91
--- /dev/null
+++ b/scripts/profile2linkerlist.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+#
+# Takes a (sorted) output of readprofile and turns it into a list suitable for
+# linker scripts
+#
+# usage:
+# readprofile | sort -rn | perl profile2linkerlist.pl > functionlist
+#
+
+while (<>) {
+ my $line = $_;
+
+ $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/;
+
+ if ( ($line =~ /unknown/) || ($line =~ /total/)) {
+
+ } else {
+ print "*(.text.$1)\n";
+ }
+}