[LNT] r300953 - Force sequential execution when capturing perf profiles.

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


Author: kbeyls
Date: Fri Apr 21 02:50:43 2017
New Revision: 300953

URL: http://llvm.org/viewvc/llvm-project?rev=300953&view=rev
Log:
Force sequential execution when capturing perf profiles.

The underlying mechanism "perf record" cannot be run multiple times
concurrently on a single machine, so avoid profiles not being captured
by making the run that captures profiles to be non-parallel.

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=300953&r1=300952&r2=300953&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/test_suite.py (original)
+++ lnt/trunk/lnt/tests/test_suite.py Fri Apr 21 02:50:43 2017
@@ -719,14 +719,21 @@ class TestSuiteTest(BuiltinTest):
         extra_args = []
         if not test:
             extra_args = ['--no-execute']
+
+        nr_threads = self._test_threads()
         if self.opts.use_perf in ('profile', 'all'):
+            if nr_threads != 1:
+                warning('Gathering profiles with perf requires -j 1 as ' +
+                        'perf record cannot be run multiple times ' +
+                        'simultaneously. Overriding -j %s to -j 1' % nr_threads)
+                nr_threads = 1
             extra_args += ['--param', 'profile=perf']
 
         note('Testing...')
         try:
             self._check_call([lit_cmd,
                               '-v',
-                              '-j', str(self._test_threads()),
+                              '-j', str(nr_threads),
                               subdir,
                               '-o', output_json_path.name] + extra_args)
         except subprocess.CalledProcessError:

Modified: lnt/trunk/tests/runtest/test_suite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/runtest/test_suite.py?rev=300953&r1=300952&r2=300953&view=diff
==============================================================================
--- lnt/trunk/tests/runtest/test_suite.py (original)
+++ lnt/trunk/tests/runtest/test_suite.py Fri Apr 21 02:50:43 2017
@@ -358,12 +358,14 @@
 # RUN:     --use-make %S/Inputs/test-suite-cmake/fake-make \
 # RUN:     --use-lit %S/Inputs/test-suite-cmake/fake-lit-profile \
 # RUN:     --use-perf=all \
+# RUN:     -j2 \
 # 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'
-# CHECK-USE-PERF-ALL: --param profile=perf
+# CHECK-USE-PERF-ALL: Overriding -j 2 to -j 1
+# CHECK-USE-PERF-ALL: fake-lit-profile -v -j 1 {{.*--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