From 6f7ae1ca32b3221a9d0464576de970ffd91f3599 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 22 Feb 2010 15:17:09 -0800 Subject: [PATCH] --- yaml --- r: 199547 b: refs/heads/master c: 1f2a144f5ab5e836b5ca8f67bd76b759fa947751 h: refs/heads/master i: 199545: 5d6db9a379db286560b4a66ba5545cd1756234d5 199543: 698540d52333e5b6fd4b6cbbb8cb20f6326941b8 v: v3 --- [refs] | 2 +- trunk/scripts/checkstack.pl | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index e4b8d3bd7039..28e99c70ed61 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b59a12258460b3d019918719b1bd2563cf37ad9a +refs/heads/master: 1f2a144f5ab5e836b5ca8f67bd76b759fa947751 diff --git a/trunk/scripts/checkstack.pl b/trunk/scripts/checkstack.pl index 14ee68e991dd..1afff6658a7d 100755 --- a/trunk/scripts/checkstack.pl +++ b/trunk/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 @@ } } -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 @@ ($) } } -print sort bysize @stack; +# Sort output by size (last field) +print sort { ($b =~ /:\t*(\d+)$/)[0] <=> ($a =~ /:\t*(\d+)$/)[0] } @stack; +