- 论坛徽章:
- 2
|
本帖最后由 cdsfiui 于 2017-03-23 20:07 编辑
我有两个环境,centos6.8和ubuntu16.04,都在virtualbox里面做了64位版本的虚拟机。在centos6.8上面安装了这两个包,如下信息:
- # yum install kernel-devel
- 已加载插件:fastestmirror, refresh-packagekit, security
- ...
- 包 kernel-devel-2.6.32-642.15.1.el6.x86_64 已安装并且是最新版本
- 无须任何处理
- # yum install kernel-debug
- 已加载插件:fastestmirror, refresh-packagekit, security
- ...
- 包 kernel-debug-2.6.32-642.15.1.el6.x86_64 已安装并且是最新版本
- 无须任何处理
复制代码
ubuntu上面也已经
- sudo apt-get install linux-headers-`uname -r`以及
- sudo apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge(不知道是不是还缺东西)
复制代码
两个环境都可以运行 stap -ve 'probe begin { log("hello world") exit() }' 没有问题。
然后我有这个.stp脚本,网上找到的一个入门的例子:
- cat test2.stp
- #!/usr/bin/stap
- probe begin
- {
- log("开始probe")
- }
- probe syscall.open
- {
- printf("%s(%d) open (%s)\n",execname(),pid(),argstr)
- }
- probe timer.ms(4000)#4秒以后
- {
- exit()
- }
- probe end
- {
- log("结束probe")
- }
复制代码
chmod+x这个脚本,然后用root来执行,两个环境都报出一堆的错误:
- $ sudo ./test2.stp
- [sudo] me 的密码:
- semantic error: while resolving probe point: identifier 'kernel' at /usr/share/systemtap/tapset/linux/syscalls2.stp:197:24
- source: probe __syscall.open = kernel.function("sys_open").call
- ^
- semantic error: missing x86_64 kernel/module debuginfo [man warning::debuginfo] under '/lib/modules/4.4.0-38-generic/build'
- semantic error: while resolving probe point: identifier '__syscall' at :177:47
- source: probe syscall.open = __syscall.compat_open ?, __syscall.open
- ^
- semantic error: no match
- Pass 2: analysis failed. [man error::pass2]
- Number of similar error messages suppressed: 1.
- Rerun with -v to see them.
- Tip: /usr/share/doc/systemtap/README.Debian should help you get started.
复制代码 这个是语法错误,还是缺少什么环境的依赖?
|
|