bpftrace報(bào):Could not resolve symbol: /proc/self/exe:BEGIN_trigger解決方案
在ubuntu上使用bpftrace時(shí),如果腳本中包含"BEGIN"或者"END"這些符號(hào)就會(huì)報(bào)如下的錯(cuò)誤:
Could not resolve symbol: /proc/self/exe:BEGIN_trigger
這是因?yàn)閍pt安裝的bpftrace是strip過(guò)的,沒(méi)有debug symbol,而B(niǎo)EGIN/END存在于debug symbol中。解決的辦法是安裝bpftrace的debug symbol。
首先要引入debug symbol源。
echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse deb http://ddebs.ubuntu.com $(lsb_release -cs)-updates main restricted universe multiverse deb http://ddebs.ubuntu.com $(lsb_release -cs)-proposed main restricted universe multiverse" | \ sudo tee -a /etc/apt/sources.list.d/ddebs.list
然后更新源,安裝debug symbol
apt update sudo apt-get install bpftrace-dbgsym
如果你的機(jī)器不能連外網(wǎng),可以在一臺(tái)可以聯(lián)網(wǎng)的機(jī)器上安裝好bpftrace-dbgsym之后將其打成deb包,再遷移到目標(biāo)機(jī)器上。
posted on 2025-05-21 14:14 半山隨筆 閱讀(72) 評(píng)論(0) 收藏 舉報(bào)
浙公網(wǎng)安備 33010602011771號(hào)