我正在尝试将perf工具用于MIPS并在获得回栈方面遇到一些麻烦。
如何为mips启用FRAME_POINTER?我已启用DEBUG_KERNEL,但看起来-fno-omit-frame-pointer不适用于kernel中的MIPS拱。
这是否意味着对于MIPS无法使用perf实现基于帧指针的堆栈展开?
我看不到mips工具链抱怨-fno-omit-frame-pointer标志
EDIT1
我能够记录性能事件。性能报告的样本输出
如果不取消堆栈,报表将无济于事。
# ./perf --version
perf version 5.6.rc2.gd04712cd3bd7
# uname -a
Linux localhost 3.14.28-1.19 #1 SMP Mon Feb 17 16:48:44 IST 2020 mips GNU/Linux
EDIT2
检测到性能特征
Auto-detecting system features:
... dwarf: [ on ]
... dwarf_getlocations: [ on ]
... glibc: [ on ]
... gtk2: [ OFF ]
... libaudit: [ on ]
... libbfd: [ OFF ]
... libcap: [ OFF ]
... libelf: [ on ]
... libnuma: [ OFF ]
... numa_num_possible_cpus: [ OFF ]
... libperl: [ OFF ]
... libpython: [ OFF ]
... libcrypto: [ OFF ]
... libunwind: [ OFF ]
... libdw-dwarf-unwind: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... get_cpuid: [ OFF ]
... bpf: [ OFF ]
... libaio: [ on ]
... libzstd: [ OFF ]
... disassembler-four-args: [ OFF ]
EDIT3
我看到libunwind的功能测试失败
cat linux-5.6-rc2/tools/build/feature/test-libunwind.make.output
/tmp/ccQnV5jZ.o: In function `main':
test-libunwind.c:(.text+0x1c): undefined reference to `_Umips_create_addr_space'
test-libunwind.c:(.text+0x4c): undefined reference to `_Umips_init_remote'
test-libunwind.c:(.text+0x70): undefined reference to `_Umips_dwarf_search_unwind_table'
collect2: error: ld returned 1 exit status
如果我看到makefile用于功能测试,则libunwind链接未针对MIPS完成。
EDIT4
常用工作流程
perf record -F 99 -ag -e cycles:u -- sleep 5
perf report
尝试使用矮人
# perf record -F 99 -ag --call-graph=dwarf -- sleep 10
Error:
The sys_perf_event_open() syscall returned with 89 (Function not implemented) for event (cycles).
/bin/dmesg | grep -i perf may provide additional information.
dmesg为空