diff options
author | Tiezhu Yang <yangtiezhu@loongson.cn> | 2023-12-19 15:49:59 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-12-29 23:22:27 +0300 |
commit | 66d25cbe29f307c0a3c53b1b1efd0f597d0756a1 (patch) | |
tree | c370e4ed33fc0911f97eeb767ed848bf60e26a27 /scripts | |
parent | 52f5628819363cd16efd2b9f35706b33f41842b3 (diff) | |
download | linux-66d25cbe29f307c0a3c53b1b1efd0f597d0756a1.tar.xz |
scripts/checkstack.pl: match all stack sizes for some archs
For some unknown reason the regular expression for checkstack only matches
three digit numbers starting with the number "3", or any higher number.
Which means that it skips any stack sizes smaller than 304 bytes. This
makes the checkstack script a bit less useful than it could be.
Change the script to match any number. To be filtered out stack sizes can
be configured with the min_stack variable, which omits any stack frame
sizes smaller than 100 bytes by default.
This is similar with commit aab1f809d754 ("scripts/checkstack.pl: match
all stack sizes for s390").
Link: https://lkml.kernel.org/r/20231219125008.23007-4-yangtiezhu@loongson.cn
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkstack.pl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index e1af9f4fcef3..a564c46d6129 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl @@ -74,16 +74,16 @@ my (@stack, $re, $dre, $sub, $x, $xs, $funcre, $min_stack); $re = qr/.*(?:linkw %fp,|addaw )#-([0-9]{1,4})(?:,%sp)?$/o; } elsif ($arch eq 'mips64') { #8800402c: 67bdfff0 daddiu sp,sp,-16 - $re = qr/.*daddiu.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o; + $re = qr/.*daddiu.*sp,sp,-([0-9]{1,8})/o; } elsif ($arch eq 'mips') { #88003254: 27bdffe0 addiu sp,sp,-32 - $re = qr/.*addiu.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o; + $re = qr/.*addiu.*sp,sp,-([0-9]{1,8})/o; } elsif ($arch eq 'nios2') { #25a8: defffb04 addi sp,sp,-20 - $re = qr/.*addi.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o; + $re = qr/.*addi.*sp,sp,-([0-9]{1,8})/o; } elsif ($arch eq 'openrisc') { # c000043c: 9c 21 fe f0 l.addi r1,r1,-272 - $re = qr/.*l\.addi.*r1,r1,-(([0-9]{2}|[3-9])[0-9]{2})/o; + $re = qr/.*l\.addi.*r1,r1,-([0-9]{1,8})/o; } elsif ($arch eq 'parisc' || $arch eq 'parisc64') { $re = qr/.*ldo ($x{1,8})\(sp\),sp/o; } elsif ($arch eq 'powerpc' || $arch =~ /^ppc(64)?(le)?$/ ) { @@ -97,10 +97,10 @@ my (@stack, $re, $dre, $sub, $x, $xs, $funcre, $min_stack); $re = qr/.*(?:lay|ag?hi).*\%r15,-([0-9]+)(?:\(\%r15\))?$/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, -([0-9]{1,8}), %sp/o; } elsif ($arch =~ /^riscv(64)?$/) { #ffffffff8036e868: c2010113 addi sp,sp,-992 - $re = qr/.*addi.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o; + $re = qr/.*addi.*sp,sp,-([0-9]{1,8})/o; } elsif ($arch =~ /^loongarch(32|64)?$/) { #9000000000224708: 02ff4063 addi.d $sp, $sp, -48(0xfd0) $re = qr/.*addi\..*sp, .*sp, -([0-9]{1,8}).*/o; |