% the percentage of the total running time of the time program used by this function.
cumulative a running sum of the number of seconds accounted seconds for by this function and those listed above it.
self the number of seconds accounted for by this seconds function alone. This is the major sort for this listing.
calls the number of times this function was invoked, if this function is profiled, else blank.
self the average number of milliseconds spent in this ms/call function per call, if this function is profiled, else blank.
total the average number of milliseconds spent in this ms/call function and its descendents per call, if this function is profiled, else blank.
name the name of the function. This is the minor sort for this listing. The index shows the location of the function in the gprof listing. If the index is in parenthesis it shows where it would appear in the gprof listing if it were to be printed.
Auto-detecting system features: ... dwarf: [ OFF ] ... dwarf_getlocations: [ OFF ] ... glibc: [ on ] ... libbfd: [ OFF ] ... libbfd-buildid: [ OFF ] ... libcap: [ OFF ] ... libelf: [ on ] ... libnuma: [ OFF ] ... numa_num_possible_cpus: [ OFF ] ... libperl: [ OFF ] ... libpython: [ on ] ... libcrypto: [ on ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ OFF ] ... zlib: [ on ] ... lzma: [ OFF ] ... get_cpuid: [ on ] ... bpf: [ on ] ... libaio: [ on ] ... libzstd: [ OFF ] ... disassembler-four-args: [ OFF ]
有很多功能被 off 掉了,这是因为 perf 编译的时候,会根据你本地安装的库的版本来决定是否支持某些功能,如果你需要全功能的 perf 则需要进一步安装依赖库:
stackcollapse.pl: for DTrace stacks stackcollapse-perf.pl: for Linux perf_events "perf script" output stackcollapse-pmc.pl: for FreeBSD pmcstat -G stacks stackcollapse-stap.pl: for SystemTap stacks stackcollapse-instruments.pl: for XCode Instruments stackcollapse-vtune.pl: for Intel VTune profiles stackcollapse-ljp.awk: for Lightweight Java Profiler stackcollapse-jstack.pl: for Java jstack(1) output stackcollapse-gdb.pl: for gdb(1) stacks stackcollapse-go.pl: for Golang pprof stacks stackcollapse-vsprof.pl: for Microsoft Visual Studio profiles stackcollapse-wcp.pl: for wallClockProfiler output
使用这些工具对不同的分析器的分析数据进行压缩,可以得到统一的分析数据:
1 2 3 4 5
For perf_events: $ ./stackcollapse-perf.pl out.perf > out.folded
For DTrace: $ ./stackcollapse.pl out.kern_stacks > out.kern_folded