1. 31 8月, 2018 4 次提交
    • H
      perf evsel: Fix potential null pointer dereference in perf_evsel__new_idx() · fd8d2702
      Hisao Tanabe 提交于
      If evsel is NULL, we should return NULL to avoid a NULL pointer
      dereference a bit later in the code.
      Signed-off-by: NHisao Tanabe <xtanabe@gmail.com>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 03e0a7df ("perf tools: Introduce bpf-output event")
      LPU-Reference: 20180824154556.23428-1-xtanabe@gmail.com
      Link: https://lkml.kernel.org/n/tip-e5plzjhx6595a5yjaf22jss3@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fd8d2702
    • K
      perf arm64: Fix include path for asm-generic/unistd.h · 5ab1de93
      Kim Phillips 提交于
      The new syscall table support for arm64 mistakenly used the system's
      asm-generic/unistd.h file when processing the
      tools/arch/arm64/include/uapi/asm/unistd.h file's include directive:
      
      	#include <asm-generic/unistd.h>
      
      See "Committer notes" section of commit 2b588243 "perf arm64:
      Generate system call table from asm/unistd.h" for more details.
      
      This patch removes the committer's temporary workaround, and instructs
      the host compiler to search the build tree's include path for the right
      copy of the unistd.h file, instead of the one on the system's
      /usr/include path.
      
      It thus fixes the committer's test that cross-builds an arm64 perf on an
      x86 platform running Ubuntu 14.04.5 LTS with an old toolchain:
      
      $ tools/perf/arch/arm64/entry/syscalls/mksyscalltbl /gcc-linaro-5.4.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc gcc `pwd`/tools tools/arch/arm64/include/uapi/asm/unistd.h | grep bpf
      	[280] = "bpf",
      Signed-off-by: NKim Phillips <kim.phillips@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Fixes: 2b588243 ("perf arm64: Generate system call table from asm/unistd.h")
      Link: http://lkml.kernel.org/r/20180806172800.bbcec3cfcc51e2facc978bf2@arm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5ab1de93
    • J
      perf tests: Add breakpoint modify tests · 9b3579fc
      Jiri Olsa 提交于
      Adding to tests that aims on kernel breakpoint modification bugs.
      
      First test creates HW breakpoint, tries to change it and checks it was
      properly changed. It aims on kernel issue that prevents HW breakpoint to
      be changed via ptrace interface.
      
      The first test forks, the child sets itself as ptrace tracee and waits
      in signal for parent to trace it, then it calls bp_1 and quits.
      
      The parent does following steps:
      
       - creates a new breakpoint (id 0) for bp_2 function
       - changes that breakpoint to bp_1 function
       - waits for the breakpoint to hit and checks
         it has proper rip of bp_1 function
      
      This test aims on an issue in kernel preventing to change disabled
      breakpoints
      
      Second test mimics the first one except for few steps
      in the parent:
       - creates a new breakpoint (id 0) for bp_1 function
       - changes that breakpoint to bogus (-1) address
       - waits for the breakpoint to hit and checks
         it has proper rip of bp_1 function
      
      This test aims on an issue in kernel disabling enabled
      breakpoint after unsuccesful change.
      
      Committer testing:
      
        # uname -a
        Linux jouet 4.18.0-rc8-00002-g1236568e #12 SMP Tue Aug 7 14:08:26 -03 2018 x86_64 x86_64 x86_64 GNU/Linux
        # perf test -v "bp modify"
        62: x86 bp modify                                         :
        --- start ---
        test child forked, pid 25671
        in bp_1
        tracee exited prematurely 2
        FAILED arch/x86/tests/bp-modify.c:209 modify test 1 failed
      
        test child finished with -1
        ---- end ----
        x86 bp modify: FAILED!
        #
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Milind Chabbi <chabbi.milind@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180827091228.2878-2-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9b3579fc
    • M
      perf annotate: Properly interpret indirect call · 1dc27f63
      Martin Liška 提交于
      The patch changes the parsing of:
      
      	callq  *0x8(%rbx)
      
      from:
      
        0.26 │     → callq  *8
      
      to:
      
        0.26 │     → callq  *0x8(%rbx)
      
      in this case an address is followed by a register, thus one can't parse
      only the address.
      
      Committer testing:
      
      1) run 'perf record sleep 10'
      2) before applying the patch, run:
      
           perf annotate --stdio2 > /tmp/before
      
      3) after applying the patch, run:
      
           perf annotate --stdio2 > /tmp/after
      
      4) diff /tmp/before /tmp/after:
        --- /tmp/before 2018-08-28 11:16:03.238384143 -0300
        +++ /tmp/after  2018-08-28 11:15:39.335341042 -0300
        @@ -13274,7 +13274,7 @@
                      ↓ jle    128
                        hash_value = hash_table->hash_func (key);
                        mov    0x8(%rsp),%rdi
        -  0.91       → callq  *30
        +  0.91       → callq  *0x30(%r12)
                        mov    $0x2,%r8d
                        cmp    $0x2,%eax
                        node_hash = hash_table->hashes[node_index];
        @@ -13848,7 +13848,7 @@
                         mov    %r14,%rdi
                         sub    %rbx,%r13
                         mov    %r13,%rdx
        -              → callq  *38
        +              → callq  *0x38(%r15)
                         cmp    %rax,%r13
           1.91        ↓ je     240
                  1b4:   mov    $0xffffffff,%r13d
        @@ -14026,7 +14026,7 @@
                         mov    %rcx,-0x500(%rbp)
                         mov    %r15,%rsi
                         mov    %r14,%rdi
        -              → callq  *38
        +              → callq  *0x38(%rax)
                         mov    -0x500(%rbp),%rcx
                         cmp    %rax,%rcx
                       ↓ jne    9b0
      <SNIP tons of other such cases>
      Signed-off-by: NMartin Liška <mliska@suse.cz>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NKim Phillips <kim.phillips@arm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/bd1f3932-be2b-85f9-7582-111ee0a43b07@suse.czSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1dc27f63
  2. 20 8月, 2018 21 次提交
  3. 15 8月, 2018 5 次提交
  4. 14 8月, 2018 10 次提交