<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/scripts/gdb/linux/utils.py, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-05-21T17:48:24+00:00</updated>
<entry>
<title>scripts/gdb/symbols: factor out pagination_off()</title>
<updated>2025-05-21T17:48:24+00:00</updated>
<author>
<name>Ilya Leoshkevich</name>
<email>iii@linux.ibm.com</email>
</author>
<published>2025-05-15T15:52:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e97c4a27cb9c4c06fdc6d0760d7ea031c98b58a5'/>
<id>urn:sha1:e97c4a27cb9c4c06fdc6d0760d7ea031c98b58a5</id>
<content type='text'>
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 &lt;iii@linux.ibm.com&gt;
Cc: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Cc: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Cc: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Kieran Bingham &lt;kbingham@kernel.org&gt;
Cc: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scripts/gdb/symbols: factor out get_vmlinux()</title>
<updated>2025-05-21T17:48:24+00:00</updated>
<author>
<name>Ilya Leoshkevich</name>
<email>iii@linux.ibm.com</email>
</author>
<published>2025-05-15T15:52:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3545414f2590177a76f86c985130dc4824d3adc9'/>
<id>urn:sha1:3545414f2590177a76f86c985130dc4824d3adc9</id>
<content type='text'>
Patch series "scripts/gdb/symbols: determine KASLR offset on s390 during
early boot".

I noticed that debugging s390 early boot using the support I introduced in
commit 28939c3e9925 ("scripts/gdb/symbols: determine KASLR offset on
s390") does not work.

The reason is that decompressor does not provide the vmcoreinfo note, so
KASLR offset needs to be extracted in a different way, which this series
implements.  Patches 1-2 are trivial refactorings, and patch 3 is the
implementation.


This patch (of 3):

Move the code that determines the current vmlinux file into a separate
function.  It will be useful later in order to analyze the kernel image in
physical memory during s390 early boot.

Link: https://lkml.kernel.org/r/20250515155811.114392-1-iii@linux.ibm.com
Link: https://lkml.kernel.org/r/20250515155811.114392-2-iii@linux.ibm.com
Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Cc: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Cc: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Cc: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Kieran Bingham &lt;kbingham@kernel.org&gt;
Cc: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scripts/gdb: fix kgdb probing on single-core systems</title>
<updated>2025-05-12T00:54:13+00:00</updated>
<author>
<name>Illia Ostapyshyn</name>
<email>illia@yshyn.com</email>
</author>
<published>2025-05-03T12:32:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6be7045c7756caf2d445dc66473e45ac5779cd55'/>
<id>urn:sha1:6be7045c7756caf2d445dc66473e45ac5779cd55</id>
<content type='text'>
Patch series "scripts/gdb: Fixes related to lx_per_cpu()".

These patches (1) fix kgdb detection on systems featuring a single CPU and
(2) update the documentation to reflect the current usage of lx_per_cpu()
and update an outdated example of its usage.


This patch (of 2):

When requested the list of threads via qfThreadInfo, gdb_cmd_query in
kernel/debug/gdbstub.c first returns "shadow" threads for CPUs followed by
the actual tasks in the system.  Extended qThreadExtraInfo queries yield
"shadowCPU%d" as the name for the CPU core threads.

This behavior is used by get_gdbserver_type() to probe for KGDB by
matching the name for the thread 2 against "shadowCPU".  This breaks down
on single-core systems, where thread 2 is the first nonshadow thread. 
Request the name for thread 1 instead.

As GDB assigns thread IDs in the order of their appearance, it is safe to
assume shadowCPU0 at ID 1 as long as CPU0 is not hotplugged.

Before:

(gdb) info threads
  Id   Target Id                      Frame
  1    Thread 4294967294 (shadowCPU0) kgdb_breakpoint ()
* 2    Thread 1 (swapper/0)           kgdb_breakpoint ()
  3    Thread 2 (kthreadd)            0x0000000000000000 in ?? ()
  ...
(gdb) p $lx_current().comm
Sorry, obtaining the current CPU is not yet supported with this gdb server.

After:

(gdb) info threads
  Id   Target Id                      Frame
  1    Thread 4294967294 (shadowCPU0) kgdb_breakpoint ()
* 2    Thread 1 (swapper/0)           kgdb_breakpoint ()
  3    Thread 2 (kthreadd)            0x0000000000000000 in ?? ()
  ...
(gdb) p $lx_current().comm
$1 = "swapper/0\000\000\000\000\000\000"

Link: https://lkml.kernel.org/r/20250503123234.2407184-1-illia@yshyn.com
Link: https://lkml.kernel.org/r/20250503123234.2407184-2-illia@yshyn.com
Signed-off-by: Illia Ostapyshyn &lt;illia@yshyn.com&gt;
Cc: Alex Shi &lt;alexs@kernel.org&gt;
Cc: Brendan Jackman &lt;jackmanb@google.com&gt;
Cc: Dongliang Mu &lt;dzm91@hust.edu.cn&gt;
Cc: Florian Rommel &lt;mail@florommel.de&gt;
Cc: Hu Haowen &lt;2023002089@link.tyut.edu.cn&gt;
Cc: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Kieran Bingham &lt;kbingham@kernel.org&gt;
Cc: Yanteng Si &lt;si.yanteng@linux.dev&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scripts/gdb/symbols: determine KASLR offset on s390</title>
<updated>2025-03-17T19:17:00+00:00</updated>
<author>
<name>Ilya Leoshkevich</name>
<email>iii@linux.ibm.com</email>
</author>
<published>2025-03-03T11:03:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=28939c3e9925735166e7b6e42f9e1dc828093510'/>
<id>urn:sha1:28939c3e9925735166e7b6e42f9e1dc828093510</id>
<content type='text'>
Use QEMU's qemu.PhyMemMode [1] functionality to read vmcore from the
physical memory the same way the existing dump tooling does this. 
Gracefully handle non-QEMU targets, early boot, and memory corruptions;
print a warning if such situation is detected.

[1] https://qemu-project.gitlab.io/qemu/system/gdb.html#examining-physical-memory

Link: https://lkml.kernel.org/r/20250303110437.79070-1-iii@linux.ibm.com
Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Acked-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Cc: Andrew Donnellan &lt;ajd@linux.ibm.com&gt;
Cc: Christian Borntraeger &lt;borntraeger@linux.ibm.com&gt;
Cc: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Cc: Kieran Bingham &lt;kbingham@kernel.org&gt;
Cc: Nina Schoetterl-Glausch &lt;nsg@linux.ibm.com&gt;
Cc: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scripts/gdb: fix failing KGDB detection during probe</title>
<updated>2024-05-08T15:41:27+00:00</updated>
<author>
<name>Florian Rommel</name>
<email>mail@florommel.de</email>
</author>
<published>2024-04-25T15:34:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ec0b6d17a5f89da2182ec8e2f978c20bbedf6ae2'/>
<id>urn:sha1:ec0b6d17a5f89da2182ec8e2f978c20bbedf6ae2</id>
<content type='text'>
Patch series "scripts/gdb: Fixes for $lx_current and $lx_per_cpu".

This series fixes several bugs in the GDB scripts related to the
$lx_current and $lx_per_cpu functions.  The changes were tested with GDB
10, 11, 12, 13, and 14.

Patch 1 fixes false-negative results when probing for KGDB

Patch 2 fixes the $lx_per_cpu function, which is currently non-functional
in QEMU-GDB and KGDB.

Patch 3 fixes an additional bug in $lx_per_cpu that occurs with KGDB.

Patch 4 fixes the incorrect detection of the current CPU number in KGDB,
which silently breaks $lx_per_cpu and $lx_current.


This patch (of 4):

The KGDB probe function sometimes failed to detect KGDB for SMP machines
as it assumed that task 2 (kthreadd) is running on CPU 0, which is not
necessarily the case.  Now, the detection is agnostic to kthreadd's CPU.

Link: https://lkml.kernel.org/r/20240425153501.749966-1-mail@florommel.de
Link: https://lkml.kernel.org/r/20240425153501.749966-2-mail@florommel.de
Signed-off-by: Florian Rommel &lt;mail@florommel.de&gt;
Cc: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Cc: Deepak Gupta &lt;debug@rivosinc.com&gt;
Cc: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Kieran Bingham &lt;kbingham@kernel.org&gt;
Cc: Kuan-Ying Lee &lt;Kuan-Ying.Lee@mediatek.com&gt;
Cc: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scripts/gdb/utils: add common type usage</title>
<updated>2023-08-21T20:46:22+00:00</updated>
<author>
<name>Kuan-Ying Lee</name>
<email>Kuan-Ying.Lee@mediatek.com</email>
</author>
<published>2023-08-08T08:30:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4d040cbca8e4714cc83e17778b6a28c6df41f79c'/>
<id>urn:sha1:4d040cbca8e4714cc83e17778b6a28c6df41f79c</id>
<content type='text'>
Since we often use 'unsigned long', 'size_t', 'usigned int'
and 'struct page', we add these common types to utils.

Link: https://lkml.kernel.org/r/20230808083020.22254-4-Kuan-Ying.Lee@mediatek.com
Signed-off-by: Kuan-Ying Lee &lt;Kuan-Ying.Lee@mediatek.com&gt;
Cc: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Cc: Chinwen Chang &lt;chinwen.chang@mediatek.com&gt;
Cc: Matthias Brugger &lt;matthias.bgg@gmail.com&gt;
Cc: Qun-Wei Lin &lt;qun-wei.lin@mediatek.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scripts/gdb: create linux/vfs.py for VFS related GDB helpers</title>
<updated>2023-04-18T23:39:34+00:00</updated>
<author>
<name>Glenn Washburn</name>
<email>development@efficientek.com</email>
</author>
<published>2023-03-01T00:53:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f4efbdaf59e959507a1a931ec4afecdfb09db76e'/>
<id>urn:sha1:f4efbdaf59e959507a1a931ec4afecdfb09db76e</id>
<content type='text'>
Patch series "GDB VFS utils".

I've created a couple GDB convenience functions that I found useful when
debugging some VFS issues and figure others might find them useful.  For
instance, they are useful in setting conditional breakpoints on VFS
functions where you only care if the dentry path is a certain value.  I
took the opportunity to create a new "vfs" python module to give VFS
related utilities a home.


This patch (of 2):

This will allow for more VFS specific GDB helpers to be collected in one
place.  Move utils.dentry_name into the vfs modules.  Also a local
variable in proc.py was changed from vfs to mnt to prevent a naming
collision with the new vfs module.

[akpm@linux-foundation.org: add SPDX-License-Identifier]
Link: https://lkml.kernel.org/r/cover.1677631565.git.development@efficientek.com
Link: https://lkml.kernel.org/r/7bba4c065a8c2c47f1fc5b03a7278005b04db251.1677631565.git.development@efficientek.com
Signed-off-by: Glenn Washburn &lt;development@efficientek.com&gt;
Cc: Alexander Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Antonio Borneo &lt;antonio.borneo@foss.st.com&gt;
Cc: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: John Ogness &lt;john.ogness@linutronix.de&gt;
Cc: Kieran Bingham &lt;kbingham@kernel.org&gt;
Cc: Petr Mladek &lt;pmladek@suse.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scripts/gdb: fix lx-timerlist for Python3</title>
<updated>2023-04-18T23:39:31+00:00</updated>
<author>
<name>Peng Liu</name>
<email>liupeng17@lenovo.com</email>
</author>
<published>2023-03-21T06:19:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7362042f3556528e9e9b1eb5ce8d7a3a6331476b'/>
<id>urn:sha1:7362042f3556528e9e9b1eb5ce8d7a3a6331476b</id>
<content type='text'>
Below incompatibilities between Python2 and Python3 made lx-timerlist fail
to run under Python3.

o xrange() is replaced by range() in Python3
o bytes and str are different types in Python3
o the return value of Inferior.read_memory() is memoryview object in
  Python3

akpm: cc stable so that older kernels are properly debuggable under newer
Python.

Link: https://lkml.kernel.org/r/TYCP286MB2146EE1180A4D5176CBA8AB2C6819@TYCP286MB2146.JPNP286.PROD.OUTLOOK.COM
Signed-off-by: Peng Liu &lt;liupeng17@lenovo.com&gt;
Reviewed-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Cc: Kieran Bingham &lt;kbingham@kernel.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scripts/gdb: fix 'lx-dmesg' on 32 bits arch</title>
<updated>2022-07-21T13:32:52+00:00</updated>
<author>
<name>Antonio Borneo</name>
<email>antonio.borneo@foss.st.com</email>
</author>
<published>2022-07-19T12:28:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e3c8d33e0d62175c31ca7ab7ab01b18f0b6318d3'/>
<id>urn:sha1:e3c8d33e0d62175c31ca7ab7ab01b18f0b6318d3</id>
<content type='text'>
The type atomic_long_t can have size 4 or 8 bytes, depending on
CONFIG_64BIT; it's only content, the field 'counter', is either an
int or a s64 value.

Current code incorrectly uses the fixed size utils.read_u64() to
read the field 'counter' inside atomic_long_t.

On 32 bits architectures reading the last element 'tail_id' of the
struct prb_desc_ring:
	struct prb_desc_ring {
		...
		atomic_long_t tail_id;
	};
causes the utils.read_u64() to access outside the boundary of the
struct and the gdb command 'lx-dmesg' exits with error:
	Python Exception &lt;class 'IndexError'&gt;: index out of range
	Error occurred in Python: index out of range

Query the really used atomic_long_t counter type size.

Link: https://lore.kernel.org/r/20220617143758.137307-1-antonio.borneo@foss.st.com
Fixes: e60768311af8 ("scripts/gdb: update for lockless printk ringbuffer")
Signed-off-by: Antonio Borneo &lt;antonio.borneo@foss.st.com&gt;
[pmladek@suse.com: Query the really used atomic_long_t counter type size]
Tested-by: Antonio Borneo &lt;antonio.borneo@foss.st.com&gt;
Reviewed-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20220719122831.19890-1-pmladek@suse.com
</content>
</entry>
<entry>
<title>scripts/gdb: add utils.read_ulong()</title>
<updated>2020-09-08T07:33:15+00:00</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2020-08-14T21:25:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3e0d075cb0ab3b1fbddc14855985215407f8a48b'/>
<id>urn:sha1:3e0d075cb0ab3b1fbddc14855985215407f8a48b</id>
<content type='text'>
Add a function for reading unsigned long values, which vary in size
depending on the architecture.

Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reviewed-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Tested-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Tested-by: Petr Mladek &lt;pmladek@suse.com&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20200814212525.6118-2-john.ogness@linutronix.de
</content>
</entry>
</feed>
