1. 21 8月, 2015 1 次提交
  2. 17 8月, 2015 1 次提交
    • A
      perf annotate: Fix 32-bit compilation error in util/annotate.c · 3d7245b0
      Adrian Hunter 提交于
      Fix the following 32-bit compilation errors:
      
        util/annotate.c: In function ‘addr_map_symbol__account_cycles’:
        util/annotate.c:643:3: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘u64’ [-Werror=format=]
          pr_debug2("BB with bad start: addr %lx start %lx sym %lx saddr %lx\n",
            ^
        util/annotate.c:643:3: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘u64’ [-Werror=format=]
        util/annotate.c:643:3: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘u64’ [-Werror=format=]
      
      These were introduced by the patch:
      
      "perf report: Add infrastructure for a cycles histogram"
      
      Also change the 'saddr' variable from 'unsigned long' to 'u64'
      noting that theoretically we could be processing data captured
      on a 64-bit machine but processing it on a 32-bit machine.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Fixes: d4957633 ("perf report: Add infrastructure for a cycles histogram")
      Link: http://lkml.kernel.org/r/1439536294-18241-1-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3d7245b0
  3. 07 8月, 2015 1 次提交
  4. 20 6月, 2015 2 次提交
  5. 28 5月, 2015 1 次提交
  6. 23 3月, 2015 1 次提交
  7. 06 3月, 2015 1 次提交
    • A
      perf annotate: Fix fallback to unparsed disassembler line · 3995614d
      Arnaldo Carvalho de Melo 提交于
      When annotating source/disasm lines the perf tools parse the output of
      objdump, trying to provide augmented output that allows navigating
      jumps, calls, etc.
      
      But when a line output by objdump can't be parsed the annotation code
      falls back to just presenting the unparsed line.
      
      When fixing a leak in the 0fb9f2aa commit ("perf annotate: Fix
      memory leaks in LOCK handling") we failed to take that into account and
      instead tried to free one of the data structures that should be freed
      only when successfully allocated, oops, segfault.
      
      There was a change in the way the objdump output for lock prefixed
      instructions is formatted that lead the relevant parser to fail to grok
      it.
      
      At least RHEL7 works ok, but Fedora 20 segfaults.
      
      Fix it by making the ins__delete() destructor work like the most basic
      destructor: free().
      
      Namely make it accept a NULL pointer and when handling it just do
      nothing.
      
      Further investigation is needed to figure out the nature of the objdump
      output change so as to make the parser grok it.
      Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Rabin Vincent <rabin@rab.in>
      Link: http://lkml.kernel.org/n/tip-7wsy0zo292pif0yjoqpfryrz@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3995614d
  8. 22 1月, 2015 1 次提交
  9. 21 1月, 2015 2 次提交
  10. 25 11月, 2014 1 次提交
  11. 19 11月, 2014 2 次提交
  12. 15 10月, 2014 1 次提交
  13. 15 8月, 2014 1 次提交
  14. 31 7月, 2014 1 次提交
  15. 19 3月, 2014 1 次提交
    • A
      perf annotate: Print the evsel name in the stdio output · 9cdbadce
      Arnaldo Carvalho de Melo 提交于
      So that when showing multiple events annotations, we can figure out
      which is which:
      
        # perf record -a -e instructions,cycles sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.826 MB perf.data (~36078 samples) ]
        # perf evlist
        instructions
        cycles
        # perf annotate intel_idle 2> /dev/null | head -1
         Percent |	Source code & Disassembly of vmlinux for instructions
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-n1r51l329434js84qtb2c6l9@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9cdbadce
  16. 24 2月, 2014 1 次提交
  17. 28 12月, 2013 2 次提交
  18. 19 12月, 2013 4 次提交
  19. 11 12月, 2013 1 次提交
  20. 14 10月, 2013 2 次提交
  21. 10 10月, 2013 3 次提交
  22. 19 9月, 2013 1 次提交
    • A
      perf annotate: Fix objdump line parsing offset validation · 886b37ba
      Adrian Hunter 提交于
      When parsing lines from objdump a line containing source code starting
      with a numeric label is mistaken for a line of disassembly starting with
      a memory address.
      
      Current validation fails to recognise that the "memory address" is out
      of range and calculates an invalid offset which later causes this
      segfault:
      
      Program received signal SIGSEGV, Segmentation fault.
      0x0000000000457315 in disasm__calc_percent (notes=0xc98970, evidx=0, offset=143705, end=2127526177, path=0x7fffffffbf50)
          at util/annotate.c:631
      631				hits += h->addr[offset++];
      (gdb) bt
       #0  0x0000000000457315 in disasm__calc_percent (notes=0xc98970, evidx=0, offset=143705, end=2127526177, path=0x7fffffffbf50)
          at util/annotate.c:631
       #1  0x00000000004d65e3 in annotate_browser__calc_percent (browser=0x7fffffffd130, evsel=0xa01da0) at ui/browsers/annotate.c:364
       #2  0x00000000004d7433 in annotate_browser__run (browser=0x7fffffffd130, evsel=0xa01da0, hbt=0x0) at ui/browsers/annotate.c:672
       #3  0x00000000004d80c9 in symbol__tui_annotate (sym=0xc989a0, map=0xa02660, evsel=0xa01da0, hbt=0x0) at ui/browsers/annotate.c:962
       #4  0x00000000004d7aa0 in hist_entry__tui_annotate (he=0xdf73f0, evsel=0xa01da0, hbt=0x0) at ui/browsers/annotate.c:823
       #5  0x00000000004dd648 in perf_evsel__hists_browse (evsel=0xa01da0, nr_events=1, helpline=
          0x58b768 "For a higher level overview, try: perf report --sort comm,dso", ev_name=0xa02cd0 "cycles", left_exits=false, hbt=
          0x0, min_pcnt=0, env=0xa011e0) at ui/browsers/hists.c:1659
       #6  0x00000000004de372 in perf_evlist__tui_browse_hists (evlist=0xa01520, help=
          0x58b768 "For a higher level overview, try: perf report --sort comm,dso", hbt=0x0, min_pcnt=0, env=0xa011e0)
          at ui/browsers/hists.c:1950
       #7  0x000000000042cf6b in __cmd_report (rep=0x7fffffffd6c0) at builtin-report.c:581
       #8  0x000000000042e25d in cmd_report (argc=0, argv=0x7fffffffe4b0, prefix=0x0) at builtin-report.c:965
       #9  0x000000000041a0e1 in run_builtin (p=0x801548, argc=1, argv=0x7fffffffe4b0) at perf.c:319
       #10 0x000000000041a319 in handle_internal_command (argc=1, argv=0x7fffffffe4b0) at perf.c:376
       #11 0x000000000041a465 in run_argv (argcp=0x7fffffffe38c, argv=0x7fffffffe380) at perf.c:420
       #12 0x000000000041a707 in main (argc=1, argv=0x7fffffffe4b0) at perf.c:521
      
      After the fix is applied the symbol can be annotated showing the
      problematic line "1:      rep"
      
      copy_user_generic_string  /usr/lib/debug/lib/modules/3.9.10-100.fc17.x86_64/vmlinux
                   */
                  ENTRY(copy_user_generic_string)
                          CFI_STARTPROC
                          ASM_STAC
                          andl %edx,%edx
                    and    %edx,%edx
                          jz 4f
                    je     37
                          cmpl $8,%edx
                    cmp    $0x8,%edx
                          jb 2f           /* less than 8 bytes, go to byte copy loop */
                    jb     33
                          ALIGN_DESTINATION
                    mov    %edi,%ecx
                    and    $0x7,%ecx
                    je     28
                    sub    $0x8,%ecx
                    neg    %ecx
                    sub    %ecx,%edx
              1a:   mov    (%rsi),%al
                    mov    %al,(%rdi)
                    inc    %rsi
                    inc    %rdi
                    dec    %ecx
                    jne    1a
                          movl %edx,%ecx
              28:   mov    %edx,%ecx
                          shrl $3,%ecx
                    shr    $0x3,%ecx
                          andl $7,%edx
                    and    $0x7,%edx
                  1:      rep
      100.00        rep    movsq %ds:(%rsi),%es:(%rdi)
                          movsq
                  2:      movl %edx,%ecx
              33:   mov    %edx,%ecx
                  3:      rep
                    rep    movsb %ds:(%rsi),%es:(%rdi)
                          movsb
                  4:      xorl %eax,%eax
              37:   xor    %eax,%eax
                    data32 xchg %ax,%ax
                          ASM_CLAC
                          ret
                    retq
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1379009721-27667-1-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      886b37ba
  23. 08 8月, 2013 3 次提交
  24. 16 3月, 2013 5 次提交
    • N
      perf annotate browser: Use disasm__calc_percent() · e64aa75b
      Namhyung Kim 提交于
      The disasm_line__calc_percent() which was used by annotate browser code
      almost duplicates disasm__calc_percent.  Let's get rid of the code
      duplication.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1362462812-30885-11-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e64aa75b
    • N
      perf annotate: Support event group view for --print-line · 1491c22a
      Namhyung Kim 提交于
      Dynamically allocate source_line_percent according to a number of group
      members and save nr_pcnt to the struct source_line.  This way we can
      handle multiple events in a general manner.
      
      However since the size of struct source_line is not fixed anymore,
      iterating whole source_line should care about its size.
      
        $ perf annotate --group --stdio --print-line
      
        Sorted summary for file /lib/ld-2.11.1.so
        ----------------------------------------------
           33.33    0.00 /build/buildd/eglibc-2.11.1/elf/rtld.c:381
           33.33    0.00 /build/buildd/eglibc-2.11.1/elf/dynamic-link.h:128
           33.33    0.00 /build/buildd/eglibc-2.11.1/elf/do-rel.h:105
            0.00   75.00 /build/buildd/eglibc-2.11.1/elf/dynamic-link.h:137
            0.00   25.00 /build/buildd/eglibc-2.11.1/elf/dynamic-link.h:187
        ...
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1362462812-30885-9-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1491c22a
    • N
      perf annotate: Factor out struct source_line_percent · c5a8368c
      Namhyung Kim 提交于
      The source_line_percent struct contains percentage value of the symbol
      histogram.  This is a preparation of event group view change.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1362462812-30885-8-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c5a8368c
    • N
      perf evsel: Introduce perf_evsel__is_group_event() helper · 759ff497
      Namhyung Kim 提交于
      The perf_evsel__is_group_event function is for checking whether given
      evsel needs event group view support or not.  Please note that it's
      different to the existing perf_evsel__is_group_leader() which checks
      only the given evsel is a leader or a standalone (i.e. non-group) event
      regardless of event group feature.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1362462812-30885-7-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      759ff497
    • N
      perf annotate: Add basic support to event group view · b1dd4432
      Namhyung Kim 提交于
      Add --group option to enable event grouping.  When enabled, all the
      group members information will be shown with the leader so skip
      non-leader events.
      
      It only supports --stdio output currently.  Later patches will extend
      additional features.
      
       $ perf annotate --group --stdio
       ...
        Percent                 |      Source code & Disassembly of libpthread-2.15.so
       --------------------------------------------------------------------------------
                                :
                                :
                                :
                                :      Disassembly of section .text:
                                :
                                :      000000387dc0aa50 <__pthread_mutex_unlock_usercnt>:
           8.08    2.40    5.29 :        387dc0aa50:   mov    %rdi,%rdx
           0.00    0.00    0.00 :        387dc0aa53:   mov    0x10(%rdi),%edi
           0.00    0.00    0.00 :        387dc0aa56:   mov    %edi,%eax
           0.00    0.80    0.00 :        387dc0aa58:   and    $0x7f,%eax
           3.03    2.40    3.53 :        387dc0aa5b:   test   $0x7c,%dil
           0.00    0.00    0.00 :        387dc0aa5f:   jne    387dc0aaa9 <__pthread_mutex_unlock_use
           0.00    0.00    0.00 :        387dc0aa61:   test   %eax,%eax
           0.00    0.00    0.00 :        387dc0aa63:   jne    387dc0aa85 <__pthread_mutex_unlock_use
           0.00    0.00    0.00 :        387dc0aa65:   and    $0x80,%edi
           0.00    0.00    0.00 :        387dc0aa6b:   test   %esi,%esi
           3.03    5.60    7.06 :        387dc0aa6d:   movl   $0x0,0x8(%rdx)
           0.00    0.00    0.59 :        387dc0aa74:   je     387dc0aa7a <__pthread_mutex_unlock_use
           0.00    0.00    0.00 :        387dc0aa76:   subl   $0x1,0xc(%rdx)
           2.02    5.60    1.18 :        387dc0aa7a:   mov    %edi,%esi
           0.00    0.00    0.00 :        387dc0aa7c:   lock decl (%rdx)
          83.84   83.20   82.35 :        387dc0aa7f:   jne    387dc0aada <_L_unlock_586>
           0.00    0.00    0.00 :        387dc0aa81:   nop
           0.00    0.00    0.00 :        387dc0aa82:   xor    %eax,%eax
           0.00    0.00    0.00 :        387dc0aa84:   retq
       ...
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1362462812-30885-6-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b1dd4432