[LNT] r300954 - Only do perf profiling once, even when multisampling.

Kristof Beyls via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 00:59:25 PDT 2017


Author: kbeyls
Date: Fri Apr 21 02:59:25 2017
New Revision: 300954

URL: http://llvm.org/viewvc/llvm-project?rev=300954&view=rev
Log:
Only do perf profiling once, even when multisampling.

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=300954&r1=300953&r2=300954&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/test_suite.py (original)
+++ lnt/trunk/lnt/tests/test_suite.py Fri Apr 21 02:59:25 2017
@@ -492,7 +492,10 @@ class TestSuiteTest(BuiltinTest):
         for i in range(max(opts.exec_multisample, opts.compile_multisample)):
             c = i < opts.compile_multisample
             e = i < opts.exec_multisample
-            run_report, json_data = self.run(cmake_vars, compile=c, test=e)
+            # only gather perf profiles on a single run.
+            p = i == 0 and self.opts.use_perf in ('profile', 'all')
+            run_report, json_data = self.run(cmake_vars, compile=c, test=e,
+                                             profile=p)
             reports.append(run_report)
             json_reports.append(json_data)
 
@@ -525,7 +528,7 @@ class TestSuiteTest(BuiltinTest):
             self._clean(self._base_path)
             self.configured = True
 
-    def run(self, cmake_vars, compile=True, test=True):
+    def run(self, cmake_vars, compile=True, test=True, profile=False):
         mkdir_p(self._base_path)
 
         if self.opts.pgo:
@@ -541,7 +544,7 @@ class TestSuiteTest(BuiltinTest):
             self._make(self._base_path)
             self.compiled = True
 
-        data = self._lit(self._base_path, test)
+        data = self._lit(self._base_path, test, profile)
         return self._parse_lit_output(self._base_path, data, cmake_vars), data
 
     def _create_merged_report(self, reports):
@@ -674,7 +677,7 @@ class TestSuiteTest(BuiltinTest):
                       "TEST_SUITE_RUN_TYPE=train"]
         self._configure(path, extra_cmake_defs=extra_defs)
         self._make(path)
-        self._lit(path, True)
+        self._lit(path, True, False)
 
     def _make(self, path):
         make_cmd = self.opts.make
@@ -702,7 +705,7 @@ class TestSuiteTest(BuiltinTest):
             # experimental compiler.
             pass
 
-    def _lit(self, path, test):
+    def _lit(self, path, test, profile):
         lit_cmd = self.opts.lit
 
         output_json_path = tempfile.NamedTemporaryFile(prefix='output',
@@ -721,7 +724,7 @@ class TestSuiteTest(BuiltinTest):
             extra_args = ['--no-execute']
 
         nr_threads = self._test_threads()
-        if self.opts.use_perf in ('profile', 'all'):
+        if profile:
             if nr_threads != 1:
                 warning('Gathering profiles with perf requires -j 1 as ' +
                         'perf record cannot be run multiple times ' +

Modified: lnt/trunk/tests/runtest/test_suite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/test_suite.py?rev=300954&r1=300953&r2=300954&view=diff
==============================================================================
--- lnt/trunk/tests/runtest/test_suite.py (original)
+++ lnt/trunk/tests/runtest/test_suite.py Fri Apr 21 02:59:25 2017
@@ -359,13 +359,19 @@
 # RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit-profile \
 # RUN:     --use-perf=all \
 # RUN:     -j2 \
+# RUN:     --exec-multisample=2 \
 # RUN:     --verbose \
 # RUN:     > %t.log 2> %t.err
 # RUN: FileCheck --check-prefix CHECK-USE-PERF-ALL < %t.err %s
 # CHECK-USE-PERF-ALL: Configuring with {
 # CHECK-USE-PERF-ALL:   TEST_SUITE_USE_PERF: 'ON'
+# Verify that tests get run sequentially when perf profile gathering is enabled:
 # CHECK-USE-PERF-ALL: Overriding -j 2 to -j 1
 # CHECK-USE-PERF-ALL: fake-lit-profile -v -j 1 {{.*--param profile=perf}}
+# Verify that lit gets invoked twice (--exec-multisample=2), but on the second
+# run, no perf profile is gathered:
+# CHECK-USE-PERF-ALL: fake-lit-profile -v -j 2
+# CHECK-USE-PERF-ALL-NOT: --param profile=perf
 # CHECK-USE-PERF-ALL: Importing 1 profiles with
 # CHECK-USE-PERF-ALL: Profile /tmp/I/Do/Not/Exist.perf_data does not exist
 




More information about the llvm-commits mailing list