1. 07 11月, 2021 1 次提交
  2. 02 8月, 2021 1 次提交
  3. 17 6月, 2021 1 次提交
    • Y
      perf annotate: Add itrace options support · 4bcbe438
      Yang Jihong 提交于
      The "auxtrace_info" and "auxtrace" functions are not set in "tool" member of
      "annotate". As a result, perf annotate does not support parsing itrace data.
      
      Before:
      
        # perf record -e arm_spe_0/branch_filter=1/ -a sleep 1
        [ perf record: Woken up 9 times to write data ]
        [ perf record: Captured and wrote 20.874 MB perf.data ]
        # perf annotate --stdio
        Error:
        The perf.data data has no samples!
      
      Solution:
      
      1. Add itrace options in help,
      2. Set hook functions of "id_index", "auxtrace_info" and "auxtrace" in perf_tool.
      
      After:
      
        # perf record --all-user -e arm_spe_0/branch_filter=1/ ls
        Couldn't synthesize bpf events.
        perf.data
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.010 MB perf.data ]
        # perf annotate --stdio
         Percent |      Source code & Disassembly of libc-2.28.so for branch-miss (1 samples, percent: local period)
        ------------------------------------------------------------------------------------------------------------
                 :
                 :
                 :
                 :           Disassembly of section .text:
                 :
                 :           0000000000066180 <__getdelim@@GLIBC_2.17>:
            0.00 :   66180:  stp     x29, x30, [sp, #-96]!
            0.00 :   66184:  cmp     x0, #0x0
            0.00 :   66188:  ccmp    x1, #0x0, #0x4, ne  // ne = any
            0.00 :   6618c:  mov     x29, sp
            0.00 :   66190:  stp     x24, x25, [sp, #56]
            0.00 :   66194:  stp     x26, x27, [sp, #72]
            0.00 :   66198:  str     x28, [sp, #88]
            0.00 :   6619c:  b.eq    66450 <__getdelim@@GLIBC_2.17+0x2d0>  // b.none
            0.00 :   661a0:  stp     x22, x23, [x29, #40]
            0.00 :   661a4:  mov     x22, x1
            0.00 :   661a8:  ldr     w1, [x3]
            0.00 :   661ac:  mov     w23, w2
            0.00 :   661b0:  stp     x20, x21, [x29, #24]
            0.00 :   661b4:  mov     x20, x3
            0.00 :   661b8:  mov     x21, x0
            0.00 :   661bc:  tbnz    w1, #15, 66360 <__getdelim@@GLIBC_2.17+0x1e0>
            0.00 :   661c0:  ldr     x0, [x3, #136]
            0.00 :   661c4:  ldr     x2, [x0, #8]
            0.00 :   661c8:  str     x19, [x29, #16]
            0.00 :   661cc:  mrs     x19, tpidr_el0
            0.00 :   661d0:  sub     x19, x19, #0x700
            0.00 :   661d4:  cmp     x2, x19
            0.00 :   661d8:  b.eq    663f0 <__getdelim@@GLIBC_2.17+0x270>  // b.none
            0.00 :   661dc:  mov     w1, #0x1                        // #1
            0.00 :   661e0:  ldaxr   w2, [x0]
            0.00 :   661e4:  cmp     w2, #0x0
            0.00 :   661e8:  b.ne    661f4 <__getdelim@@GLIBC_2.17+0x74>  // b.any
            0.00 :   661ec:  stxr    w3, w1, [x0]
            0.00 :   661f0:  cbnz    w3, 661e0 <__getdelim@@GLIBC_2.17+0x60>
            0.00 :   661f4:  b.ne    66448 <__getdelim@@GLIBC_2.17+0x2c8>  // b.any
            0.00 :   661f8:  ldr     x0, [x20, #136]
            0.00 :   661fc:  ldr     w1, [x20]
            0.00 :   66200:  ldr     w2, [x0, #4]
            0.00 :   66204:  str     x19, [x0, #8]
            0.00 :   66208:  add     w2, w2, #0x1
            0.00 :   6620c:  str     w2, [x0, #4]
            0.00 :   66210:  tbnz    w1, #5, 66388 <__getdelim@@GLIBC_2.17+0x208>
            0.00 :   66214:  ldr     x19, [x29, #16]
            0.00 :   66218:  ldr     x0, [x21]
            0.00 :   6621c:  cbz     x0, 66228 <__getdelim@@GLIBC_2.17+0xa8>
            0.00 :   66220:  ldr     x0, [x22]
            0.00 :   66224:  cbnz    x0, 6623c <__getdelim@@GLIBC_2.17+0xbc>
            0.00 :   66228:  mov     x0, #0x78                       // #120
            0.00 :   6622c:  str     x0, [x22]
            0.00 :   66230:  bl      20710 <malloc@plt>
            0.00 :   66234:  str     x0, [x21]
            0.00 :   66238:  cbz     x0, 66428 <__getdelim@@GLIBC_2.17+0x2a8>
            0.00 :   6623c:  ldr     x27, [x20, #8]
            0.00 :   66240:  str     x19, [x29, #16]
            0.00 :   66244:  ldr     x19, [x20, #16]
            0.00 :   66248:  sub     x19, x19, x27
            0.00 :   6624c:  cmp     x19, #0x0
            0.00 :   66250:  b.le    66398 <__getdelim@@GLIBC_2.17+0x218>
            0.00 :   66254:  mov     x25, #0x0                       // #0
            0.00 :   66258:  b       662d8 <__getdelim@@GLIBC_2.17+0x158>
            0.00 :   6625c:  nop
            0.00 :   66260:  add     x24, x19, x25
            0.00 :   66264:  ldr     x3, [x22]
            0.00 :   66268:  add     x26, x24, #0x1
            0.00 :   6626c:  ldr     x0, [x21]
            0.00 :   66270:  cmp     x3, x26
            0.00 :   66274:  b.cs    6629c <__getdelim@@GLIBC_2.17+0x11c>  // b.hs, b.nlast
            0.00 :   66278:  lsl     x3, x3, #1
            0.00 :   6627c:  cmp     x3, x26
            0.00 :   66280:  csel    x26, x3, x26, cs  // cs = hs, nlast
            0.00 :   66284:  mov     x1, x26
            0.00 :   66288:  bl      206f0 <realloc@plt>
            0.00 :   6628c:  cbz     x0, 66438 <__getdelim@@GLIBC_2.17+0x2b8>
            0.00 :   66290:  str     x0, [x21]
            0.00 :   66294:  ldr     x27, [x20, #8]
            0.00 :   66298:  str     x26, [x22]
            0.00 :   6629c:  mov     x2, x19
            0.00 :   662a0:  mov     x1, x27
            0.00 :   662a4:  add     x0, x0, x25
            0.00 :   662a8:  bl      87390 <explicit_bzero@@GLIBC_2.25+0x50>
            0.00 :   662ac:  ldr     x0, [x20, #8]
            0.00 :   662b0:  add     x19, x0, x19
            0.00 :   662b4:  str     x19, [x20, #8]
            0.00 :   662b8:  cbnz    x28, 66410 <__getdelim@@GLIBC_2.17+0x290>
            0.00 :   662bc:  mov     x0, x20
            0.00 :   662c0:  bl      73b80 <__underflow@@GLIBC_2.17>
            0.00 :   662c4:  cmn     w0, #0x1
            0.00 :   662c8:  b.eq    66410 <__getdelim@@GLIBC_2.17+0x290>  // b.none
            0.00 :   662cc:  ldp     x27, x19, [x20, #8]
            0.00 :   662d0:  mov     x25, x24
            0.00 :   662d4:  sub     x19, x19, x27
            0.00 :   662d8:  mov     x2, x19
            0.00 :   662dc:  mov     w1, w23
            0.00 :   662e0:  mov     x0, x27
            0.00 :   662e4:  bl      807b0 <memchr@@GLIBC_2.17>
            0.00 :   662e8:  cmp     x0, #0x0
            0.00 :   662ec:  mov     x28, x0
            0.00 :   662f0:  sub     x0, x0, x27
            0.00 :   662f4:  csinc   x19, x19, x0, eq  // eq = none
            0.00 :   662f8:  mov     x0, #0x7fffffffffffffff         // #9223372036854775807
            0.00 :   662fc:  sub     x0, x0, x25
            0.00 :   66300:  cmp     x19, x0
            0.00 :   66304:  b.lt    66260 <__getdelim@@GLIBC_2.17+0xe0>  // b.tstop
            0.00 :   66308:  adrp    x0, 17f000 <sys_sigabbrev@@GLIBC_2.17+0x320>
            0.00 :   6630c:  ldr     x0, [x0, #3624]
            0.00 :   66310:  mrs     x2, tpidr_el0
            0.00 :   66314:  ldr     x19, [x29, #16]
            0.00 :   66318:  mov     w3, #0x4b                       // #75
            0.00 :   6631c:  ldr     w1, [x20]
            0.00 :   66320:  mov     x24, #0xffffffffffffffff        // #-1
            0.00 :   66324:  str     w3, [x2, x0]
            0.00 :   66328:  tbnz    w1, #15, 66340 <__getdelim@@GLIBC_2.17+0x1c0>
            0.00 :   6632c:  ldr     x0, [x20, #136]
            0.00 :   66330:  ldr     w1, [x0, #4]
            0.00 :   66334:  sub     w1, w1, #0x1
            0.00 :   66338:  str     w1, [x0, #4]
            0.00 :   6633c:  cbz     w1, 663b8 <__getdelim@@GLIBC_2.17+0x238>
            0.00 :   66340:  mov     x0, x24
            0.00 :   66344:  ldr     x28, [sp, #88]
            0.00 :   66348:  ldp     x20, x21, [x29, #24]
            0.00 :   6634c:  ldp     x22, x23, [x29, #40]
            0.00 :   66350:  ldp     x24, x25, [sp, #56]
            0.00 :   66354:  ldp     x26, x27, [sp, #72]
            0.00 :   66358:  ldp     x29, x30, [sp], #96
            0.00 :   6635c:  ret
          100.00 :   66360:  tbz     w1, #5, 66218 <__getdelim@@GLIBC_2.17+0x98>
            0.00 :   66364:  ldp     x20, x21, [x29, #24]
            0.00 :   66368:  mov     x24, #0xffffffffffffffff        // #-1
            0.00 :   6636c:  ldp     x22, x23, [x29, #40]
            0.00 :   66370:  mov     x0, x24
            0.00 :   66374:  ldp     x24, x25, [sp, #56]
            0.00 :   66378:  ldp     x26, x27, [sp, #72]
            0.00 :   6637c:  ldr     x28, [sp, #88]
            0.00 :   66380:  ldp     x29, x30, [sp], #96
            0.00 :   66384:  ret
            0.00 :   66388:  mov     x24, #0xffffffffffffffff        // #-1
            0.00 :   6638c:  ldr     x19, [x29, #16]
            0.00 :   66390:  b       66328 <__getdelim@@GLIBC_2.17+0x1a8>
            0.00 :   66394:  nop
            0.00 :   66398:  mov     x0, x20
            0.00 :   6639c:  bl      73b80 <__underflow@@GLIBC_2.17>
            0.00 :   663a0:  cmn     w0, #0x1
            0.00 :   663a4:  b.eq    66438 <__getdelim@@GLIBC_2.17+0x2b8>  // b.none
            0.00 :   663a8:  ldp     x27, x19, [x20, #8]
            0.00 :   663ac:  sub     x19, x19, x27
            0.00 :   663b0:  b       66254 <__getdelim@@GLIBC_2.17+0xd4>
            0.00 :   663b4:  nop
            0.00 :   663b8:  str     xzr, [x0, #8]
            0.00 :   663bc:  ldxr    w2, [x0]
            0.00 :   663c0:  stlxr   w3, w1, [x0]
            0.00 :   663c4:  cbnz    w3, 663bc <__getdelim@@GLIBC_2.17+0x23c>
            0.00 :   663c8:  cmp     w2, #0x1
            0.00 :   663cc:  b.le    66340 <__getdelim@@GLIBC_2.17+0x1c0>
            0.00 :   663d0:  mov     x1, #0x81                       // #129
            0.00 :   663d4:  mov     x2, #0x1                        // #1
            0.00 :   663d8:  mov     x3, #0x0                        // #0
            0.00 :   663dc:  mov     x8, #0x62                       // #98
            0.00 :   663e0:  svc     #0x0
            0.00 :   663e4:  ldp     x20, x21, [x29, #24]
            0.00 :   663e8:  ldp     x22, x23, [x29, #40]
            0.00 :   663ec:  b       66370 <__getdelim@@GLIBC_2.17+0x1f0>
            0.00 :   663f0:  ldr     w2, [x0, #4]
            0.00 :   663f4:  add     w2, w2, #0x1
            0.00 :   663f8:  str     w2, [x0, #4]
            0.00 :   663fc:  tbz     w1, #5, 66214 <__getdelim@@GLIBC_2.17+0x94>
            0.00 :   66400:  mov     x24, #0xffffffffffffffff        // #-1
            0.00 :   66404:  ldr     x19, [x29, #16]
            0.00 :   66408:  b       66330 <__getdelim@@GLIBC_2.17+0x1b0>
            0.00 :   6640c:  nop
            0.00 :   66410:  ldr     x0, [x21]
            0.00 :   66414:  strb    wzr, [x0, x24]
            0.00 :   66418:  ldr     w1, [x20]
            0.00 :   6641c:  ldr     x19, [x29, #16]
            0.00 :   66420:  b       66328 <__getdelim@@GLIBC_2.17+0x1a8>
            0.00 :   66424:  nop
            0.00 :   66428:  mov     x24, #0xffffffffffffffff        // #-1
            0.00 :   6642c:  ldr     w1, [x20]
            0.00 :   66430:  b       66328 <__getdelim@@GLIBC_2.17+0x1a8>
            0.00 :   66434:  nop
            0.00 :   66438:  mov     x24, #0xffffffffffffffff        // #-1
            0.00 :   6643c:  ldr     w1, [x20]
            0.00 :   66440:  ldr     x19, [x29, #16]
            0.00 :   66444:  b       66328 <__getdelim@@GLIBC_2.17+0x1a8>
            0.00 :   66448:  bl      e3ba0 <pthread_setcanceltype@@GLIBC_2.17+0x30>
            0.00 :   6644c:  b       661f8 <__getdelim@@GLIBC_2.17+0x78>
            0.00 :   66450:  adrp    x0, 17f000 <sys_sigabbrev@@GLIBC_2.17+0x320>
            0.00 :   66454:  ldr     x0, [x0, #3624]
            0.00 :   66458:  mrs     x1, tpidr_el0
            0.00 :   6645c:  mov     w2, #0x16                       // #22
            0.00 :   66460:  mov     x24, #0xffffffffffffffff        // #-1
            0.00 :   66464:  str     w2, [x1, x0]
            0.00 :   66468:  b       66370 <__getdelim@@GLIBC_2.17+0x1f0>
            0.00 :   6646c:  ldr     w1, [x20]
            0.00 :   66470:  mov     x4, x0
            0.00 :   66474:  tbnz    w1, #15, 6648c <__getdelim@@GLIBC_2.17+0x30c>
            0.00 :   66478:  ldr     x0, [x20, #136]
            0.00 :   6647c:  ldr     w1, [x0, #4]
            0.00 :   66480:  sub     w1, w1, #0x1
            0.00 :   66484:  str     w1, [x0, #4]
            0.00 :   66488:  cbz     w1, 66494 <__getdelim@@GLIBC_2.17+0x314>
            0.00 :   6648c:  mov     x0, x4
            0.00 :   66490:  bl      20e40 <gnu_get_libc_version@@GLIBC_2.17+0x130>
            0.00 :   66494:  str     xzr, [x0, #8]
            0.00 :   66498:  ldxr    w2, [x0]
            0.00 :   6649c:  stlxr   w3, w1, [x0]
            0.00 :   664a0:  cbnz    w3, 66498 <__getdelim@@GLIBC_2.17+0x318>
            0.00 :   664a4:  cmp     w2, #0x1
            0.00 :   664a8:  b.le    6648c <__getdelim@@GLIBC_2.17+0x30c>
            0.00 :   664ac:  mov     x1, #0x81                       // #129
            0.00 :   664b0:  mov     x2, #0x1                        // #1
            0.00 :   664b4:  mov     x3, #0x0                        // #0
            0.00 :   664b8:  mov     x8, #0x62                       // #98
            0.00 :   664bc:  svc     #0x0
            0.00 :   664c0:  b       6648c <__getdelim@@GLIBC_2.17+0x30c>
      Signed-off-by: NYang Jihong <yangjihong1@huawei.com>
      Tested-by: NLeo Yan <leo.yan@linaro.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210615091704.259202-1-yangjihong1@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4bcbe438
  4. 29 4月, 2021 2 次提交
  5. 14 4月, 2021 1 次提交
    • Y
      perf annotate: Fix sample events lost in stdio mode · 5676dba7
      Yang Jihong 提交于
      In hist__find_annotations(), since different 'struct hist_entry' entries
      may point to same symbol, we free notes->src to signal already processed
      this symbol in stdio mode; when annotate, entry will skipped if
      notes->src is NULL to avoid repeated output.
      
      However, there is a problem, for example, run the following command:
      
       # perf record -e branch-misses -e branch-instructions -a sleep 1
      
      perf.data file contains different types of sample event.
      
      If the same IP sample event exists in branch-misses and branch-instructions,
      this event uses the same symbol. When annotate branch-misses events, notes->src
      corresponding to this event is set to null, as a result, when annotate
      branch-instructions events, this event is skipped and no annotate is output.
      
      Solution of this patch is to remove zfree in hists__find_annotations and
      change sort order to "dso,symbol" to avoid duplicate output when different
      processes correspond to the same symbol.
      Signed-off-by: NYang Jihong <yangjihong1@huawei.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: zhangjinhao2@huawei.com
      Link: http://lore.kernel.org/lkml/20210319123527.173883-1-yangjihong1@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5676dba7
  6. 31 3月, 2021 1 次提交
  7. 24 3月, 2021 1 次提交
  8. 01 12月, 2020 2 次提交
  9. 28 5月, 2020 1 次提交
  10. 06 5月, 2020 3 次提交
  11. 27 2月, 2020 2 次提交
    • R
      perf annotate: Prefer cmdline option over default config · 812b0f52
      Ravi Bangoria 提交于
      For all the perf-config options that can also be set from command line
      option, the preference is given to command line version in case of any
      conflict. But that's opposite in case of perf annotate. i.e. the more
      preference is given to default option rather than command line option.
      Fix it.
      
      Before:
      
        $ ./perf config
        annotate.show_nr_samples=false
      
        $ ./perf annotate shash --show-nr-samples
        Percent│
               │24:   mov    -0xc(%rbp),%eax
         49.19 │      imul   $0x1003f,%eax,%ecx
               │      mov    -0x18(%rbp),%rax
      
      After:
      
        Samples│
               │24:   mov    -0xc(%rbp),%eax
             1 │      imul   $0x1003f,%eax,%ecx
               │      mov    -0x18(%rbp),%rax
      Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Yisheng Xie <xieyisheng1@huawei.com>
      Link: http://lore.kernel.org/lkml/20200213064306.160480-7-ravi.bangoria@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      812b0f52
    • R
      perf annotate: Make perf config effective · 7384083b
      Ravi Bangoria 提交于
      perf default config set by user in [annotate] section is totally ignored
      by annotate code. Fix it.
      
      Before:
      
        $ ./perf config
        annotate.hide_src_code=true
        annotate.show_nr_jumps=true
        annotate.show_nr_samples=true
      
        $ ./perf annotate shash
               │    unsigned h = 0;
               │      movl   $0x0,-0xc(%rbp)
               │    while (*s)
               │    ↓ jmp    44
               │    h = 65599 * h + *s++;
         11.33 │24:   mov    -0xc(%rbp),%eax
         43.50 │      imul   $0x1003f,%eax,%ecx
               │      mov    -0x18(%rbp),%rax
      
      After:
      
               │        movl   $0x0,-0xc(%rbp)
               │      ↓ jmp    44
             1 │1 24:   mov    -0xc(%rbp),%eax
             4 │        imul   $0x1003f,%eax,%ecx
               │        mov    -0x18(%rbp),%rax
      
      Note that we have removed show_nr_samples and show_total_period from
      annotation_options because they are not used. Instead of them we use
      symbol_conf.show_nr_samples and symbol_conf.show_total_period.
      
      Committer testing:
      
      Using 'perf annotate --stdio2' to use the TUI rendering but emitting the output to stdio:
      
        # perf config
        #
        # perf config annotate.hide_src_code=true
        # perf config
        annotate.hide_src_code=true
        #
        # perf config annotate.show_nr_jumps=true
        # perf config annotate.show_nr_samples=true
        # perf config
        annotate.hide_src_code=true
        annotate.show_nr_jumps=true
        annotate.show_nr_samples=true
        #
        #
      
      Before:
      
        # perf annotate --stdio2 ObjectInstance::weak_pointer_was_finalized
        Samples: 1  of event 'cycles', 4000 Hz, Event count (approx.): 830873, [percent: local period]
        ObjectInstance::weak_pointer_was_finalized() /usr/lib64/libgjs.so.0.0.0
        Percent
                    00000000000609f0 <ObjectInstance::weak_pointer_was_finalized()@@base>:
                      endbr64
                      cmpq    $0x0,0x20(%rdi)
                    ↓ je      10
                      xor     %eax,%eax
                    ← retq
                      xchg    %ax,%ax
        100.00  10:   push    %rbp
                      cmpq    $0x0,0x18(%rdi)
                      mov     %rdi,%rbp
                    ↓ jne     20
                1b:   xor     %eax,%eax
                      pop     %rbp
                    ← retq
                      nop
                20:   lea     0x18(%rdi),%rdi
                    → callq   JS_UpdateWeakPointerAfterGC(JS::Heap<JSObject*
                      cmpq    $0x0,0x18(%rbp)
                    ↑ jne     1b
                      mov     %rbp,%rdi
                    → callq   ObjectBase::jsobj_addr() const@plt
                      mov     $0x1,%eax
                      pop     %rbp
                    ← retq
        #
      
      After:
      
        # perf annotate --stdio2 ObjectInstance::weak_pointer_was_finalized 2> /dev/null
        Samples: 1  of event 'cycles', 4000 Hz, Event count (approx.): 830873, [percent: local period]
        ObjectInstance::weak_pointer_was_finalized() /usr/lib64/libgjs.so.0.0.0
        Samples       endbr64
                      cmpq    $0x0,0x20(%rdi)
                    ↓ je      10
                      xor     %eax,%eax
                    ← retq
                      xchg    %ax,%ax
           1  1 10:   push    %rbp
                      cmpq    $0x0,0x18(%rdi)
                      mov     %rdi,%rbp
                    ↓ jne     20
              1 1b:   xor     %eax,%eax
                      pop     %rbp
                    ← retq
                      nop
              1 20:   lea     0x18(%rdi),%rdi
                    → callq   JS_UpdateWeakPointerAfterGC(JS::Heap<JSObject*
                      cmpq    $0x0,0x18(%rbp)
                    ↑ jne     1b
                      mov     %rbp,%rdi
                    → callq   ObjectBase::jsobj_addr() const@plt
                      mov     $0x1,%eax
                      pop     %rbp
                    ← retq
        #
        # perf config annotate.show_nr_jumps
        annotate.show_nr_jumps=true
        # perf config annotate.show_nr_jumps=false
        # perf config annotate.show_nr_jumps
        annotate.show_nr_jumps=false
        #
        # perf annotate --stdio2 ObjectInstance::weak_pointer_was_finalized 2> /dev/null
        Samples: 1  of event 'cycles', 4000 Hz, Event count (approx.): 830873, [percent: local period]
        ObjectInstance::weak_pointer_was_finalized() /usr/lib64/libgjs.so.0.0.0
        Samples       endbr64
                      cmpq    $0x0,0x20(%rdi)
                    ↓ je      10
                      xor     %eax,%eax
                    ← retq
                      xchg    %ax,%ax
             1  10:   push    %rbp
                      cmpq    $0x0,0x18(%rdi)
                      mov     %rdi,%rbp
                    ↓ jne     20
                1b:   xor     %eax,%eax
                      pop     %rbp
                    ← retq
                      nop
                20:   lea     0x18(%rdi),%rdi
                    → callq   JS_UpdateWeakPointerAfterGC(JS::Heap<JSObject*
                      cmpq    $0x0,0x18(%rbp)
                    ↑ jne     1b
                      mov     %rbp,%rdi
                    → callq   ObjectBase::jsobj_addr() const@plt
                      mov     $0x1,%eax
                      pop     %rbp
                    ← retq
        #
      Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Yisheng Xie <xieyisheng1@huawei.com>
      Link: http://lore.kernel.org/lkml/20200213064306.160480-6-ravi.bangoria@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7384083b
  12. 14 1月, 2020 1 次提交
    • A
      perf tools: Support --prefix/--prefix-strip · 3b0b16bf
      Andi Kleen 提交于
      The objdump utility has useful --prefix / --prefix-strip options to
      allow changing source code file names hardcoded into executables' debug
      info. Add options to 'perf report', 'perf top' and 'perf annotate',
      which are then passed to objdump.
      
        $ mkdir foo
        $ echo 'main() { for (;;); }' > foo/foo.c
        $ gcc -g foo/foo.c
        foo/foo.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
            1 | main() { for (;;); }
              | ^~~~
        $ perf record ./a.out
        ^C[ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.230 MB perf.data (5721 samples) ]
        $ mv foo bar
        $ perf annotate
        <does not show source code>
        $ perf annotate --prefix=/home/ak/lsrc/git/bar --prefix-strip=5
        <does show source code>
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Tested-by: NJiri Olsa <jolsa@redhat.com>
      LPU-Reference: 20200107210444.214071-1-andi@firstfloor.org
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3b0b16bf
  13. 12 11月, 2019 2 次提交
  14. 07 11月, 2019 1 次提交
  15. 21 9月, 2019 1 次提交
  16. 20 9月, 2019 1 次提交
  17. 01 9月, 2019 3 次提交
  18. 30 7月, 2019 1 次提交
  19. 09 7月, 2019 1 次提交
  20. 16 5月, 2019 1 次提交
    • J
      perf annotate: Remove hist__account_cycles() from callback · bdd1666b
      Jin Yao 提交于
      The hist__account_cycles() function is executed when the
      hist_iter__branch_callback() is called.
      
      But it looks it's not necessary.  In hist__account_cycles, it already
      walks on all branch entries.
      
      This patch moves the hist__account_cycles out of callback, now the data
      processing is much faster than before.
      
      Previous code has an issue that the ch[offset].num++ (in
      __symbol__account_cycles) is executed repeatedly since
      hist__account_cycles is called in each hist_iter__branch_callback, so
      the counting of ch[offset].num is not correct (too big).
      
      With this patch, the issue is fixed. And we don't need the code of
      "ch->reset >= ch->num / 2" to check if there are too many overlaps (in
      annotation__count_and_fill), otherwise some data would be hidden.
      
      Now, we can try, for example:
      
        perf record -b ...
        perf annotate or perf report -s symbol
      
      The before/after output should be no change.
      
       v3:
       ---
       Fix the crash in stdio mode.
       Like previous code, it needs the checking of ui__has_annotation()
       before hist__account_cycles()
      
       v2:
       ---
       1. Cover the similar perf report
       2. Remove the checking code "ch->reset >= ch->num / 2"
      Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jin Yao <yao.jin@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1552684577-29041-1-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bdd1666b
  21. 23 2月, 2019 1 次提交
    • J
      perf data: Add global path holder · 2d4f2799
      Jiri Olsa 提交于
      Add a 'path' member to 'struct perf_data'. It will keep the configured
      path for the data (const char *). The path in struct perf_data_file is
      now dynamically allocated (duped) from it.
      
      This scheme is useful/used in following patches where struct
      perf_data::path holds the 'configure' directory path and struct
      perf_data_file::path holds the allocated path for specific files.
      
      Also it actually makes the code little simpler.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/20190221094145.9151-3-jolsa@kernel.org
      [ Fixup data-convert-bt.c missing conversion ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2d4f2799
  22. 06 2月, 2019 1 次提交
  23. 25 1月, 2019 2 次提交
  24. 19 9月, 2018 1 次提交
  25. 09 8月, 2018 1 次提交
    • J
      perf annotate: Add --percent-type option · 88c21190
      Jiri Olsa 提交于
      Add --percent-type option to set annotation percent type from following
      choices:
      
        global-period, local-period, global-hits, local-hits
      
      Examples:
      
        $ perf annotate --percent-type period-local --stdio | head -1
         Percent         |      Source code ... es, percent: local period)
        $ perf annotate --percent-type hits-local --stdio | head -1
         Percent         |      Source code ... es, percent: local hits)
        $ perf annotate --percent-type hits-global --stdio | head -1
         Percent         |      Source code ... es, percent: global hits)
        $ perf annotate --percent-type period-global --stdio | head -1
         Percent         |      Source code ... es, percent: global period)
      
      The local/global keywords set if the percentage is computed in the scope
      of the function (local) or the whole data (global).
      
      The period/hits keywords set the base the percentage is computed on -
      the samples period or the number of samples (hits).
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/20180804130521.11408-20-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      88c21190
  26. 25 6月, 2018 1 次提交
    • R
      perf tools: Fix crash caused by accessing feat_ops[HEADER_LAST_FEATURE] · 92ead7ee
      Ravi Bangoria 提交于
      perf_event__process_feature() accesses feat_ops[HEADER_LAST_FEATURE]
      which is not defined and thus perf is crashing. HEADER_LAST_FEATURE is
      used as an end marker for the perf report but it's unused for perf
      script/annotate. Ignore HEADER_LAST_FEATURE for perf script/annotate,
      just like it is done in 'perf report'.
      
      Before:
        # perf record -o - ls | perf script
        <SNIP 'ls' output>
        Segmentation fault (core dumped)
        #
      
      After:
        # perf record -o - ls | perf script
        <SNIP 'ls' output>
        Segmentation fault (core dumped)
        ls 7031 4392.099856:  250000 cpu-clock:uhH:  7f5e0ce7cd60
        ls 7031 4392.100355:  250000 cpu-clock:uhH:  7f5e0c706ef7
        #
      Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Fixes: 57b5de46 ("perf report: Support forced leader feature in pipe mode")
      Link: http://lkml.kernel.org/r/20180625124220.6434-4-ravi.bangoria@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      92ead7ee
  27. 04 6月, 2018 5 次提交