使用stap命令时报如下错误

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

linux systemtap报错解决

[[email protected] 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

linux systemtap报错解决

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

linux systemtap报错解决

(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报错解决

(4)重新运行测试命令

linux systemtap报错解决

成功运行

linux systemtap报错解决

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2021-06-24
  • 2022-12-23
  • 2021-04-15
猜你喜欢
  • 2022-12-23
  • 2021-12-27
  • 2021-05-24
  • 2021-08-04
  • 2022-12-23
  • 2021-07-09
  • 2022-01-09
相关资源
相似解决方案