[英]Perf Tool Linux - No Call-Graph
I am tring to use perf version 3.0.8
to profile my embedded system Linux kernel version 3.0.8
. 我想使用perf version 3.0.8
来配置我的嵌入式系统Linux kernel version 3.0.8
。
I cross-compiled tools/perf using zlib and elfutils. 我使用zlib和elfutils交叉编译工具/ perf。
In order to familiarize with this tool I am using a simple quicksort example compiled using -g
option. 为了熟悉这个工具,我使用了一个使用-g
选项编译的简单快速排序示例。
I run perf record -F 99 -g -- ./qsort
(copied from the example) and then perf report --stdio
to see my profile results. 我运行perf record -F 99 -g -- ./qsort
(从示例中复制)然后执行perf report --stdio
以查看我的个人资料结果。
This is a snapshot of the perf report -g --stdio
output: 这是perf report -g --stdio
输出的快照:
No kallsyms or vmlinux with build-id f41dfb5606beda1d75171db69f1e9466cb4868ba was found
[hi3518_dsu] with build id f41dfb5606beda1d75171db69f1e9466cb4868ba not found, continuing without symbols
No kallsyms or vmlinux with build-id a0f9a05faf6bcfb72282a03e048b47e8a8c0f2ec was found
[hi3518_tde] with build id a0f9a05faf6bcfb72282a03e048b47e8a8c0f2ec not found, continuing without symbols
# Events: 256 cpu-clock
#
# Overhead Command Shared Object Symbol
# ........ ....... ................. ......................
#
96.88% qsort qsort [.] partition
0.78% qsort [kernel.kallsyms] [k] __do_softirq
0.39% qsort [kernel.kallsyms] [k] __wake_up_sync_key
0.39% qsort [kernel.kallsyms] [k] get_page_from_freelist
0.39% qsort [kernel.kallsyms] [k] __memzero
0.39% qsort [kernel.kallsyms] [k] div_s64_rem
0.39% qsort [hi3518_tde] [k] 0x58
0.39% qsort [hi3518_dsu] [k] 0x8154
As you can see there is not call-trace at all. 如您所见,根本没有呼叫追踪。 I am really interested to study in deep my system and without a call-trace these results are useless. 我真的很有兴趣深入研究我的系统而没有呼叫追踪,这些结果毫无用处。
You might have some luck using the -fno-omit-frame-pointer
flag while compiling the program you are trying to profile. 在编译您尝试分析的程序时,使用-fno-omit-frame-pointer
标志可能会有一些运气。 I am also having issues making call graphs work with perf on an ARM embedded system. 我也遇到了在ARM嵌入式系统上使用perf工作调用图的问题。
I found a solution. 我找到了解决方案。 Run perf --call-graph dwarf -- ./qsort
Make sure you have compiled the program with dwarf debug symbols (-g, -ggdb, or -gdwarf flag). 运行perf --call-graph dwarf -- ./qsort
确保已使用矮调试符号(-g,-ggdb或-gdwarf标志)编译程序。 In addition, you might need to install debug symbols for any libraries you are using on your system. 此外,您可能需要为系统上使用的任何库安装调试符号。 https://fedoraproject.org/wiki/StackTraces shows how to install debug symbol packages for Fedora. https://fedoraproject.org/wiki/StackTraces展示了如何为Fedora安装调试符号包。
If the perf command fails with --call-graph dwarf, you may need to compile perf with libunwind in addition to elfutils. 如果perf命令使用--call-graph dwarf失败,除了elfutils之外,您可能还需要使用libunwind编译perf。
Probably my pref version is really old (or/and the kernel tool). 可能我的pref版本真的很旧(或/和内核工具)。 I tried with another soc (with a newer kernel and perf tool) and the callstack works properly. 我尝试使用另一个soc(使用更新的内核和perf工具)并且callstack正常工作。 However, even without this feature, I'm using this tool profitably. 但是,即使没有这个功能,我也可以使用这个工具。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.