All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Boettcher <pboettcher@kernellabs.com>
To: linux-kernel@vger.kernel.org
Cc: Martin Habets <errandir_news@mph.eclipse.co.uk>
Subject: PATCH [2/2] - CHECKSTACK: simplify text-formatting for displaying the stacksize
Date: Mon, 23 Nov 2009 12:05:57 +0100 (CET)	[thread overview]
Message-ID: <alpine.LRH.2.00.0911231205080.14263@pub1.ifh.de> (raw)
In-Reply-To: <alpine.LRH.2.00.0911231148441.14263@pub1.ifh.de>


Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com>

----
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);
  	}
  }


  parent reply	other threads:[~2009-11-23 11:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23 11:01 PATCH [0/2] - CHECKSTACK: sparc-stack-size and formatting Patrick Boettcher
2009-11-23 11:04 ` PATCH [1/2] - CHECKSTACK: sparc: fix regex to match all stacksize Patrick Boettcher
2009-11-23 11:05 ` Patrick Boettcher [this message]
2009-11-23 15:50 ` PATCH [0/2] - CHECKSTACK: sparc-stack-size and formatting Américo Wang
2009-11-30  1:09 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.00.0911231205080.14263@pub1.ifh.de \
    --to=pboettcher@kernellabs.com \
    --cc=errandir_news@mph.eclipse.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.