PATCH [2/2] - CHECKSTACK: simplify text-formatting for displayingthe stacksize

From: Patrick Boettcher
Date: Mon Nov 23 2009 - 06:06:08 EST



Signed-off-by: Patrick Boettcher <pboettcher@xxxxxxxxxxxxxx>

----
diff --git a/tools/checkstack.pl b/tools/checkstack.pl
index e0af9c7..4fed8c7 100755
--- a/tools/checkstack.pl
+++ b/tools/checkstack.pl
@@ -139,7 +139,7 @@ while (my $line = <STDIN>) {
$size += 0x80000000;
$size += 0x80000000;
}
- next if ($size > 0x10000000);
+ next if ($size > 0x10000000) || ($size < 100);

next if $line !~ m/^($xs*)/;
my $addr = $1;
@@ -147,13 +147,7 @@ while (my $line = <STDIN>) {
$addr = "0x$addr";

my $intro = "$addr $func [$file]:";
- my $padlen = 56 - length($intro);
- while ($padlen > 0) {
- $intro .= ' ';
- $padlen -= 8;
- }
- next if ($size < 100);
- push @stack, "$intro$size\n";
+ push @stack, sprintf("%-64s %d\n", $intro, $size);
}
elsif (defined $dre && $line =~ m/$dre/) {
my $size = "Dynamic ($1)";
@@ -164,12 +158,7 @@ while (my $line = <STDIN>) {
$addr = "0x$addr";

my $intro = "$addr $func [$file]:";
- my $padlen = 56 - length($intro);
- while ($padlen > 0) {
- $intro .= ' ';
- $padlen -= 8;
- }
- push @stack, "$intro$size\n";
+ push @stack, sprintf("%-64s %d\n", $intro, $size);
}
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/