본문 바로가기

Programming/Linux

kvm_entry & kvm_exit

2019.11.27

  1. counting events 파트 kvm_entry, kvm_exit

    1. https://www.linux-kvm.org/page/Main_Page

    2.  /usr/src/linux-5.1.5/tools/perf/perf stat -e 'kvm:*' -a sleep 1m

    3. 결과 정리

    4. 2019.11.27 스프레드 시트에 정리해둠.

  2. https://patchwork.kernel.org/cover/10989117/

    1. “record" enables recording of two pair of tracepoints:

    2.  - "kvm:kvm_entry" and "kvm:kvm_exit"

    3.  - "kvm:kvm_trap_enter" and "kvm:kvm_trap_exit"

    4. "report" reports statistical analysis of guest exit&trap events.

  3. https://www.linux-kvm.org/page/Perf_events

    1. sudo ./perf stat -e 'kvm:*' -a sleep 1h

  4. ftrace를 사용해도 kvm_exit, kvm_entry, kvm_mmio, kvm_apic등을 확인 할 수 있는듯하다.

    1. kvm_trace, kvm_stat도 존재

  5. guest os를 분석해야 하는지, host os를 분석해야 하는지

2019.11.26

  1. perf kvm exit

    1. perf-kvm - Tool to trace/measure kvm guest os

    2. https://lwn.net/Articles/513317/

    3. http://man7.org/linux/man-pages/man1/perf-kvm.1.html#top_of_page

    4. ./perf kvm stat record -p 26071

      1. record 한후에 ctrl + C

      2. perf.data.guest 라는 파일에 퍼포먼스를 저장

    5. ./perf kvm stat report --event=vmexit

      1. vmexit 출력

  2. 실행코드

    1. /usr/src/linux-5.1.5/tools/perf/perf kvm stat record -p 26947

    2. /usr/src/linux-5.1.5/tools/perf/perf kvm stat report --event=vmexit