Skip to contentSkip to conversation

checkstack-fix-printed-address.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Dec 7, 2023 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: checkstack: fix printed address
has been removed from the -mm tree. Its filename was
checkstack-fix-printed-address.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Heiko Carstens <[email protected]>
Subject: checkstack: fix printed address
Date: Mon, 20 Nov 2023 19:37:17 +0100

All addresses printed by checkstack have an extra incorrect 0 appended at the end.

This was introduced with commit 677f1410e058 ("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.

Fixes 677f1410e058 ("scripts/checkstack.pl: don't display $dre as different entity")
Cc Maninder Singh <[email protected]>
Cc Masahiro Yamada <[email protected]>
Cc Vaneet Narang <[email protected]>

---

 scripts/checkstack.pl |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
scripts/checkstack.pl renamed from scripts/checkstack.pl~checkstack-fix-printed-address +2 -6
@@ -139,15 +139,11 @@ $total_size = 0;
 while (my $line = <STDIN>) {
 	if ($line =~ m/$funcre/) {
 		$func = $1;
-		next if $line !~ m/^($xs*)/;
+		next if $line !~ m/^($x*)/;
 		if ($total_size > $min_stack) {
 			push @stack, "$intro$total_size\n";
 		}
-
-		$addr = $1;
-		$addr =~ s/ /0/g;
-		$addr = "0x$addr";
-
+		$addr = "0x$1";
 		$intro = "$addr $func [$file]:";
 		my $padlen = 56 - length($intro);
 		while ($padlen > 0) {

_

Patches currently in -mm which might be from [email protected] are

arch-remove-arch_thread_stack_allocator.patch arch-remove-arch_task_struct_allocator.patch arch-remove-arch_task_struct_on_stack.patch checkstack-sort-output-by-size-and-function-name.patch checkstack-allow-to-pass-minstacksize-parameter.patch