使用带有文件名和行号的 systemtap 会产生错误,而使用(损坏的)函数名很好。我在这里做错了什么?
// fails with
// semantic error: no match
// Pass 2: analysis failed. [man error::pass2]
probe process("a.out").statement("*@hello.cpp:5") {
printf("in test\n")
}
// succeeds
probe process("a.out").function("_Z4testv").return {
printf("in test\n")
}
//content of source of a.out
#include <iostream>
void test() {
int a = 1;
std::cout << "Hello World!";
}
int main()
{
test();
}
//stap command
sudo stap a.stp -c "./a.out"
linux版本3.10.0-229.el7.x86_64
版本2.8/0.160
目录内容:a.out hello.cpp a.stp