1. 29 9月, 2016 10 次提交
  2. 28 9月, 2016 3 次提交
    • W
      perf data: Fix building in 32 bit platform with libbabeltrace · f2c8852e
      Wang Nan 提交于
      On ARM32 building it report following error when we build with
      libbabeltrace:
      
        util/data-convert-bt.c: In function 'add_bpf_output_values':
        util/data-convert-bt.c:440:3: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format]
        cc1: all warnings being treated as errors
      
      Fix it by changing %lu to %zu.
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Fixes: 6122d57e ("perf data: Support converting data from bpf_perf_event_output()")
      Link: http://lkml.kernel.org/r/1475035126-146587-1-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f2c8852e
    • A
      perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change · 973186ca
      Adrian Hunter 提交于
      Patch "perf record: Mark MAP_HUGETLB when synthesizing mmap events") breaks
      MMAP event synthesis.  The executable name comparison will match any name
      if the length is zero, resulting in all the user space maps becoming
      anonymous.  This is particularly noticeable with system-wide traces.
      Example:
      
      	perf record -a sleep 1
      	perf script --show-mmap-events
      
      Committer note:
      
      That is not the case when, say, one has a qemu instance and libvirt actually
      mounts hugetlbfs. To test this I had to first umount it:
      
      [root@jouet ~]# mount | grep hugetlbfs
      hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel)
      [root@jouet ~]#
      
      After unmount it the error fixed by this patch manifests itself:
      
        # perf record -a sleep 1
        # perf script --show-mmap-events | grep PERF_RECORD_MMAP2 | head -5
          systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x557d47ed8000(0x167000) @ 0 fd:00 3146896 7362875424355726126]: r-xp //anon
          systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c488d000(0x4000) @ 0 fd:00 3153214 7362875424355726126]: r-xp //anon
          systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4a92000(0x3d000) @ 0 fd:00 3159276 7362875424355726126]: r-xp //anon
          systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4cd5000(0x15000) @ 0 fd:00 3153725 7362875424355726126]: r-xp //anon
          systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4eeb000(0x25000) @ 0 fd:00 3153260 7362875424355726126]: r-xp //anon
        #
      
      Fixed version:
      
        # perf record -a sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 1.419 MB perf.data (182 samples) ]
        # perf script --show-mmap-events | grep PERF_RECORD_MMAP2 | head -5
          systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x557d47ed8000(0x167000) @ 0 fd:00 3146896 7362875424355726126]: r-xp /usr/lib/systemd/systemd
          systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c488d000(0x4000) @ 0 fd:00 3153214 7362875424355726126]: r-xp /usr/lib64/libuuid.so.1.3.0
          systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4a92000(0x3d000) @ 0 fd:00 3159276 7362875424355726126]: r-xp /usr/lib64/libblkid.so.1.1.0
          systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4cd5000(0x15000) @ 0 fd:00 3153725 7362875424355726126]: r-xp /usr/lib64/libz.so.1.2.8
          systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4eeb000(0x25000) @ 0 fd:00 3153260 7362875424355726126]: r-xp /usr/lib64/liblzma.so.5.2.2
      [root@jouet ~]#
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Link: http://lkml.kernel.org/r/1474641528-18776-3-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      973186ca
    • A
      perf record: Fix documentation 'event_sources' -> 'event_source' · a9e57009
      Adrian Hunter 提交于
      Change '/sys/bus/event_sources' to the correct path which is
      '/sys/bus/event_source'.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Link: http://lkml.kernel.org/r/1474641528-18776-2-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a9e57009
  3. 23 9月, 2016 11 次提交
  4. 22 9月, 2016 6 次提交
  5. 21 9月, 2016 6 次提交
    • J
      perf hists: Use bigger buffer for stdio headers · d5278220
      Jiri Olsa 提交于
      With node column on big CPUs servers we can run out of stdio header
      space quite soon. Enlarging header buffer.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Joe Mario <jmario@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1474290610-23241-5-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d5278220
    • J
      perf evsel: Remove superfluous initialization of weight · 82deb8a2
      Jiri Olsa 提交于
      Removing superfluous initialization of weight, it's already set to 0 via
      memset.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Joe Mario <jmario@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1474290610-23241-3-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      82deb8a2
    • I
      Merge tag 'perf-core-for-mingo-20160920' of... · 89f1c2c5
      Ingo Molnar 提交于
      Merge tag 'perf-core-for-mingo-20160920' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      User visible changes:
      
      - Support event group view with hierarchy mode in 'perf top' and 'perf report'
        (Namhyung Kim)
      
        e.g.:
      
        $ perf record -e '{cycles,instructions}' make
        $ perf report --hierarchy --stdio
        ...
        #               Overhead  Command / Shared Object / Symbol
        # ......................  ..................................
        ...
            25.74%  27.18%        sh
               19.96%  24.14%        libc-2.24.so
                  9.55%  14.64%        [.] __strcmp_sse2
                  1.54%   0.00%        [.] __tfind
                  1.07%   1.13%        [.] _int_malloc
                  0.95%   0.00%        [.] __strchr_sse2
                  0.89%   1.39%        [.] __tsearch
                  0.76%   0.00%        [.] strlen
      
      - Fix the dwarf regs table for x86_64, adding a missing % to the "%di"
        register, noticed with a failing 'perf test bpf' (Arnaldo Carvalho de Melo)
      
      - Fix handling of mmap parameters in the 'perf trace' beautifier in
        architectures that don't have the same mappings as x86_64 (Wang Nan)
      
      - Handle hugetbl mappings in older systems running new kernels (Wang Nan)
      
      - Resolve 'call' operands in 'annotate', that when using /proc/kcore
        were appearing just as hexadecimal addresses, to function names
        (Arnaldo Carvalho de Melo)
      
      - Fix width computation for srcline sort entry (Jiri Olsa)
      
      - Do not ignore call instruction with indirect target in 'annotate'
        (Ravi Bangoria)
      
      - Handle MADV_FREE in the madvise 'trace' beautifier (Wang Nan)
      
      - Fix build of 'perf trace' mman beautifier in !x86_64 (Wang Nan)
      
      Infrastructure changes:
      
      - Add infrastructure for PMU specific configuration, allowing to pass
        config variables directly to the kernel PMU driver, prefixing those
        variables with a '@', part of a larger series to support Coresight (Mathieu Poirier)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      89f1c2c5
    • J
      perf symbols: Do not open device files · 3c028a0c
      Jiri Olsa 提交于
      The dso__read_binary_type_filename gets the dso's file name to open. We
      need to check it for regular file before trying to open it, otherwise we
      might get stuck with device file.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Joe Mario <jmario@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20160920161245.GA8995@kravaSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3c028a0c
    • N
      perf hists: Factor out hists__reset_column_width() · e3b60bc9
      Namhyung Kim 提交于
      The stdio and tui has same code to reset hpp format column width.
      Factor it out as a new function.
      Suggested-and-Acked-by: NJiri Olsa <jolsa@redhat.com>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20160920053025.13989-2-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e3b60bc9
    • N
      perf ui/tui: Reset output width for hierarchy · 5ff3e7a2
      Namhyung Kim 提交于
      When --hierarchy option is used, each entry has its own hpp_list to show
      the result.  But it missed to update width of each column.
      
      Before:
      
        - 46.29% 48.12%        netctl-auto
           + 31.44% 29.25%        [kernel.vmlinux]
           + 8.52% 11.55%        libc-2.22.so
           + 5.19% 6.91%        bash
        + 10.75% 11.83%        wpa_cli
        + 8.25% 2.23%        swapper
        + 6.45% 5.40%        tr
        + 4.81% 8.09%        awk
        + 4.15% 2.85%        firefox
        + 3.86% 2.53%        sh
      
      After:
      
        -  46.29%  48.12%        netctl-auto
            +  31.44%  29.25%        [kernel.vmlinux]
            +   8.52%  11.55%        libc-2.22.so
            +   5.19%   6.91%        bash
        +  10.75%  11.83%        wpa_cli
        +   8.25%   2.23%        swapper
        +   6.45%   5.40%        tr
        +   4.81%   8.09%        awk
        +   4.15%   2.85%        firefox
        +   3.86%   2.53%        sh
      
      Committer note:
      
      Full testing instructions:
      
      1) Record with an event group:
      
        $ perf record -e '{cycles,instructions}' make -j4
      
      2) Use report in hierarchy mode, to get a few expanded trees on
         the same screen, use --percent-limit:
      
        $ perf report --hierarchy --percent-limit 0.5
      
      Samples: 103K of event 'anon group { cycles:u, instructions:u }',
      Event count (approx.): 57317631725
               Overhead        Command / Shared Object / Symbol        ◆
      -  58.89%  55.12%        cc1                                     ▒
         -  50.26%  48.10%        cc1                                  ▒
                3.61%   5.13%        [.] _cpp_lex_token                ▒
                2.58%   0.78%        [.] ht_lookup_with_hash           ▒
                1.31%   1.30%        [.] ggc_internal_alloc            ▒
                1.08%   2.25%        [.] get_combined_adhoc_loc        ▒
                1.01%   1.95%        [.] ira_init                      ▒
                0.96%   1.78%        [.] linemap_position_for_column   ▒
                0.65%   1.01%        [.] cpp_get_token_with_location   ▒
         -   7.52%   6.58%        libc-2.23.so                         ▒
                1.70%   1.78%        [.] _int_malloc                   ▒
                0.69%   0.75%        [.] _int_free                     ▒
                0.67%   0.42%        [.] malloc_consolidate            ▒
         -   0.58%   0.42%        ld-2.23.so                           ▒
                                     no entry >= 0.50%                 ▒
         -   0.52%   0.03%        [kernel.vmlinux]                     ▒
                                     no entry >= 0.50%                 ▒
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Fixes: 1b2dbbf4 ("perf hists: Use own hpp_list for hierarchy mode")
      Link: http://lkml.kernel.org/r/20160920053025.13989-1-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5ff3e7a2
  6. 20 9月, 2016 4 次提交
    • A
      perf annotate: Resolve 'call' operands to function names · 5f62d4fd
      Arnaldo Carvalho de Melo 提交于
      Before this patch the '_raw_spin_lock_irqsave' and 'update_rq_clock' operands
      were appearing just as hexadecimal numbers:
      
        update_blocked_averages  /proc/kcore
             │       push   %r12
             │       push   %rbx
             │       and    $0xfffffffffffffff0,%rsp
             │       sub    $0x40,%rsp
             │       add    -0x662cac00(,%rdi,8),%rax
             │       mov    %rax,%rbx
             │       mov    %rax,%rdi
             │       mov    %rax,0x38(%rsp)
             │     → callq  _raw_spin_lock_irqsave
             │       mov    %rbx,%rdi
             │       mov    %rax,0x30(%rsp)
             │     → callq  update_rq_clock
             │       mov    0x8d0(%rbx),%rax
             │       lea    0x8d0(%rbx),%r11
      
      To check that all is right one can always use the 'o' hotkey and see
      the original objdump -dS output, that for this case is:
      
        update_blocked_averages  /proc/kcore
             │ffffffff990d5489:   push   %r12
             │ffffffff990d548b:   push   %rbx
             │ffffffff990d548c:   and    $0xfffffffffffffff0,%rsp
             │ffffffff990d5490:   sub    $0x40,%rsp
             │ffffffff990d5494:   add    -0x662cac00(,%rdi,8),%rax
             │ffffffff990d549c:   mov    %rax,%rbx
             │ffffffff990d549f:   mov    %rax,%rdi
             │ffffffff990d54a2:   mov    %rax,0x38(%rsp)
             │ffffffff990d54a7: → callq  0xffffffff997eb7a0
             │ffffffff990d54ac:   mov    %rbx,%rdi
             │ffffffff990d54af:   mov    %rax,0x30(%rsp)
             │ffffffff990d54b4: → callq  0xffffffff990c7720
             │ffffffff990d54b9:   mov    0x8d0(%rbx),%rax
             │ffffffff990d54c0:   lea    0x8d0(%rbx),%r11
      
      Use the 'h' hotkey to see a list of available hotkeys.
      
      More work needed to cover operands for other instructions, such as 'mov',
      that can resolve variable names, etc.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Chris Riyder <chris.ryder@arm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-xqgtw9mzmzcjgwkis9kiiv1p@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5f62d4fd
    • A
      perf annotate: Pass the symbol's map/dso to the instruction parsers · bff5c306
      Arnaldo Carvalho de Melo 提交于
      So that things like:
      
             → callq  0xffffffff993e3230
      
      found while disassembling /proc/kcore can be beautified by later
      patches, that will resolve that address to a function, looking it up in
      /proc/kallsyms.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Chris Riyder <chris.ryder@arm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-p76myuke4j7gplg54amaklxk@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bff5c306
    • R
      perf annotate: Do not ignore call instruction with indirect target · 88a7fcf9
      Ravi Bangoria 提交于
      Do not ignore call instruction with indirect target when its already
      identified as a call. This is an extension of commit e8ea1561 ("perf
      annotate: Use raw form for register indirect call instructions") to
      generalize annotation for all instructions with indirect calls.
      
      This is needed for certain powerpc call instructions that use address in
      a register (such as bctrl, btarl, ...).
      
      Apart from that, when kcore is used to disassemble function, all call
      instructions were ignored. This patch will fix it as a side effect by
      not ignoring them. For example,
      
      Before (with kcore):
             mov    %r13,%rdi
             callq  0xffffffff811a7e70
           ^ jmpq   64
             mov    %gs:0x7ef41a6e(%rip),%al
      
      After (with kcore):
             mov    %r13,%rdi
           > callq  0xffffffff811a7e70
           ^ jmpq   64
             mov    %gs:0x7ef41a6e(%rip),%al
      Suggested-by: NMichael Ellerman <mpe@ellerman.id.au>
      [Suggested about 'bctrl' instruction]
      Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Chris Riyder <chris.ryder@arm.com>
      Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Taeung Song <treeze.taeung@gmail.com>
      Link: http://lkml.kernel.org/r/1471611578-11255-5-git-send-email-ravi.bangoria@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      88a7fcf9
    • J
      perf hists: Fix width computation for srcline sort entry · f666ac0d
      Jiri Olsa 提交于
      Adding header size to width computation for srcline sort entry,
      because it's possible to get empty data with ':0' which set width
      of 2 which is lower than width needed to display column header.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Don Zickus <dzickus@redhat.com>
      Cc: Joe Mario <jmario@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1474290610-23241-62-git-send-email-jolsa@kernel.org
      [ Added declaration to sort.h ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f666ac0d