1. 20 Feb, 2019 1 commit
  2. 12 Feb, 2019 2 commits
  3. 26 Jan, 2019 1 commit
  4. 12 Nov, 2018 1 commit
  5. 06 Nov, 2018 1 commit
  6. 08 Oct, 2018 1 commit
  7. 19 Sep, 2018 2 commits
  8. 18 Sep, 2018 1 commit
  9. 05 Sep, 2018 1 commit
    • Arnaldo Carvalho de Melo's avatar
      perf tests: Fix record+probe_libc_inet_pton.sh without ping's debuginfo · 16329364
      Arnaldo Carvalho de Melo authored
      When we don't have the iputils-debuginfo package installed, i.e. when we
      don't have the DWARF information needed to resolve ping's samples, we
      end up failing this 'perf test' entry:
      
        # perf test ping
        62: probe libc's inet_pton & backtrace it with ping       : Ok
        # rpm -e iputils-debuginfo
        # perf test ping
        62: probe libc's inet_pton & backtrace it with ping       : FAILED!
        #
      
      Fix it to accept "[unknown]" where the symbol + offset, when resolved,
      is expected.
      
      I think this will fail in the other arches as well, but since I can't
      test now, I'm leaving s390x and ppc cases as-is.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Sandipan Das <sandipan@linux.vnet.ibm.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 7903a708 ("perf script: Show symbol offsets by default")
      Link: https://lkml.kernel.org/n/tip-hnizqwqrs03vcq1b74yao0f6@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      16329364
  10. 20 Aug, 2018 3 commits
    • Jiri Olsa's avatar
      perf tools: Remove ext from struct kmod_path · b946cd37
      Jiri Olsa authored
      Having comp carrying the compression ID, we no longer need return the
      extension. Removing it and updating the automated test.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180817094813.15086-14-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b946cd37
    • Jiri Olsa's avatar
      perf tools: Add compression id into 'struct kmod_path' · 4b838b0d
      Jiri Olsa authored
      Store a decompression ID in 'struct kmod_path', so it can be later
      stored in 'struct dso'.
      
      Switch 'struct kmod_path's 'comp' from 'bool' to 'int' to return the
      compressions array index. Add 0 index item into compressions array, so
      that the comp usage stays as it was: 0 - no compression, != 0
      compression index.
      
      Update the kmod_path tests.
      
      Committer notes:
      
      Use a designated initializer + terminating comma, e.g. { .fmt = NULL, }, to fix
      the build in several distros:
      
        centos:6:       util/dso.c:201: error: missing initializer
        centos:6:       util/dso.c:201: error: (near initialization for 'compressions[0].decompress')
        debian:9:       util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers]
        fedora:25:      util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers]
        fedora:26:      util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers]
        fedora:27:      util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers]
        oraclelinux:6:  util/dso.c:201: error: missing initializer
        oraclelinux:6:  util/dso.c:201: error: (near initialization for 'compressions[0].decompress')
        ubuntu:12.04.5: util/dso.c:201:2: error: missing initializer [-Werror=missing-field-initializers]
        ubuntu:12.04.5: util/dso.c:201:2: error: (near initialization for 'compressions[0].decompress') [-Werror=missing-field-initializers]
        ubuntu:16.04:   util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers]
        ubuntu:16.10:   util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers]
        ubuntu:16.10:   util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers]
        ubuntu:17.10:   util/dso.c:201:24: error: missing field 'decompress' initializer [-Werror,-Wmissing-field-initializers]
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180817094813.15086-7-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4b838b0d
    • Jiri Olsa's avatar
      perf tools: Get rid of dso__needs_decompress() call in read_object_code() · bcd4287e
      Jiri Olsa authored
      There's no need to call dso__needs_decompress() twice in the function.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20180817094813.15086-2-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      bcd4287e
  11. 08 Aug, 2018 1 commit
    • Yury Norov's avatar
      perf tools: Drop unneeded bitmap_zero() calls · 3c8b8186
      Yury Norov authored
      bitmap_zero() is called after bitmap_alloc() in perf code. But
      bitmap_alloc() internally uses calloc() which guarantees that allocated
      area is zeroed. So following bitmap_zero is unneeded. Drop it.
      
      This happened because of confusing name for bitmap allocator. It
      should has name bitmap_zalloc instead of bitmap_alloc.
      
      This series:
      
        https://lkml.org/lkml/2018/6/18/841
      
      introduces a new API for bitmap allocations in kernel, and functions
      there are named correctly. Following patch propogates the API to tools,
      and fixes naming issue.
      Signed-off-by: default avatarYury Norov <ynorov@caviumnetworks.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andriy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: David Carrillo-Cisneros <davidcc@google.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Mike Snitzer <snitzer@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Link: http://lkml.kernel.org/r/20180623073502.16321-1-ynorov@caviumnetworks.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3c8b8186
  12. 31 Jul, 2018 2 commits
    • Sandipan Das's avatar
      perf tests: Fix indexing when invoking subtests · aa90f9f9
      Sandipan Das authored
      Recently, the subtest numbering was changed to start from 1.  While it
      is fine for displaying results, this should not be the case when the
      subtests are actually invoked.
      
      Typically, the subtests are stored in zero-indexed arrays and invoked
      based on the index passed to the main test function.  Since the index
      now starts from 1, the second subtest in the array (index 1) gets
      invoked instead of the first (index 0).  This applies to all of the
      following subtests but for the last one, the subtest always fails
      because it does not meet the boundary condition of the subtest index
      being lesser than the number of subtests.
      
      This can be observed on powerpc64 and x86_64 systems running Fedora 28
      as shown below.
      
      Before:
      
        # perf test "builtin clang support"
        55: builtin clang support                                 :
        55.1: builtin clang compile C source to IR                : Ok
        55.2: builtin clang compile C source to ELF object        : FAILED!
      
        # perf test "LLVM search and compile"
        38: LLVM search and compile                               :
        38.1: Basic BPF llvm compile                              : Ok
        38.2: kbuild searching                                    : Ok
        38.3: Compile source for BPF prologue generation          : Ok
        38.4: Compile source for BPF relocation                   : FAILED!
      
        # perf test "BPF filter"
        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                              : FAILED!
      
      After:
      
        # perf test "builtin clang support"
        55: builtin clang support                                 :
        55.1: builtin clang compile C source to IR                : Ok
        55.2: builtin clang compile C source to ELF object        : Ok
      
        # perf test "LLVM search and compile"
        38: LLVM search and compile                               :
        38.1: Basic BPF llvm compile                              : Ok
        38.2: kbuild searching                                    : Ok
        38.3: Compile source for BPF prologue generation          : Ok
        38.4: Compile source for BPF relocation                   : Ok
      
        # perf test "BPF filter"
        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
      Signed-off-by: default avatarSandipan Das <sandipan@linux.ibm.com>
      Reported-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Fixes: 9ef01124 ("perf test: Fix subtest number when showing results")
      Link: http://lkml.kernel.org/r/20180726171733.33208-1-sandipan@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      aa90f9f9
    • Sandipan Das's avatar
      perf tests: Fix complex event name parsing · a6f39cec
      Sandipan Das authored
      The 'umask' event parameter is unsupported on some architectures like
      powerpc64.
      
      This can be observed on a powerpc64le system running Fedora 27 as shown
      below.
      
        # perf test "Parse event definition strings" -v
         6: Parse event definition strings                        :
        --- start ---
        test child forked, pid 45915
        ...
        running test 3 'cpu/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks',period=0x1,event=0x2,umask=0x3/ukp'Invalid event/parameter 'umask'
        Invalid event/parameter 'umask'
        failed to parse event 'cpu/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks',period=0x1,event=0x2,umask=0x3/ukp', err 1, str 'unknown term'
        event syntax error: '..,event=0x2,umask=0x3/ukp'
                                          \___ unknown term
      
        valid terms: event,mark,pmc,cache_sel,pmcxsel,unit,thresh_stop,thresh_start,combine,thresh_sel,thresh_cmp,sample_mode,config,config1,config2,name,period,freq,branch_type,time,call-graph,stack-size,no-inherit,inherit,max-stack,no-overwrite,overwrite,driver-config
      
        mem_access -> cpu/event=0x10401e0/
        running test 0 'config=10,config1,config2=3,umask=1'
        test child finished with 1
        ---- end ----
        Parse event definition strings: FAILED!
      
      Committer testing:
      
      After applying the patch these test passes and in verbose mode we get:
      
        # perf test -v "event definition"
         6: Parse event definition strings:
        --- start ---
        test child forked, pid 11061
        running test 0 'syscalls:sys_enter_openat'Using CPUID GenuineIntel-6-9E
        <SNIP>
        running test 53 'cycles/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks'/Duk'
        running test 0 'cpu/config=10,config1,config2=3,period=1000/u'
        running test 1 'cpu/config=1,name=krava/u,cpu/config=2/u'
        running test 2 'cpu/config=1,call-graph=fp,time,period=100000/,cpu/config=2,call-graph=no,time=0,period=2000/'
        running test 3 'cpu/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks',period=0x1,event=0x2/ukp'
        <SNIP>
        test child finished with 0
        ---- end ----
        Parse event definition strings: Ok
        #
      Suggested-by: default avatarRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Signed-off-by: default avatarSandipan Das <sandipan@linux.ibm.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Fixes: 06dc5bf2 ("perf tests: Check that complex event name is parsed correctly")
      Link: http://lkml.kernel.org/r/20180726105502.31670-1-sandipan@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a6f39cec
  13. 24 Jul, 2018 5 commits
    • Thomas Richter's avatar
      perf test: Fix subtest number when showing results · 9ef01124
      Thomas Richter authored
      Perf test 40 for example has several subtests numbered 1-4 when
      displaying the start of the subtest. When the subtest results
      are displayed the subtests are numbered 0-3.
      
      Use this command to generate trace output:
      
        [root@s35lp76 perf]# ./perf test -Fv 40 2>/tmp/bpf1
      
      Fix this by adjusting the subtest number when show the
      subtest result.
      
      Output before:
      
        [root@s35lp76 perf]# egrep '(^40\.[0-4]| subtest [0-4]:)' /tmp/bpf1
        40.1: Basic BPF filtering                                 :
        BPF filter subtest 0: Ok
        40.2: BPF pinning                                         :
        BPF filter subtest 1: Ok
        40.3: BPF prologue generation                             :
        BPF filter subtest 2: Ok
        40.4: BPF relocation checker                              :
        BPF filter subtest 3: Ok
        [root@s35lp76 perf]#
      
      Output after:
      
        root@s35lp76 ~]# egrep '(^40\.[0-4]| subtest [0-4]:)' /tmp/bpf1
        40.1: Basic BPF filtering                                 :
        BPF filter subtest 1: Ok
        40.2: BPF pinning                                         :
        BPF filter subtest 2: Ok
        40.3: BPF prologue generation                             :
        BPF filter subtest 3: Ok
        40.4: BPF relocation checker                              :
        BPF filter subtest 4: Ok
        [root@s35lp76 ~]#
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180724134858.100644-1-tmricht@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9ef01124
    • Sandipan Das's avatar
      perf tests: Fix record+probe_libc_inet_pton.sh when event exists · 60089e42
      Sandipan Das authored
      If the event 'probe_libc:inet_pton' already exists, this test fails and
      deletes the existing event before exiting. This will then pass for any
      subsequent executions.
      
      Instead of skipping to deleting the existing event because of failing to
      add a new event, a duplicate event is now created and the script
      continues with the usual checks. Only the new duplicate event that is
      created at the beginning of the test is deleted as a part of the
      cleanups in the end. All existing events remain as it is.
      
      This can be observed on a powerpc64 system running Fedora 27 as shown
      below.
      
        # perf probe -x /usr/lib64/power8/libc-2.26.so -a inet_pton
      
        Added new event:
          probe_libc:inet_pton (on inet_pton in /usr/lib64/power8/libc-2.26.so)
      
      Before:
      
        # perf test -v "probe libc's inet_pton & backtrace it with ping"
      
        62: probe libc's inet_pton & backtrace it with ping       :
        --- start ---
        test child forked, pid 21302
        test child finished with -1
        ---- end ----
        probe libc's inet_pton & backtrace it with ping: FAILED!
      
        # perf probe --list
      
      After:
      
        # perf test -v "probe libc's inet_pton & backtrace it with ping"
      
        62: probe libc's inet_pton & backtrace it with ping       :
        --- start ---
        test child forked, pid 21490
        ping 21513 [035] 39357.565561: probe_libc:inet_pton_1: (7fffa4c623b0)
        7fffa4c623b0 __GI___inet_pton+0x0 (/usr/lib64/power8/libc-2.26.so)
        7fffa4c190dc gaih_inet.constprop.7+0xf4c (/usr/lib64/power8/libc-2.26.so)
        7fffa4c19c4c getaddrinfo+0x15c (/usr/lib64/power8/libc-2.26.so)
        111d93c20 main+0x3e0 (/usr/bin/ping)
        test child finished with 0
        ---- end ----
        probe libc's inet_pton & backtrace it with ping: Ok
      
        # perf probe --list
      
          probe_libc:inet_pton (on __inet_pton@resolv/inet_pton.c in /usr/lib64/power8/libc-2.26.so)
      Signed-off-by: default avatarSandipan Das <sandipan@linux.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/e11fecff96e6cf4c65cdbd9012463513d7b8356c.1530724939.git.sandipan@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      60089e42
    • Sandipan Das's avatar
      perf tests: Fix record+probe_libc_inet_pton.sh to ensure cleanups · 83e3b6d7
      Sandipan Das authored
      If there is a mismatch in the perf script output, this test fails and
      exits before the event and temporary files created during its execution
      are cleaned up.
      
      This can be observed on a powerpc64 system running Fedora 27 as shown
      below.
      
        # perf test -v "probe libc's inet_pton & backtrace it with ping"
      
        62: probe libc's inet_pton & backtrace it with ping       :
        --- start ---
        test child forked, pid 18655
        ping 18674 [013] 24511.496995: probe_libc:inet_pton: (7fffa6b423b0)
        7fffa6b423b0 __GI___inet_pton+0x0 (/usr/lib64/power8/libc-2.26.so)
        7fffa6af90dc gaih_inet.constprop.7+0xf4c (/usr/lib64/power8/libc-2.26.so)
        FAIL: expected backtrace entry "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/power8/libc-2.26.so\)$" got "7fffa6af90dc gaih_inet.constprop.7+0xf4c (/usr/lib64/power8/libc-2.26.so)"
        test child finished with -1
        ---- end ----
        probe libc's inet_pton & backtrace it with ping: FAILED!
      
        # ls /tmp/expected.* /tmp/perf.data.* /tmp/perf.script.*
      
        /tmp/expected.u31  /tmp/perf.data.Pki  /tmp/perf.script.Bhs
      
        # perf probe --list
      
          probe_libc:inet_pton (on __inet_pton@resolv/inet_pton.c in /usr/lib64/power8/libc-2.26.so)
      
      Cleanup of the event and the temporary files are now ensured by allowing
      the cleanup code to be executed even if the lines from the backtrace do
      not match their expected patterns instead of simply exiting from the
      point of failure.
      Signed-off-by: default avatarSandipan Das <sandipan@linux.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/ce9fb091dd3028fba8749a1a267cfbcb264bbfb1.1530724939.git.sandipan@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      83e3b6d7
    • Sandipan Das's avatar
      perf tests: Fix record+probe_libc_inet_pton.sh for powerpc64 · 3eae52f8
      Sandipan Das authored
      For powerpc64, this test currently fails due to a mismatch in the
      expected output.
      
      This can be observed on a powerpc64le system running Fedora 27 as shown
      below.
      
        # perf test -v "probe libc's inet_pton & backtrace it with ping"
      
      Before:
      
        62: probe libc's inet_pton & backtrace it with ping       :
        --- start ---
        test child forked, pid 23948
        ping 23965 [003] 71136.075084: probe_libc:inet_pton: (7fff996aaf28)
        7fff996aaf28 __GI___inet_pton+0x8 (/usr/lib64/libc-2.26.so)
        7fff9965fa54 gaih_inet.constprop.7+0xf44 (/usr/lib64/libc-2.26.so)
        FAIL: expected backtrace entry 2 "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/libc-2.26.so\)$" got "7fff9965fa54 gaih_inet.constprop.7+0xf44 (/usr/lib64/libc-2.26.so)"
        test child finished with -1
        ---- end ----
        probe libc's inet_pton & backtrace it with ping: FAILED!
      
      After:
      
        62: probe libc's inet_pton & backtrace it with ping       :
        --- start ---
        test child forked, pid 24638
        ping 24655 [001] 71208.525396: probe_libc:inet_pton: (7fffa245af28)
        7fffa245af28 __GI___inet_pton+0x8 (/usr/lib64/libc-2.26.so)
        7fffa240fa54 gaih_inet.constprop.7+0xf44 (/usr/lib64/libc-2.26.so)
        7fffa24105b4 getaddrinfo+0x164 (/usr/lib64/libc-2.26.so)
        138d52d70 main+0x3e0 (/usr/bin/ping)
        test child finished with 0
        ---- end ----
        probe libc's inet_pton & backtrace it with ping: Ok
      Signed-off-by: default avatarSandipan Das <sandipan@linux.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Maynard Johnson <maynard@us.ibm.com>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Fixes: e07d585e2454 ("perf tests: Switch trace+probe_libc_inet_pton to use record")
      Link: http://lkml.kernel.org/r/49621ec5f37109f0655e5a8c32287ad68d85a1e5.1530724939.git.sandipan@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3eae52f8
    • Alexey Budankov's avatar
      perf tests: Check that complex event name is parsed correctly · 06dc5bf2
      Alexey Budankov authored
      Extend regression testing to cover case of complex event names enabled
      by the cset f92da712 ("perf record: Enable arbitrary event names
      thru name= modifier").
      
      Testing it:
      
        # perf test
         1: vmlinux symtab matches kallsyms                       : Skip
         2: Detect openat syscall event                           : Ok
         3: Detect openat syscall event on all cpus               : Ok
         4: Read samples using the mmap interface                 : Ok
         5: Test data source output                               : Ok
         6: Parse event definition strings                        : Ok		<===!
         7: Simple expression parser                              : Ok
      ...
      
      Committer testing:
      
        # perf test "event definition"
         6: Parse event definition strings                        : Ok
        # perf test -v 6 2> /tmp/before
        # perf test -v 6 2> /tmp/after
        # diff -u /tmp/before /tmp/after
        --- /tmp/before	2018-06-19 10:50:21.485572638 -0300
        +++ /tmp/after	2018-06-19 10:50:40.886572896 -0300
        @@ -1,6 +1,6 @@
          6: Parse event definition strings                        :
         --- start ---
        -test child forked, pid 24259
        +test child forked, pid 24904
         running test 0 'syscalls:sys_enter_openat'Using CPUID GenuineIntel-6-3D
         registering plugin: /root/.traceevent/plugins/plugin_kvm.so
         registering plugin: /root/.traceevent/plugins/plugin_hrtimer.so
        @@ -136,9 +136,11 @@
         running test 50 '4:0x6530160/name=numpmu/'
         running test 51 'L1-dcache-misses/name=cachepmu/'
         running test 52 'intel_pt//u'
        +running test 53 'cycles/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks'/Duk'
         running test 0 'cpu/config=10,config1,config2=3,period=1000/u'
         running test 1 'cpu/config=1,name=krava/u,cpu/config=2/u'
         running test 2 'cpu/config=1,call-graph=fp,time,period=100000/,cpu/config=2,call-graph=no,time=0,period=2000/'
        +running test 3 'cpu/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks',period=0x1,event=0x2,umask=0x3/ukp'
         el-capacity -> cpu/event=0x54,umask=0x2/
         el-conflict -> cpu/event=0x54,umask=0x1/
         el-start -> cpu/event=0xc8,umask=0x1/
        #
      Signed-off-by: default avatarAlexey Budankov <alexey.budankov@linux.intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/ad30b774-219b-7b80-c610-4e9e298cf8a7@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      06dc5bf2
  14. 11 Jul, 2018 3 commits
    • Kim Phillips's avatar
      perf test shell: Prevent temporary editor files from being considered test scripts · db8fec58
      Kim Phillips authored
      Allows a perf shell test developer to concurrently edit and run their
      test scripts, avoiding perf test attempts to execute their editor
      temporary files, such as seen here:
      
       $ sudo taskset -c 0 ./perf test -vvvvvvvv -F 63
       63: 0VIM 8.0                                              :
       --- start ---
       sh: 1: ./tests/shell/.record+probe_libc_inet_pton.sh.swp: Permission denied
       ---- end ----
       0VIM 8.0: FAILED!
      Signed-off-by: default avatarKim 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 Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sandipan Das <sandipan@linux.vnet.ibm.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/20180629124658.15a506b41fc4539c08eb9426@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      db8fec58
    • Kim Phillips's avatar
      perf test shell: Make perf's inet_pton test more portable · 98c6c8a1
      Kim Phillips authored
      Debian based systems such as Ubuntu have dash as their default shell.
      Even if the normal or root user's shell is bash, certain scripts still
      call /bin/sh, which points to dash, so we fix this perf test by
      rewriting it in a more portable way.
      
      BEFORE:
      
       $ sudo perf test -v 64
       64: probe libc's inet_pton & backtrace it with ping       :
       --- start ---
       test child forked, pid 31942
       ./tests/shell/record+probe_libc_inet_pton.sh: 18: ./tests/shell/record+probe_libc_inet_pton.sh: expected[0]=ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\): not found
       ./tests/shell/record+probe_libc_inet_pton.sh: 19: ./tests/shell/record+probe_libc_inet_pton.sh: expected[1]=.*inet_pton\+0x[[:xdigit:]]+[[:space:]]\(/lib/x86_64-linux-gnu/libc-2.27.so|inlined\)$: not found
       ./tests/shell/record+probe_libc_inet_pton.sh: 29: ./tests/shell/record+probe_libc_inet_pton.sh: expected[2]=getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\(/lib/x86_64-linux-gnu/libc-2.27.so\)$: not found
       ./tests/shell/record+probe_libc_inet_pton.sh: 30: ./tests/shell/record+probe_libc_inet_pton.sh: expected[3]=.*\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$: not found
       ping 31963 [004] 83577.670613: probe_libc:inet_pton: (7fe15f87f4b0)
       ./tests/shell/record+probe_libc_inet_pton.sh: 39: ./tests/shell/record+probe_libc_inet_pton.sh: Bad substitution
       ./tests/shell/record+probe_libc_inet_pton.sh: 41: ./tests/shell/record+probe_libc_inet_pton.sh: Bad substitution
       test child finished with -2
       ---- end ----
       probe libc's inet_pton & backtrace it with ping: Skip
      
      AFTER:
      
       $ sudo perf test -v 64
       64: probe libc's inet_pton & backtrace it with ping       :
       --- start ---
       test child forked, pid 32277
       ping 32295 [001] 83679.690020: probe_libc:inet_pton: (7ff244f504b0)
       7ff244f504b0 __GI___inet_pton+0x0 (/lib/x86_64-linux-gnu/libc-2.27.so)
       7ff244f14ce4 getaddrinfo+0x124 (/lib/x86_64-linux-gnu/libc-2.27.so)
       556ac036b57d _init+0xb75 (/bin/ping)
       test child finished with 0
       ---- end ----
       probe libc's inet_pton & backtrace it with ping: Ok
      Signed-off-by: default avatarKim 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 Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sandipan Das <sandipan@linux.vnet.ibm.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/20180629124643.2089b3ce59960eba34e87b27@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      98c6c8a1
    • Kim Phillips's avatar
      perf test shell: Replace '|&' with '2>&1 |' to work with more shells · 508ef3e7
      Kim Phillips authored
      Since we do not specify bash (and/or zsh) as a requirement, use the
      standard error redirection that is more widely supported.
      
      BEFORE:
      
       $ sudo perf test -v 62
       62: Check open filename arg using perf trace + vfs_getname:
       --- start ---
       test child forked, pid 27305
       ./tests/shell/trace+probe_vfs_getname.sh: 20: ./tests/shell/trace+probe_vfs_getname.sh: Syntax error: "&" unexpected
       test child finished with -2
       ---- end ----
       Check open filename arg using perf trace + vfs_getname: Skip
      
      AFTER:
      
       $ sudo perf test -v 62
       64: Check open filename arg using perf trace + vfs_getname               :
       --- start ---
       test child forked, pid 23008
       Added new event:
         probe:vfs_getname    (on getname_flags:72 with pathname=result->name:string)
      
       You can now use it in all perf tools, such as:
      
               perf record -e probe:vfs_getname -aR sleep 1
      
            0.361 ( 0.008 ms): touch/23032 openat(dfd: CWD, filename: /tmp/temporary_file.VEh0n, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 4
       test child finished with 0
       ---- end ----
       Check open filename arg using perf trace + vfs_getname: Ok
      
      Similar to commit 35435cd0, with the same title.
      Signed-off-by: default avatarKim 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 Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Sandipan Das <sandipan@linux.vnet.ibm.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/20180629124633.0a9f4bea54b8d2c28f265de2@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      508ef3e7
  15. 25 Jun, 2018 3 commits
    • Jiri Olsa's avatar
      perf tests: Add valid callback for parse-events test · 16ddcfbf
      Jiri Olsa authored
      Adding optional 'valid' callback for events tests in parse-events
      object, so we don't try to parse PMUs, which are not supported.
      
      Following line is displayed for skipped test:
      
        running test 52 'intel_pt//u'... SKIP
      
      Committer note:
      
      Use named initializers in the struct evlist_test variable to avoid
      breaking the build on centos:5, 6 and others with a similar gcc:
      
        cc1: warnings being treated as errors
        tests/parse-events.c: In function 'test_pmu_events':
        tests/parse-events.c:1817: error: missing initializer
        tests/parse-events.c:1817: error: (near initialization for 'e.type')
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Link: http://lkml.kernel.org/r/20180611093422.1005-2-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      16ddcfbf
    • Jiri Olsa's avatar
      perf tests: Add event parsing error handling to parse events test · 933ccf20
      Jiri Olsa authored
      Add missing error handling for parse_events calls in test_event function
      that led to following segfault on s390:
      
        running test 52 'intel_pt//u'
        perf: Segmentation fault
        ...
        /lib64/libc.so.6(vasprintf+0xe6) [0x3fffca3f106]
        /lib64/libc.so.6(asprintf+0x46) [0x3fffca1aa96]
        ./perf(parse_events_add_pmu+0xb8) [0x80132088]
        ./perf(parse_events_parse+0xc62) [0x8019529a]
        ./perf(parse_events+0x98) [0x801341c0]
        ./perf(test__parse_events+0x48) [0x800cd140]
        ./perf(cmd_test+0x26a) [0x800bd44a]
        test child interrupted
      
      Adding the struct parse_events_error argument to parse_events call. Also
      adding parse_events_print_error to get more details on the parsing
      failures, like:
      
        # perf test 6 -v
        running test 52 'intel_pt//u'failed to parse event 'intel_pt//u', err 1, str 'Cannot find PMU `intel_pt'. Missing kernel support?'
        event syntax error: 'intel_pt//u'
                             \___ Cannot find PMU `intel_pt'. Missing kernel support?
      
      Committer note:
      
      Use named initializers in the struct parse_events_error variable to
      avoid breaking the build on centos5, 6 and others with a similar gcc:
      
        cc1: warnings being treated as errors
        tests/parse-events.c: In function 'test_event':
        tests/parse-events.c:1696: error: missing initializer
        tests/parse-events.c:1696: error: (near initialization for 'err.str')
      Reported-by: default avatarKim Phillips <kim.phillips@arm.com>
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Tested-by: default avatarKim Phillips <kim.phillips@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Link: http://lkml.kernel.org/r/20180611093422.1005-1-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      933ccf20
    • Thomas Richter's avatar
      perf test session topology: Fix test on s390 · b930e62e
      Thomas Richter authored
      On s390 this test case fails because the socket identifiction numbers
      assigned to the CPU are higher than the CPU identification numbers.
      
      F/ix this by adding the platform architecture into the perf data header
      flag information. This helps identifiing the test platform and handles
      s390 specifics in process_cpu_topology().
      
      Before:
      
        [root@p23lp27 perf]# perf test -vvvvv -F 39
        39: Session topology                                      :
        --- start ---
        templ file: /tmp/perf-test-iUv755
        socket_id number is too big.You may need to upgrade the perf tool.
        ---- end ----
        Session topology: Skip
        [root@p23lp27 perf]#
      
      After:
      
        [root@p23lp27 perf]# perf test -vvvvv -F 39
        39: Session topology                                      :
        --- start ---
        templ file: /tmp/perf-test-8X8VTs
        CPU 0, core 0, socket 6
        CPU 1, core 1, socket 3
        ---- end ----
        Session topology: Ok
        [root@p23lp27 perf]#
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Fixes: c84974ed ("perf test: Add entry to test cpu topology")
      Link: http://lkml.kernel.org/r/20180611073153.15592-2-tmricht@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b930e62e
  16. 06 Jun, 2018 3 commits
  17. 05 Jun, 2018 1 commit
  18. 04 Jun, 2018 1 commit
  19. 30 May, 2018 1 commit
    • Thomas Richter's avatar
      perf test: "Session topology" dumps core on s390 · d1211091
      Thomas Richter authored
      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: default avatarThomas 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d1211091
  20. 18 May, 2018 1 commit
    • Sandipan Das's avatar
      perf script: Show symbol offsets by default · 7903a708
      Sandipan Das authored
      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: default avatarSandipan Das <sandipan@linux.vnet.ibm.com>
      Tested-by: default avatarArnaldo 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7903a708
  21. 17 May, 2018 2 commits
  22. 15 May, 2018 1 commit
  23. 10 May, 2018 1 commit
  24. 30 Apr, 2018 1 commit