[test-suite] r263535 - cmake/lit: Collect link_times
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 14 22:24:04 PDT 2016
Author: matze
Date: Tue Mar 15 00:24:03 2016
New Revision: 263535
URL: http://llvm.org/viewvc/llvm-project?rev=263535&view=rev
Log:
cmake/lit: Collect link_times
Previously we only collected compile_times, this adds a new metric
link_time. This currently has the same problem as compile_time with the
SingleSource/** directories.
Modified:
test-suite/trunk/CMakeLists.txt
test-suite/trunk/litsupport/compiletime.py
Modified: test-suite/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/CMakeLists.txt?rev=263535&r1=263534&r2=263535&view=diff
==============================================================================
--- test-suite/trunk/CMakeLists.txt (original)
+++ test-suite/trunk/CMakeLists.txt Tue Mar 15 00:24:03 2016
@@ -136,6 +136,8 @@ mark_as_advanced(TEST_SUITE_TAKE_COMPILE
if(TEST_SUITE_TAKE_COMPILE_TIME)
set(CMAKE_C_COMPILE_OBJECT "${CMAKE_BINARY_DIR}/tools/timeit --summary <OBJECT>.time ${CMAKE_C_COMPILE_OBJECT}")
set(CMAKE_CXX_COMPILE_OBJECT "${CMAKE_BINARY_DIR}/tools/timeit --summary <OBJECT>.time ${CMAKE_CXX_COMPILE_OBJECT}")
+ set(CMAKE_C_LINK_EXECUTABLE "${CMAKE_BINARY_DIR}/tools/timeit --summary <TARGET>.link.time ${CMAKE_C_LINK_EXECUTABLE}")
+ set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_BINARY_DIR}/tools/timeit --summary <TARGET>.link.time ${CMAKE_CXX_LINK_EXECUTABLE}")
endif()
set(TEST_SUITE_BENCHMARKING_ONLY "OFF" CACHE BOOL
Modified: test-suite/trunk/litsupport/compiletime.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/compiletime.py?rev=263535&r1=263534&r2=263535&view=diff
==============================================================================
--- test-suite/trunk/litsupport/compiletime.py (original)
+++ test-suite/trunk/litsupport/compiletime.py Tue Mar 15 00:24:03 2016
@@ -7,13 +7,20 @@ def _getCompileTime(context):
# TODO: This is not correct yet as the directory may contain .o.time files
# of multiple benchmarks in the case of SingleSource tests.
compile_time = 0.0
+ link_time = 0.0
basepath = os.path.dirname(context.test.getFilePath())
for path, subdirs, files in os.walk(basepath):
for file in files:
if file.endswith('.o.time'):
fullpath = os.path.join(path, file)
compile_time += timeit.getUserTime(fullpath)
- return {'compile_time': lit.Test.toMetricValue(compile_time)}
+ if file.endswith('.link.time'):
+ fullpath = os.path.join(path, file)
+ link_time += timeit.getUserTime(fullpath)
+ return {
+ 'compile_time': lit.Test.toMetricValue(compile_time),
+ 'link_time': lit.Test.toMetricValue(link_time),
+ }
def mutatePlan(context, plan):
More information about the llvm-commits
mailing list