Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / scripts / checkstack.pl
index dadfa20..b349246 100644 (file)
@@ -89,11 +89,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 +119,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 .= '     ';