[test-suite] r300972 - Make measured perf events configurable.

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


Author: kbeyls
Date: Fri Apr 21 08:22:00 2017
New Revision: 300972

URL: http://llvm.org/viewvc/llvm-project?rev=300972&view=rev
Log:
Make measured perf events configurable.

Sometimes you need more or other events than the default ones.

This patch furthermore changes the default to also measure "number of
instructions executed", as that is often also a key metric to
understand the performance difference when code generation changed.
This increases the number of events measured by default to 4 from 3;
but almost all cores do enable measuring at least 4 performance events
concurrently.

Modified:
    test-suite/trunk/lit.cfg
    test-suite/trunk/litsupport/perf.py

Modified: test-suite/trunk/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/lit.cfg?rev=300972&r1=300971&r2=300972&view=diff
==============================================================================
--- test-suite/trunk/lit.cfg (original)
+++ test-suite/trunk/lit.cfg Fri Apr 21 08:22:00 2017
@@ -34,6 +34,11 @@ console_log = logging.StreamHandler()
 console_log.setLevel(logging.WARNING)
 logger.addHandler(console_log)
 
+# Pass on some options to context object:
+config.perf_profile_events = "cycles,cache-misses,branch-misses,instructions"
+if lit_config.params.get('perf_profile_events'):
+    config.perf_profile_events = lit_config.params.get('perf_profile_events')
+
 # Find and initialize lit modules.
 if lit_config.params.get('profile') == 'perf':
     config.test_modules += ['perf']

Modified: test-suite/trunk/litsupport/perf.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/perf.py?rev=300972&r1=300971&r2=300972&view=diff
==============================================================================
--- test-suite/trunk/litsupport/perf.py (original)
+++ test-suite/trunk/litsupport/perf.py Fri Apr 21 08:22:00 2017
@@ -11,7 +11,7 @@ def mutateCommandLine(context, commandli
     cmd = shellcommand.parse(commandline)
     cmd.wrap('perf', [
         'record',
-        '-e', 'cycles,cache-misses,branch-misses',
+        '-e', context.config.perf_profile_events,
         '-o', profilefile,
         '--'
     ])




More information about the llvm-commits mailing list