1. 14 7月, 2021 3 次提交
  2. 10 7月, 2021 4 次提交
  3. 23 6月, 2021 1 次提交
  4. 19 6月, 2021 3 次提交
  5. 01 6月, 2021 1 次提交
    • T
      perf test: Test 17 fails with make LIBPFM4=1 on s390 z/VM · f677ec94
      Thomas Richter 提交于
      This test case fails on s390 virtual machine z/VM which has no PMU support
      when the perf tool is built with LIBPFM4=1.
      
      Using make LIBPFM4=1 builds the perf tool with support for libpfm
      event notation. The command line flag --pfm-events is valid:
       # ./perf record --pfm-events cycles -- true
       [ perf record: Woken up 1 times to write data ]
       [ perf record: Captured and wrote 0.001 MB perf.data (2 samples) ]
       #
      
      However the command 'perf test -Fv 17' fails on s390 z/VM virtual machine
      with LIBPFM4=1:
        # perf test -Fv 17
        17: Setup struct perf_event_attr                                    :
        --- start ---
        .....
        running './tests/attr/test-record-group2'
        unsupp  './tests/attr/test-record-group2'
        running './tests/attr/test-record-pfm-period'
        expected exclude_hv=0, got 1
       FAILED './tests/attr/test-record-pfm-period' - match failure
       ---- end ----
       Setup struct perf_event_attr: FAILED!
      
      When --pfm-event system is not supported, the test returns unsupported
      and continues. Here is an example using a virtual machine on x86 and
      Fedora 34:
       [root@f33 perf]# perf test -Fv 17
       17: Setup struct perf_event_attr                                    :
       --- start ---
       .....
       running './tests/attr/test-record-group2'
       unsupp  './tests/attr/test-record-group2'
       running './tests/attr/test-record-pfm-period'
       unsupp  './tests/attr/test-record-pfm-period'
       ....
      
      The issue is file ./tests/attr/test-record-pfm-period
      which requires perf event attribute member exclude_hv to be zero.
      This is not the case on s390 where the value of exclude_hv is one when
      executing on a z/VM virtual machine without PMU hardware support.
      
      Fix this by allowing value exlucde_hv to be zero or one.
      
      Output before:
       # /usr/bin/python ./tests/attr.py -d ./tests/attr/ -t \
      	test-record-pfm-period -p ./perf  -vvv 2>&1| fgrep match
          matching [event:base-record]
          match: [event:base-record] matches []
       FAILED './tests/attr//test-record-pfm-period' - match failure
       #
      
      Output after:
       # /usr/bin/python ./tests/attr.py -d ./tests/attr/ -t \
      	test-record-pfm-period -p ./perf  -vvv 2>&1| fgrep match
          matching [event:base-record]
          match: [event:base-record] matches ['event-1-0-6', 'event-1-0-5']
        matched
      
      Background:
      Using libpfm library ends up in this function call sequence
      
      pfm_get_perf_event_encoding()
      +-- pfm_get_os_event_encoding()
          +-- pfmlib_perf_event_encode()
      
      is called when no hardware specific PMU unit can be detected
      as in the s390 z/VM virtual machine case. This uses the
      "perf_events generic PMU" data structure which sets exclude_hv
      to 1 per default.  Using this PMU that test case always fails.
      
      That is the reason why exclude_hv attribute setting varies.
      
      Version 2:
      
         As suggested by Ian Rogers make perf_event_attribute member
         exclude_hv more robust and accept value 0 or 1 to handle more
         test cases which might fail on s390 virtual machine z/VM.
      Suggested-by: NIan Rogers <irogers@google.com>
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Reviewed-by: NIan Rogers <irogers@google.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Sven Schnelle <svens@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Link: http://lore.kernel.org/lkml/20210528091050.245838-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      f677ec94
  6. 28 5月, 2021 2 次提交
  7. 22 5月, 2021 1 次提交
  8. 19 5月, 2021 1 次提交
    • T
      perf test: Fix libpfm4 support (63) test error for nested event groups · 316a76a5
      Thomas Richter 提交于
      Compiling perf with make LIBPFM4=1 includes libpfm support and
      enables test case 63 'Test libpfm4 support'. This test reports an error
      on all platforms for subtest 63.2 'test groups of --pfm-events'.
      The reported error message is 'nested event groups not supported'
      
       # ./perf test -F 63
       63: Test libpfm4 support                                            :
       63.1: test of individual --pfm-events                               :
       Error:
       failed to parse event stereolab : event not found
       Error:
       failed to parse event stereolab,instructions : event not found
       Error:
       failed to parse event instructions,stereolab : event not found
        Ok
       63.2: test groups of --pfm-events                                   :
       Error:
       nested event groups not supported    <------ Error message here
       Error:
       failed to parse event {stereolab} : event not found
       Error:
       failed to parse event {instructions,cycles},{instructions,stereolab} :\
      	 event not found
       Ok
       #
      
      This patch addresses the error message 'nested event groups not supported'.
      The root cause is function parse_libpfm_events_option() which parses the
      event string '{},{instructions}' and can not handle a leading empty
      group notation '{},...'.
      
      The code detects the first (empty) group indicator '{' but does not
      terminate group processing on the following group closing character '}'.
      So when the second group indicator '{' is detected, the code assumes
      a nested group and returns an error.
      
      With the error message fixed, also change the expected event number to
      one for the test case to succeed.
      
      While at it also fix a memory leak. In good case the function does not
      free the duplicated string given as first parameter.
      
      Output after:
       # ./perf test -F 63
       63: Test libpfm4 support                                            :
       63.1: test of individual --pfm-events                               :
       Error:
       failed to parse event stereolab : event not found
       Error:
       failed to parse event stereolab,instructions : event not found
       Error:
       failed to parse event instructions,stereolab : event not found
        Ok
       63.2: test groups of --pfm-events                                   :
       Error:
       failed to parse event {stereolab} : event not found
       Error:
       failed to parse event {instructions,cycles},{instructions,stereolab} : \
      	 event not found
        Ok
       #
      Error message 'nested event groups not supported' is gone.
      Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
      Acked-By: NIan Rogers <irogers@google.com>
      Acked-by: NSumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sven Schnelle <svens@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Link: http://lore.kernel.org/lkml/20210517140931.2559364-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      316a76a5
  9. 18 5月, 2021 1 次提交
  10. 17 5月, 2021 1 次提交
  11. 10 5月, 2021 1 次提交
    • A
      tools headers UAPI: Sync perf_event.h with the kernel sources · 71d7924b
      Arnaldo Carvalho de Melo 提交于
      To pick up the changes in:
      
        2b26f0aa ("perf: Support only inheriting events if cloned with CLONE_THREAD")
        2e498d0a ("perf: Add support for event removal on exec")
        547b6098 ("perf: aux: Add flags for the buffer format")
        55bcf6ef ("perf: Extend PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE")
        7dde5176 ("perf: aux: Add CoreSight PMU buffer formats")
        97ba62b2 ("perf: Add support for SIGTRAP on perf events")
        d0d1dd62 ("perf core: Add PERF_COUNT_SW_CGROUP_SWITCHES event")
      
      Also change the expected sizeof(struct perf_event_attr) from 120 to 128 due to
      fields being added for the SIGTRAP changes.
      
      Addressing this perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h'
        diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h
      
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Marco Elver <elver@google.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      71d7924b
  12. 29 4月, 2021 9 次提交
  13. 20 4月, 2021 1 次提交
  14. 09 4月, 2021 2 次提交
  15. 30 3月, 2021 1 次提交
  16. 26 3月, 2021 1 次提交
    • L
      perf test: Change to use bash for daemon test · 1dc481c0
      Leo Yan 提交于
      When executing the daemon test on Arm64 and x86 with Debian (Buster)
      distro, both skip the test case with the log:
      
        # ./perf test -v 76
        76: daemon operations                                               :
        --- start ---
        test child forked, pid 11687
        test daemon list
        trap: SIGINT: bad trap
        ./tests/shell/daemon.sh: 173: local: cpu-clock: bad variable name
        test child finished with -2
        ---- end ----
        daemon operations: Skip
      
      So the error happens for the variable expansion when use local variable
      in the shell script.  Since Debian Buster uses dash but not bash as
      non-interactive shell, when execute the daemon testing, it hits a known
      issue for dash which was reported [1].
      
      To resolve this issue, one option is to add double quotes for all local
      variables assignment, so need to change the code from:
      
        local line=`perf daemon --config ${config} -x: | head -2 | tail -1`
      
        ... to:
      
        local line="`perf daemon --config ${config} -x: | head -2 | tail -1`"
      
      But the testing script has bunch of local variables, this leads to big
      changes for whole script.
      
      On the other hand, the testing script asks to use the "local" feature
      which is bash-specific, so this patch explicitly uses "#!/bin/bash" to
      ensure running the script with bash.
      
      After:
      
        # ./perf test -v 76
        76: daemon operations                                               :
        --- start ---
        test child forked, pid 11329
        test daemon list
        test daemon reconfig
        test daemon stop
        test daemon signal
        signal 12 sent to session 'test [11596]'
        signal 12 sent to session 'test [11596]'
        test daemon ping
        test daemon lock
        test child finished with 0
        ---- end ----
        daemon operations: Ok
      
      [1] https://bugs.launchpad.net/ubuntu/+source/dash/+bug/139097
      
      Fixes: 2291bb91 ("perf tests: Add daemon 'list' command test")
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20210320104554.529213-1-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1dc481c0
  17. 24 3月, 2021 4 次提交
  18. 17 3月, 2021 3 次提交