mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maninder Singh <maninder1.s@samsung.com>
To: yamada.masahiro@socionext.com, george_davis@mentor.com
Cc: linux-kernel@vger.kernel.org, a.sahrawat@samsung.com,
	arnd@arndb.de, ak@linux.intel.com,
	Maninder Singh <maninder1.s@samsung.com>,
	Vaneet Narang <v.narang@samsung.com>
Subject: [PATCH v2 2/4] scripts/checkstack.pl: Add argument to print stacks greather than value.
Date: Fri,  8 May 2020 16:33:15 +0530	[thread overview]
Message-ID: <1588935797-7283-2-git-send-email-maninder1.s@samsung.com> (raw)
In-Reply-To: <1588935797-7283-1-git-send-email-maninder1.s@samsung.com>

Add arguments support to print stacks which are greater than
argument value only.

Co-developed-by: Vaneet Narang <v.narang@samsung.com>
Signed-off-by: Vaneet Narang <v.narang@samsung.com>
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
---
 scripts/checkstack.pl | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index 6957108..bc23cc7 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -35,7 +35,7 @@ use strict;
 # $1 (first bracket) matches the dynamic amount of the stack growth
 #
 # use anything else and feel the pain ;)
-my (@stack, $re, $dre, $x, $xs, $funcre);
+my (@stack, $re, $dre, $x, $xs, $funcre, $min_stack);
 {
 	my $arch = shift;
 	if ($arch eq "") {
@@ -43,6 +43,11 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
 		chomp($arch);
 	}
 
+	$min_stack = shift;
+	if ($min_stack eq "" || $min_stack !~ /^\d+$/) {
+		$min_stack = 100;
+	}
+
 	$x	= "[0-9a-f]";	# hex character
 	$xs	= "[0-9a-f ]";	# hex character or space
 	$funcre = qr/^$x* <(.*)>:$/;
@@ -117,7 +122,7 @@ while (my $line = <STDIN>) {
 	if ($line =~ m/$funcre/) {
 		$func = $1;
 		next if $line !~ m/^($xs*)/;
-		if ($total_size > 100) {
+		if ($total_size > $min_stack) {
 			push @stack, "$intro$total_size\n";
 		}
 
@@ -162,7 +167,7 @@ while (my $line = <STDIN>) {
 		$total_size += $size;
 	}
 }
-if ($total_size > 100) {
+if ($total_size > $min_stack) {
 	push @stack, "$intro$total_size\n";
 }
 
-- 
1.9.1


  parent reply	other threads:[~2020-05-08 11:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200508110343epcas5p1ae3398e56ee895572487d05b730bd466@epcas5p1.samsung.com>
2020-05-08 11:03 ` [PATCH v2 1/4] scripts/checkstack.pl: don't display $dre as different entity Maninder Singh
     [not found]   ` <CGME20200508110351epcas5p32b6adff3dd1cb36dd4912c82bb291bbd@epcas5p3.samsung.com>
2020-05-08 11:03     ` Maninder Singh [this message]
     [not found]   ` <CGME20200508110354epcas5p3b80625f7ae03836a38547017b671268d@epcas5p3.samsung.com>
2020-05-08 11:03     ` [PATCH v2 3/4] scripts/checkstack.pl: add arm push handling for stack usage Maninder Singh
     [not found]   ` <CGME20200508110359epcas5p19f9e7bdbd7a9c2880308f5201f6badc9@epcas5p1.samsung.com>
2020-05-08 11:03     ` [PATCH v2 4/4] scripts/checkstack.pl: fix arm sp regex Maninder Singh
2020-05-09  7:42   ` [PATCH v2 1/4] scripts/checkstack.pl: don't display $dre as different entity Masahiro Yamada

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=1588935797-7283-2-git-send-email-maninder1.s@samsung.com \
    --to=maninder1.s@samsung.com \
    --cc=a.sahrawat@samsung.com \
    --cc=ak@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=george_davis@mentor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=v.narang@samsung.com \
    --cc=yamada.masahiro@socionext.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®