Skip to content

Commit ee34db3

Browse files
hcahcaakpm00
authored andcommitted
checkstack: fix printed address
All addresses printed by checkstack have an extra incorrect 0 appended at the end. This was introduced with commit 677f141 ("scripts/checkstack.pl: don't display $dre as different entity"): since then the address is taken from the line which contains the function name, instead of the line which contains stack consumption. E.g. on s390: 0000000000100a30 <do_one_initcall>: ... 100a44: e3 f0 ff 70 ff 71 lay %r15,-144(%r15) So the used regex which matches spaces and hexadecimal numbers to extract an address now matches a different substring. Subsequently replacing spaces with 0 appends a zero at the and, instead of replacing leading spaces. Fix this by using the proper regex, and simplify the code a bit. Link: https://lkml.kernel.org/r/[email protected] Fixes: 677f141 ("scripts/checkstack.pl: don't display $dre as different entity") Signed-off-by: Heiko Carstens <[email protected]> Cc: Maninder Singh <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Vaneet Narang <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent f42ce5f commit ee34db3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

scripts/checkstack.pl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,11 @@ sub arm_push_handling {
139139
while (my $line = <STDIN>) {
140140
if ($line =~ m/$funcre/) {
141141
$func = $1;
142-
next if $line !~ m/^($xs*)/;
142+
next if $line !~ m/^($x*)/;
143143
if ($total_size > $min_stack) {
144144
push @stack, "$intro$total_size\n";
145145
}
146-
147-
$addr = $1;
148-
$addr =~ s/ /0/g;
149-
$addr = "0x$addr";
150-
146+
$addr = "0x$1";
151147
$intro = "$addr $func [$file]:";
152148
my $padlen = 56 - length($intro);
153149
while ($padlen > 0) {

0 commit comments

Comments
 (0)