summaryrefslogtreecommitdiffstats
path: root/scripts/checkstack.pl
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-06-02 14:18:06 +0200
committerTakashi Iwai <tiwai@suse.de>2010-06-02 14:18:06 +0200
commitc7a441bba9de3b4e166b6a4449208bc906d70558 (patch)
tree346fdf11e464c8201a9aaa8abdd1c1b6dc4f86e0 /scripts/checkstack.pl
parentead54d878465291746c91c95749990d62742a6cf (diff)
parente4caa8bab3862a7694ab7c6dfede223227ad7fc5 (diff)
downloadtalos-op-linux-c7a441bba9de3b4e166b6a4449208bc906d70558.tar.gz
talos-op-linux-c7a441bba9de3b4e166b6a4449208bc906d70558.zip
Merge branch 'fix/hda' into for-linus
Diffstat (limited to 'scripts/checkstack.pl')
-rwxr-xr-xscripts/checkstack.pl16
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;
+
OpenPOWER on IntegriCloud