1. 13 4月, 2018 1 次提交
  2. 17 3月, 2018 1 次提交
  3. 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
  4. 27 12月, 2017 1 次提交
  5. 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
  6. 13 9月, 2017 1 次提交
  7. 23 8月, 2017 1 次提交
  8. 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
  9. 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
  10. 06 6月, 2017 1 次提交
  11. 25 4月, 2017 1 次提交
  12. 20 4月, 2017 2 次提交
  13. 27 3月, 2017 1 次提交
  14. 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
  15. 20 2月, 2017 1 次提交
  16. 12 1月, 2017 1 次提交
  17. 16 12月, 2016 1 次提交
  18. 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
  19. 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
  20. 03 8月, 2016 1 次提交
  21. 19 7月, 2016 1 次提交
  22. 14 7月, 2016 1 次提交
  23. 13 7月, 2016 1 次提交
    • A
      tools: Introduce str_error_r() · c8b5f2c9
      Arnaldo Carvalho de Melo 提交于
      The tools so far have been using the strerror_r() GNU variant, that
      returns a string, be it the buffer passed or something else.
      
      But that, besides being tricky in cases where we expect that the
      function using strerror_r() returns the error formatted in a provided
      buffer (we have to check if it returned something else and copy that
      instead), breaks the build on systems not using glibc, like Alpine
      Linux, where musl libc is used.
      
      So, introduce yet another wrapper, str_error_r(), that has the GNU
      interface, but uses the portable XSI variant of strerror_r(), so that
      users rest asured that the provided buffer is used and it is what is
      returned.
      
      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-d4t42fnf48ytlk8rjxs822tf@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c8b5f2c9
  24. 01 7月, 2016 2 次提交
  25. 10 5月, 2016 1 次提交
  26. 30 3月, 2016 1 次提交
    • J
      perf tests: Add test to check for event times · b31d660d
      Jiri Olsa 提交于
      This test creates software event 'cpu-clock' attaches it in several ways
      and checks that enabled and running times match.
      
      Committer notes:
      
      Testing it:
      
        [acme@jouet linux]$ perf test -v times
        44: Test events times                                        :
        --- start ---
        test child forked, pid 27170
        attaching to spawned child, enable on exec
          OK    : ena 307328, run 307328
        attaching to current thread as enabled
          OK    : ena 7826, run 7826
        attaching to current thread as disabled
          OK    : ena 738, run 738
        attaching to CPU 0 as enabled
          SKIP  : not enough rights
        attaching to CPU 0 as enabled
          SKIP  : not enough rights
        test child finished with -2
        ---- end ----
        Test events times: Skip
        [acme@jouet linux]$
      
        [root@jouet ~]# perf test times
        44: Test events times                                        : Ok
        [root@jouet ~]# perf test -v times
        44: Test events times                                        :
        --- start ---
        test child forked, pid 27306
        attaching to spawned child, enable on exec
          OK    : ena 479290, run 479290
        attaching to current thread as enabled
          OK    : ena 11356, run 11356
        attaching to current thread as disabled
          OK    : ena 987, run 987
        attaching to CPU 0 as enabled
          OK    : ena 3717, run 3717
        attaching to CPU 0 as enabled
          OK    : ena 2323, run 2323
        test child finished with 0
        ---- end ----
        Test events times: Ok
        [root@jouet ~]#
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1458823940-24583-7-git-send-email-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b31d660d
  27. 18 12月, 2015 7 次提交
  28. 14 12月, 2015 1 次提交
    • A
      perf test: Dump the stack when test segfaults when in verbose mode · b6847d2c
      Arnaldo Carvalho de Melo 提交于
      E.g.:
      
        # perf test 26
        26: Test mmap thread lookup                                  : FAILED!
        # perf test -v 26
        26: Test mmap thread lookup                                  :
        --- start ---
        test child forked, pid 9269
        tid = 9269, map = 0x7ff99ff0c000
        tid = 9270, map = 0x7ff99ff0b000
        tid = 9271, map = 0x7ff99ff0a000
        tid = 9272, map = 0x7ff99ff09000
        perf: Segmentation fault
        Obtained 13 stack frames.
        perf(sighandler_dump_stack+0x41) [0x4e3541]
        /lib64/libc.so.6(+0x34960) [0x7ff99d5f6960]
        perf(thread__put+0x5b) [0x4c6f6b]
        perf(machine__process_event+0x14e) [0x4bd37e]
        perf(perf_event__synthesize_threads+0x3aa) [0x48678a]
        perf(test__mmap_thread_lookup+0x20a) [0x474e0a]
        perf() [0x460d56]
        perf(cmd_test+0x589) [0x461319]
        perf() [0x47c641]
        perf(main+0x617) [0x422317]
        /lib64/libc.so.6(__libc_start_main+0xf0) [0x7ff99d5e1fe0]
        perf() [0x422429]
        [(nil)]
        test child interrupted
        ---- end ----
        Test mmap thread lookup: FAILED!
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-sypazzsl4ptctrmlyi2zcmaj@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      b6847d2c
  29. 20 11月, 2015 1 次提交
    • W
      perf test: Mute test cases error messages if verbose == 0 · 5bcf2fe0
      Wang Nan 提交于
      Sometimes error messages in breaks the pretty output of 'perf test'.
      For example:
      
        # mv /lib/modules/4.3.0-rc4+/build/vmlinux{,.bak}
        # perf test LLVM BPF
        35: Test LLVM searching and compiling                        :
        35.1: Basic BPF llvm compiling test                          : Ok
        35.2: Test kbuild searching                                  : Ok
        35.3: Compile source for BPF prologue generation test        : Ok
        37: Test BPF filter                                          :
        37.1: Test basic BPF filtering                               : Ok
        37.2: Test BPF prologue generation                           :Failed to find the path for kernel: No such file or directory FAILED!
      
      This patch mute test cases thoroughly by redirect their stdout and
      stderr to /dev/null when verbose == 0. After applying this patch:
      
        # ./perf test LLVM BPF
        35: Test LLVM searching and compiling                        :
        35.1: Basic BPF llvm compiling test                          : Ok
        35.2: Test kbuild searching                                  : Ok
        35.3: Compile source for BPF prologue generation test        : Ok
        37: Test BPF filter                                          :
        37.1: Test basic BPF filtering                               : Ok
        37.2: Test BPF prologue generation                           : FAILED!
      
        # ./perf test -v LLVM BPF
        35: Test LLVM searching and compiling                        :
        35.1: Basic BPF llvm compiling test                          :
        --- start ---
        test child forked, pid 13183
        Kernel build dir is set to /lib/modules/4.3.0-rc4+/build
        set env: KBUILD_DIR=/lib/modules/4.3.0-rc4+/build
        ...
        bpf: config 'func=null_lseek file->f_mode offset orig' is ok
        Looking at the vmlinux_path (7 entries long)
        Failed to find the path for kernel: No such file or directory
        bpf_probe: failed to convert perf probe eventsFailed to add events selected by BPF
        test child finished with -1
        ---- end ----
        Test BPF filter subtest 1: FAILED!
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1447749170-175898-6-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      5bcf2fe0