[LNT] r300973 - Introduce --perf-events to lnt runtest test-suite

Kristof Beyls via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 06:26:04 PDT 2017


Author: kbeyls
Date: Fri Apr 21 08:26:04 2017
New Revision: 300973

URL: http://llvm.org/viewvc/llvm-project?rev=300973&view=rev
Log:
Introduce --perf-events to lnt runtest test-suite

... to specify which linux perf events to profile.

Modified:
    lnt/trunk/lnt/tests/test_suite.py
    lnt/trunk/tests/runtest/test_suite.py

Modified: lnt/trunk/lnt/tests/test_suite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/tests/test_suite.py?rev=300973&r1=300972&r2=300973&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/test_suite.py (original)
+++ lnt/trunk/lnt/tests/test_suite.py Fri Apr 21 08:26:04 2017
@@ -265,6 +265,9 @@ class TestSuiteTest(BuiltinTest):
                          type='choice',
                          choices=['none', 'time', 'profile', 'all'],
                          default='none')
+        group.add_option("", "--perf-events", dest="perf_events",
+                         help=("Define which linux perf events to measure"),
+                         type=str, default=None)
         group.add_option("", "--run-under", dest="run_under",
                          help="Wrapper to run tests under ['%default']",
                          type=str, default="")
@@ -731,6 +734,9 @@ class TestSuiteTest(BuiltinTest):
                         'simultaneously. Overriding -j %s to -j 1' % nr_threads)
                 nr_threads = 1
             extra_args += ['--param', 'profile=perf']
+            if self.opts.perf_events:
+                extra_args += ['--param',
+                               'perf_profile_events=%s' % self.opts.perf_events]
 
         note('Testing...')
         try:

Modified: lnt/trunk/tests/runtest/test_suite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/test_suite.py?rev=300973&r1=300972&r2=300973&view=diff
==============================================================================
--- lnt/trunk/tests/runtest/test_suite.py (original)
+++ lnt/trunk/tests/runtest/test_suite.py Fri Apr 21 08:26:04 2017
@@ -375,6 +375,21 @@
 # CHECK-USE-PERF-ALL: Importing 1 profiles with
 # CHECK-USE-PERF-ALL: Profile /tmp/I/Do/Not/Exist.perf_data does not exist
 
+# Check specifying which linux perf events to measure
+# RUN: lnt runtest test-suite \
+# RUN:     --sandbox %t.SANDBOX \
+# RUN:     --no-timestamp \
+# RUN:     --test-suite %S/Inputs/test-suite-cmake \
+# RUN:     --cc %{shared_inputs}/FakeCompilers/clang-r154331 \
+# RUN:     --use-cmake %S/Inputs/test-suite-cmake/fake-cmake \
+# RUN:     --use-make %S/Inputs/test-suite-cmake/fake-make \
+# RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit-profile \
+# RUN:     --use-perf=profile \
+# RUN:     --perf-events=cycles,cache_misses \
+# RUN:     --verbose \
+# RUN:     > %t.log 2> %t.err
+# RUN: FileCheck --check-prefix CHECK-USE-PERF-EVENT < %t.err %s
+# CHECK-USE-PERF-EVENT: fake-lit-profile -v -j 1 {{.*--param profile=perf --param perf_profile_events=cycles,cache_misses}}
 
 # Check a missing --cc on the command line
 # RUN: lnt runtest test-suite \




More information about the llvm-commits mailing list