我试图分析一个简单的C程序与perf事件上Debian8Jessie.我可以看到符号,但我无法得到堆栈痕迹。同一过程在ubuntu16.04上生成良好的堆栈跟踪。
我安装了linux-image-amd64-dbg和libc6-dbg。我已经确认内核配置参数包括CONFIG_KALLSYMS=y。
我已经用gcc -g3 -O0 hello.c编译了程序,以启用调试符号。
我使用以下命令开始分析。sudo perf record -g ./a.out
我使用以下命令生成火焰图火焰图
sudo perf script | ~/code/FlameGraph/stackcollapse-perf.pl | \
~/code/FlameGraph/flamegraph.pl > perf-kernel.svg这是hello.c的清单,我正试图对其进行分析。
#include <stdio.h>
#include <unistd.h>
void do2() {
FILE* f = fopen("/dev/zero", "r");
int fd = fileno(f);
char buf[100];
while(1) {
read(fd, buf, sizeof(buf)/sizeof(buf[0]));
}
}
int main(void)
{
do2();
return 0;
}为什么debian jessie中缺少堆栈跟踪?
谢谢沙拉斯
发布于 2017-09-27 17:58:21
找到了问题所在。我必须启用CONFIG_FRAME_POINTER=y并按照Brendan Gregg's perf站点重新编译内核
不幸的是,Debian 8的内核传送没有启用此功能,从而破坏了perf。
https://stackoverflow.com/questions/46250669
复制相似问题