网上看到一篇@digoal写的文章,
http://blog.163.com/digoal@126/blog/static/163877040201310255717379/
打算在做这个设置,但是使用SystemTap 一直报错,请大神帮忙指点。
开始报错很多,我已经参考下面的文章 ,安装了跟我内核匹配的rpm包。
http://blog.163.com/digoal@126/blog/static/163877040201310113462317/
[root@localhost ~]# rpm -qa|grep coreutils
coreutils-debuginfo-8.4-19.el6.x86_64
coreutils-libs-8.4-19.el6.x86_64
coreutils-8.4-19.el6.x86_64
policycoreutils-2.0.83-19.30.el6.x86_64
[root@localhost ~]# rpm -qa|grep kernel-debuginfo
kernel-debuginfo-common-x86_64-2.6.32-573.18.1.el6.x86_64
kernel-debuginfo-2.6.32-573.18.1.el6.x86_64
[root@localhost ~]# uname -r
2.6.32-573.18.1.el6.x86_64
开启postgres:
-bash-4.1$ taskset -c 1 /usr/pgsql-9.2/bin/postgres >/dev/null 2>&1
进程号:
[root@localhost ~]# su - postgres
-bash-4.1$ psql
psql (9.2.14)
Type "help" for help.
postgres=# select pg_backend_pid();
2486
(1 row)
报错信息:
[root@localhost ~]# taskset -c 0 stap -e '
global a
probe process("/usr/pgsql-9.2/bin/postgres").mark("query__start") {
delete a
println("query__start ", user_string($arg1), "pid:", pid())
}
probe vfs.read.return {
t = gettimeofday_ns() - @entry(gettimeofday_ns())
# if (execname() == "postgres" && devname != "N/A")a[pid()] <<< t
}
probe process("/usr/pgsql-9.2/bin/postgres").mark("query__done") {
if (@count(a[pid()]))printdln("**", pid(), @count(a[pid()]), @avg(a[pid()]))
println("query__done ", user_string($arg1), "pid:", pid())
if (@count(a[pid()])) {println(@hist_log(a[pid()])) #println(@hist_linear(a[pid()],1024,4096,100))
}
delete a
}' -x 2486
semantic error: while resolving probe point: identifier 'process' at :3:7source: probe process("/usr/pgsql-9.2/bin/postgres").mark("query__start") { ^
semantic error: no match
Pass 2: analysis failed. [man error::pass2]
Number of similar error messages suppressed: 1.
Rerun with -v to see them.
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
检查一下PostgreSQL编译时有没有开启dtrace和debug
同时检查一下stap的版本