All of lore.kernel.org
 help / color / mirror / Atom feed
* PATCH [0/2] - CHECKSTACK: sparc-stack-size and formatting
@ 2009-11-23 11:01 Patrick Boettcher
  2009-11-23 11:04 ` PATCH [1/2] - CHECKSTACK: sparc: fix regex to match all stacksize Patrick Boettcher
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Patrick Boettcher @ 2009-11-23 11:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Martin Habets

Hi,

I shamelessly stole the checkstack-script for a project of mine and now 
want to contribute what I changed:

1) CHECKSTACK: sparc: fix regex to match all stacksizes
2) CHECKSTACK: simplify text-formatting for displaying the stacksize

For 1): as there are no comments in the script as to why the regex was 
limiting the detection of stacksizes to less 300 bytes and if I understood 
it correctly, to a maximum of 1000, I simply removed it.

best regards,
--

Patrick Boettcher - Kernel Labs
http://www.kernellabs.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* PATCH [1/2] - CHECKSTACK: sparc: fix regex to match all stacksize
  2009-11-23 11:01 PATCH [0/2] - CHECKSTACK: sparc-stack-size and formatting Patrick Boettcher
@ 2009-11-23 11:04 ` Patrick Boettcher
  2009-11-23 11:05 ` PATCH [2/2] - CHECKSTACK: simplify text-formatting for displaying the stacksize Patrick Boettcher
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Patrick Boettcher @ 2009-11-23 11:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: Martin Habets

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

----
diff --git a/tools/checkstack.pl b/tools/checkstack.pl
index 14ee68e..e0af9c7 100755
--- a/tools/checkstack.pl
+++ b/tools/checkstack.pl
@@ -97,7 +97,7 @@ my (@stack, $re, $dre, $x, $xs);
  		$re = qr/.*[[:space:]]LINK[[:space:]]*(0x$x{1,8})/o;
  	} elsif ($arch eq 'sparc' || $arch eq 'sparc64') {
  		# f0019d10:       9d e3 bf 90     save  %sp, -112, %sp
-		$re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;
+		$re = qr/.*save.*%sp, -(\d*), %sp/o;
  	} else {
  		print("wrong or unknown architecture \"$arch\"\n");
  		exit





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* PATCH [2/2] - CHECKSTACK: simplify text-formatting for displaying the stacksize
  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
  2009-11-23 15:50 ` PATCH [0/2] - CHECKSTACK: sparc-stack-size and formatting Américo Wang
  2009-11-30  1:09 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Patrick Boettcher @ 2009-11-23 11:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Martin Habets


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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: PATCH [0/2] - CHECKSTACK: sparc-stack-size and formatting
  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 ` PATCH [2/2] - CHECKSTACK: simplify text-formatting for displaying the stacksize Patrick Boettcher
@ 2009-11-23 15:50 ` Américo Wang
  2009-11-30  1:09 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Américo Wang @ 2009-11-23 15:50 UTC (permalink / raw)
  To: Patrick Boettcher; +Cc: linux-kernel, Martin Habets

On Mon, Nov 23, 2009 at 12:01:00PM +0100, Patrick Boettcher wrote:
> Hi,
>
> I shamelessly stole the checkstack-script for a project of mine and now  
> want to contribute what I changed:
>
> 1) CHECKSTACK: sparc: fix regex to match all stacksizes

Please Cc sparc people for this, he should be David Miller, I think.


> 2) CHECKSTACK: simplify text-formatting for displaying the stacksize
>
> For 1): as there are no comments in the script as to why the regex was  
> limiting the detection of stacksizes to less 300 bytes and if I 
> understood it correctly, to a maximum of 1000, I simply removed it.

Please don't do this, write your change log for each patch please.


-- 
Live like a child, think like the god.
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH [0/2] - CHECKSTACK: sparc-stack-size and formatting
  2009-11-23 11:01 PATCH [0/2] - CHECKSTACK: sparc-stack-size and formatting Patrick Boettcher
                   ` (2 preceding siblings ...)
  2009-11-23 15:50 ` PATCH [0/2] - CHECKSTACK: sparc-stack-size and formatting Américo Wang
@ 2009-11-30  1:09 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2009-11-30  1:09 UTC (permalink / raw)
  To: pboettcher; +Cc: linux-kernel, errandir_news

From: Patrick Boettcher <pboettcher@kernellabs.com>
Date: Mon, 23 Nov 2009 12:01:00 +0100 (CET)

> I shamelessly stole the checkstack-script for a project of mine and
> now want to contribute what I changed:
> 
> 1) CHECKSTACK: sparc: fix regex to match all stacksizes
> 2) CHECKSTACK: simplify text-formatting for displaying the stacksize
> 
> For 1): as there are no comments in the script as to why the regex was
> limiting the detection of stacksizes to less 300 bytes and if I
> understood it correctly, to a maximum of 1000, I simply removed it.

The limit is just an oversight as far as I can tell, your sparc
regex fix looks fine to me, thanks!

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-11-30  1:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` PATCH [2/2] - CHECKSTACK: simplify text-formatting for displaying the stacksize Patrick Boettcher
2009-11-23 15:50 ` PATCH [0/2] - CHECKSTACK: sparc-stack-size and formatting Américo Wang
2009-11-30  1:09 ` David Miller

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.