我正在努力工作/设置Systemtap工具,以便在虚拟Linux上分析操作系统进程。我正在使用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
语义错误:libdwfl失败 处理调试信息时出现问题。在大多数情况下,此错误是由安装kernel-debuginfo软件包引起的,该软件包的版本与探测的内核完全不匹配。已安装的kernel-debuginfo包本身可能存在一些一致性或正确性问题。
我没有找到关于“kernel-debuginfo”包的相关信息。我也尝试了没有好处的详细选项。我甚至尝试使用虚拟机的旧快照。有什么想法吗?
我跑的.stp程序的代码:
probe timer.profile{
printf("Process: %s\n", execname())
printf("Process ID: %d\n", pid())
}
答案 0 :(得分:0)
Found the problem!!!! It seemed that I was using the wrong version of the Linux Kernel. I was using the default kernel supplied by the version I wrote in the question. It seems that that version (the 2.6.32-5-686 one) has problems with the debug-info so all I did was try the same with another version (the Linux version 3.9.6 with gcc version 4.7.2 Debian 4.7.2-5) and it worked without trouble :)