1. 15 6月, 2016 2 次提交
    • J
      perf mem: Add --ldlat option · b0d745b3
      Jiri Olsa 提交于
      Adding --ldlat option to specify desired latency for loads event.
      
      Specify 50 as loads event latency:
      
        $ perf mem record -e ldlat-loads -v --ldlat 50 true
        calling: record -W -d -e cpu/mem-loads,ldlat=50/P true
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1465928361-2442-2-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b0d745b3
    • H
      perf unwind: Fix compile error for static cross build · 906a8276
      He Kuang 提交于
      Build failure for static cross-compiling on aarch64, with libunwind-x86
      provided:
      
        $ file ./libunwind_for_x86_on_aarch64/lib/libunwind-x86.so.8.0.1
      
        libunwind-x86.so.8.0.1: ELF 64-bit LSB shared object, ARM aarch64,
        version 1 (SYSV), dynamically linked, not stripped
      
        $ make LDFLAGS=-static LIBUNWIND_DIR=./libunwind_for_x86_on_aarch64
        ARCH=aarch64 CROSS_COMPILE=aarch64-buildroot-linux-gnu-
      
        ~/libperf.a(libperf-in.o): In function `find_proc_info':
        :(.text+0xae4ac): undefined reference to `_Ux86_dwarf_search_unwind_table'
        ~/libperf.a(libperf-in.o): In function `_unwind__prepare_access':
        :(.text+0xaedd0): undefined reference to `_Ux86_create_addr_space'
        :(.text+0xaee24): undefined reference to `_Ux86_set_caching_policy'
        ~/libperf.a(libperf-in.o): In function `_unwind__flush_access':
        :(.text+0xaee98): undefined reference to `_Ux86_flush_cache'
        ~/libperf.a(libperf-in.o): In function `_unwind__finish_access':
        :(.text+0xaef08): undefined reference to `_Ux86_destroy_addr_space'
        ~/libperf.a(libperf-in.o): In function `get_entries':
        :(.text+0xaf148): undefined reference to `_Ux86_init_remote'
        :(.text+0xaf184): undefined reference to `_Ux86_get_reg'
        :(.text+0xaf1a4): undefined reference to `_Ux86_step'
        collect2: error: ld returned 1 exit status
        Makefile.perf:350: recipe for target '~/perf' failed
        make[1]: *** [~/perf] Error 1
        Makefile:68: recipe for target 'all' failed
        make: *** [all] Error 2
      
      This is because the remote libunwind library detected is not appended to
      EXTLIBS variable, which will be included between 'start-group' and
      'end-group' when linking.
      
      The existing variable LIBUNWIND_LIBS is assigned to libs for local
      unwind, this patch introduces a new variable EXTLIBS_LIBUNWIND for
      storing remote libunwind libraries instead.
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1465988636-81502-1-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      906a8276
  2. 14 6月, 2016 6 次提交
  3. 08 6月, 2016 5 次提交
    • H
      perf callchain: Support aarch64 cross-platform · 057fbfb2
      He Kuang 提交于
      Support aarch64 cross platform callchain unwind.
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1464924803-22214-15-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      057fbfb2
    • H
      perf callchain: Support x86 target platform · 52ffe0ff
      He Kuang 提交于
      Support x86(32-bit) cross platform callchain unwind.
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1464924803-22214-14-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      52ffe0ff
    • H
      perf unwind: Introduce flag to separate local/remote unwind compilation · 19473e7b
      He Kuang 提交于
      This is a preparation for including unwind-libunwind-local.c in other
      files for remote libunwind.
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1464924803-22214-13-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      19473e7b
    • H
      perf unwind: Change fixed name of libunwind__arch_reg_id to macro · eeb118c5
      He Kuang 提交于
      For local libunwind, it uses the fixed methods to convert register id
      according to the host platform, but in remote libunwind, this convert
      function should be the one for remote architecture. This patch changes
      the fixed name to macro and code for each remote platform can be
      compiled indivadually.
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1464924803-22214-12-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eeb118c5
    • H
      perf unwind: Check the target platform before assigning unwind methods · d64ec10e
      He Kuang 提交于
      Currently, 'perf script' uses host unwind methods to parse perf.data
      callchain info without taking the target architecture into account, i.e.
      assuming the perf.data file was generated on the same machine where the
      analysis is being performed. So we get wrong result without any warnings
      when unwinding callchains of x86(32-bit) on x86(64-bit) machine.
      
      This patch adds an extra step that checks the target platform before
      assigning unwind methods. In later patches in this series, we can use
      this info to assign the right unwind methods for supported platforms.
      
      Committer note:
      
      After fixing it to register the local unwinder for live mode tools
      ('perf trace', 'perf top'), i.e. tools that don't use a perf.data file,
      it works as intended and passes the 'perf test unwind' test:
      
        # perf trace -e nanosleep --call dwarf usleep 1
           0.328 ( 0.058 ms): usleep/11115 nanosleep(rqtp: 0x7fff083fa480) = 0
                                             __nanosleep_nocancel+0x7 (/usr/lib64/libc-2.22.so)
                                             usleep+0x34 (/usr/lib64/libc-2.22.so)
                                             main+0x1eb (/usr/bin/usleep)
                                             __libc_start_main+0xf0 (/usr/lib64/libc-2.22.so)
                                             _start+0x29 (/usr/bin/usleep)
        # perf test 48
        48: Test dwarf unwind         : Ok
        #
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1464924803-22214-11-git-send-email-hekuang@huawei.com
      [ Fixed exit path for 'live' mode tools, where we need to default to local unwinding ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d64ec10e
  4. 07 6月, 2016 25 次提交
  5. 06 6月, 2016 1 次提交
  6. 04 6月, 2016 1 次提交
    • H
      perf script: Show call graphs when 1st event doesn't have it but some other has · 40f20e50
      He Kuang 提交于
      There's a display inconsistency when there are multiple tracepoint
      events, some of which have the 'call-graph' config option set but the
      first one hasn't, i.e. the whole logic for call graph processing is
      enabled only if the first tracepoint event has call-graph set.
      
      For instance, if we record signal_deliver with call-graph and
      signal_generate without:
      
        $ perf record -g -a -e signal:signal_deliver -e signal:signal_generate/call-graph=no/
      
        [ perf record: Captured and wrote 0.017 MB perf.data (2 samples) ]
      
        $ perf script
      
        kworker/u2:1    13 [000]  6563.875949: signal:signal_generate: sig=2 errno=0 code=128 comm=perf pid=1313 grp=1 res=0 ff61cc __send_signal+0x3ec ([kernel.kallsyms])
        perf  1313 [000]  6563.877584:  signal:signal_deliver: sig=2 errno=0 code=128 sa_handler=43115e sa_flags=14000000
                    7ffff314 get_signal+0x80007f0023a4 ([kernel.kallsyms])
                    7fffe358 do_signal+0x80007f002028 ([kernel.kallsyms])
                    7fffa5e8 exit_to_usermode_loop+0x80007f002053 ([kernel.kallsyms])
                    ...
      
      Then we exchange the order of these two events in commandline, and keep
      signal_generate without call-graph.
      
        $ perf record -g -a -e signal:signal_generate/call-graph=no/ -e signal:signal_deliver
      
        [ perf record: Captured and wrote 0.017 MB perf.data (2 samples) ]
      
        $ perf script
      
          kworker/u2:2  1314 [000]  6933.353060: signal:signal_generate: sig=2 errno=0 code=128 comm=perf pid=1321 grp=1 res=0
                  perf  1321 [000]  6933.353872:  signal:signal_deliver: sig=2 errno=0 code=128 sa_handler=43115e sa_flags=14000000
      
      This time, the callchain of the event signal_deliver disappeared. The
      problem is caused by that perf only checks for the first evsel in evlist
      and decides if callchain should be printed.
      
      This patch traverses all evsels in evlist to see if any of them have
      callchains, and shows the right result:
      
        $ perf script
      
        kworker/u2:2  1314 [000]  6933.353060: signal:signal_generate: sig=2 errno=0 code=128 comm=perf pid=1321 grp=1 res=0 ff61cc __send_signal+0x3ec ([kernel.kallsyms])
        perf  1321 [000]  6933.353872:  signal:signal_deliver: sig=2 errno=0 code=128 sa_handler=43115e sa_flags=14000000
                    7ffff314 get_signal+0x80007f0023a4 ([kernel.kallsyms])
                    7fffe358 do_signal+0x80007f002028 ([kernel.kallsyms])
                    7fffa5e8 exit_to_usermode_loop+0x80007f002053 ([kernel.kallsyms])
                    ...
      Signed-off-by: NHe Kuang <hekuang@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1463374279-97209-1-git-send-email-hekuang@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      40f20e50