You are not logged in.

#1 2024-12-26 07:39:56

deepak.sharma.vardhaman
Member
Registered: 2024-12-26
Posts: 2

[SOLVED] SystemTap can't find DWARF on custom build with DEBUG_INFO

Hey there, I have been trying to debug certain issues around with kernel built using the Arch Linux build system, and I wanted to use SystemTap to probe the kernel statement, but I have not been able to get it to work

$ stap -i
Example commands: 'sample', 'add', 'run', 'help'
stap> add probe kernel.statement("*@net/sock.c:700") {}
Script analysis:
WARNING: cannot find module kernel debuginfo: No DWARF information found [man warning::debuginfo]
semantic error: while resolving probe point: identifier 'kernel' at <input>:1:7
        source: probe kernel.statement("*@net/sock.c:700") {}
                      ^

semantic error: no match

Pass 2: analysis failed.  [man error::pass2]
stap>

The kernel configuration I built with

$ cat config | grep DEBUG_INFO
CONFIG_DEBUG_INFO=y
# CONFIG_DEBUG_INFO_NONE is not set
# CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT is not set
# CONFIG_DEBUG_INFO_DWARF4 is not set
CONFIG_DEBUG_INFO_DWARF5=y
CONFIG_DEBUG_INFO_REDUCED=n
CONFIG_DEBUG_INFO_COMPRESSED_NONE=y
# CONFIG_DEBUG_INFO_COMPRESSED_ZLIB is not set
# CONFIG_DEBUG_INFO_COMPRESSED_ZSTD is not set
# CONFIG_DEBUG_INFO_SPLIT is not set
CONFIG_DEBUG_INFO_BTF=y
CONFIG_DEBUG_INFO_BTF_MODULES=y

I am definitely running the correct kernel image too, and also made sure that `DEBUG_INFO_REDUCED` is `n`

A possible guess I had was that it might be due to the DWARF mismatch, but I think that it's mostly backwards incompatible. Also, in case of stacktraces as generated by kernel in `dmesg` buffers, I noticed that the source lines are not being printed, so I'd assume that kernel really lacks information about source lines. I'd appreciate any help regarding this, thanks : )

Last edited by deepak.sharma.vardhaman (2024-12-28 13:00:10)

Offline

#2 2024-12-28 12:59:20

deepak.sharma.vardhaman
Member
Registered: 2024-12-26
Posts: 2

Re: [SOLVED] SystemTap can't find DWARF on custom build with DEBUG_INFO

I was able to solve it. So the `vmlinux` with DEBUG_INFO was indeed built by the build system and kept in the `src/linux-x.xx.x` directory, the one installed was for some reason without debug_info. The easy way out was to pick that `vmlinux` and keep it one of the directories where the SystemTap may look for it https://sourceware.org/systemtap/wiki/SystemTapFAQ

Offline

Board footer

Powered by FluxBB