1. 27 4月, 2018 1 次提交
  2. 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
  3. 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
  4. 13 4月, 2018 1 次提交
  5. 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
  6. 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
  7. 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
  8. 17 3月, 2018 3 次提交
  9. 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
  10. 08 3月, 2018 3 次提交
  11. 05 3月, 2018 11 次提交
  12. 17 2月, 2018 5 次提交
  13. 16 2月, 2018 1 次提交
    • J
      perf tests: Fix dwarf unwind for stripped binaries · fdf7c49c
      Jiri Olsa 提交于
      When we strip the perf binary, dwarf unwind test stop
      to work. The reason is that strip will remove static
      function symbols, which we need to check for unwind.
      
      This change will keep this test working in cases where
      the global symbols are put into dynamic symbol table,
      which is the case on x86. It still won't work on powerpc.
      
      Making those 5 local functions global, and adding
      'test_dwarf_unwind__' to their names.
      
      Committer testing:
      
      Before:
      
        # perf test dwarf
        58: DWARF unwind                               : Ok
        # strip ~/bin/perf
        # perf test dwarf
        58: DWARF unwind                               : FAILED!
        # perf test -v dwarf
        58: DWARF unwind                               :
        --- start ---
        test child forked, pid 6590
        unwind: thread map already set, dso=/home/acme/bin/perf
        <SNIP>
        unwind: access_mem addr 0x7ffce6c48098 val 48563f, offset 1144
        unwind: test__dwarf_unwind:ip = 0x4a54e5 (0xa54e5)
        got: test__dwarf_unwind 0xa54e5, expecting test__dwarf_unwind
        unwind: '':ip = 0x4a50bb (0xa50bb)
        failed: got unresolved address 0xa50bb
        unwind failed
        test child finished with -1
        ---- end ----
        DWARF unwind: FAILED!
        #
      
      After:
      
        # perf test dwarf
        58: DWARF unwind                               : Ok
        # strip ~/bin/perf
        # perf test dwarf
        58: DWARF unwind                               : Ok
        #
        # perf test -v dwarf
        58: DWARF unwind                               :
        --- start ---
        test child forked, pid 7219
        unwind: thread map already set, dso=/home/acme/bin/perf
        <SNIP>
        unwind: access_mem addr 0x7fff007da2c8 val 48575f, offset 1144
        unwind: test__arch_unwind_sample:ip = 0x589044 (0x189044)
        got: test__arch_unwind_sample 0x189044, expecting test__arch_unwind_sample
        unwind: test_dwarf_unwind__thread:ip = 0x4a52f7 (0xa52f7)
        got: test_dwarf_unwind__thread 0xa52f7, expecting test_dwarf_unwind__thread
        unwind: test_dwarf_unwind__compare:ip = 0x4a5468 (0xa5468)
        got: test_dwarf_unwind__compare 0xa5468, expecting test_dwarf_unwind__compare
        unwind: bsearch:ip = 0x7f6608ae94d8 (0x394d8)
        got: bsearch 0x394d8, expecting bsearch
        unwind: test_dwarf_unwind__krava_3:ip = 0x4a54d1 (0xa54d1)
        got: test_dwarf_unwind__krava_3 0xa54d1, expecting test_dwarf_unwind__krava_3
        unwind: test_dwarf_unwind__krava_2:ip = 0x4a550b (0xa550b)
        got: test_dwarf_unwind__krava_2 0xa550b, expecting test_dwarf_unwind__krava_2
        unwind: test_dwarf_unwind__krava_1:ip = 0x4a554b (0xa554b)
        got: test_dwarf_unwind__krava_1 0xa554b, expecting test_dwarf_unwind__krava_1
        unwind: test__dwarf_unwind:ip = 0x4a5605 (0xa5605)
        got: test__dwarf_unwind 0xa5605, expecting test__dwarf_unwind
        test child finished with 0
        ---- end ----
        DWARF unwind: Ok
        #
      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: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180206181813.10943-17-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      fdf7c49c
  14. 15 2月, 2018 2 次提交
    • T
      perf test: Fix test trace+probe_libc_inet_pton.sh for s390x · 7a924536
      Thomas Richter 提交于
      On Intel test case trace+probe_libc_inet_pton.sh succeeds and the
      output is:
      
      [root@f27 perf]# ./perf trace --no-syscalls
                        -e probe_libc:inet_pton/max-stack=3/ ping -6 -c 1 ::1
      PING ::1(::1) 56 data bytes
      64 bytes from ::1: icmp_seq=1 ttl=64 time=0.037 ms
      
       --- ::1 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 0.037/0.037/0.037/0.000 ms
           0.000 probe_libc:inet_pton:(7fa40ac618a0))
                    __GI___inet_pton (/usr/lib64/libc-2.26.so)
                    getaddrinfo (/usr/lib64/libc-2.26.so)
                    main (/usr/bin/ping)
      
      The kernel stack unwinder is used, it is specified implicitly
      as call-graph=fp (frame pointer).
      
      On s390x only dwarf is available for stack unwinding. It is also
      done in user space. This requires different parameter setup
      and result checking for s390x and Intel.
      
      This patch adds separate perf trace setup and result checking
      for Intel and s390x. On s390x specify this command line to
      get a call-graph and handle the different call graph result
      checking:
      
      [root@s35lp76 perf]# ./perf trace --no-syscalls
      	-e probe_libc:inet_pton/call-graph=dwarf/ ping -6 -c 1 ::1
      PING ::1(::1) 56 data bytes
      64 bytes from ::1: icmp_seq=1 ttl=64 time=0.041 ms
      
       --- ::1 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 0.041/0.041/0.041/0.000 ms
           0.000 probe_libc:inet_pton:(3ffb9942060))
                  __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)
      [root@s35lp76 perf]#
      
      Before:
      [root@s8360047 perf]# ./perf test -vv 58
      58: probe libc's inet_pton & backtrace it with ping       :
       --- start ---
      test child forked, pid 26349
      PING ::1(::1) 56 data bytes
      64 bytes from ::1: icmp_seq=1 ttl=64 time=0.079 ms
       --- ::1 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 0.079/0.079/0.079/0.000 ms
      0.000 probe_libc:inet_pton:(3ff925c2060))
      test child finished with -1
       ---- end ----
      probe libc's inet_pton & backtrace it with ping: FAILED!
      [root@s8360047 perf]#
      
      After:
      [root@s35lp76 perf]# ./perf test -vv 57
      57: probe libc's inet_pton & backtrace it with ping       :
       --- start ---
      test child forked, pid 38708
      PING ::1(::1) 56 data bytes
      64 bytes from ::1: icmp_seq=1 ttl=64 time=0.038 ms
       --- ::1 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 0.038/0.038/0.038/0.000 ms
      0.000 probe_libc:inet_pton:(3ff87342060))
      __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)
      test child finished with 0
       ---- end ----
      probe libc's inet_pton & backtrace it with ping: Ok
      [root@s35lp76 perf]#
      
      On Intel the test case runs unchanged and succeeds.
      Signed-off-by: NThomas Richter <tmricht@linux.vnet.ibm.com>
      Reviewed-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180117083831.101001-1-tmricht@linux.vnet.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      7a924536
    • K
      perf test: Update mmap read functions for backward-ring-buffer test · 600a7cfe
      Kan Liang 提交于
      Use the new perf_mmap__read_* interfaces for overwrite ringbuffer test.
      
      Commiter notes:
      
      Testing:
      
        [root@seventh ~]# perf test -v backward
        48: Read backward ring buffer                             :
        --- start ---
        test child forked, pid 8309
        Using CPUID GenuineIntel-6-9E
        mmap size 1052672B
        mmap size 8192B
        Finished reading overwrite ring buffer: rewind
        test child finished with 0
        ---- end ----
        Read backward ring buffer: Ok
        [root@seventh ~]#
      Signed-off-by: NKan Liang <kan.liang@intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1516310792-208685-10-git-send-email-kan.liang@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      600a7cfe
  15. 25 1月, 2018 1 次提交
  16. 18 1月, 2018 1 次提交
  17. 17 1月, 2018 1 次提交
    • A
      perf unwind: Do not look just at the global callchain_param.record_mode · eabad8c6
      Arnaldo Carvalho de Melo 提交于
      When setting up DWARF callchains on specific events, without using
      'record' or 'trace' --call-graph, but instead doing it like:
      
      	perf trace -e cycles/call-graph=dwarf/
      
      The unwind__prepare_access() call in thread__insert_map() when we
      process PERF_RECORD_MMAP(2) metadata events were not being performed,
      precluding us from using per-event DWARF callchains, handling them just
      when we asked for all events to be DWARF, using "--call-graph dwarf".
      
      We do it in the PERF_RECORD_MMAP because we have to look at one of the
      executable maps to figure out the executable type (64-bit, 32-bit) of
      the DSO laid out in that mmap. Also to look at the architecture where
      the perf.data file was recorded.
      
      All this probably should be deferred to when we process a sample for
      some thread that has callchains, so that we do this processing only for
      the threads with samples, not for all of them.
      
      For now, fix using DWARF on specific events.
      
      Before:
      
        # perf trace --no-syscalls -e probe_libc:inet_pton/call-graph=dwarf/ ping -6 -c 1 ::1
        PING ::1(::1) 56 data bytes
        64 bytes from ::1: icmp_seq=1 ttl=64 time=0.048 ms
      
        --- ::1 ping statistics ---
        1 packets transmitted, 1 received, 0% packet loss, time 0ms
        rtt min/avg/max/mdev = 0.048/0.048/0.048/0.000 ms
           0.000 probe_libc:inet_pton:(7fe9597bb350))
        Problem processing probe_libc:inet_pton callchain, skipping...
        #
      
      After:
      
        # perf trace --no-syscalls -e probe_libc:inet_pton/call-graph=dwarf/ ping -6 -c 1 ::1
        PING ::1(::1) 56 data bytes
        64 bytes from ::1: icmp_seq=1 ttl=64 time=0.060 ms
      
        --- ::1 ping statistics ---
        1 packets transmitted, 1 received, 0% packet loss, time 0ms
        rtt min/avg/max/mdev = 0.060/0.060/0.060/0.000 ms
             0.000 probe_libc:inet_pton:(7fd4aa930350))
                                               __inet_pton (inlined)
                                               gaih_inet.constprop.7 (/usr/lib64/libc-2.26.so)
                                               __GI_getaddrinfo (inlined)
                                               [0xffffaa804e51af3f] (/usr/bin/ping)
                                               __libc_start_main (/usr/lib64/libc-2.26.so)
                                               [0xffffaa804e51b379] (/usr/bin/ping)
        #
        # perf trace --call-graph=dwarf --no-syscalls -e probe_libc:inet_pton/call-graph=dwarf/ ping -6 -c 1 ::1
        PING ::1(::1) 56 data bytes
        64 bytes from ::1: icmp_seq=1 ttl=64 time=0.057 ms
      
        --- ::1 ping statistics ---
        1 packets transmitted, 1 received, 0% packet loss, time 0ms
        rtt min/avg/max/mdev = 0.057/0.057/0.057/0.000 ms
             0.000 probe_libc:inet_pton:(7f9363b9e350))
                                               __inet_pton (inlined)
                                               gaih_inet.constprop.7 (/usr/lib64/libc-2.26.so)
                                               __GI_getaddrinfo (inlined)
                                               [0xffffa9e8a14e0f3f] (/usr/bin/ping)
                                               __libc_start_main (/usr/lib64/libc-2.26.so)
                                               [0xffffa9e8a14e1379] (/usr/bin/ping)
        #
        # perf trace --call-graph=fp --no-syscalls -e probe_libc:inet_pton/call-graph=dwarf/ ping -6 -c 1 ::1
        PING ::1(::1) 56 data bytes
        64 bytes from ::1: icmp_seq=1 ttl=64 time=0.077 ms
      
        --- ::1 ping statistics ---
        1 packets transmitted, 1 received, 0% packet loss, time 0ms
        rtt min/avg/max/mdev = 0.077/0.077/0.077/0.000 ms
             0.000 probe_libc:inet_pton:(7f4947e1c350))
                                               __inet_pton (inlined)
                                               gaih_inet.constprop.7 (/usr/lib64/libc-2.26.so)
                                               __GI_getaddrinfo (inlined)
                                               [0xffffaa716d88ef3f] (/usr/bin/ping)
                                               __libc_start_main (/usr/lib64/libc-2.26.so)
                                               [0xffffaa716d88f379] (/usr/bin/ping)
        #
        # perf trace --no-syscalls -e probe_libc:inet_pton/call-graph=fp/ ping -6 -c 1 ::1
        PING ::1(::1) 56 data bytes
        64 bytes from ::1: icmp_seq=1 ttl=64 time=0.078 ms
      
        --- ::1 ping statistics ---
        1 packets transmitted, 1 received, 0% packet loss, time 0ms
        rtt min/avg/max/mdev = 0.078/0.078/0.078/0.000 ms
             0.000 probe_libc:inet_pton:(7fa157696350))
                                               __GI___inet_pton (/usr/lib64/libc-2.26.so)
                                               getaddrinfo (/usr/lib64/libc-2.26.so)
                                               [0xffffa9ba39c74f40] (/usr/bin/ping)
        #
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hendrick Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/r/20180116182650.GE16107@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      eabad8c6
  18. 08 1月, 2018 2 次提交