1. 22 3月, 2018 2 次提交
  2. 21 3月, 2018 16 次提交
  3. 20 3月, 2018 1 次提交
    • A
      perf annotate: Use ops->target.name when available for unresolved call targets · 4c9cb2c2
      Arnaldo Carvalho de Melo 提交于
      There is a bug where when using 'perf annotate timerqueue_add' the
      target for its only routine called with the 'callq' instruction,
      'rb_insert_color', doesn't get resolved from its address when parsing
      that 'callq' instruction.
      
      That symbol resolution works when using 'perf report --tui' and then
      doing annotation for 'timerqueue_add' from there, the vmlinux
      dso->symbols rb_tree somehow gets in a state that we can't find that
      address, that is a bug that has to be further investigated.
      
      But since the objdump output has the function name, i.e. the raw objdump
      disassembled line looks like:
      
      So, before:
      
        # perf annotate timerqueue_add
      
                    │      mov    %rbx,%rdi
                    │      mov    %rbx,(%rdx)
                    │    → callq  *ffffffff8184dc80
                    │      mov    0x8(%rbp),%rdx
                    │      test   %rdx,%rdx
                    │    ↓ je     67
      
        # perf report
      
                    │      mov    %rbx,%rdi
                    │      mov    %rbx,(%rdx)
                    │    → callq  rb_insert_color
                    │      mov    0x8(%rbp),%rdx
                    │      test   %rdx,%rdx
                    │    ↓ je     67
      
      And after both look the same:
      
        # perf annotate timerqueue_add
      
                    │      mov    %rbx,%rdi
                    │      mov    %rbx,(%rdx)
                    │    → callq  rb_insert_color
                    │      mov    0x8(%rbp),%rdx
                    │      test   %rdx,%rdx
                    │    ↓ je     67
      
      From 'perf report' one can annotate and navigate to that 'rb_insert_color'
      function, but not directly from 'perf annotate timerqueue_add', that
      remains to be investigated and fixed.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-nkktz6355rhqtq7o8atr8f8r@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      4c9cb2c2
  4. 17 3月, 2018 1 次提交
    • A
      perf annotate: Use asprintf when formatting objdump command line · 6810158d
      Arnaldo Carvalho de Melo 提交于
      We were using a local buffer with an arbitrary size, that would have to
      get increased to avoid truncation as warned by gcc 8:
      
        util/annotate.c: In function 'symbol__disassemble':
        util/annotate.c:1488:4: error: '%s' directive output may be truncated writing up to 4095 bytes into a region of size between 3966 and 8086 [-Werror=format-truncation=]
            "%s %s%s --start-address=0x%016" PRIx64
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        util/annotate.c:1498:20:
            symfs_filename, symfs_filename);
                            ~~~~~~~~~~~~~~
        util/annotate.c:1490:50: note: format string is defined here
            " -l -d %s %s -C \"%s\" 2>/dev/null|grep -v \"%s:\"|expand",
                                                        ^~
        In file included from /usr/include/stdio.h:861,
                         from util/color.h:5,
                         from util/sort.h:8,
                         from util/annotate.c:14:
        /usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output 116 or more bytes (assuming 8331) into a destination of size 8192
           return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                __bos (__s), __fmt, __va_arg_pack ());
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      So switch to asprintf, that will make sure enough space is available.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-qagoy2dmbjpc9gdnaj0r3mml@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6810158d
  5. 08 3月, 2018 1 次提交
    • T
      perf annotate: Fix s390 target function disassembly · 0b58a77c
      Thomas Richter 提交于
      'perf annotate' displays function call assembler instructions with a
      right arrow. Hitting enter on this line/instruction causes the browser
      to disassemble this target function and show it on the screen.  On s390
      this results in an error message 'The called function was not found.'
      
      The function call assembly line parsing does not handle the s390 bras
      and brasl instructions. Function call__parse expects the target as first
      operand:
      
      	callq	e9140 <__fxstat>
      
      S390 has a register number as first operand:
      
      	brasl	%r14,41d60 <abort>
      
      Therefore the target addresses on s390 are always zero which is an
      invalid address.
      
      Introduce a s390 specific call parsing function which skips the first
      operand on s390.
      Signed-off-by: NThomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180307134325.96106-1-tmricht@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0b58a77c
  6. 05 3月, 2018 1 次提交
  7. 08 1月, 2018 1 次提交
    • J
      perf report: Fix a wrong offset issue when using /proc/kcore · 935f5a9d
      Jin Yao 提交于
      When a valid vmlinux is not found, 'perf report' falls back to look at
      /proc/kcore. In this case, it will report the impossible large offset.
      
      For example:
      
        # perf record -b -e cycles:k find /etc/ > /dev/null
        # perf report --stdio --branch-history
      
          22.77%  _vm_normal_page+18446603336221188162
                  |
                  ---page_remove_rmap +18446603336221188324
                     page_remove_rmap +18446603336221188487 (cycles:5)
                     unlock_page_memcg +18446603336221188096
                     page_remove_rmap +18446603336221188327 (cycles:1)
      
      The issue is the value which is passed to parameter 'addr' in
      __get_srcline() is the objdump address. It's not correct if we calculate
      the offset by using 'addr - sym->start'.
      
      This patch creates a new parameter 'ip' in __get_srcline(). It is not
      converted to objdump address.
      
      With this patch, the perf report output is:
      
          22.77%  _vm_normal_page+66
                  |
                  ---page_remove_rmap +228
                     page_remove_rmap +391 (cycles:5)
                     unlock_page_memcg +0
                     page_remove_rmap +231 (cycles:1)
                     page_remove_rmap +236
      
      Committer testing:
      
      Make sure you get any valid vmlinux out of the way, using '-v' on the
      'perf report' case and deleting it from places where perf searches them,
      like your kernel build dir and the build-id cache, in ~/.debug/.
      Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      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: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1514564812-17344-1-git-send-email-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      935f5a9d
  8. 27 12月, 2017 3 次提交
  9. 05 12月, 2017 1 次提交
  10. 29 11月, 2017 1 次提交
  11. 17 11月, 2017 10 次提交
  12. 13 11月, 2017 2 次提交