1. 14 10月, 2013 2 次提交
  2. 10 10月, 2013 3 次提交
  3. 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
  4. 08 8月, 2013 3 次提交
  5. 16 3月, 2013 9 次提交
  6. 15 2月, 2013 1 次提交
    • N
      perf annotate: Fix warning message on a missing vmlinux · e3a34029
      Namhyung Kim 提交于
      When perf annotate runs with no vmlinux file it cannot annotate kernel
      symbols because the kallsyms only provides symbol addresses.  So it
      recommends to run perf buildid-cache to install proper vmlinux image.
      
      But running perf buildid-cache -av vmlinux as the message gives me a
      following error:
      
        $ perf buildid-cache -av /home/namhyung/build/kernel/vmlinux
        Couldn't add v: No such file or directory
      
      Since the -a option receives a parameter, 'v' should not be after the
      option.
      
      In addition -a option is not work for this case since the build-id cache
      already has a kallsyms with same build-id so it'll fail with EEXIST.
      Use recently added -u (--update) option for it.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Borislav Petkov <bp@alien8.de>
      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/1360227734-375-6-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e3a34029
  7. 10 11月, 2012 2 次提交
    • N
      perf annotate: Merge same lines in summary view · 41127965
      Namhyung Kim 提交于
      The --print-line option of perf annotate command shows summary for
      each source line.  But it didn't merge same lines so that it can
      appear multiple times.
      
      * before:
      
        Sorted summary for file /home/namhyung/bin/mcol
        ----------------------------------------------
           21.71 /home/namhyung/tmp/mcol.c:26
           20.66 /home/namhyung/tmp/mcol.c:25
            9.53 /home/namhyung/tmp/mcol.c:24
            7.68 /home/namhyung/tmp/mcol.c:25
            7.67 /home/namhyung/tmp/mcol.c:25
            7.66 /home/namhyung/tmp/mcol.c:26
            7.49 /home/namhyung/tmp/mcol.c:26
            6.92 /home/namhyung/tmp/mcol.c:25
            6.81 /home/namhyung/tmp/mcol.c:25
            1.07 /home/namhyung/tmp/mcol.c:26
            0.52 /home/namhyung/tmp/mcol.c:25
            0.51 /home/namhyung/tmp/mcol.c:25
            0.51 /home/namhyung/tmp/mcol.c:24
      
      * after:
      
        Sorted summary for file /home/namhyung/bin/mcol
        ----------------------------------------------
           50.77 /home/namhyung/tmp/mcol.c:25
           37.94 /home/namhyung/tmp/mcol.c:26
           10.04 /home/namhyung/tmp/mcol.c:24
      
      To do that, introduce percent_sum field so that the normal
      line-by-line output doesn't get changed.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1352440729-21848-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      41127965
    • N
      perf annotate: Whitespace fixups · 2ba34aaa
      Namhyung Kim 提交于
      Some lines are indented by whitespace characters rather than tabs.  Fix
      them.
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1352482044-3443-3-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2ba34aaa
  8. 31 10月, 2012 1 次提交
  9. 29 10月, 2012 1 次提交
  10. 11 9月, 2012 1 次提交
    • I
      perf tools: Use __maybe_used for unused variables · 1d037ca1
      Irina Tirdea 提交于
      perf defines both __used and __unused variables to use for marking
      unused variables. The variable __used is defined to
      __attribute__((__unused__)), which contradicts the kernel definition to
      __attribute__((__used__)) for new gcc versions. On Android, __used is
      also defined in system headers and this leads to warnings like: warning:
      '__used__' attribute ignored
      
      __unused is not defined in the kernel and is not a standard definition.
      If __unused is included everywhere instead of __used, this leads to
      conflicts with glibc headers, since glibc has a variables with this name
      in its headers.
      
      The best approach is to use __maybe_unused, the definition used in the
      kernel for __attribute__((unused)). In this way there is only one
      definition in perf sources (instead of 2 definitions that point to the
      same thing: __used and __unused) and it works on both Linux and Android.
      This patch simply replaces all instances of __used and __unused with
      __maybe_unused.
      Signed-off-by: NIrina Tirdea <irina.tirdea@intel.com>
      Acked-by: NPekka Enberg <penberg@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung.kim@lge.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com
      [ committer note: fixed up conflict with a116e05d in builtin-sched.c ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1d037ca1
  11. 09 9月, 2012 1 次提交
  12. 06 9月, 2012 1 次提交
  13. 26 7月, 2012 1 次提交
  14. 25 7月, 2012 1 次提交
    • J
      perf symbols: Factor DSO symtab types to generic binary types · 44f24cb3
      Jiri Olsa 提交于
      Adding interface to access DSOs so it could be used
      from another place.
      
      New DSO binary type is added - making current SYMTAB__*
      types more general:
         DSO_BINARY_TYPE__* = SYMTAB__*
      
      Following function is added to return path based on the specified
      binary type:
         dso__binary_type_file
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Arun Sharma <asharma@fb.com>
      Cc: Benjamin Redelings <benjamin.redelings@nescent.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Frank Ch. Eigler <fche@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Robert Richter <robert.richter@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Ulrich Drepper <drepper@gmail.com>
      Link: http://lkml.kernel.org/r/1342959280-5361-10-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      44f24cb3
  15. 13 5月, 2012 2 次提交
  16. 12 5月, 2012 2 次提交
  17. 11 5月, 2012 1 次提交
  18. 08 5月, 2012 2 次提交
  19. 26 4月, 2012 1 次提交
  20. 25 4月, 2012 1 次提交
  21. 21 4月, 2012 2 次提交
  22. 20 4月, 2012 1 次提交