1. 20 10月, 2015 3 次提交
  2. 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
  3. 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
  4. 07 10月, 2015 4 次提交
  5. 06 10月, 2015 8 次提交
  6. 03 10月, 2015 2 次提交
  7. 01 10月, 2015 16 次提交
  8. 29 9月, 2015 3 次提交
    • H
      perf tools: Enable event_config terms to tracepoint events · e637d177
      He Kuang 提交于
      This patch enables config terms for tracepoint perf events. Valid terms
      for tracepoint events are 'call-graph' and 'stack-size', so we can use
      different callgraph settings for each event and eliminate unnecessary
      overhead.
      
      Here is an example for using different call-graph config for each
      tracepoint.
      
        $ perf record -e syscalls:sys_enter_write/call-graph=fp/
                      -e syscalls:sys_exit_write/call-graph=no/
                      dd if=/dev/zero of=test bs=4k count=10
      
        $ perf report --stdio
      
        #
        # Total Lost Samples: 0
        #
        # Samples: 13  of event 'syscalls:sys_enter_write'
        # Event count (approx.): 13
        #
        # Children      Self  Command  Shared Object       Symbol
        # ........  ........  .......  ..................  ......................
        #
            76.92%    76.92%  dd       libpthread-2.20.so  [.] __write_nocancel
                         |
                         ---__write_nocancel
      
            23.08%    23.08%  dd       libc-2.20.so        [.] write
                         |
                         ---write
                            |
                            |--33.33%-- 0x2031342820736574
                            |
                            |--33.33%-- 0xa6e69207364726f
                            |
                             --33.33%-- 0x34202c7320393039
        ...
      
        # Samples: 13  of event 'syscalls:sys_exit_write'
        # Event count (approx.): 13
        #
        # Children      Self  Command  Shared Object       Symbol
        # ........  ........  .......  ..................  ......................
        #
            76.92%    76.92%  dd       libpthread-2.20.so  [.] __write_nocancel
            23.08%    23.08%  dd       libc-2.20.so        [.] write
             7.69%     0.00%  dd       [unknown]           [.] 0x0a6e69207364726f
             7.69%     0.00%  dd       [unknown]           [.] 0x2031342820736574
             7.69%     0.00%  dd       [unknown]           [.] 0x34202c7320393039
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1443412336-120050-4-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e637d177
    • H
      perf tools: Adds the tracepoint name parsing support · 865582c3
      He Kuang 提交于
      Adds rules for parsing tracepoint names. Change rules of tracepoint which
      derives from PE_NAMEs into tracepoint names directly, so adding more rules
      based on tracepoint names will be easier.
      
      Changes v2-v3:
         - Change __event_legacy_tracepoint label in bison file to tracepoint_name
         - Fix formats error.
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1443412336-120050-3-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      865582c3
    • H
      perf tools: Show proper error message for wrong terms of hw/sw events · ffeb883e
      He Kuang 提交于
      Show proper error message and show valid terms when wrong config terms
      is specified for hw/sw type perf events.
      
      This patch makes the original error format function formats_error_string()
      more generic, which only outputs the static config terms for hw/sw perf
      events, and prepends pmu formats for pmu events.
      
      Before this patch:
      
        $ perf record -e 'cpu-clock/freqx=200/' -a sleep 1
        invalid or unsupported event: 'cpu-clock/freqx=200/'
        Run 'perf list' for a list of valid events
      
         usage: perf record [<options>] [<command>]
            or: perf record [<options>] -- <command> [<options>]
      
            -e, --event <event>   event selector. use 'perf list' to list available events
      
      After this patch:
      
        $ perf record -e 'cpu-clock/freqx=200/' -a sleep 1
        event syntax error: 'cpu-clock/freqx=200/'
                                       \___ unknown term
      
        valid terms: config,config1,config2,name,period,freq,branch_type,time,call-graph,stack-size
      
        Run 'perf list' for a list of valid events
      
         usage: perf record [<options>] [<command>]
            or: perf record [<options>] -- <command> [<options>]
      
            -e, --event <event>   event selector. use 'perf list' to list available events
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1443412336-120050-2-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ffeb883e