1. 28 10月, 2015 5 次提交
  2. 27 10月, 2015 4 次提交
  3. 24 10月, 2015 2 次提交
    • A
      perf tools: Provide help for subset of options · 161d9041
      Arnaldo Carvalho de Melo 提交于
      Some tools have a lot of options, so, providing a way to show help just
      for some of them may come handy:
      
        $ perf report -h --tui
      
         Usage: perf report [<options>]
      
              --tui             Use the TUI interface
      
        $ perf report -h --tui --showcpuutilization -b -c
      
         Usage: perf report [<options>]
      
          -b, --branch-stack    use branch records for per branch histogram filling
          -c, --comms <comm[,comm...]>
                                only consider symbols in these comms
              --showcpuutilization
                                Show sample percentage for different cpu modes
              --tui             Use the TUI interface
      
        $
      
      Using it with perf bash completion is also handy, just make sure you
      source the needed file:
      
        $ . ~/git/linux/tools/perf/perf-completion.sh
      
      Then press tab/tab after -- to see a list of options, put them after -h
      and only the options chosen will have its help presented:
      
        $ perf report -h --
        --asm-raw              --demangle-kernel      --group
        --kallsyms             --pretty               --stdio
        --branch-history       --disassembler-style   --gtk
        --max-stack            --showcpuutilization   --symbol-filter
        --branch-stack         --dsos                 --header
        --mem-mode             --show-info            --symbols
        --call-graph           --dump-raw-trace       --header-only
        --modules              --show-nr-samples      --symfs
        --children             --exclude-other        --hide-unresolved
        --objdump              --show-ref-call-graph  --threads
        --column-widths        --fields               --ignore-callees
        --parent               --show-total-period    --tid
        --comms                --field-separator      --input
        --percentage           --socket-filter        --tui
        --cpu                  --force                --inverted
        --percent-limit        --sort                 --verbose
        --demangle             --full-source-path     --itrace
        --pid                  --source               --vmlinux
        $ perf report -h --socket-filter
      
         Usage: perf report [<options>]
      
            --socket-filter <n>
                        only show processor socket that match with this filter
      Suggested-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Chandler Carruth <chandlerc@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-83mcdd3wj0379jcgea8w0fxa@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      161d9041
    • A
      perf tools: Show tool command line options ordered · 869c55b0
      Arnaldo Carvalho de Melo 提交于
      When asking for a listing of the options, be it using -h or when an
      unknown option is passed, order it by one-letter options, then the ones
      having just long names.
      Suggested-by: NIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Chandler Carruth <chandlerc@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-41qh68t35n4ehrpsuazp1dx8@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      869c55b0
  4. 23 10月, 2015 4 次提交
  5. 22 10月, 2015 2 次提交
  6. 21 10月, 2015 1 次提交
    • K
      perf cpu_map: Fix core dump caused by per-socket/core system-wide stat · bc1d0368
      Kan Liang 提交于
      Perf will core dump if --per-socket/core -a are applied for perf stat.
      
      The root cause is that cpu_map__build_map set refcnt of evlist's cpu_map
      to 1.  It should set refcnt for the newly created cpu_map, not evlist's
      cpu_map.
      
      Here is the example:
      
        # perf stat -e cycles --per-socket -a sleep 1
      
         Performance counter stats for 'system wide':
      
        S0       36         30,196,257      cycles
        S1       28         15,823,536      cycles
      
             1.001126828 seconds time elapsed
      
        *** Error in `./perf': corrupted double-linked list: 0x00000000021f9090 ***
        ======= Backtrace: =========
        /lib64/libc.so.6[0x3002e7bbe7]
        /lib64/libc.so.6[0x3002e7d2b5]
        ./perf(perf_evsel__delete+0x28)[0x485bdd]
        ./perf[0x4800e8]
        ./perf(perf_evlist__delete+0x5e)[0x482cd5]
        ./perf(cmd_stat+0xf25)[0x432328]
        ./perf[0x4768e0]
        ./perf[0x476ad6]
        ./perf[0x476b41]
        ./perf(main+0x1d0)[0x476db2]
        /lib64/libc.so.6(__libc_start_main+0xf5)[0x3002e21b45]
        ./perf[0x4202c5]
      Signed-off-by: NKan Liang <kan.liang@intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Link: http://lkml.kernel.org/r/1444388363-35936-1-git-send-email-kan.liang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bc1d0368
  7. 20 10月, 2015 7 次提交
  8. 13 10月, 2015 3 次提交
    • R
      perf callchains: Fix unw_word_t pointer casts · 186c6cfb
      Rabin Vincent 提交于
      unw_word_t is uint64_t even on 32-bit MIPS.  Cast it to uintptr_t before
      the cast to void *p to get rid of the following errors:
      
        util/unwind-libunwind.c: In function 'access_mem':
        util/unwind-libunwind.c:464:4: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
        util/unwind-libunwind.c:475:2: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
        cc1: all warnings being treated as errors
        make[3]: *** [util/unwind-libunwind.o] Error 1
      Signed-off-by: NRabin Vincent <rabin.vincent@axis.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Rabin Vincent <rabinv@axis.com>
      Link: http://lkml.kernel.org/r/1443379079-29133-1-git-send-email-rabin.vincent@axis.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      186c6cfb
    • R
      perf callchain: Use debug_frame if eh_frame is unusable · 8eac1d5e
      Rabin Vincent 提交于
      When NO_LIBUNWIND_DEBUG_FRAME=0, use the .debug_frame if the .eh_frame
      doesn't contain the approprate unwind tables.
      Signed-off-by: NRabin Vincent <rabin.vincent@axis.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Rabin Vincent <rabinv@axis.com>
      Link: http://lkml.kernel.org/r/1443379079-29133-3-git-send-email-rabin.vincent@axis.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      8eac1d5e
    • A
      perf symbols: Try the .debug/ DSO cache as a last resort · dc38218e
      Arnaldo Carvalho de Melo 提交于
      Not as the first attempt at finding a vmlinux for the running kernel,
      this way we get a more informative filename to present in tools, it will
      check that the build-id is the same as the one previously loaded in the
      DSO in dso->build_id, reading from /sys/kernel/notes, for instance.
      
      E.g. in the annotation TUI, going from 'perf top', for the scsi_sg_alloc
      kernel function, in the first line:
      
      Before:
      
      scsi_sg_alloc  /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1
      
      After:
      
      scsi_sg_alloc  /lib/modules/4.3.0-rc1+/build/vmlinux
      
      And:
      
        # ls -la /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1
      lrwxrwxrwx. 1 root root 81 Sep 22 16:11 /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1 -> ../../home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1
        # file ~/.debug/home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1
      /root/.debug/home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=282777c262e6b3c0451375163c9a81c893218ab1, not stripped
        #
      
      The same as:
      
        # file /lib/modules/4.3.0-rc1+/build/vmlinux
      /lib/modules/4.3.0-rc1+/build/vmlinux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=282777c262e6b3c0451375163c9a81c893218ab1, not stripped
      
      Furthermore:
      
        # sha256sum /lib/modules/4.3.0-rc1+/build/vmlinux
        e7a789bbdc61029ec09140c228e1dd651271f38ef0b8416c0b7d5ff727b98be2  /lib/modules/4.3.0-rc1+/build/vmlinux
        # sha256sum ~/.debug/home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1
        e7a789bbdc61029ec09140c228e1dd651271f38ef0b8416c0b7d5ff727b98be2  /root/.debug/home/git/build/v4.3.0-rc1+/vmlinux/282777c262e6b3c0451375163c9a81c893218ab1
        [root@zoo new]#
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-9y42ikzq3jisiddoi6f07n8z@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      dc38218e
  9. 08 10月, 2015 1 次提交
    • A
      perf python: Support the PERF_RECORD_SWITCH event · ae938802
      Arnaldo Carvalho de Melo 提交于
      To test it check tools/perf/python/twatch.py, after following the
      instructions there to enable context_switch, output looks like:
      
        [root@zoo linux]# tools/perf/python/twatch.py
        cpu: 1, pid: 31463, tid: 31463 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31463, switch_out: 0 }
        cpu: 2, pid: 31463, tid: 31496 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31496, switch_out: 0 }
        cpu: 2, pid: 31463, tid: 31496 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31496, switch_out: 1 }
        cpu: 3, pid: 31463, tid: 31527 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31527, switch_out: 0 }
        cpu: 1, pid: 31463, tid: 31463 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31463, switch_out: 1 }
        cpu: 3, pid: 31463, tid: 31527 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31527, switch_out: 1 }
        cpu: 1, pid: 31463, tid: 31463 { type: context_switch, next_prev_pid: 31463, next_prev_tid: 31463, switch_out: 0 }
        ^CTraceback (most recent call last):
          File "tools/perf/python/twatch.py", line 67, in <module>
            main(context_switch = 1, thread = 31463)
          File "tools/perf/python/twatch.py", line 40, in main
            evlist.poll(timeout = -1)
        KeyboardInterrupt
        [root@zoo linux]#
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Guy Streeter <streeter@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-1ukistmpamc5z717k80ctcp2@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ae938802
  10. 07 10月, 2015 4 次提交
  11. 06 10月, 2015 7 次提交