diff options
| author | J. Bruce Fields <bfields@redhat.com> | 2010-08-26 13:22:27 -0400 |
|---|---|---|
| committer | J. Bruce Fields <bfields@redhat.com> | 2010-08-26 13:22:27 -0400 |
| commit | f632265d0ffb5acf331252d98c64939849d96bb2 (patch) | |
| tree | 31187d9a726bf1ca6ca12e26ad8e7c609eaf4d8b /scripts/checkstack.pl | |
| parent | 7d94784293096c0a46897acdb83be5abd9278ece (diff) | |
| parent | da5cabf80e2433131bf0ed8993abc0f7ea618c73 (diff) | |
Merge commit 'v2.6.36-rc1' into HEAD
Diffstat (limited to 'scripts/checkstack.pl')
| -rwxr-xr-x | scripts/checkstack.pl | 16 |
1 files changed, 6 insertions, 10 deletions
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 = <STDIN>) { if ($line =~ m/$funcre/) { @@ -173,4 +167,6 @@ while (my $line = <STDIN>) { } } -print sort bysize @stack; +# Sort output by size (last field) +print sort { ($b =~ /:\t*(\d+)$/)[0] <=> ($a =~ /:\t*(\d+)$/)[0] } @stack; + |
