linux systemtap报错解决

使用stap命令时报如下错误

stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'

linux systemtap报错解决_第1张图片

[root@myds1 tmp]# stap /usr/share/doc/systemtap-client-2.6/examples/io/inodewatch.stp  253 1 204550458
semantic error: while resolving probe point: identifier 'kernel' at /usr/share/systemtap/tapset/linux/vfs.stp:836:19
        source: probe vfs.write = kernel.function("vfs_write")
                                  ^

semantic error: missing x86_64 kernel/module debuginfo [man warning::debuginfo] under '/lib/modules/3.10.0-229.el7.x86_64/build'

semantic error: while resolving probe point: identifier 'vfs' at /usr/share/doc/systemtap-client-2.6/examples/io/inodewatch.stp:3:7
        source: probe vfs.write, vfs.read
                      ^

semantic error: no match

Pass 2: analysis failed.  [man error::pass2]
Number of similar error messages suppressed: 2.
Rerun with -v to see them.

报错原因:

缺少kernel-debuginfo-common、kernel-debuginfo两个依赖包

解决方式:

(1)查看linux内核版本

uname -r

(2)下载与内核版本一致的rpm包

(3)安装rpm包

rpm -ivh kernel-debuginfo-common-x86_64-3.10.0-229.el7.x86_64.rpm
rpm -ivh kernel-debuginfo-3.10.0-229.el7.x86_64.rpm

linux systemtap报错解决_第2张图片

(4)重新运行测试命令

linux systemtap报错解决_第3张图片

成功运行

linux systemtap报错解决_第4张图片

你可能感兴趣的:(linux)