1. 17 5月, 2016 1 次提交
  2. 12 5月, 2016 1 次提交
  3. 06 5月, 2016 1 次提交
  4. 08 12月, 2015 1 次提交
  5. 12 11月, 2015 1 次提交
    • M
      perf annotate: Support full source file paths for srcline fix · 4a4c03c1
      Michael Petlan 提交于
      The --full-paths option did not show the full source file paths in the 'perf
      annotate' tool, because the value of the option was not propagated into the
      related functions.
      
      With this patch the value of the --full-paths option is known to the function
      that composes the srcline string, so it prints the full path when necessary.
      
      Committer Note:
      
      This affects annotate when the --print-line option is used:
      
        # perf annotate -h 2>&1 | grep print-line
            -l, --print-line      print matching source lines (may be slow)
      
      Looking just at the lines that should be affected by this change:
      
      Before:
      
        # perf annotate --print-line --full-paths --stdio fput | grep '\.[ch]:[0-9]\+'
           94.44 atomic64_64.h:114
            5.56 file_table.c:265
         file_table.c:265    5.56 :	  ffffffff81219a00:       callq  ffffffff81769360 <__fentry__>
         atomic64_64.h:114   94.44 :	  ffffffff81219a05:       lock decq 0x38(%rdi)
      
      After:
      
        # perf annotate --print-line --full-paths --stdio fput | grep '\.[ch]:[0-9]\+'
           94.44 /home/git/linux/arch/x86/include/asm/atomic64_64.h:114
            5.56 /home/git/linux/fs/file_table.c:265
         /home/git/linux/fs/file_table.c:265    5.56 :	  ffffffff81219a00:       callq  ffffffff81769360 <__fentry__>
         /home/git/linux/arch/x86/include/asm/atomic64_64.h:114   94.44 :	  ffffffff81219a05:       lock decq 0x38(%rdi)
        #
      Signed-off-by: NMichael Petlan <mpetlan@redhat.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Link: http://permalink.gmane.org/gmane.linux.kernel.perf.user/2365Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4a4c03c1
  6. 06 11月, 2015 1 次提交
    • A
      perf annotate: Inform the user about objdump failures in --stdio · 62ec9b3f
      Andi Kleen 提交于
      When the browser fails to annotate it is difficult for users to find out
      what went wrong.
      
      Add some errors for objdump failures that are displayed in the UI.
      
      Note it would be even better to handle these errors smarter, like
      falling back to the binary when the debug info is somehow corrupted. But
      for now just giving a better error is an improvement.
      
      Committer note:
      
      This works for --stdio, where errors just scroll by the screen:
      
        # perf annotate --stdio intel_idle
        Failure running objdump  --start-address=0xffffffff81418290 --stop-address=0xffffffff814183ae -l -d --no-show-raw -S -C /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1 2>/dev/null|grep -v /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1|expand
         Percent |      Source code & Disassembly of vmlinux for cycles:pp
        ------------------------------------------------------------------
      
      And with that one can use that command line to try to find out more about what
      happened instead of getting a blank screen, an improvement.
      
      We need tho to improve this further to get it to work with other UIs, like
      --tui and --gtk, where it continues showing a blank screen, no messages, as
      the pr_err() used is enough just for --stdio.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/1446779167-18949-1-git-send-email-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      62ec9b3f
  7. 22 10月, 2015 1 次提交
  8. 21 8月, 2015 1 次提交
  9. 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
  10. 07 8月, 2015 1 次提交
  11. 20 6月, 2015 2 次提交
  12. 28 5月, 2015 1 次提交
  13. 23 3月, 2015 1 次提交
  14. 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
  15. 22 1月, 2015 1 次提交
  16. 21 1月, 2015 2 次提交
  17. 25 11月, 2014 1 次提交
  18. 19 11月, 2014 2 次提交
  19. 15 10月, 2014 1 次提交
  20. 15 8月, 2014 1 次提交
  21. 31 7月, 2014 1 次提交
  22. 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
  23. 24 2月, 2014 1 次提交
  24. 28 12月, 2013 2 次提交
  25. 19 12月, 2013 4 次提交
  26. 11 12月, 2013 1 次提交
  27. 14 10月, 2013 2 次提交
  28. 10 10月, 2013 3 次提交
  29. 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
  30. 08 8月, 2013 1 次提交