CentOS 7上最新的kernel-debuginfo包,是kernel-debuginfo-4.x.x-x.el7,而当前内核是kernel-3.10.0。因此,如果安装或者升级到了最新的kernel-debuginfo包,会导致类似SystemTap这样需要内核头文件和调试符号的工具执行出错。这是CentOS 7的bug。
以SystemTap为例,其报错大致如下
[root@pusf ~]# rpm -qa | grep kernel-debuginfo
kernel-debuginfo-4.9.31-203.el7.centos.x86_64
kernel-debuginfo-common-x86_64-4.9.31-203.el7.centos.x86_64[root@pusf ~]
[root@pusf ~]# stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'
Pass 1: parsed user script and 119 library scripts using 117224virt/33688res/3120shr/30824data kb, in 240usr/10sys/292real ms.
semantic error: while resolving probe point: identifier 'kernel' at /usr/share/systemtap/tapset/linux/vfs.stp:882:18
source: probe vfs.read