linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Maninder Singh <maninder1.s@samsung.com>
Cc: "George G. Davis" <george_davis@mentor.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	a.sahrawat@samsung.com, Vaneet Narang <v.narang@samsung.com>
Subject: Re: [PATCH 2/4] scripts/checkstack.pl: Add argument to print stacks greather than value.
Date: Thu, 7 May 2020 17:13:02 +0900	[thread overview]
Message-ID: <CAK7LNARQNmrCYofk5yG6diwrZnaqgUs0ASBo23k25SnOKM3viQ@mail.gmail.com> (raw)
In-Reply-To: <1588250972-8507-2-git-send-email-maninder1.s@samsung.com>

On Thu, Apr 30, 2020 at 9:50 PM Maninder Singh <maninder1.s@samsung.com> wrote:
>
> Add arguments support to print stacks which are greater than
> argument value only.
>
> Signed-off-by: Vaneet Narang <v.narang@samsung.com>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> ---
>  scripts/checkstack.pl | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
> index 412c459..8e5ef98 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* <(.*)>:$/;
> @@ -113,7 +118,7 @@ my ($func, $file, $lastslash, $total_size, $addr, $intro);
>
>  while (my $line = <STDIN>) {
>         if ($line =~ m/$funcre/) {
> -               if ($total_size > 100) {
> +               if ($total_size > $min_stack) {
>                         push @stack, "$intro$total_size\n";
>                 }
>
> @@ -150,7 +155,6 @@ while (my $line = <STDIN>) {
>                         $size += 0x80000000;
>                 }
>                 next if ($size > 0x10000000);
> -


This is a noise change.

You can do this in 1/4 if you want to.



>                 $total_size = $total_size + $size
>         }
>         elsif (defined $dre && $line =~ m/$dre/) {
> @@ -160,7 +164,7 @@ while (my $line = <STDIN>) {
>                 $total_size = $total_size + $size
>         }
>  }
> -if ($total_size > 100) {
> +if ($total_size > $min_stack) {
>         push @stack, "$intro$total_size\n";
>  }
>
> --
> 1.9.1
>


--
Best Regards

Masahiro Yamada

  reply	other threads:[~2020-05-07  8:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200430124952epcas5p28cd53b0aa452f43eed48ed9d58b4005b@epcas5p2.samsung.com>
2020-04-30 12:49 ` [PATCH 1/4] scripts/checkstack.pl: don't display $dre as different entity Maninder Singh
     [not found]   ` <CGME20200430124955epcas5p4b5c1dd7393a7b798d80206d071264df3@epcas5p4.samsung.com>
2020-04-30 12:49     ` [PATCH 2/4] scripts/checkstack.pl: Add argument to print stacks greather than value Maninder Singh
2020-05-07  8:13       ` Masahiro Yamada [this message]
     [not found]   ` <CGME20200430124958epcas5p15ecc8e744ed0f78837a6d58274a5baf0@epcas5p1.samsung.com>
2020-04-30 12:49     ` [PATCH 3/4] scripts/checkstack.pl: add arm push handling for stack usage Maninder Singh
2020-05-07 10:35       ` Masahiro Yamada
     [not found]       ` <CGME20200430124958epcas5p15ecc8e744ed0f78837a6d58274a5baf0@epcms5p8>
2020-05-07 13:32         ` Vaneet Narang
     [not found]   ` <CGME20200430125001epcas5p2a6f02e9888481cef96f32ba14450bc63@epcas5p2.samsung.com>
2020-04-30 12:49     ` [PATCH 4/4] scripts/checkstack.pl: fix arm sp regex Maninder Singh
2020-05-07 10:38       ` Masahiro Yamada
     [not found]       ` <CGME20200430125001epcas5p2a6f02e9888481cef96f32ba14450bc63@epcms5p5>
2020-05-07 10:51         ` Maninder Singh
2020-05-07 11:58           ` [PATCH " Masahiro Yamada
2020-05-07  8:12   ` [PATCH 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=CAK7LNARQNmrCYofk5yG6diwrZnaqgUs0ASBo23k25SnOKM3viQ@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=a.sahrawat@samsung.com \
    --cc=george_davis@mentor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maninder1.s@samsung.com \
    --cc=v.narang@samsung.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;
as well as URLs for NNTP newsgroup(s).