开发者社区> 问答> 正文

关于 cost constants 的校准

已解决

网上看到一篇@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();

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:7

    source: 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.

展开
收起
大鹏888 2016-02-15 16:37:53 3076 0
1 条回答
写回答
取消 提交回答
  • 公益是一辈子的事, I am digoal, just do it. 阿里云数据库团队, 擅长PolarDB, PostgreSQL, DuckDB, ADB等, 长期致力于推动开源数据库技术、生态在中国的发展与开源产业人才培养. 曾荣获阿里巴巴麒麟布道师称号、2018届OSCAR开源尖峰人物.
    采纳回答

    检查一下PostgreSQL编译时有没有开启dtrace和debug
    同时检查一下stap的版本

    2019-07-17 18:28:52
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载