Linux perf tool의 percentage mode별 결과 차이 문제

안녕하세요, 처음으로 질문 남겨봅니다.
현재 linux perf를 사용해서 QEMU process의 CPU usage를 분석하는 작업을 해보고 있습니다.
다음 명령어로 QEMU에 대한 perf.data를 얻었습니다.
perf record -p $(pgrep qemu) -- sleep 10
(동시에 guest에서는 특정 작업을 수행하고 있습니다.)
그리고 perf report의 두가지 percentage mode를 사용해서 결과를 확인했습니다.
--percentage=absolute
를 사용할 경우:
# Samples: 4K of event 'cycles' # Event count (approx.): 662311748 # # Overhead Samples Command Shared Object Symbol # ........ ............ ............... ................... ............................... # 0.44% 68 qemu-system-aar [kernel.kallsyms] [k] finish_task_switch.isra.0 0.04% 1 qemu-system-aar qemu-system-aarch64 [.] g_main_context_check 0.04% 1 qemu-system-aar [kernel.kallsyms] [k] _copy_to_iter ...
총 4K개의 sample 있다고 나오지만, 실제 결과에는 가장 높은 것이 68개로 나옵니다.
--percentage=relative
를 사용할 경우:
# Samples: 79 of event 'cycles' # Event count (approx.): 4267002 # # Overhead Samples Command Shared Object Symbol # ........ ............ ............... ................... ............................... # 68.11% 68 qemu-system-aar [kernel.kallsyms] [k] finish_task_switch.isra.0 6.30% 1 qemu-system-aar qemu-system-aarch64 [.] g_main_context_check 5.89% 1 qemu-system-aar [kernel.kallsyms] [k] _copy_to_iter ...
전체 sample이 79개로 나오고 아래 결과에 나온 모든 sample 수를 합치면 79가 됩니다.
(4K - 79)개의 나머지 sample들은 어디로 간걸까요? 별도의 filter를 사용하지 않았습니다.
그리고 perf script | grep cycles | wc -l
로 확인해보면 총 79개의 sample만 존재하는 것을 확인할 수 있습니다.
또한, perf report --hide-unresolved
를 사용하면 동일하게 79개의 샘플에 대한 결과가 나옵니다.
script 파일에는 symbol이 [unknown]인 것은 없는데 원인이 무엇인지 모르겠습니다.
추가적으로, 아래는 QEMU process의 strace 결과입니다
% time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 99.92 9.371500 22801 411 ppoll 0.04 0.003862 5 710 write 0.02 0.001797 4 376 read 0.02 0.001733 5 324 recvmsg 0.01 0.000496 41 12 sendmsg 0.00 0.000023 23 1 ioctl ------ ----------- ----------- --------- --------- ---------------- 100.00 9.379411 5114 1834 total
대부분의 시간이 polling에 사용되고 있음을 확인할 수 있습니다. 이것이 관련있을까요?
여기에 질문하는 것이 적합한지 모르겠네요. 감사합니다.
댓글 달기