1. 29 11月, 2019 1 次提交
  2. 26 11月, 2019 2 次提交
  3. 20 10月, 2019 1 次提交
    • L
      perf tests bp_account: Add dedicated checking helper is_supported() · e533eadf
      Leo Yan 提交于
      The arm architecture supports breakpoint accounting but it doesn't
      support breakpoint overflow signal handling.  The current code uses the
      same checking helper, thus it disables both testings (bp_account and
      bp_signal) for arm platform.
      
      For handling two testings separately, this patch adds a dedicated
      checking helper is_supported() for breakpoint accounting testing, thus
      it allows supporting breakpoint accounting testing on arm platform; the
      old helper test__bp_signal_is_supported() is only used to checking for
      breakpoint overflow signal testing.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Brajeswar Ghosh <brajeswar.linux@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Souptick Joarder <jrdr.linux@gmail.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lore.kernel.org/lkml/20191018085531.6348-2-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e533eadf
  4. 01 9月, 2019 1 次提交
  5. 10 7月, 2019 1 次提交
    • A
      perf test: Auto bump rlimit(MEMLOCK) for BPF test sake · d3280ce0
      Arnaldo Carvalho de Melo 提交于
      I noticed that the 'perf test bpf' was failing:
      
        # perf test bpf
        41: BPF filter                                            :
        41.1: Basic BPF filtering                                 : Skip
        41.2: BPF pinning                                         : Skip
        41.3: BPF prologue generation                             : Skip
        41.4: BPF relocation checker                              : Skip
        # ulimit -l
        64
        #
      
      Using verbose mode we get just a line bout -EPERF being returned from
      libbpf's bpf_load_program_xattr(), that ends up being used in 'perf
      test bpf' initial program loading capability query:
      
        Missing basic BPF support, skip this test: Operation not permitted
      
      Not that informative, but on a separate problem when creating BPF maps
      bumping rlimit(MEMLOCK) helped, so I tried it here as well, works:
      
        # ulimit -l 128
        # perf test bpf
        41: BPF filter                                            :
        41.1: Basic BPF filtering                                 : Ok
        41.2: BPF pinning                                         : Ok
        41.3: BPF prologue generation                             : Ok
        41.4: BPF relocation checker                              : Ok
        #
      
      So use the recently added rlimit__bump_memlock() helper:
      
        # ulimit -l 64
        # perf test bpf
        41: BPF filter                                            :
        41.1: Basic BPF filtering                                 : Ok
        41.2: BPF pinning                                         : Ok
        41.3: BPF prologue generation                             : Ok
        41.4: BPF relocation checker                              : Ok
        # ulimit -l
        64
        #
      
      I.e. the bumping of memlock is restricted to the 'perf test' instance,
      not changing the global value.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-b9fubkhr4jm192lu7y8hgjvo@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d3280ce0
  6. 26 6月, 2019 1 次提交
  7. 11 6月, 2019 1 次提交
    • A
      perf tests: Add a test for time-utils · e39a12cb
      Adrian Hunter 提交于
      Test time ranges work as expected.
      
      Committer testing:
      
        $ perf test "time utils"
        59: time utils                                            : Ok
        $ perf test -v "time utils"
        59: time utils                                            :
        --- start ---
        test child forked, pid 31711
      
        parse_nsec_time("0")
        0
      
        parse_nsec_time("1")
        1000000000
      
        parse_nsec_time("0.000000001")
        1
      
        parse_nsec_time("1.000000001")
        1000000001
      
        parse_nsec_time("123456.123456")
        123456123456000
      
        parse_nsec_time("1234567.123456789")
        1234567123456789
      
        parse_nsec_time("18446744073.709551615")
        18446744073709551615
      
        perf_time__parse_str("1234567.123456789,1234567.123456789")
        start time 1234567123456789, end time 1234567123456789
      
        perf_time__parse_str("1234567.123456789,1234567.123456790")
        start time 1234567123456789, end time 1234567123456790
      
        perf_time__parse_str("1234567.123456789,")
        start time 1234567123456789, end time 0
      
        perf_time__parse_str(",1234567.123456789")
        start time 0, end time 1234567123456789
      
        perf_time__parse_str("0,1234567.123456789")
        start time 0, end time 1234567123456789
      
        perf_time__parse_for_ranges("1234567.123456789,1234567.123456790")
        start time 1234567123456789, end time 1234567123456790
      
        perf_time__parse_for_ranges("10%/1")
        first_sample_time 7654321000000000 last_sample_time 7654321000000100
        start time 0: 7654321000000000, end time 0: 7654321000000009
      
        perf_time__parse_for_ranges("10%/2")
        first_sample_time 7654321000000000 last_sample_time 7654321000000100
        start time 0: 7654321000000010, end time 0: 7654321000000019
      
        perf_time__parse_for_ranges("10%/1,10%/2")
        first_sample_time 11223344000000000 last_sample_time 11223344000000100
        start time 0: 11223344000000000, end time 0: 11223344000000009
        start time 1: 11223344000000010, end time 1: 11223344000000019
      
        perf_time__parse_for_ranges("10%/1,10%/3,10%/10")
        first_sample_time 11223344000000000 last_sample_time 11223344000000100
        start time 0: 11223344000000000, end time 0: 11223344000000009
        start time 1: 11223344000000020, end time 1: 11223344000000029
        start time 2: 11223344000000090, end time 2: 11223344000000100
      
        test child finished with 0
        ---- end ----
        time utils: Ok
        $
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/r/20190604130017.31207-19-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e39a12cb
  8. 29 5月, 2019 1 次提交
  9. 18 12月, 2018 1 次提交
  10. 09 10月, 2018 1 次提交
  11. 19 9月, 2018 1 次提交
  12. 31 7月, 2018 1 次提交
    • S
      perf tests: Fix indexing when invoking subtests · aa90f9f9
      Sandipan Das 提交于
      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: NSandipan Das <sandipan@linux.ibm.com>
      Reported-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Tested-by: NArnaldo 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: NArnaldo Carvalho de Melo <acme@redhat.com>
      aa90f9f9
  13. 25 7月, 2018 1 次提交
    • T
      perf test: Fix subtest number when showing results · 9ef01124
      Thomas Richter 提交于
      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: 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>
      Link: http://lkml.kernel.org/r/20180724134858.100644-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9ef01124
  14. 11 7月, 2018 1 次提交
  15. 27 4月, 2018 1 次提交
  16. 13 4月, 2018 1 次提交
  17. 17 3月, 2018 1 次提交
  18. 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
  19. 27 12月, 2017 1 次提交
  20. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  21. 13 9月, 2017 1 次提交
  22. 23 8月, 2017 1 次提交
  23. 12 8月, 2017 2 次提交
    • A
      perf test: Make 'list' use same filtering code as main 'perf test' · 6d02acc1
      Arnaldo Carvalho de Melo 提交于
      Before:
      
        # perf test Synth
        39: Synthesize thread map  : Ok
        41: Synthesize cpu map     : Ok
        42: Synthesize stat config : Ok
        43: Synthesize stat        : Ok
        44: Synthesize stat round  : Ok
        45: Synthesize attr update : Ok
        # perf test list Synth
        #
      
      After:
      
        # perf test Synth
        39: Synthesize thread map  : Ok
        41: Synthesize cpu map     : Ok
        42: Synthesize stat config : Ok
        43: Synthesize stat        : Ok
        44: Synthesize stat round  : Ok
        45: Synthesize attr update : Ok
        # perf test list Synth
        39: Synthesize thread map
        41: Synthesize cpu map
        42: Synthesize stat config
        43: Synthesize stat
        44: Synthesize stat round
        45: Synthesize attr update
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-v95tqqzuwawsmds3zn2mosje@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6d02acc1
    • A
      perf test: Add infrastructure to run shell based tests · 1209b273
      Arnaldo Carvalho de Melo 提交于
      To allow testing by directly using perf tools in scripts, checking that
      the effects on the system are the ones expected and that the output
      produced is as well the desired one.
      
      For instance, adding a probe at a well known location with 'perf probe',
      then checking that the results from using that probe to record are the
      desired ones, etc.
      
      The next csets will introduce tests using this new testing
      infrastructure.
      
      The scripts should return 0 for Ok, 1 for FAIL and 2 for SKIP.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-swbpn7amrjqffh83lsr39s9p@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      1209b273
  24. 11 8月, 2017 2 次提交
    • A
      perf test: Add 'struct test *' to the test functions · 81f17c90
      Arnaldo Carvalho de Melo 提交于
      This way we'll be able to pass more test specific parameters without
      having to change this function signature.
      
      Will be used by the upcoming 'shell tests', shell scripts that will
      call perf tools and check if they work as expected, comparing its
      effects on the system (think 'perf probe foo') the output produced, etc.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-wq250w7j1opbzyiynozuajbl@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      81f17c90
    • A
      perf test: Make 'list' subcommand match main 'perf test' numbering/matching · 28765bf2
      Arnaldo Carvalho de Melo 提交于
      Before:
      
        # perf test Synth
        39: Synthesize thread map  : Ok
        41: Synthesize cpu map     : Ok
        42: Synthesize stat config : Ok
        43: Synthesize stat        : Ok
        44: Synthesize stat round  : Ok
        45: Synthesize attr update : Ok
        #
        # perf test list Synth
         1: Synthesize thread map
         2: Synthesize cpu map
         3: Synthesize stat config
         4: Synthesize stat
         5: Synthesize stat round
         6: Synthesize attr update
        #
      
      After:
      
        # perf test Synth
        39: Synthesize thread map  : Ok
        41: Synthesize cpu map     : Ok
        42: Synthesize stat config : Ok
        43: Synthesize stat        : Ok
        44: Synthesize stat round  : Ok
        45: Synthesize attr update : Ok
        #
        # perf test list Synth
        39: Synthesize thread map
        41: Synthesize cpu map
        42: Synthesize stat config
        43: Synthesize stat
        44: Synthesize stat round
        45: Synthesize attr update
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Matt Fleming <matt.fleming@intel.com>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-pjhuhkphs7o3tkbqrukfv6bz@git.kernel.org
      Fixes: e8210cef ("perf tests: Introduce iterator function for tests")
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      28765bf2
  25. 06 6月, 2017 1 次提交
  26. 25 4月, 2017 1 次提交
  27. 20 4月, 2017 2 次提交
  28. 27 3月, 2017 1 次提交
  29. 23 3月, 2017 1 次提交
    • A
      perf tools: Add a simple expression parser for JSON · 07516736
      Andi Kleen 提交于
      Add a simple expression parser good enough to parse JSON relation
      expressions. The parser is implemented using bison.
      
      This is just intended as an simple parser for internal usage in the
      event lists, not the beginning of a "perf scripting language"
      
      v2: Use expr__ prefix instead of expr_
          Support multiple free variables for parser
      
      Committer note:
      
      The v2 patch had:
      
        %define api.pure full
      
      In expr.y, that is a feature introduced in bison 2.7, to have reentrant
      parsers, not using global variables, which would make tools/perf stop
      building with the bison version shipped in older distros, so Andi
      realised that the other parsers (e.g. parse-events.y) were using:
      
        %pure-parser
      
      Which is present in older versions of bison and fits the bill.
      
      I added:
      
        CFLAGS_expr-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
      
      To finally make it build, copying what was there for pmu-bison.o,
      another parser.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/20170320201711.14142-8-andi@firstfloor.org
      [ stdlib.h is needed in tests/expr.c for free() fixing build in systems such as ubuntu:16.04-x-s390 ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      07516736
  30. 20 2月, 2017 1 次提交
  31. 12 1月, 2017 1 次提交
  32. 16 12月, 2016 1 次提交
  33. 06 12月, 2016 1 次提交
    • W
      perf clang: Add builtin clang support ant test case · 00b86691
      Wang Nan 提交于
      Add basic clang support in clang.cpp and test__clang() testcase. The
      first testcase checks if builtin clang is able to generate LLVM IR.
      
      tests/clang.c is a proxy. Real testcase resides in
      utils/c++/clang-test.cpp in c++ and exports C interface to perf test
      subsystem.
      
      Test result:
      
         $ perf test -v clang
         51: builtin clang support                               :
         51.1: Test builtin clang compile C source to IR              :
         --- start ---
         test child forked, pid 13215
         test child finished with 0
         ---- end ----
         Test builtin clang support subtest 0: Ok
      
      Committer note:
      
      Make sure you've enabled CLANG and LLVM builtin support by setting
      the LIBCLANGLLVM variable on the make command line, e.g.:
      
        make LIBCLANGLLVM=1 O=/tmp/build/perf -C tools/perf install-bin
      
      Otherwise you'll get this when trying to do the 'perf test' call above:
      
        # perf test clang
        51: builtin clang support                      : Skip (not compiled in)
        #
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexei Starovoitov <ast@fb.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Joe Stringer <joe@ovn.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/20161126070354.141764-11-wangnan0@huawei.com
      [ Removed "Test" from descriptions, redundant and already removed from all the other entries ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      00b86691
  34. 29 11月, 2016 2 次提交
    • A
      perf test: Remove "test" and similar strings from test descriptions · 030910c0
      Arnaldo Carvalho de Melo 提交于
      Having "test" in almost all test descriptions is redundant, simplify it
      removing and rewriting tests with such descriptions.
      
      End result:
      
        # perf test
         1: vmlinux symtab matches kallsyms            : Ok
         2: Detect openat syscall event                : Ok
         3: Detect openat syscall event on all cpus    : Ok
         4: Read samples using the mmap interface      : Ok
         5: Parse event definition strings             : Ok
         6: PERF_RECORD_* events & perf_sample fields  : Ok
         7: Parse perf pmu format                      : Ok
         8: DSO data read                              : Ok
         9: DSO data cache                             : Ok
        10: DSO data reopen                            : Ok
        11: Roundtrip evsel->name                      : Ok
        12: Parse sched tracepoints fields             : Ok
        13: syscalls:sys_enter_openat event fields     : Ok
        14: Setup struct perf_event_attr               : Ok
        15: Match and link multiple hists              : Ok
        16: 'import perf' in python                    : Ok
        17: Breakpoint overflow signal handler         : Ok
        18: Breakpoint overflow sampling               : Ok
        19: Number of exit events of a simple workload : Ok
        20: Software clock events period values        : Ok
        21: Object code reading                        : Ok
        22: Sample parsing                             : Ok
        23: Use a dummy software event to keep tracking: Ok
        24: Parse with no sample_id_all bit set        : Ok
        25: Filter hist entries                        : Ok
        26: Lookup mmap thread                         : Ok
        27: Share thread mg                            : Ok
        28: Sort output of hist entries                : Ok
        29: Cumulate child hist entries                : Ok
        30: Track with sched_switch                    : Ok
        31: Filter fds with revents mask in a fdarray  : Ok
        32: Add fd to a fdarray, making it autogrow    : Ok
        33: kmod_path__parse                           : Ok
        34: Thread map                                 : Ok
        35: LLVM search and compile                    :
        35.1: Basic BPF llvm compile                    : Ok
        35.2: kbuild searching                          : Ok
        35.3: Compile source for BPF prologue generation: Ok
        35.4: Compile source for BPF relocation         : Ok
        36: Session topology                           : Ok
        37: BPF filter                                 :
        37.1: Basic BPF filtering                      : Ok
        37.2: BPF prologue generation                  : Ok
        37.3: BPF relocation checker                   : Ok
        38: Synthesize thread map                      : Ok
        39: Synthesize cpu map                         : Ok
        40: Synthesize stat config                     : Ok
        41: Synthesize stat                            : Ok
        42: Synthesize stat round                      : Ok
        43: Synthesize attr update                     : Ok
        44: Event times                                : Ok
        45: Read backward ring buffer                  : Ok
        46: Print cpu map                              : Ok
        47: Probe SDT events                           : Ok
        48: is_printable_array                         : Ok
        49: Print bitmap                               : Ok
        50: perf hooks                                 : Ok
        51: x86 rdpmc                                  : Ok
        52: Convert perf time to TSC                   : Ok
        53: DWARF unwind                               : Ok
        54: x86 instruction decoder - new instructions : Ok
        55: Intel cqm nmi context read                 : Skip
        #
      
      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>
      Link: http://lkml.kernel.org/n/tip-rx2lbfcrrio2yx1fxcljqy0e@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      030910c0
    • W
      perf tools: Introduce perf hooks · a074865e
      Wang Nan 提交于
      Perf hooks allow hooking user code at perf events. They can be used for
      manipulation of BPF maps, taking snapshot and reporting results. In this
      patch two perf hook points are introduced: record_start and record_end.
      
      To avoid buggy user actions, a SIGSEGV signal handler is introduced into
      'perf record'. It turns off perf hook if it causes a segfault and report
      an error to help debugging.
      
      A test case for perf hook is introduced.
      
      Test result:
        $ ./buildperf/perf test -v hook
        50: Test perf hooks                                          :
        --- start ---
        test child forked, pid 10311
        SIGSEGV is observed as expected, try to recover.
        Fatal error (SEGFAULT) in perf hook 'test'
        test child finished with 0
        ---- end ----
        Test perf hooks: Ok
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Cc: Alexei Starovoitov <ast@fb.com>
      Cc: He Kuang <hekuang@huawei.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Joe Stringer <joe@ovn.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/20161126070354.141764-5-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      a074865e
  35. 03 8月, 2016 1 次提交