<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/scripts/gdb/linux/symbols.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-11-20T22:03:42+00:00</updated>
<entry>
<title>scripts/gdb/symbols: make BPF debug info available to GDB</title>
<updated>2025-11-20T22:03:42+00:00</updated>
<author>
<name>Ilya Leoshkevich</name>
<email>iii@linux.ibm.com</email>
</author>
<published>2025-11-06T12:43:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=581ee79a254759ea8288057f762389820b39adcc'/>
<id>urn:sha1:581ee79a254759ea8288057f762389820b39adcc</id>
<content type='text'>
One can debug BPF programs with QEMU gdbstub by setting a breakpoint on
bpf_prog_kallsyms_add(), waiting for a hit with a matching aux.name, and
then setting a breakpoint on bpf_func.  This is tedious, error-prone, and
also lacks line numbers.

Automate this in a way similar to the existing support for modules in
lx-symbols.

Enumerate and monitor changes to both BPF kallsyms and JITed progs.  For
each ksym, generate and compile a synthetic .s file containing the name,
code, and size.  In addition, if this ksym is also a prog, and not a
trampoline, add line number information.

Ensure that this is a no-op if the kernel is built without BPF support or
if "as" is missing.  In theory the "as" dependency may be dropped by
generating the synthetic .o file manually, but this is too much complexity
for too little benefit.

Now one can debug BPF progs out of the box like this:

    (gdb) lx-symbols -bpf
    (gdb) b bpf_prog_4e612a6a881a086b_arena_list_add
    Breakpoint 2 (bpf_prog_4e612a6a881a086b_arena_list_add) pending.

    # ./test_progs -t arena_list

    Thread 4 hit Breakpoint 2, bpf_prog_4e612a6a881a086b_arena_list_add ()
        at linux/tools/testing/selftests/bpf/progs/arena_list.c:51
    51              list_head = &amp;global_head;
    (gdb) n
    bpf_prog_4e612a6a881a086b_arena_list_add () at linux/tools/testing/selftests/bpf/progs/arena_list.c:53
    53              for (i = zero; i &lt; cnt &amp;&amp; can_loop; i++) {

This also works for subprogs.

Link: https://lkml.kernel.org/r/20251106124600.86736-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: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: Andrii Nakryiko &lt;andrii@kernel.org&gt;
Cc: Daniel Borkman &lt;daniel@iogearbox.net&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: make lx-symbols skip the s390 decompressor</title>
<updated>2025-07-10T12:42:10+00:00</updated>
<author>
<name>Ilya Leoshkevich</name>
<email>iii@linux.ibm.com</email>
</author>
<published>2025-06-25T15:36:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b6d0427cfc699243fc1f82087b58f63d389321aa'/>
<id>urn:sha1:b6d0427cfc699243fc1f82087b58f63d389321aa</id>
<content type='text'>
When one starts QEMU with the -S flag and attaches GDB, the kernel is
not yet loaded, and the current instruction is an entry point to the
decompressor. In case the intention is to debug the early kernel boot,
and not the decompressor, e.g., put a breakpoint on some kernel
function and see all the invocations, one has to skip the decompressor.

There are many ways to do this, and so far people wrote private scripts
or memorized certain command sequences.

Make it work out of the box like this:

    $ gdb -ex 'target remote :6812' -ex 'source vmlinux-gdb.py' vmlinux
    Remote debugging using :6812
    0x0000000000010000 in ?? ()
    (gdb) lx-symbols
    loading vmlinux
    (gdb) x/i $pc
    =&gt; 0x3ffe0100000 &lt;startup_continue&gt;:    lghi    %r2,0

Implement this by reading the address of the jump_to_kernel() function
from the lowcore, and step until DAT is turned on.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Acked-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Tested-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20250625154220.75300-3-iii@linux.ibm.com
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>scripts/gdb/symbols: determine KASLR offset on s390 during early boot</title>
<updated>2025-05-21T17:48:25+00:00</updated>
<author>
<name>Ilya Leoshkevich</name>
<email>iii@linux.ibm.com</email>
</author>
<published>2025-05-15T15:52:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c164679bed3a5f0d235723c2395d9a5122b151c4'/>
<id>urn:sha1:c164679bed3a5f0d235723c2395d9a5122b151c4</id>
<content type='text'>
Using lx-symbols during s390 early boot fails with:

    Error occurred in Python: 'utf-8' codec can't decode byte 0xcb in position 0: invalid continuation byte

The reason is that s390 decompressor's startup_kernel() does not create
vmcoreinfo note, and sets vmcore_info to kernel's physical base.  This
confuses get_vmcore_s390().

Fix by handling this special case.  Extract vm_layout.kaslr_offset from
the kernel image in physical memory, which is placed there by the
decompressor using the __bootdata_preserved mechanism, and generate a
synthetic vmcoreinfo note from it.

Link: https://lkml.kernel.org/r/20250515155811.114392-4-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 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/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/linux/symbols.py: address changes to module_sect_attrs</title>
<updated>2025-03-17T19:16:59+00:00</updated>
<author>
<name>Antonio Quartulli</name>
<email>antonio@mandelbit.com</email>
</author>
<published>2025-02-21T20:40:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e0349c46cb4fbbb507fa34476bd70f9c82bad359'/>
<id>urn:sha1:e0349c46cb4fbbb507fa34476bd70f9c82bad359</id>
<content type='text'>
When loading symbols from kernel modules we used to iterate
from 0 to module_sect_attrs::nsections, in order to
retrieve their name and address.

However module_sect_attrs::nsections has been removed from
the struct by a previous commit.

Re-arrange the iteration by accessing all items in
module_sect_attrs::grp::bin_attrs[] until NULL is found
(it's a NULL terminated array).

At the same time the symbol address cannot be extracted
from module_sect_attrs::attrs[]::address anymore because
it has also been deleted. Fetch it from
module_sect_attrs::grp::bin_attrs[]::private as described
in 4b2c11e4aaf7.

Link: https://lkml.kernel.org/r/20250221204034.4430-1-antonio@mandelbit.com
Fixes: d8959b947a8d ("module: sysfs: Drop member 'module_sect_attrs::nsections'")
Fixes: 4b2c11e4aaf7 ("module: sysfs: Drop member 'module_sect_attr::address'")
Signed-off-by: Antonio Quartulli &lt;antonio@mandelbit.com&gt;
Reviewed-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Cc: Kieran Bingham &lt;kbingham@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>gdb: lx-symbols: do not error out on monolithic build</title>
<updated>2024-11-15T06:51:14+00:00</updated>
<author>
<name>Etienne Buira</name>
<email>etienne.buira@free.fr</email>
</author>
<published>2024-11-08T16:45:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2c259a91d8d23a8266092b0dd51b8092877717a4'/>
<id>urn:sha1:2c259a91d8d23a8266092b0dd51b8092877717a4</id>
<content type='text'>
This avoids spurious message:
(gdb) lx-symbols
loading vmlinux
No source file named kernel/module/main.c.

Link: https://lkml.kernel.org/r/Zy5ALByQtpO-ddh4@Z926fQmE5jqhFMgp6
Signed-off-by: Etienne Buira &lt;etienne.buira@free.fr&gt;
Cc: Andrew Ballance &lt;andrewjballance@gmail.com&gt;
Cc: Kieran Bingham &lt;kbingham@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scripts/gdb/symbols: fix invalid escape sequence warning</title>
<updated>2024-03-08T00:14:19+00:00</updated>
<author>
<name>Andrew Ballance</name>
<email>andrewjballance@gmail.com</email>
</author>
<published>2024-03-04T01:25:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ded79af42f114bb89f8e90c8e7337f5b7bb5f015'/>
<id>urn:sha1:ded79af42f114bb89f8e90c8e7337f5b7bb5f015</id>
<content type='text'>
With python 3.12, '\.' results in this warning
    SyntaxWarning: invalid escape sequence '\.'

Link: https://lkml.kernel.org/r/20240304012507.240380-1-andrewjballance@gmail.com
Signed-off-by: Andrew Ballance &lt;andrewjballance@gmail.com&gt;
Cc: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Cc: Kieran Bingham &lt;kbingham@kernel.org&gt;
Cc: Koudai Iwahori &lt;koudai@google.com&gt;
Cc: Kuan-Ying Lee &lt;Kuan-Ying.Lee@mediatek.com&gt;
Cc: Luis Chamberlain &lt;mcgrof@kernel.org&gt;
Cc: Pankaj Raghav &lt;p.raghav@samsung.com&gt;
Cc: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>revert "scripts/gdb/symbols: add specific ko module load command"</title>
<updated>2023-09-19T20:21:33+00:00</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@linux-foundation.org</email>
</author>
<published>2023-09-12T16:19:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=493d4eecf45d15bb1850832f5f5ece2556308646'/>
<id>urn:sha1:493d4eecf45d15bb1850832f5f5ece2556308646</id>
<content type='text'>
Revert 11f956538c07 ("scripts/gdb/symbols: add specific ko module load
command") due to breakage identified by Johannes Berg in [1].

Fixes: 11f956538c07 ("scripts/gdb/symbols: add specific ko module load command")
Reported-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Closes: https://lkml.kernel.org/r/c44b748307a074d0c250002cdcfe209b8cce93c9.camel@sipsolutions.net [1]
Cc: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Cc: Chinwen Chang &lt;chinwen.chang@mediatek.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: 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>
</feed>
