]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - scripts/checkstack.pl
[MIPS] VPE loader: convert from struct class_ device to struct device
[linux-2.6-omap-h63xx.git] / scripts / checkstack.pl
index dadfa20ffec0106ecea591e607a4ca3f722f3e27..663158627155151d60315059a81f1b02d68af697 100755 (executable)
@@ -12,6 +12,7 @@
 #      sh64 port by Paul Mundt
 #      Random bits by Matt Mackall <mpm@selenic.com>
 #      M68k port by Geert Uytterhoeven and Andreas Schwab
+#      AVR32 port by Haavard Skinnemoen <hskinnemoen@atmel.com>
 #
 #      Usage:
 #      objdump -d vmlinux | stackcheck.pl [arch]
@@ -37,6 +38,10 @@ my (@stack, $re, $x, $xs);
        if ($arch eq 'arm') {
                #c0008ffc:      e24dd064        sub     sp, sp, #100    ; 0x64
                $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o;
+       } elsif ($arch eq 'avr32') {
+               #8000008a:       20 1d           sub sp,4
+               #80000ca8:       fa cd 05 b0     sub sp,sp,1456
+               $re = qr/^.*sub.*sp.*,([0-9]{1,8})/o;
        } elsif ($arch =~ /^i[3456]86$/) {
                #c0105234:       81 ec ac 05 00 00       sub    $0x5ac,%esp
                $re = qr/^.*[as][du][db]    \$(0x$x{1,8}),\%esp$/o;
@@ -62,6 +67,8 @@ my (@stack, $re, $x, $xs);
        } elsif ($arch eq 'ppc64') {
                #XXX
                $re = qr/.*stdu.*r1,-($x{1,8})\(r1\)/o;
+       } elsif ($arch eq 'powerpc') {
+               $re = qr/.*st[dw]u.*r1,-($x{1,8})\(r1\)/o;
        } elsif ($arch =~ /^s390x?$/) {
                #   11160:       a7 fb ff 60             aghi   %r15,-160
                $re = qr/.*ag?hi.*\%r15,-(([0-9]{2}|[3-9])[0-9]{2})/o;
@@ -89,11 +96,21 @@ sub bysize($) {
 #
 my $funcre = qr/^$x* <(.*)>:$/;
 my $func;
+my $file, $lastslash;
+
 while (my $line = <STDIN>) {
        if ($line =~ m/$funcre/) {
                $func = $1;
        }
-       if ($line =~ m/$re/) {
+       elsif ($line =~ m/(.*):\s*file format/) {
+               $file = $1;
+               $file =~ s/\.ko//;
+               $lastslash = rindex($file, "/");
+               if ($lastslash != -1) {
+                       $file = substr($file, $lastslash + 1);
+               }
+       }
+       elsif ($line =~ m/$re/) {
                my $size = $1;
                $size = hex($size) if ($size =~ /^0x/);
 
@@ -109,7 +126,7 @@ while (my $line = <STDIN>) {
                $addr =~ s/ /0/g;
                $addr = "0x$addr";
 
-               my $intro = "$addr $func:";
+               my $intro = "$addr $func [$file]:";
                my $padlen = 56 - length($intro);
                while ($padlen > 0) {
                        $intro .= '     ';