símbolos não resolvidos sudo perf record / report

0

Estou tentando usar perf para criar um perfil de um programa que escrevi em um servidor de trabalho. Tenho privilégios de sudo, mas devo limitar o que faço com isso.

$ rm perf.data
$ perf record ./catch-hedging stress_BS_EURUSD_03M_delta_gamma_n_2_1_1
WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted,
check /proc/sys/kernel/kptr_restrict.

Samples in kernel functions may not be resolved if a suitable vmlinux
file is not found in the buildid cache or in the vmlinux path.

Samples in kernel modules won't be resolved at all.

If some relocation was applied (e.g. kexec) symbols may be misresolved
even with a suitable vmlinux or kallsyms file.

Lowering default frequency rate to 250.
Please consider tweaking /proc/sys/kernel/perf_event_max_sample_rate.
Cannot read kernel map
Couldn't record kernel reference relocation symbol
Symbol resolution may be skewed if relocation was used (e.g. kexec).
Check /proc/kallsyms permission or run as root.
Read 'results-gcc.txt', got 285 results. Took 0.000514 seconds
===============================================================================
All tests passed (1 assertion in 1 test case)

[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.007 MB perf.data (143 samples) ]

Quando executo o relatório de perfurações, recebo entradas como:

10.79%  catch-hedging  [unknown]         [k] 0xffffffff81614733

Agora que tenho privilégio de sudo, achei que isso resolveria meu problema com símbolos de kernel não resolvidos. Então eu corro:

$ sudo perf record ./catch-hedging stress_BS_EURUSD_03M_delta_gamma_n_2_1_1
Lowering default frequency rate to 250.
Please consider tweaking /proc/sys/kernel/perf_event_max_sample_rate.
Read 'results-gcc.txt', got 285 results. Took 0.000942 seconds
===============================================================================
All tests passed (1 assertion in 1 test case)

[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.020 MB perf.data (149 samples) ]

O que parece melhor, mas quando executo o sudo perf report -f os símbolos do meu próprio código não parecem estar resolvidos:

17.13%  catch-hedging  catch-hedging      [.] 0x000000000002eced

Por que os símbolos do meu programa não são resolvidos? O que posso fazer para resolver os símbolos do kernel e os símbolos do meu programa ao mesmo tempo?

Para referência, um comando típico de compilação parece (alguns nomes foram alterados):

g++ -Wunused -pthread -std=c++17 -g -fno-omit-frame-pointer -O2 -pthread -std=c++17 -Wno-parentheses -Wsequence-point -Wconversion -Wuninitialized -Wunused -Wmissing-field-initializers -g -fno-omit-frame-pointer -O2 -Isome-include-directories-omitted -D__stdcall= -DWINAPI= '-D__declspec(X)='  -c -o file.o file.cpp

Estou usando o g ++ 8.1.0.

    
por Bowie Owens 24.07.2018 / 08:53

0 respostas

Tags