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에 사용되고 있음을 확인할 수 있습니다. 이것이 관련있을까요?

여기에 질문하는 것이 적합한지 모르겠네요. 감사합니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.