linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qian Cai <cai@lca.pw>
To: akpm@linux-foundation.org
Cc: catalin.marinas@arm.com, will.deacon@arm.com,
	linux-kernel@vger.kernel.org, Qian Cai <cai@lca.pw>
Subject: [PATCH] checkstack.pl: dynamic stack growth for aarch64
Date: Fri,  7 Dec 2018 21:51:43 -0500	[thread overview]
Message-ID: <20181208025143.39363-1-cai@lca.pw> (raw)

This is to track dynamic amount of stack growth for aarch64, so it is
possible to print out offensive functions that may consume too much
stack. For example,

0xffff2000084d1270 try_to_unmap_one [vmlinux]:		Dynamic (0xcf0)
0xffff200008538358 migrate_page_move_mapping [vmlinux]:	Dynamic (0xc60)
0xffff2000081276c8 copy_process.isra.2 [vmlinux]:	Dynamic (0xb20)
0xffff200008424958 show_free_areas [vmlinux]:		Dynamic (0xb40)
0xffff200008545178 __split_huge_pmd_locked [vmlinux]:	Dynamic (0xb30)
0xffff200008555120 collapse_shmem [vmlinux]:		Dynamic (0xbc0)
0xffff20000862e0d0 do_direct_IO [vmlinux]:		Dynamic (0xb70)
0xffff200008cc0aa0 md_do_sync [vmlinux]:		Dynamic (0xb90)

Signed-off-by: Qian Cai <cai@lca.pw>
---
 scripts/checkstack.pl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index 34414c6efad6..122aef5e4e14 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -48,7 +48,9 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
 	$funcre = qr/^$x* <(.*)>:$/;
 	if ($arch eq 'aarch64') {
 		#ffffffc0006325cc:       a9bb7bfd        stp     x29, x30, [sp, #-80]!
+		#a110:       d11643ff        sub     sp, sp, #0x590
 		$re = qr/^.*stp.*sp, \#-([0-9]{1,8})\]\!/o;
+		$dre = qr/^.*sub.*sp, sp, #(0x$x{1,8})/o;
 	} elsif ($arch eq 'arm') {
 		#c0008ffc:	e24dd064	sub	sp, sp, #100	; 0x64
 		$re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o;
-- 
2.17.2 (Apple Git-113)


                 reply	other threads:[~2018-12-08  2:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181208025143.39363-1-cai@lca.pw \
    --to=cai@lca.pw \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).