1. 09 11月, 2016 1 次提交
  2. 17 10月, 2016 2 次提交
    • A
      perf jit: Fix build issue on Ubuntu · 53613e00
      Anton Blanchard 提交于
      When building on Ubuntu 16.04, I get the following error:
      
      Makefile:49: *** the openjdk development package appears to me missing, install and try again.  Stop.
      
      The problem is that update-java-alternatives has multiple spaces between
      fields, and cut treats each space as a new delimiter:
      
      java-1.8.0-openjdk-ppc64el     1081       /usr/lib/jvm/java-1.8.0-openjdk-ppc64el
      
      Fix this by using awk, which handles this fine.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Reviewed-by: NStephane Eranian <eranian@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1476325243-15788-1-git-send-email-anton@ozlabs.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      53613e00
    • W
      perf jevents: Handle events including .c and .o · 2d470b62
      Wang Nan 提交于
      This patch helps with Sukadev's vendor event tree where such events can happen.
      
      >From Andi Kleen:
       Any event including a .c/.o/.bpf currently triggers BPF compilation or loading
       and then an error. This can happen for some Intel vendor events, which cannot
       be used.
      
      This patch fixes this problem by forbidding BPF file patch containing '{', '}'
      and ',', make sure flex consumes the leading '{', instead of matching it using
      a BPF file path.
      
      Tested result:
      
        $ perf stat -e '{unc_p_clockticks,unc_p_power_state_occupancy.cores_c0}' -a -I 1000
        invalid or unsupported event: '{unc_p_clockticks,unc_p_power_state_occupancy.cores_c0}'
        Run 'perf list' for a list of valid events
        (as expected, interperted as event)
      
        $ perf stat -e 'aaa.c' -a -I 1000
        ERROR: problems with path aaa.c: No such file or directory
        (as expected, interpreted as BPF source)
      
        $ perf stat -e 'aaa.ccc' -a -I 1000
        invalid or unsupported event: 'aaa.ccc'
        (as expected, interpreted as event)
      
        $ perf stat -e '{aaa.c}' -a -I 1000
        ERROR: problems with path aaa.c: No such file or directory
        event syntax error: '{aaa.c}'
        <SKIP>
        (as expected, interpreted as BPF source)
      
        $ perf stat -e '{cycles,aaa.c}' -a -I 1000
        ERROR: problems with path aaa.c: No such file or directory
        event syntax error: '{cycles,aaa.c}'
        (as expected, interpreted as BPF source)
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Reported-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1475900185-37967-1-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2d470b62
  3. 13 10月, 2016 2 次提交
  4. 06 10月, 2016 4 次提交
  5. 05 10月, 2016 3 次提交
  6. 04 10月, 2016 17 次提交
  7. 03 10月, 2016 3 次提交
  8. 29 9月, 2016 8 次提交
    • R
      perf tests: Add dwarf unwind test for powerpc · d18019a5
      Ravi Bangoria 提交于
      The user stack dump feature was recently added for powerpc. But there
      was no test case available to test it.
      
      This test works same as on other architectures by preparing a stack
      frame on the perf test thread and comparing each frame by unwinding it.
      
        $ ./perf test 50
          50: Test dwarf unwind    : Ok
      
      User stack dump for powerpc: https://lkml.org/lkml/2016/4/28/482Signed-off-by: NRavi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Anju T Sudhakar <anju@linux.vnet.ibm.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Matt Fleming <matt.fleming@intel.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Link: http://lkml.kernel.org/r/1474267100-31079-1-git-send-email-ravi.bangoria@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d18019a5
    • M
      perf probe: Match linkage name with mangled name · d5a00296
      Masami Hiramatsu 提交于
      Match linkage name with mangled name if exists. The linkage_name is used
      for storing mangled name of the object.
      
      Thus, this allows 'perf probe' to find appropriate probe point from
      mangled symbol as below.
      
      E.g. without this fix:
        ----
        $ perf probe -x /usr/lib64/libstdc++.so.6 \
          -D _ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv
        Probe point '_ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv'
        not found.
          Error: Failed to add events.
        ----
      
      With this fix, perf probe can find the correct one.
        ----
        $ perf probe -x /usr/lib64/libstdc++.so.6 \
          -D _ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv
        p:probe_libstdc/_ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv
        /usr/lib64/libstdc++.so.6.0.22:0x8ca60
        ----
      
      Committer notes:
      
      After the fix, setting it for real (no -D/--definition, that amounts to
      a --dry-run):
      
        # perf probe -x /usr/lib64/libstdc++.so.6 _ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv
        Added new event:
          probe_libstdc:_ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv (on _ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv in /usr/lib64/libstdc++.so.6.0.22)
      
        You can now use it in all perf tools, such as:
      
      	perf record -e probe_libstdc:_ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv -aR sleep 1
      
        # perf probe -l probe_libstdc:*
          probe_libstdc:_ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv (on is_open@libstdc++-v3/include/fstream in /usr/lib64/libstdc++.so.6.0.22)
        #
      Reported-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/147464493162.29804.16715053505069382443.stgit@devboxSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d5a00296
    • M
      perf probe: Fix to cut off incompatible chars from group name · 35726d3a
      Masami Hiramatsu 提交于
      Cut off the characters which can not use for group name of uprobes
      when making it based on executable filename.
      
      For example, if the exec name is libstdc++.so, without this fix
      perf probe generates "probe_libstdc++" as the group name, but
      it is failed to set because '+' can not be used for group name.
      
      With this fix perf accepts only alphabet, number or '_' for group
      name, thus perf generates "probe_libstdc" as the group name.
      
      E.g. with this fix, you can see the event name has no "+".
        ----
        $ ./perf probe -x /usr/lib64/libstdc++.so.6 -D is_open
        p:probe_libstdc/is_open /usr/lib64/libstdc++.so.6.0.22:0x8ca80
        p:probe_libstdc/is_open_1 /usr/lib64/libstdc++.so.6.0.22:0x8ca70
        p:probe_libstdc/is_open_2 /usr/lib64/libstdc++.so.6.0.22:0x8ca60
        p:probe_libstdc/is_open_3 /usr/lib64/libstdc++.so.6.0.22:0xb0ad0
        p:probe_libstdc/is_open_4 /usr/lib64/libstdc++.so.6.0.22:0xecca9
        ----
      
      Committer note:
      
      Before this fix:
      
        # perf probe -x /usr/lib64/libstdc++.so.6 is_open
        Failed to write event: Invalid argument
          Error: Failed to add events.
        #
      
      After the fix:
      
        # perf probe -x /usr/lib64/libstdc++.so.6 is_open
        Added new events:
          probe_libstdc:is_open (on is_open in /usr/lib64/libstdc++.so.6.0.22)
          probe_libstdc:is_open_1 (on is_open in /usr/lib64/libstdc++.so.6.0.22)
          probe_libstdc:is_open_2 (on is_open in /usr/lib64/libstdc++.so.6.0.22)
          probe_libstdc:is_open_3 (on is_open in /usr/lib64/libstdc++.so.6.0.22)
          probe_libstdc:is_open_4 (on is_open in /usr/lib64/libstdc++.so.6.0.22)
      
        You can now use it in all perf tools, such as:
      
      	  perf record -e probe_libstdc:is_open_4 -aR sleep 1
      
        # perf probe -l probe_libstdc:*
          probe_libstdc:is_open (on is_open@libstdc++-v3/include/fstream in /usr/lib64/libstdc++.so.6.0.22)
          probe_libstdc:is_open_1 (on is_open@libstdc++-v3/include/fstream in /usr/lib64/libstdc++.so.6.0.22)
          probe_libstdc:is_open_2 (on is_open@libstdc++-v3/include/fstream in /usr/lib64/libstdc++.so.6.0.22)
          probe_libstdc:is_open_3 (on is_open@src/c++98/basic_file.cc in /usr/lib64/libstdc++.so.6.0.22)
          probe_libstdc:is_open_4 (on stdio_filebuf:5@include/ext/stdio_filebuf.h in /usr/lib64/libstdc++.so.6.0.22)
        #
      Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/147464491667.29804.9553638175441827970.stgit@devboxSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      35726d3a
    • M
      perf probe: Skip if the function address is 0 · 0ad45b33
      Masami Hiramatsu 提交于
      Skip probes if the entry address of the target function is 0.  This can
      happen when we're handling C++ debuginfo files.
      
      E.g. without this fix, below case still fail.
        ----
        $ ./perf probe -x /usr/lib64/libstdc++.so.6 -vD is_open
        probe-definition(0): is_open
        symbol:is_open file:(null) line:0 offset:0 return:0 lazy:(null)
        0 arguments
        symbol:catch file:(null) line:0 offset:0 return:0 lazy:(null)
        symbol:throw file:(null) line:0 offset:0 return:0 lazy:(null)
        symbol:rethrow file:(null) line:0 offset:0 return:0 lazy:(null)
        Open Debuginfo file: /usr/lib/debug/usr/lib64/libstdc++.so.6.0.22.debug
        Try to find probe point from debuginfo.
        Matched function: is_open [295df]
        found inline addr: 0x8ca80
        Probe point found: is_open+0
        found inline addr: 0x8ca70
        Probe point found: is_open+0
        found inline addr: 0x8ca60
        Probe point found: is_open+0
        Matched function: is_open [6527f]
        Matched function: is_open [9fe8a]
        Probe point found: is_open+0
        Matched function: is_open [19710b]
        found inline addr: 0xecca9
        Probe point found: stdio_filebuf+57
        found inline addr: 0x0
        Probe point found: swap+0
        Matched function: is_open [19fc9d]
        Probe point found: is_open+0
        Found 7 probe_trace_events.
        p:probe_libstdc++/is_open /usr/lib64/libstdc++.so.6.0.22:0x8ca80
        p:probe_libstdc++/is_open_1 /usr/lib64/libstdc++.so.6.0.22:0x8ca70
        p:probe_libstdc++/is_open_2 /usr/lib64/libstdc++.so.6.0.22:0x8ca60
        p:probe_libstdc++/is_open_3 /usr/lib64/libstdc++.so.6.0.22:0xb0ad0
        p:probe_libstdc++/is_open_4 /usr/lib64/libstdc++.so.6.0.22:0xecca9
        Failed to synthesize probe trace event.
          Error: Failed to add events. Reason: Invalid argument (Code: -22)
        ----
      This is because some instances have entry_pc == 0 (see 19710b and
      19fc9d). With this fix, those are skipped.
      
        ----
        $ ./perf probe -x /usr/lib64/libstdc++.so.6 -D is_open
        p:probe_libstdc++/is_open /usr/lib64/libstdc++.so.6.0.22:0x8ca80
        p:probe_libstdc++/is_open_1 /usr/lib64/libstdc++.so.6.0.22:0x8ca70
        p:probe_libstdc++/is_open_2 /usr/lib64/libstdc++.so.6.0.22:0x8ca60
        p:probe_libstdc++/is_open_3 /usr/lib64/libstdc++.so.6.0.22:0xb0ad0
        p:probe_libstdc++/is_open_4 /usr/lib64/libstdc++.so.6.0.22:0xecca9
        ----
      Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/147464490707.29804.14277897643725143867.stgit@devboxSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0ad45b33
    • M
      perf probe: Ignore the error of finding inline instance · f8da4b51
      Masami Hiramatsu 提交于
      Ignore the error when the perf probe failed to find inline function
      instances. This can happen when we search a method in C++ debuginfo.  If
      there is completely no instance in target, perf probe can return an
      error.
      
      E.g. without this fix:
        ----
        $ perf probe -x /usr/lib64/libstdc++.so.6 -vD showmanyc
        probe-definition(0): showmanyc
        symbol:showmanyc file:(null) line:0 offset:0 return:0 lazy:(null)
        0 arguments
        symbol:catch file:(null) line:0 offset:0 return:0 lazy:(null)
        symbol:throw file:(null) line:0 offset:0 return:0 lazy:(null)
        symbol:rethrow file:(null) line:0 offset:0 return:0 lazy:(null)
        Open Debuginfo file: /usr/lib/debug/usr/lib64/libstdc++.so.6.0.22.debug
        Try to find probe point from debuginfo.
        Matched function: showmanyc
        An error occurred in debuginfo analysis (-2).
        Trying to use symbols.
        Failed to find symbol showmanyc in /usr/lib64/libstdc++.so.6.0.22
          Error: Failed to add events. Reason: No such file or directory (Code: -2)
        ----
      
      This is because one of showmanyc is defined as inline but no instance
      found. With this fix, it is succeeded to show as below.
        ----
        $ perf probe -x /usr/lib64/libstdc++.so.6 -D showmanyc
        p:probe_libstdc++/showmanyc /usr/lib64/libstdc++.so.6.0.22:0xb0e50
        p:probe_libstdc++/showmanyc_1 /usr/lib64/libstdc++.so.6.0.22:0xc7c40
        p:probe_libstdc++/showmanyc_2 /usr/lib64/libstdc++.so.6.0.22:0xecfa0
        p:probe_libstdc++/showmanyc_3 /usr/lib64/libstdc++.so.6.0.22:0x115fc0
        p:probe_libstdc++/showmanyc_4 /usr/lib64/libstdc++.so.6.0.22:0x121a90
        ----
      Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/147464489775.29804.3190419491209875936.stgit@devboxSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f8da4b51
    • A
      perf intel-pt: Fix decoding when there are address filters · 2acee108
      Adrian Hunter 提交于
      Due to errata SKL014 "Intel PT TIP.PGD May Not Have Target IP Payload",
      the Intel PT decoder needs to match address filters against TIP.PGD
      packets.  Parse the address filters and implement the decoder's
      'pgd_ip()' callback to match the IP against the filter regions.
      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-17-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2acee108
    • A
      perf intel-pt: Enable decoder to handle TIP.PGD with missing IP · 9f1d122b
      Adrian Hunter 提交于
      When address filters are used, the decoder must detect the end of a
      filter region (or a branch into a tracestop region) by matching Packet
      Generation Disabled (TIP.PGD) packets against the object code using the
      IP given in the packet. However, due to errata SKL014 "Intel PT TIP.PGD
      May Not Have Target IP Payload", that IP may not be present.
      
      Enable the decoder to handle that by adding a new callback function
      'pgd_ip()' which indicates whether the IP is not traced, in which case
      that is the point where the trace was disabled.
      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-16-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9f1d122b
    • A
      perf intel-pt: Read address filter from AUXTRACE_INFO event · 2b9e32c4
      Adrian Hunter 提交于
      Read the address filter from the AUXTRACE_INFO event in preparation for
      using it to assist in decoding.
      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-15-git-send-email-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2b9e32c4