2017-09-16 80 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

相關問題