Hi 章老师,
之前的"build-id mismatch"的问题解决了,是因为内核和安装的debuginfo包的build-id不同引起的。
重新安装debuginfo包之后问题不再出现。
#eu-readelf -n /boot/vmlinuz-2.6.32-279.1.1.el6.x86_64 | grep "Build ID"
Build ID: 8c33eab01b34cdde6dbb46ebcb2ae3c9929c836d
#eu-readelf -n /usr/lib/debug/lib/modules/2.6.32-279.1.1.el6.x86_64/vmlinux
| grep "Build ID"
Build ID: 8c33eab01b34cdde6dbb46ebcb2ae3c9929c836d
之后重新运行stap,第一次总是出错:
# /opt/systemtap/bin/stap --ldd -d /usr/sbin/nginx --all-modules -D
MAXMAPENTRIES=5120 -D MAXACTION=20000 -D MAXTRACE=50 -D
MAXSTRINGLEN=1024 -D MAXBACKTRACE=100 -x 21954 a.stp --vp 00001 >
a.out
Pass 5: starting run.
ERROR: error allocating hash
ERROR: global variable 's' allocation failed
WARNING: /opt/systemtap/bin/staprun exited with status: 1
Pass 5: run completed in 0usr/70sys/683real ms.
Pass 5: run failed. Try again with another '--vp 00001' option.
# /opt/systemtap/bin/stap --ldd -d /usr/sbin/nginx --all-modules -D
MAXMAPENTRIES=5120 -D MAXACTION=20000 -D MAXTRACE=50 -D
MAXSTRINGLEN=1024 -D MAXBACKTRACE=100 -x 21954 a.stp --vp 00001 >
a.out
Pass 5: starting run.
WARNING: Missing unwind data for module, rerun with 'stap -d
stap_b4701e846c78c93e13b217f69be297e_18846'
WARNING: _stp_read_address failed to access memory location
WARNING: Number of errors: 0, skipped probes: 99
Pass 5: run completed in 0usr/90sys/20481real ms.
请问上面的一些警告信息是否会影响stap的运行?
谢谢。
2012/10/16 Wenhua Zhang <shi...@gmail.com>:
> Hi 章老师,
> 谢谢您的回复。
> 我之前尝试了用系统自带的systemtap,但仍然出现问题:
> #stap --ldd -d /usr/sbin/nginx --all-modules -D MAXMAPENTRIES=5120 -D
> MAXACTION=20000 -D MAXTRACE=50 -D MAXSTRINGLEN=1024 -D
> MAXBACKTRACE=100 -x 21954 a.stp --vp 00001 > a.out
> Pass 5: starting run.
> ERROR: Build-id mismatch: "kernel" vs. "vmlinux" byte 1 (0x2d vs 0x33)
> address 0xffffffff81508170 rc 0
> WARNING: /usr/bin/staprun exited with status: 1
> Pass 5: run completed in 0usr/50sys/84real ms.
> Pass 5: run failed. Try again with another '--vp 00001' option.
>
> # which stap
> /usr/bin/stap
>
> # stap --version
> Systemtap translator/driver (version 1.7/0.152 non-git sources)
> Copyright (C) 2005-2012 Red Hat, Inc. and others
> This is free software; see the source for copying conditions.
> enabled features: AVAHI LIBRPM LIBSQLITE3 NSS BOOST_SHARED_PTR
> TR1_UNORDERED_MAP NLS
>
> 是否和我装的debug包有关系?
> # rpm -qa | grep `uname -r`
> kernel-2.6.32-279.1.1.el6.x86_64
> kernel-debuginfo-common-x86_64-2.6.32-279.1.1.el6.x86_64
> kernel-headers-2.6.32-279.1.1.el6.x86_64
> kernel-debuginfo-2.6.32-279.1.1.el6.x86_64
> kernel-devel-2.6.32-279.1.1.el6.x86_64
> perf-2.6.32-279.1.1.el6.x86_64
>
> ”Build-id mismatch“这个问题在网上也有人提出,但没有找到好的解决办法。
> 谢谢。
>
> Best Wishes,
> Wenhua
>
>
> 在 2012年10月16日 上午1:56,agentzh <age...@gmail.com> 写道:
>> Hello!
>>
>> 2012/10/15 Wenhua Zhang:
>>> Pass 5: starting run.
>>> WARNING: Missing unwind data for module, rerun with 'stap -d
>>> stap_32956d49a7514625e7674714a68170c7_4108'
>>> WARNING: _stp_read_address failed to access memory location
>>> ERROR: MAXACTION exceeded near operator '{' at
>>> /opt/systemtap/share/systemtap/tapset/linux/ucontext-symbols.stp:113:28
>>> WARNING: Number of errors: 1, skipped probes: 24
>>> WARNING: /opt/systemtap/bin/staprun exited with status: 1
>>> Pass 5: run completed in 10usr/90sys/20437real ms.
>>> Pass 5: run failed. Try again with another '--vp 00001' option.
>>>
>>> 生成的SVG文件有很多“_init”,见附件。
>>> 请问这种情况是否正常?
>>
>> 你的 SVG 看起来完全不正确。你的 systemtap 貌似未能成功获得用户态调用栈。
>>
>>>
>>> 另外,之前遇到的错误“ERROR: Build-id mismatch: "kernel" vs. "vmlinux" byte 1
>>> (0x2d vs 0x33)
>>> address 0xffffffff81508170 rc 0”,把文件systemtap/runtime/sym.c中的if(rc ||
>>> (theory != practice))写成: if (0 && (rc || (theory
>>> !=practice))),然后重新编译,请问这种解决方法是否会影响systemtap的运行?
>>>
>>
>> 你这里把兼容性检查代码彻底移除,貌似并不是一个好主意 :) 你可以尝试移除 $HOME/.systemtap ?
>>
>> 我建议你先直接尝试系统自带的 systemtap 包?版本老点就老点吧,呵呵。基本能工作就好了。
>>
>> 另外,MAXACTION 确实应当设置得大一些 ;)
>>
>> Best regards,
>> -agentzh
Attachment:
nginx-agentzh-stap-4.svg
Description: image/svg