tools/mostcalled: find most called Z80 fns, so we can do RST hacks
authorAlan Cox <alan@linux.intel.com>
Fri, 29 May 2015 14:47:58 +0000 (15:47 +0100)
committerAlan Cox <alan@linux.intel.com>
Fri, 29 May 2015 14:47:58 +0000 (15:47 +0100)
Kernel/tools/mostcalled [new file with mode: 0755]

diff --git a/Kernel/tools/mostcalled b/Kernel/tools/mostcalled
new file mode 100755 (executable)
index 0000000..8ab4ad5
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+(
+grep -h "call  _" *.asm platform/*.asm > tmp_calls
+
+X=$(sed -e  "s/^.*call.//" < tmp_calls| sort -n|uniq)
+
+for i in $X
+do
+       n=$(grep $i tmp_calls | wc -l)
+       echo $n": "$i
+done
+) | sort -n