aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gdb/linux/utils.py
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2025-05-15 17:52:12 +0200
committerAndrew Morton <akpm@linux-foundation.org>2025-05-21 10:48:24 -0700
commite97c4a27cb9c4c06fdc6d0760d7ea031c98b58a5 (patch)
treee03d425df1636aa789f6bf1b42140b66ba26dd3e /scripts/gdb/linux/utils.py
parentscripts/gdb/symbols: factor out get_vmlinux() (diff)
downloadlinux-rng-e97c4a27cb9c4c06fdc6d0760d7ea031c98b58a5.tar.xz
linux-rng-e97c4a27cb9c4c06fdc6d0760d7ea031c98b58a5.zip
scripts/gdb/symbols: factor out pagination_off()
Move the code that turns off pagination into a separate function. It will be useful later in order to prevent hangs when loading symbols for kernel image in physical memory during s390 early boot. Link: https://lkml.kernel.org/r/20250515155811.114392-3-iii@linux.ibm.com Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Cc: Alexander Gordeev <agordeev@linux.ibm.com> Cc: Heiko Carstens <hca@linux.ibm.com> Cc: Jan Kiszka <jan.kiszka@siemens.com> Cc: Kieran Bingham <kbingham@kernel.org> Cc: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
-rw-r--r--scripts/gdb/linux/utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/gdb/linux/utils.py b/scripts/gdb/linux/utils.py
index 6e125830d3f2..e11f6f67961a 100644
--- a/scripts/gdb/linux/utils.py
+++ b/scripts/gdb/linux/utils.py
@@ -260,3 +260,14 @@ def get_vmlinux():
obj.filename.endswith('vmlinux.debug')):
vmlinux = obj.filename
return vmlinux
+
+
+@contextlib.contextmanager
+def pagination_off():
+ show_pagination = gdb.execute("show pagination", to_string=True)
+ pagination = show_pagination.endswith("on.\n")
+ gdb.execute("set pagination off")
+ try:
+ yield
+ finally:
+ gdb.execute("set pagination %s" % ("on" if pagination else "off"))