未解決のシンボル sudo perf ロギング/レポート

未解決のシンボル sudo perf ロギング/レポート

私はジョブサーバーで作成したプログラムを分析するためにperfを使用しようとしています。 sudo権限がありますが、これを使用して実行できる操作には制限があります。

$ 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) ]

パフォーマンスレポートを実行すると、次の項目が表示されます。

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

これでsudo権限があるので、これが解決されていないカーネルシンボルの問題を解決すると思います。だから私は次を実行します。

$ 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) ]

これは良く見えますが、私のコードでsudo perf report -fを実行するとシンボルが解決されないようです。

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

私のプログラムのシンボルが解釈されないのはなぜですか?カーネルシンボルとプログラムのシンボルを同時に解決するには?

ちなみに、一般的なコンパイルコマンドは次のとおりです(一部の名前が変更されます)。

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

私はg ++ 8.1.0を使用しています。

ベストアンサー1

おすすめ記事