Commit 572220aa authored by Maninder Singh's avatar Maninder Singh Committed by Masahiro Yamada

scripts/checkstack.pl: Add argument to print stacks greather than value.

Add arguments support to print stacks which are greater than
argument value only.
Co-developed-by: default avatarVaneet Narang <v.narang@samsung.com>
Signed-off-by: default avatarVaneet Narang <v.narang@samsung.com>
Signed-off-by: default avatarManinder Singh <maninder1.s@samsung.com>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 677f1410
...@@ -35,7 +35,7 @@ use strict; ...@@ -35,7 +35,7 @@ use strict;
# $1 (first bracket) matches the dynamic amount of the stack growth # $1 (first bracket) matches the dynamic amount of the stack growth
# #
# use anything else and feel the pain ;) # 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; my $arch = shift;
if ($arch eq "") { if ($arch eq "") {
...@@ -43,6 +43,11 @@ my (@stack, $re, $dre, $x, $xs, $funcre); ...@@ -43,6 +43,11 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
chomp($arch); chomp($arch);
} }
$min_stack = shift;
if ($min_stack eq "" || $min_stack !~ /^\d+$/) {
$min_stack = 100;
}
$x = "[0-9a-f]"; # hex character $x = "[0-9a-f]"; # hex character
$xs = "[0-9a-f ]"; # hex character or space $xs = "[0-9a-f ]"; # hex character or space
$funcre = qr/^$x* <(.*)>:$/; $funcre = qr/^$x* <(.*)>:$/;
...@@ -117,7 +122,7 @@ while (my $line = <STDIN>) { ...@@ -117,7 +122,7 @@ while (my $line = <STDIN>) {
if ($line =~ m/$funcre/) { if ($line =~ m/$funcre/) {
$func = $1; $func = $1;
next if $line !~ m/^($xs*)/; next if $line !~ m/^($xs*)/;
if ($total_size > 100) { if ($total_size > $min_stack) {
push @stack, "$intro$total_size\n"; push @stack, "$intro$total_size\n";
} }
...@@ -162,7 +167,7 @@ while (my $line = <STDIN>) { ...@@ -162,7 +167,7 @@ while (my $line = <STDIN>) {
$total_size += $size; $total_size += $size;
} }
} }
if ($total_size > 100) { if ($total_size > $min_stack) {
push @stack, "$intro$total_size\n"; push @stack, "$intro$total_size\n";
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment