I created the following scripts:
complexity.pl
while(<STDIN>) { chomp; @array = split(' ', $_); open(FILE, "< $array[2]") or next; $count = 0; $count++ while <FILE>; print("$count $array[0] $array[1] $array[2]\n"); }
inline.pl
while(<STDIN>) { chomp; @array = split(' ', $_); open(FILE, "< $array[5]") or next; $count = 0; while (<FILE>) { #print("$_"); if (/__asm__/) { $count++; #print("$_ $array[5]"); } } if ($count > 0) { print("$count $array[5]\n"); } }
uint32.pl
while(<STDIN>) { chomp; @array = split(' ', $_); open(FILE, "< $array[5]") or next; $count = 0; while (<FILE>) { #print("$_"); if (/uint32/) { $count++; #print("$_ $array[5]"); } } if ($count > 0) { print("$count $array[5]\n"); } }
That you feed with awk, the consoleText of a build and a local copy of that build via:
awk '/target asm:/ {print $2," ",$3," ",$5}' consoleText | perl complexity.pl | sort --sort=g -r awk '/target arm C:/ {print $1,$2,$3,$4,$5,$6}' consoleText > c_stuff.txt awk '/target arm C++:/ {print $1,$2,$3,$4,$5,$6}' consoleText >> c_stuff.txt awk '/target C++:/ {print $1,$2,$3,$4,$5,$6}' consoleText >> c_stuff.txt awk '/target thumb C:/ {print $1,$2,$3,$4,$5,$6}' consoleText >> c_stuff.txt awk '/target thumb C++:/ {print $1,$2,$3,$4,$5,$6}' consoleText >> c_stuff.txt cat c_stuff.txt | perl inline.pl | sort -g -r
Did this to find how much asm there is, how many inline __asm__ statements and how may instances of uint32
linaro-android@lists.linaro.org