Linux 上的 Systemtap libdwfl 错误

Systemtap libdwfl error on Linux

我正在绑定 work/setup Systemtap 工具,用于在虚拟 Linux 上分析 OS 进程。我正在使用 VirtualBox 运行 图像。通过

rpm -q kernel

cat /proc/version

获取的版本为:

Linux version 2.6.32-5-686 (Debian 2.6.32-48squeeze4)

我已经正确下载并安装了该工具并编写了一个简单的程序(.stp)。但是我一直报同样的错误,我找了很多地方的资料都没有成功:

执行后:

sudo stap my_profiler.stp

我得到:

semantic error: libdwfl failure (all kernel modules found): no error
Pass 3: translation failed. Try again with another '--vp 001' option.

根据https://sourceware.org/systemtap/SystemTap_Beginners_Guide/errors.html

⁠semantic error: libdwfl failure There was a problem processing the debugging information. In most cases, this error results from the installation of a kernel-debuginfo package whose version does not match the probed kernel exactly. The installed kernel-debuginfo package itself may have some consistency or correctness problems.

我没有找到关于"kernel-debuginfo"包的相关信息。我也尝试过冗长的选项但没有任何好处。我什至尝试使用 VM 的旧快照。有什么想法吗?

我的.stp程序代码运行:

probe timer.profile{
    printf("Process: %s\n", execname())
    printf("Process ID: %d\n", pid())
}

找到问题了!!!!似乎我使用了错误版本的 Linux 内核。我使用的是我在问题中写的版本提供的默认内核。似乎该版本(2.6.32-5-686 版本)在 debug-info 方面存在问题,所以我所做的就是对另一个版本(Linux 版本 3.9.6 与 gcc 版本 4.7.2 Debian 4.7.2-5) 并且它工作顺利:)