perf record -g dwarf -p 4591
방법을 선택하는 올바른 옵션이 -g
반면 --call-graph
요즘은 기본 방법 fp
의와 호출 스택을 가능하게하는 유일한 플래그이다.
man perf-record
. 그런데
-g
Enables call-graph (stack chain/backtrace) recording.
--call-graph
Setup and enable call-graph (stack chain/backtrace) recording,
implies -g. Default is "fp".
Allows specifying "fp" (frame pointer) or "dwarf"
(DWARF's CFI - Call Frame Information) or "lbr"
(Hardware Last Branch Record facility) as the method to collect
the information used to show the call graphs.
In some systems, where binaries are build with gcc
--fomit-frame-pointer, using the "fp" method will produce bogus
call graphs, using "dwarf", if available (perf tools linked to
the libunwind or libdw library) should be used instead.
Using the "lbr" method doesn't require any compiler options. It
will produce call graphs from the hardware LBR registers. The
main limitation is that it is only available on new Intel
platforms, such as Haswell. It can only get user call chain. It
doesn't work with branch stack sampling at the same time.
When "dwarf" recording is used, perf also records (user) stack dump
when sampled. Default size of the stack dump is 8192 (bytes).
User can change the size by passing the size after comma like
"--call-graph dwarf,4096".
시도
fp
첫째 - 그것은 훨씬 더 효율적이지만, 최적화 된 바이너리 (예를 들어
--fomit-frame-pointer
) 잘 작동하지 않습니다. 또한 이것은 디버그 정보와 거의 관련이 없습니다. 스택 추적을 알 필요가 없으면
-g
을 추가 할 필요가 없습니다.
의역을 말로 나타내지 말고 항상 축 어적 인 오류 메시지를 게시하십시오! 당신이 도움을받을 가능성이 훨씬 높아집니다. – Zulan