X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=scripts%2Fcheckstack.pl;h=1afff6658a7d2a657333ff8815486b998b5c16bd;hb=97e0214044d9f279a3d6286c9f859696ef0b7ebe;hp=14ee68e991dd45767b8ded17747da02a59c703f1;hpb=55fa518867978e1f5fd8353098f80d125ac734d7;p=cascardo%2Flinux.git diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index 14ee68e991dd..1afff6658a7d 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl @@ -21,6 +21,8 @@ # # TODO : Port to all architectures (one regex per arch) +use strict; + # check for arch # # $re is used for two matches: @@ -104,19 +106,11 @@ my (@stack, $re, $dre, $x, $xs); } } -sub bysize($) { - my ($asize, $bsize); - ($asize = $a) =~ s/.*: *(.*)$/$1/; - ($bsize = $b) =~ s/.*: *(.*)$/$1/; - $bsize <=> $asize -} - # # main() # my $funcre = qr/^$x* <(.*)>:$/; -my $func; -my $file, $lastslash; +my ($func, $file, $lastslash); while (my $line = ) { if ($line =~ m/$funcre/) { @@ -173,4 +167,6 @@ while (my $line = ) { } } -print sort bysize @stack; +# Sort output by size (last field) +print sort { ($b =~ /:\t*(\d+)$/)[0] <=> ($a =~ /:\t*(\d+)$/)[0] } @stack; +