1. 05 6月, 2018 1 次提交
  2. 04 6月, 2018 1 次提交
  3. 30 5月, 2018 1 次提交
    • T
      perf test: "Session topology" dumps core on s390 · d1211091
      Thomas Richter 提交于
      The "perf test Session topology" entry fails with core dump on s390. The root
      cause is a NULL pointer dereference in function check_cpu_topology() line 76
      (or line 82 without -v).
      
      The session->header.env.cpu variable is NULL because on s390 function
      process_cpu_topology() returns with error:
      
          socket_id number is too big.
          You may need to upgrade the perf tool.
      
      and releases the env.cpu variable via zfree() and sets it to NULL.
      
      Here is the gdb output:
      (gdb) n
      76                      pr_debug("CPU %d, core %d, socket %d\n", i,
      (gdb) n
      
      Program received signal SIGSEGV, Segmentation fault.
      0x00000000010f4d9e in check_cpu_topology (path=0x3ffffffd6c8
      	"/tmp/perf-test-J6CHMa", map=0x14a1740) at tests/topology.c:76
      76  pr_debug("CPU %d, core %d, socket %d\n", i,
      (gdb)
      
      Make sure the env.cpu variable is not used when its NULL.
      Test for NULL pointer and return TEST_SKIP if so.
      
      Output before:
      
        [root@p23lp27 perf]# ./perf test -F 39
        39: Session topology  :Segmentation fault (core dumped)
        [root@p23lp27 perf]#
      
      Output after:
      
        [root@p23lp27 perf]# ./perf test -vF 39
        39: Session topology                                      :
        --- start ---
        templ file: /tmp/perf-test-Ajx59D
        socket_id number is too big.You may need to upgrade the perf tool.
        ---- end ----
        Session topology: Skip
        [root@p23lp27 perf]#
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180528073657.11743-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d1211091
  4. 19 5月, 2018 1 次提交
    • S
      perf script: Show symbol offsets by default · 7903a708
      Sandipan Das 提交于
      Since the ip shown for a symbol is now always a virtual address, it
      becomes difficult to correlate this with objdump output and determine
      the exact instruction address. So, we always show the offset from the
      start of the symbol.
      
      This can be verified on a powerpc64le system running Fedora 27 as
      follows:
      
        # perf probe -a sys_write
        # perf record -e probe:sys_write -g ~/test
      
      Before applying this patch:
      
        # perf script
      
        test  9710 [013] 95614.332431: probe:sys_write: (c0000000004025b0)
                c0000000004025b0 sys_write (/lib/modules/4.17.0-rc4+/build/vmlinux)
                c00000000000b9e0 system_call (/lib/modules/4.17.0-rc4+/build/vmlinux)
                    7fffb70d8234 __GI___libc_write (/usr/lib64/libc-2.26.so)
                    7fffb7052c74 _IO_file_write@@GLIBC_2.17 (/usr/lib64/libc-2.26.so)
                        5afc1818 [unknown] ([unknown])
                    7fffb7051a60 new_do_write (/usr/lib64/libc-2.26.so)
                    7fffb7054638 _IO_do_write@@GLIBC_2.17 (/usr/lib64/libc-2.26.so)
                    7fffb7054bbc _IO_file_overflow@@GLIBC_2.17 (/usr/lib64/libc-2.26.so)
                    7fffb7055a24 __overflow (/usr/lib64/libc-2.26.so)
                    7fffb7044548 _IO_puts (/usr/lib64/libc-2.26.so)
                        10000440 main (/home/sandipan/test)
                    7fffb6fe36a0 generic_start_main.isra.0 (/usr/lib64/libc-2.26.so)
                    7fffb6fe3898 __libc_start_main (/usr/lib64/libc-2.26.so)
                               0 [unknown] ([unknown])
        ...
      
      After applying this patch:
      
        # perf script
      
        test  9710 [013] 95614.332431: probe:sys_write: (c0000000004025b0)
                c0000000004025b0 sys_write+0x10 (/lib/modules/4.17.0-rc4+/build/vmlinux)
                c00000000000b9e0 system_call+0x58 (/lib/modules/4.17.0-rc4+/build/vmlinux)
                    7fffb70d8234 __GI___libc_write+0x24 (/usr/lib64/libc-2.26.so)
                    7fffb7052c74 _IO_file_write@@GLIBC_2.17+0x44 (/usr/lib64/libc-2.26.so)
                        5afc1818 [unknown] ([unknown])
                    7fffb7051a60 new_do_write+0x90 (/usr/lib64/libc-2.26.so)
                    7fffb7054638 _IO_do_write@@GLIBC_2.17+0x38 (/usr/lib64/libc-2.26.so)
                    7fffb7054bbc _IO_file_overflow@@GLIBC_2.17+0x14c (/usr/lib64/libc-2.26.so)
                    7fffb7055a24 __overflow+0x64 (/usr/lib64/libc-2.26.so)
                    7fffb7044548 _IO_puts+0x218 (/usr/lib64/libc-2.26.so)
                        10000440 main+0x20 (/home/sandipan/test)
                    7fffb6fe36a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so)
                    7fffb6fe3898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so)
                               0 [unknown] ([unknown])
        ...
      Signed-off-by: NSandipan Das <sandipan@linux.vnet.ibm.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Link: http://lkml.kernel.org/r/20180517063326.6319-2-sandipan@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7903a708
  5. 18 5月, 2018 2 次提交
  6. 15 5月, 2018 1 次提交
  7. 11 5月, 2018 1 次提交
  8. 30 4月, 2018 1 次提交
  9. 27 4月, 2018 12 次提交
  10. 23 4月, 2018 2 次提交
    • J
      perf evsel: Disable write_backward for leader sampling group events · e9add8ba
      Jiri Olsa 提交于
      .. and other related fields that do not need to be enabled
      for events that have sampling leader.
      
      It fixes the perf top usage Ingo reported broken:
      
        # perf top -e '{cycles,msr/aperf/}:S'
      
      The 'msr/aperf/' event is configured for write_back sampling, which is
      not allowed by the MSR PMU, so it fails to create the event.
      
      Adjusting related attr test.
      Reported-by: NIngo Molnar <mingo@kernel.org>
      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: Kan Liang <kan.liang@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180423090823.32309-6-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e9add8ba
    • T
      perf test: Adapt test case record+probe_libc_inet_pton.sh for s390 · b31a8cc1
      Thomas Richter 提交于
      perf test case 58 (record+probe_libc_inet_pton.sh) executed on s390x
      using kernel 4.16.0rc3 displays this result:
      
       # perf trace --no-syscalls -e probe_libc:inet_pton/call-graph=dwarf/ ping -6 -c 1 ::1
           probe_libc:inet_pton: (3ffa0240448)
      	      __GI___inet_pton (/usr/lib64/libc-2.26.so)
      	      gaih_inet (inlined)
      	      __GI_getaddrinfo (inlined)
      	      main (/usr/bin/ping)
      	      __libc_start_main (/usr/lib64/libc-2.26.so)
      	     _start (/usr/bin/ping)
      
      After I installed kernel 4.16.0 the same tests uses commands:
      
       # perf record -e probe_libc:inet_pton/call-graph=dwarf/
            -o /tmp/perf.data.abc ping -6 -c 1 ::1
       # perf script -i /tmp/perf.data.abc
      
      and displays:
      
       ping 39048 [006] 84230.381198: probe_libc:inet_pton: (3ffa0240448)
      	       140448 __GI___inet_pton (/usr/lib64/libc-2.26.so)
      	       fbde1 gaih_inet (inlined)
      	       fe2b9 __GI_getaddrinfo (inlined)
      	        398d main (/usr/bin/ping)
      
      Nothing else changed including glibc elfutils and other libraries picked
      up by the build.
      
      The entries for __libc_start_main and _start are missing.
      
      I bisected missing __libc_start_main and _start to commit
      
      Fixes: 3d20c624 ("perf unwind: Unwind with libdw doesn't take symfs into account")
      
      When I undo this commit I get this call stack on s390:
       [root@s35lp76 perf]# ./perf script  -i /tmp/perf.data.abc
       ping 39048 [006] 84230.381198: probe_libc:inet_pton: (3ffa0240448)
      	140448 __GI___inet_pton (/usr/lib64/libc-2.26.so)
      	 fbde1 gaih_inet (inlined)
      	 fe2b9 __GI_getaddrinfo (inlined)
      	  398d main (/usr/bin/ping)
      	 22fbd __libc_start_main (/usr/lib64/libc-2.26.so)
      	  457b _start (/usr/bin/ping)
      
      Looks like dwarf functions dwfl_xxx create different call back stack
      trace when using file /usr/lib/debug/usr/bin/ping-20161105-7.fc27.s390x.debug
      instead of file /usr/bin/ping.
      
      Fix this test case on s390 and do not expect any call back stack entry
      after the main() function. Also be more robust and accept a leading
      __GI_ prefix in front of getaddrinfo.
      
      On x86 this test case shows the same call stack using both kernel
      versions 4.16.0rc3 and 4.16.0 and also stops at main:
      
        [root@f27 perf]# ./perf script -i /tmp/perf.data.tmr
        ping  4446 [000]   172.027088: probe_libc:inet_pton: (7fdfa08c93c0)
      	             1393c0 __GI___inet_pton (/usr/lib64/libc-2.26.so)
      	              fe60d getaddrinfo (/usr/lib64/libc-2.26.so)
      	               2f40 main (/usr/bin/ping)
        [root@f27 perf]#
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Martin Vuille <jpmv27@aim.com>
      Link: http://lkml.kernel.org/r/20180423082428.7930-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b31a8cc1
  11. 19 4月, 2018 2 次提交
    • A
      perf test BPF: Fixup BPF test using epoll_pwait syscall function probe · eccb1b93
      Arnaldo Carvalho de Melo 提交于
      Since e145242e ("syscalls/core, syscalls/x86: Clean up syscall stub
      naming convention") changed the main syscall function for 'epoll_pwait'
      to something other than the expected 'SyS_epoll_pwait the' 'perf test
      BPF' entries started failing, fix it by using something called from the
      main syscall function instead, 'epoll_wait', which should keep this test
      working in older kernels too.
      
      Before:
      
        # perf test BPF
        40: BPF filter                           :
        40.1: Basic BPF filtering                : FAILED!
        40.2: BPF pinning                        : Skip
        40.3: BPF prologue generation            : Skip
        40.4: BPF relocation checker             : Skip
      
      If we use -v for that test we see the problem:
      
          Probe point 'SyS_epoll_pwait' not found.
      
      After:
      
        # perf test BPF
        40: BPF filter                           :
        40.1: Basic BPF filtering                : Ok
        40.2: BPF pinning                        : Ok
        40.3: BPF prologue generation            : Ok
        40.4: BPF relocation checker             : Ok
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/r/tip-y24nmn70cs2am8jh4i344dng@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eccb1b93
    • A
      perf tests mmap: Show which tracepoint is failing · 518c6021
      Arnaldo Carvalho de Melo 提交于
      In the 'perf test "mmap interface"' we try creating events for several
      tracepoints, but when perf_evsel__new() fails we're not showing which
      one is failing, fix that to help diagnosing problems, such as the
      syscall tracepoints ones being found and fixes in this merge window.
      
      Now the failing tests shows:
      
        # perf test -v "mmap interface"
       4: Read samples using the mmap interface                 :
        --- start ---
        test child forked, pid 14311
        <SNIP>
        perf_evsel__new(sys_enter_getppid)
        test child finished with -1
        ---- end ----
        Read samples using the mmap interface: FAILED!
        #
      
      Now to check why the syscalls:sys_enter_getppid is failing...
      
        # ls -la /sys/kernel/debug/tracing/events/syscalls/sys_enter_getppid
        ls: cannot access '/sys/kernel/debug/tracing/events/syscalls/sys_enter_getppid': No such file or directory
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-44xk0ycdzrfzx1o9rklf5itl@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      518c6021
  12. 13 4月, 2018 1 次提交
  13. 12 4月, 2018 1 次提交
    • A
      perf tests bpf: Remove unused ptrace.h include from LLVM test · c13009c1
      Arnaldo Carvalho de Melo 提交于
      The bpf-script-test-kbuild.c script, used in one of the LLVM subtests,
      includes ptrace.h unnecessarily, and that ends up making it include a
      header that uses asm(_ASM_SP), a feature that is not supported by clang
      <= 4.0, breaking that 'perf test' entry.
      
      This ended up leading to the ca26cffa ("x86/asm: Allow again using
      asm.h when building for the 'bpf' clang target"), adding an ifndef
      __BPF__ to the arch/x86/include/asm/asm.h file.
      
      Newer clang versions accept that asm(_ASM_SP) construct, so just remove
      the ptrace.h include, which paves the way for reverting ca26cffa
      ("x86/asm: Allow again using asm.h when building for the 'bpf' clang
      target").
      Suggested-by: NYonghong Song <yhs@fb.com>
      Acked-by: NYonghong Song <yhs@fb.com>
      Link: https://lkml.kernel.org/r/613f0a0d-c433-8f4d-dcc1-c9889deae39e@fb.com
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Dmitriy Vyukov <dvyukov@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Matthias Kaehlcke <mka@chromium.org>
      Cc: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-clbcnzbakdp18ibme4wt43ib@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c13009c1
  14. 20 3月, 2018 1 次提交
    • A
      perf tests bp_account: Fix build with clang-6 · 1cd61883
      Arnaldo Carvalho de Melo 提交于
      To shut up this compiler warning:
      
          CC       /tmp/build/perf/tests/bp_account.o
          CC       /tmp/build/perf/tests/task-exit.o
          CC       /tmp/build/perf/tests/sw-clock.o
        tests/bp_account.c:106:20: error: pointer type mismatch ('int (*)(void)' and 'void *') [-Werror,-Wpointer-type-mismatch]
                void *addr = is_x ? test_function : (void *) &the_var;
                                  ^ ~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~
        1 error generated.
      
      Noticed with clang 6 on fedora rawhide.
      
        [perfbuilder@44490f0e7241 perf]$ clang -v
        clang version 6.0.0 (tags/RELEASE_600/final)
        Target: x86_64-unknown-linux-gnu
        Thread model: posix
        InstalledDir: /usr/bin
        Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/8
        Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/8
        Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/8
        Candidate multilib: .;@m64
        Candidate multilib: 32;@m32
        Selected multilib: .;@m64
        [perfbuilder@44490f0e7241 perf]$
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 032db28e ("perf tests: Add breakpoint accounting/modify test")
      Link: https://lkml.kernel.org/n/tip-a3jnkzh4xam0l954de5tn66d@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1cd61883
  15. 19 3月, 2018 1 次提交
    • J
      perf tools: Fix snprint warnings for gcc 8 · 77f18153
      Jiri Olsa 提交于
      With gcc 8 we get new set of snprintf() warnings that breaks the
      compilation, one example:
      
        tests/mem.c: In function ‘check’:
        tests/mem.c:19:48: error: ‘%s’ directive output may be truncated writing \
              up to 99 bytes into a region of size 89 [-Werror=format-truncation=]
          snprintf(failure, sizeof failure, "unexpected %s", out);
      
      The gcc docs says:
      
       To avoid the warning either use a bigger buffer or handle the
       function's return value which indicates whether or not its output
       has been truncated.
      
      Given that all these warnings are harmless, because the code either
      properly fails due to uncomplete file path or we don't care for
      truncated output at all, I'm changing all those snprintf() calls to
      scnprintf(), which actually 'checks' for the snprint return value so the
      gcc stays silent.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Link: http://lkml.kernel.org/r/20180319082902.4518-1-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      77f18153
  16. 17 3月, 2018 3 次提交
  17. 13 3月, 2018 1 次提交
    • J
      perf tests: Add breakpoint accounting/modify test · 032db28e
      Jiri Olsa 提交于
      Adding test that:
      
        - detects the number of watch/break-points,
          skip test if any is missing
        - detects PERF_EVENT_IOC_MODIFY_ATTRIBUTES ioctl,
          skip test if it's missing
        - detects if watchpoints and breakpoints share
          same slots
        - create all possible watchpoints on cpu 0
        - change one of it to breakpoint
        - in case wp and bp do not share slots,
          we create another watchpoint to ensure
          the slot accounting is correct
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Milind Chabbi <chabbi.milind@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Oleg Nesterov <onestero@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Link: http://lkml.kernel.org/r/20180312134548.31532-9-jolsa@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      032db28e
  18. 08 3月, 2018 3 次提交
  19. 05 3月, 2018 4 次提交