CTest Environment Update (#756)
* Update test/tools/json-tool.cpp
- push/pop ppid as external correlation id instead of pid
* Update environment variables for tests and samples
* Revert to old CDash dashboard in run-ci.py
* Revert to new CDash dashboard in run-ci.py
[ROCm/rocprofiler-sdk commit: 3eaa678054]
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
cf1767b3d2
Коммит
03fb9ace21
@@ -66,11 +66,15 @@ function(rocprofiler_set_memcheck_env _TYPE _LIB_BASE)
|
||||
set(ROCPROFILER_MEMCHECK_PRELOAD_ENV
|
||||
"LD_PRELOAD=${${_TYPE}_LIBRARY}"
|
||||
CACHE INTERNAL "LD_PRELOAD env variable for tests " FORCE)
|
||||
set(ROCPROFILER_MEMCHECK_PRELOAD_ENV_VALUE
|
||||
"${${_TYPE}_LIBRARY}"
|
||||
CACHE INTERNAL "Library to LD_PRELOAD for tests " FORCE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# always unset so that it doesn't preload if memcheck disabled
|
||||
unset(ROCPROFILER_MEMCHECK_PRELOAD_ENV CACHE)
|
||||
unset(ROCPROFILER_MEMCHECK_PRELOAD_ENV_VALUE CACHE)
|
||||
|
||||
# the soversions below are fallbacks in case deduce-sanitizer-lib.sh fails
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION
|
||||
|
||||
@@ -44,16 +44,11 @@ target_link_libraries(
|
||||
advanced-thread-trace PRIVATE advanced-thread-trace-client Threads::Threads
|
||||
rocprofiler::samples-build-flags)
|
||||
|
||||
rocprofiler_samples_get_preload_env(PRELOAD_ENV advanced-thread-trace-client)
|
||||
|
||||
add_test(NAME advanced-thread-trace COMMAND $<TARGET_FILE:advanced-thread-trace>)
|
||||
|
||||
set_tests_properties(
|
||||
advanced-thread-trace
|
||||
PROPERTIES
|
||||
TIMEOUT
|
||||
45
|
||||
LABELS
|
||||
"samples"
|
||||
ENVIRONMENT
|
||||
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV};HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"threw an exception")
|
||||
PROPERTIES TIMEOUT 45 LABELS "samples" ENVIRONMENT "${PRELOAD_ENV}"
|
||||
FAIL_REGULAR_EXPRESSION "threw an exception")
|
||||
|
||||
@@ -43,16 +43,14 @@ target_link_libraries(
|
||||
buffered-api-tracing PRIVATE buffered-api-tracing-client Threads::Threads
|
||||
rocprofiler::samples-build-flags)
|
||||
|
||||
rocprofiler_samples_get_preload_env(PRELOAD_ENV buffered-api-tracing-client)
|
||||
rocprofiler_samples_get_ld_library_path_env(LIBRARY_PATH_ENV)
|
||||
|
||||
set(buffered-api-tracing-env ${PRELOAD_ENV} ${LIBRARY_PATH_ENV})
|
||||
|
||||
add_test(NAME buffered-api-tracing COMMAND $<TARGET_FILE:buffered-api-tracing>)
|
||||
|
||||
set_tests_properties(
|
||||
buffered-api-tracing
|
||||
PROPERTIES
|
||||
TIMEOUT
|
||||
45
|
||||
LABELS
|
||||
"samples"
|
||||
ENVIRONMENT
|
||||
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV};HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
||||
PROPERTIES TIMEOUT 45 LABELS "samples" ENVIRONMENT "${buffered-api-tracing-env}"
|
||||
FAIL_REGULAR_EXPRESSION "${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
||||
|
||||
@@ -46,13 +46,13 @@ target_link_libraries(
|
||||
PRIVATE callback-api-tracing-client Threads::Threads
|
||||
rocprofiler-sdk-roctx::rocprofiler-sdk-roctx rocprofiler::samples-build-flags)
|
||||
|
||||
add_test(NAME callback-api-tracing COMMAND $<TARGET_FILE:callback-api-tracing>)
|
||||
rocprofiler_samples_get_preload_env(PRELOAD_ENV callback-api-tracing-client)
|
||||
rocprofiler_samples_get_ld_library_path_env(
|
||||
LIBRARY_PATH_ENV rocprofiler-sdk-roctx::rocprofiler-sdk-roctx-shared-library)
|
||||
|
||||
set(callback-api-tracing-env
|
||||
${ROCPROFILER_MEMCHECK_PRELOAD_ENV}
|
||||
"HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
|
||||
"LD_LIBRARY_PATH=$<TARGET_FILE_DIR:rocprofiler-sdk-roctx::rocprofiler-sdk-roctx-shared-library>:$ENV{LD_LIBRARY_PATH}"
|
||||
)
|
||||
set(callback-api-tracing-env ${PRELOAD_ENV} ${LIBRARY_PATH_ENV})
|
||||
|
||||
add_test(NAME callback-api-tracing COMMAND $<TARGET_FILE:callback-api-tracing>)
|
||||
|
||||
set_tests_properties(
|
||||
callback-api-tracing
|
||||
|
||||
@@ -41,12 +41,6 @@ add_test(NAME code-object-isa-decode COMMAND $<TARGET_FILE:code-object-isa-decod
|
||||
|
||||
set_tests_properties(
|
||||
code-object-isa-decode
|
||||
PROPERTIES
|
||||
TIMEOUT
|
||||
45
|
||||
LABELS
|
||||
"samples"
|
||||
ENVIRONMENT
|
||||
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV};HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"threw an exception")
|
||||
PROPERTIES TIMEOUT 45 LABELS "samples" ENVIRONMENT
|
||||
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV}" FAIL_REGULAR_EXPRESSION
|
||||
"threw an exception")
|
||||
|
||||
@@ -47,12 +47,6 @@ add_test(NAME code-object-tracing COMMAND $<TARGET_FILE:code-object-tracing>)
|
||||
|
||||
set_tests_properties(
|
||||
code-object-tracing
|
||||
PROPERTIES
|
||||
TIMEOUT
|
||||
45
|
||||
LABELS
|
||||
"samples"
|
||||
ENVIRONMENT
|
||||
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV};HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
||||
PROPERTIES TIMEOUT 45 LABELS "samples" ENVIRONMENT
|
||||
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV}" FAIL_REGULAR_EXPRESSION
|
||||
"${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
||||
|
||||
@@ -40,3 +40,47 @@ if(EXISTS ${EXTERNAL_SUBMODULE_DIR}/filesystem/include/ghc/filesystem.hpp)
|
||||
rocprofiler-samples-common-library SYSTEM
|
||||
INTERFACE $<BUILD_INTERFACE:${EXTERNAL_SUBMODULE_DIR}/filesystem/include>)
|
||||
endif()
|
||||
|
||||
# function for getting the LD_PRELOAD environment variable
|
||||
function(rocprofiler_samples_get_preload_env _VAR)
|
||||
set(_PRELOAD_ENV_LIBS ${ROCPROFILER_MEMCHECK_PRELOAD_ENV_VALUE} $ENV{LD_PRELOAD})
|
||||
|
||||
foreach(_TARG ${ARGN})
|
||||
if(NOT TARGET ${_TARG})
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"rocprofiler_samples_get_preload_env: '${_TARG}' is not a valid target"
|
||||
)
|
||||
endif()
|
||||
list(APPEND _PRELOAD_ENV_LIBS $<TARGET_FILE:${_TARG}>)
|
||||
endforeach()
|
||||
|
||||
if(_PRELOAD_ENV_LIBS)
|
||||
string(REPLACE ";" ":" _PRELOAD_ENV "LD_PRELOAD=${_PRELOAD_ENV_LIBS}")
|
||||
endif()
|
||||
|
||||
set(${_VAR}
|
||||
"${_PRELOAD_ENV}"
|
||||
PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# function for getting the LD_LIBRARY_PATH environment variable
|
||||
function(rocprofiler_samples_get_ld_library_path_env _VAR)
|
||||
|
||||
set(_LDLIB_PATH "LD_LIBRARY_PATH=")
|
||||
foreach(_TARG ${ARGN})
|
||||
if(NOT TARGET ${_TARG})
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"rocprofiler_samples_get_ld_library_path_env: '${_TARG}' is not a valid target"
|
||||
)
|
||||
endif()
|
||||
string(APPEND _LDLIB_PATH "$<TARGET_FILE_DIR:${_TARG}>:")
|
||||
endforeach()
|
||||
# append the environments current LD_LIBRARY_PATH
|
||||
string(APPEND _LDLIB_PATH "$ENV{LD_LIBRARY_PATH}")
|
||||
|
||||
set(${_VAR}
|
||||
"${_LDLIB_PATH}"
|
||||
PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
@@ -40,19 +40,18 @@ target_sources(counter-collection-buffer PRIVATE main.cpp)
|
||||
target_link_libraries(counter-collection-buffer PRIVATE counter-collection-buffer-client
|
||||
Threads::Threads)
|
||||
|
||||
rocprofiler_samples_get_ld_library_path_env(LIBRARY_PATH_ENV)
|
||||
rocprofiler_samples_get_preload_env(PRELOAD_ENV counter-collection-buffer-client)
|
||||
|
||||
set(counter-collection-buffer-env "${PRELOAD_ENV}" "${LIBRARY_PATH_ENV}")
|
||||
|
||||
add_test(NAME counter-collection-buffer COMMAND $<TARGET_FILE:counter-collection-buffer>)
|
||||
|
||||
set_tests_properties(
|
||||
counter-collection-buffer
|
||||
PROPERTIES
|
||||
TIMEOUT
|
||||
120
|
||||
LABELS
|
||||
"samples"
|
||||
ENVIRONMENT
|
||||
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV};HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
||||
PROPERTIES TIMEOUT 120 LABELS "samples" ENVIRONMENT
|
||||
"${counter-collection-buffer-env}" FAIL_REGULAR_EXPRESSION
|
||||
"${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
||||
|
||||
add_library(counter-collection-callback-client SHARED)
|
||||
target_sources(counter-collection-callback-client PRIVATE callback_client.cpp client.hpp)
|
||||
@@ -67,20 +66,18 @@ target_sources(counter-collection-callback PRIVATE main.cpp)
|
||||
target_link_libraries(counter-collection-callback
|
||||
PRIVATE counter-collection-callback-client Threads::Threads)
|
||||
|
||||
rocprofiler_samples_get_preload_env(PRELOAD_ENV counter-collection-callback-client)
|
||||
|
||||
set(counter-collection-callback-env "${PRELOAD_ENV}" "${LIBRARY_PATH_ENV}")
|
||||
|
||||
add_test(NAME counter-collection-callback
|
||||
COMMAND $<TARGET_FILE:counter-collection-callback>)
|
||||
|
||||
set_tests_properties(
|
||||
counter-collection-callback
|
||||
PROPERTIES
|
||||
TIMEOUT
|
||||
120
|
||||
LABELS
|
||||
"samples"
|
||||
ENVIRONMENT
|
||||
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV};HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
||||
PROPERTIES TIMEOUT 120 LABELS "samples" ENVIRONMENT
|
||||
"${counter-collection-callback-env}" FAIL_REGULAR_EXPRESSION
|
||||
"${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
||||
|
||||
add_library(counter-collection-functional-counter-client SHARED)
|
||||
target_sources(counter-collection-functional-counter-client
|
||||
@@ -96,17 +93,16 @@ target_link_libraries(
|
||||
counter-collection-print-functional-counters
|
||||
PRIVATE counter-collection-functional-counter-client Threads::Threads)
|
||||
|
||||
rocprofiler_samples_get_preload_env(PRELOAD_ENV
|
||||
counter-collection-functional-counter-client)
|
||||
|
||||
set(counter-collection-functional-counter-env "${PRELOAD_ENV}" "${LIBRARY_PATH_ENV}")
|
||||
|
||||
add_test(NAME counter-collection-print-functional-counters
|
||||
COMMAND $<TARGET_FILE:counter-collection-print-functional-counters>)
|
||||
|
||||
set_tests_properties(
|
||||
counter-collection-print-functional-counters
|
||||
PROPERTIES
|
||||
TIMEOUT
|
||||
120
|
||||
LABELS
|
||||
"samples"
|
||||
ENVIRONMENT
|
||||
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV};HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
||||
PROPERTIES TIMEOUT 120 LABELS "samples" ENVIRONMENT
|
||||
"${counter-collection-functional-counter-env}" FAIL_REGULAR_EXPRESSION
|
||||
"${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
||||
|
||||
@@ -42,16 +42,14 @@ target_sources(intercept-table PRIVATE main.cpp)
|
||||
target_link_libraries(intercept-table PRIVATE intercept-table-client Threads::Threads
|
||||
rocprofiler::samples-build-flags)
|
||||
|
||||
rocprofiler_samples_get_preload_env(PRELOAD_ENV intercept-table-client)
|
||||
rocprofiler_samples_get_ld_library_path_env(LIBRARY_PATH_ENV)
|
||||
|
||||
set(intercept-table-env ${PRELOAD_ENV} ${LIBRARY_PATH_ENV})
|
||||
|
||||
add_test(NAME intercept-table COMMAND $<TARGET_FILE:intercept-table>)
|
||||
|
||||
set_tests_properties(
|
||||
intercept-table
|
||||
PROPERTIES
|
||||
TIMEOUT
|
||||
45
|
||||
LABELS
|
||||
"samples"
|
||||
ENVIRONMENT
|
||||
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV};HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
|
||||
FAIL_REGULAR_EXPRESSION
|
||||
"${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
||||
PROPERTIES TIMEOUT 45 LABELS "samples" ENVIRONMENT "${intercept-table-env}"
|
||||
FAIL_REGULAR_EXPRESSION "${ROCPROFILER_DEFAULT_FAIL_REGEX}")
|
||||
|
||||
@@ -12,6 +12,8 @@ import multiprocessing
|
||||
|
||||
# this constant is used to define CTEST_PROJECT_NAME
|
||||
# and default value for CTEST_SUBMIT_URL
|
||||
# _PROJECT_NAME = "rocprofiler-v2-internal"
|
||||
# _BASE_URL = "10.194.116.31/cdash"
|
||||
_PROJECT_NAME = "rocprofiler-sdk-internal"
|
||||
_BASE_URL = "cdash.mariadb.svc.cluster.local"
|
||||
_GCOVR_GENERATE_CMD = None
|
||||
|
||||
@@ -17,10 +17,8 @@ else()
|
||||
set(LOG_LEVEL "info")
|
||||
endif()
|
||||
|
||||
set(tracing-env
|
||||
"${PRELOAD_ENV}" "ROCPROF_LOG_LEVEL=${LOG_LEVEL}"
|
||||
"ROCPROFILER_LOG_LEVEL=${LOG_LEVEL}"
|
||||
"HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>")
|
||||
set(tracing-env "${PRELOAD_ENV}" "ROCPROF_LOG_LEVEL=${LOG_LEVEL}"
|
||||
"ROCPROFILER_LOG_LEVEL=${LOG_LEVEL}")
|
||||
|
||||
foreach(FILENAME validate.py conftest.py)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${FILENAME}
|
||||
|
||||
@@ -21,7 +21,6 @@ add_test(NAME test-scratch-memory-tracing-execute COMMAND $<TARGET_FILE:scratch-
|
||||
|
||||
set(scratch-memory-tracing-env
|
||||
"${PRELOAD_ENV}"
|
||||
"HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
|
||||
"ROCPROFILER_TOOL_OUTPUT_FILE=scratch-memory-tracing-test.json"
|
||||
"LD_LIBRARY_PATH=$<TARGET_FILE_DIR:rocprofiler::rocprofiler-shared-library>:$ENV{LD_LIBRARY_PATH}"
|
||||
)
|
||||
|
||||
@@ -1343,7 +1343,7 @@ tool_init(rocprofiler_client_finalize_t fini_func, void* tool_data)
|
||||
}
|
||||
}
|
||||
|
||||
push_external_correlation(getpid());
|
||||
push_external_correlation(getppid());
|
||||
|
||||
start();
|
||||
|
||||
@@ -1910,13 +1910,13 @@ pop_external_correlation()
|
||||
auto _data = rocprofiler_user_data_t{.value = 0};
|
||||
ROCPROFILER_CALL(rocprofiler_pop_external_correlation_id(*itr.second, tid, &_data),
|
||||
"push external correlation");
|
||||
if(_data.value != static_cast<uint64_t>(getpid()))
|
||||
if(_data.value != static_cast<uint64_t>(getppid()))
|
||||
{
|
||||
auto _msg = std::stringstream{};
|
||||
_msg << "rocprofiler_pop_external_correlation_id(context.handle="
|
||||
<< itr.second->handle << ", tid=" << tid
|
||||
<< ", ...) returned external correlation id value of " << _data.value
|
||||
<< ". expected: " << getpid();
|
||||
<< ". expected: " << getppid();
|
||||
throw std::runtime_error{_msg.str()};
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user