lkml.org 
[lkml]   [2020]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/4] scripts/checkstack.pl: Add argument to print stacks greather than value.
Date
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);
-
$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
\
 
 \ /
  Last update: 2020-04-30 14:50    [W:0.073 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site