sample-bt-off-cpu使用过程中遇到的问题

195 views
Skip to first unread message

周李洋

unread,
May 13, 2014, 12:16:55 AM5/13/14
to open...@googlegroups.com
HI 章老师,
我在使用sample-bt-off-cpu过程中遇到了这样的一个问题
./sample-bt-off-cpu -p 8467 -t 5 > 11.bt
stap: /data/elfutils-0.150/libdwfl/derelocate.c:243: dwfl_module_relocations: Assertion `mod->debug.address_sync == mod->main.address_sync' failed.

./sample-bt-off-cpu -p 8467 -t 5 -a '-vw'> 11.bt的结果为
Pass 1: parsed user script and 102 library script(s) using 106704virt/26152res/2116shr/24820data kb, in 370usr/10sys/383real ms.
Pass 2: analyzed script: 5 probe(s), 13 function(s), 5 embed(s), 4 global(s) using 128912virt/49488res/3156shr/47028data kb, in 530usr/340sys/870real ms.
stap: /data/elfutils-0.150/libdwfl/derelocate.c:243: dwfl_module_relocations: Assertion `mod->debug.address_sync == mod->main.address_sync' failed.
不知应该如何解决呢?
谢谢~

周李洋

unread,
May 13, 2014, 12:30:14 AM5/13/14
to open...@googlegroups.com
PS:使用sample-bt-leaks.sxx出现另外一个问题
./sample-bt-leaks.sxx -x 8467  time=5 -D STP_NO_OVERLOAD -D MAXMAPENTRIES=10000 -v > a.bt

parse error: expected literal string or number
saw: operator ':' at ./sample-bt-leaks.sxx:52:33
     source:                 $*sizeof_size_t := &@cast(0, "size_t")[1]
                                             ^

parse error: expected literal string or number
saw: identifier '$' at ./sample-bt-leaks.sxx:88:15
     source: probe timer.s($^arg_time)
                           ^

2 parse errors.
Pass 1: parsed user script and 102 library script(s) using 106688virt/26272res/2220shr/24804data kb, in 360usr/20sys/383real ms.
Pass 1: parse failed.  [man error::pass1]


在 2014年5月13日星期二UTC+8下午12时16分55秒,周李洋写道:

Yichun Zhang (agentzh)

unread,
May 13, 2014, 1:26:46 AM5/13/14
to openresty
Hello!

On Mon, May 12, 2014 at 9:16 PM, 周李洋 wrote:
> 我在使用sample-bt-off-cpu过程中遇到了这样的一个问题
> ./sample-bt-off-cpu -p 8467 -t 5 > 11.bt
> stap: /data/elfutils-0.150/libdwfl/derelocate.c:243:
> dwfl_module_relocations: Assertion `mod->debug.address_sync ==
> mod->main.address_sync' failed.
>

建议把 systemtap 和其依赖项 elfutils 都升级到最新版:

http://openresty.org/#BuildSystemtap

> ./sample-bt-leaks.sxx -x 8467 time=5 -D STP_NO_OVERLOAD -D MAXMAPENTRIES=10000 -v > a.bt
>
> parse error: expected literal string or number
> saw: operator ':' at ./sample-bt-leaks.sxx:52:33
> source: $*sizeof_size_t := &@cast(0, "size_t")[1]
> ^

你这里是使用 stapxx 项目中的 stap++ 工具运行这个 ./sample-bt-leaks.sxx 脚本的么?怎么感觉你是直接拿
stap 工具运行它的?

Regards,
-agentzh

周李洋

unread,
May 13, 2014, 1:46:03 AM5/13/14
to open...@googlegroups.com
HI 章老师
sample-bt-leaks是使用stap++来用的,
不过现在变成这个报错了。

WARNING: cannot find module /lib64/libc-2.5.so debuginfo: No DWARF information found [man warning::debuginfo]
semantic error: unresolved target-symbol expression: identifier '$oldmem' at <input>:33:23
        source:                 ptr = $oldmem
                                      ^

semantic error: type definition 'size_t' not found in '/lib64/libc-2.5.so': operator '@cast' at :53:28
        source:                 p = ptr - &@cast(0, "size_t")[1]
                                           ^

Pass 2: analysis failed.  [man error::pass2]
Number of similar error messages suppressed: 11.
Number of similar warning messages suppressed: 35.

在 2014年5月13日星期二UTC+8下午1时26分46秒,agentzh写道:

周李洋

unread,
May 13, 2014, 4:51:40 AM5/13/14
to open...@googlegroups.com
春哥
且根据您建议的
中的方式安装最新版本
会在make systemtap的过程中出现一个问题。
gcc -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"/usr/local/systemtap/share/locale"' -DIS_LIBDW -I. -I../../../../elfutils-0.157/libdw -I..  -I. -I../../../../elfutils-0.157/libdw -I../../../../elfutils-0.157/lib -I.. -I../../../../elfutils-0.157/libdw/../libelf  -std=gnu99 -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2    -g -O2 -D_BSD_SOURCE -fstack-protector-all -D_FORTIFY_SOURCE=2 -fgnu89-inline -fexceptions -MT dwarf_begin_elf.o -MD -MP -MF .deps/dwarf_begin_elf.Tpo -c -o dwarf_begin_elf.o ../../../../elfutils-0.157/libdw/dwarf_begin_elf.c
cc1: warnings being treated as errors
../../../../elfutils-0.157/libdw/dwarf_begin_elf.c: In function ‘check_section’:
../../../../elfutils-0.157/libdw/dwarf_begin_elf.c:282: warning: implicit declaration of function ‘be64toh’
make[4]: *** [dwarf_begin_elf.o] Error 1
make[4]: Leaving directory `/data/2/systemtap/build-elfutils/libdw'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/data/2/systemtap/build-elfutils/libdw'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/data/2/systemtap/build-elfutils'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/data/2/systemtap/build-elfutils'
make: *** [stamp-elfutils] Error 2
而systemtap2.5+elfutils1.50不会出现这个问题,
但是1.50安装好后使用的时候会出现
./sample-bt-off-cpu -p 8467 -t 5 > 11.bt
stap: /data/elfutils-0.150/libdwfl/derelocate.c:243: dwfl_module_relocations: Assertion `mod->debug.address_sync == mod->main.address_sync' failed.
在 2014年5月13日星期二UTC+8下午12时16分55秒,周李洋写道:

Yichun Zhang (agentzh)

unread,
May 13, 2014, 3:08:43 PM5/13/14
to openresty
Hello!

On Mon, May 12, 2014 at 10:46 PM, 周李洋 wrote:
> sample-bt-leaks是使用stap++来用的,
> 不过现在变成这个报错了。
>
> WARNING: cannot find module /lib64/libc-2.5.so debuginfo: No DWARF
> information found [man warning::debuginfo]

这条 stap 出错消息清楚地指示出你系统里的 libc 安装缺少调试符号。请参考你使用系统的相关参考手册。

比如在我的 Fedora Linux 系统上,可以通过下面的命令安装 libc 的调试信息包:

sudo debuginfo-install glibc

> 且根据您建议的
> http://openresty.org/#BuildSystemtap
> 中的方式安装最新版本
> 会在make systemtap的过程中出现一个问题。
> gcc -D_GNU_SOURCE -DHAVE_CONFIG_H
> -DLOCALEDIR='"/usr/local/systemtap/share/locale"' -DIS_LIBDW -I.
> -I../../../../elfutils-0.157/libdw -I.. -I.
> -I../../../../elfutils-0.157/libdw -I../../../../elfutils-0.157/lib -I..
> -I../../../../elfutils-0.157/libdw/../libelf -std=gnu99 -Wall -Wshadow
> -Werror -Wunused -Wextra -Wformat=2 -g -O2 -D_BSD_SOURCE
> -fstack-protector-all -D_FORTIFY_SOURCE=2 -fgnu89-inline -fexceptions -MT
> dwarf_begin_elf.o -MD -MP -MF .deps/dwarf_begin_elf.Tpo -c -o
> dwarf_begin_elf.o ../../../../elfutils-0.157/libdw/dwarf_begin_elf.c
> cc1: warnings being treated as errors
> ../../../../elfutils-0.157/libdw/dwarf_begin_elf.c: In function
> ‘check_section’:
> ../../../../elfutils-0.157/libdw/dwarf_begin_elf.c:282: warning: implicit
> declaration of function ‘be64toh’

貌似你的 gcc 比较老,建议将此问题直接报告给 elfutils 官方:

http://lists.fedorahosted.org/mailman/listinfo/elfutils-devel

或者再尝试稍老一些的 elfutils 的版本。

Regards,
-agentzh
Reply all
Reply to author
Forward
0 new messages