2017-09-16 79 views
2

我试图用debian 8 jessie上的perf-events来分析一个简单的C程序。我可以看到符号,但我无法获取堆栈跟踪。同样的过程在ubuntu 16.04上生成了很好的堆栈跟踪。在debian 8上没有显示StackTraces的perf-events jessie

我已经安装了linux-image-amd64-dbglibc6-dbg。 我已确认内核配置参数包括CONFIG_KALLSYMS=y

我已编译程序gcc -g3 -O0 hello.c以启用调试符号。

我开始使用以下命令进行分析。 sudo perf record -g ./a.out

我产生火焰图形Flame Graph用下面的命令

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; 
} 

This is the flame graph with debian jessie

This is the flame graph with ubuntu

为什么debian jessie中的堆栈跟踪丢失?

感谢 沙拉斯

回答

0

设法找到这一问题。 我不得不启用CONFIG_FRAME_POINTER=y和重新编译内核按照Brendan Gregg's perf site

不幸的是,与Debian的8内核航运没有启用此功能,它打破PERF

相关问题