rocprofv3: Update rocprofv3 command line for ATT (#201)

* rocprofv3: suppress agent info when no data collected

* Update output config serialization

- full serialization of output configuration

* Update rocprofiler-sdk-att/tests

- add version and soversion
- change output directory
- generate libatt_decoder_summary
- disable tests instead of removing them

* Update rocprofv3 command-line

- make --att-library-path hidden by default
- simplify check_att_capability
- reorder pc sampling options
- add hidden --echo option
- remove ROCPROF_LIST_AVAIL_TOOL_LIBRARY from preload

* Add new rocprofv3 tests for specify the ATT library path

* Tweak to rocprofv3-test-hsa-multiqueue-att tests

* Update rocprofv3 tool to enable output with att

* Fix standalone test installation

* Revert to fetchcontent_makeavailable to fetchcontent_populate

* Revert tests/common/CMakeLists.txt

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
This commit is contained in:
Madsen, Jonathan
2025-02-11 18:10:48 -06:00
gecommit door GitHub
bovenliggende 6246ec4040
commit 59b41ab5aa
12 gewijzigde bestanden met toevoegingen van 401 en 191 verwijderingen
+6
Bestand weergeven
@@ -33,6 +33,12 @@ include(GNUInstallDirs)
# always use lib instead of lib64
set(CMAKE_INSTALL_LIBDIR "lib")
# define the library output directory
if(PROJECT_IS_TOP_LEVEL)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
endif()
# needed for validation
find_package(Python3 REQUIRED)
+8 -1
Bestand weergeven
@@ -36,6 +36,14 @@ set(AMDGPU_TARGETS
"GPU targets to compile for AMDGPUs (update GPU_TARGETS, not this variable)"
FORCE)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
cmake_policy(SET CMP0135 NEW)
endif()
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.30)
cmake_policy(SET CMP0167 NEW)
endif()
# build flags
add_library(rocprofiler-sdk-tests-build-flags INTERFACE)
add_library(rocprofiler-sdk::tests-build-flags ALIAS rocprofiler-sdk-tests-build-flags)
@@ -78,7 +86,6 @@ if(NOT TARGET rocprofiler-sdk::rocprofiler-sdk-cereal)
${PROJECT_BINARY_DIR}/external/build/cereal-build SUBBUILD_DIR
${PROJECT_BINARY_DIR}/external/build/cereal-subdir)
# This particular version of projD requires workarounds
fetchcontent_getproperties(cereal)
if(NOT cereal_POPULATED)
@@ -21,8 +21,8 @@ find_package(rocprofiler-sdk REQUIRED)
add_test(
NAME rocprofv3-test-hsa-multiqueue-att-cmd-env-ld-lib-path-execute
COMMAND
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> --advanced-thread-trace 1
--att-target-cu 1 --att-shader-engine-mask 0x11 --kernel-include-regex copyD
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> --log-level env --advanced-thread-trace
1 --att-target-cu 1 --att-shader-engine-mask 0x11 --kernel-include-regex copyD
--att-buffer-size 0x6000000 --att-simd-select 0x3 --att-parse testing
--att-serialize-all 1 -d ${CMAKE_CURRENT_BINARY_DIR}/%argt%-trace/cmd_input -o
out --output-format json ${PRELOAD_ARGS} --
@@ -31,14 +31,13 @@ add_test(
set_tests_properties(
rocprofv3-test-hsa-multiqueue-att-cmd-env-ld-lib-path-execute
PROPERTIES TIMEOUT 45 LABELS "integration-tests" ENVIRONMENT
LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}
FAIL_REGULAR_EXPRESSION "HSA_API|HIP_API")
LD_LIBRARY_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{LD_LIBRARY_PATH})
# hsa multiqueue dependency test
add_test(
NAME rocprofv3-test-hsa-multiqueue-att-cmd-env-att-lib-path-execute
COMMAND
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> --advanced-thread-trace 1
--att-target-cu 1 --att-shader-engine-mask 0x11 --kernel-include-regex copyD
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> --log-level env --advanced-thread-trace
1 --att-target-cu 1 --att-shader-engine-mask 0x11 --kernel-include-regex copyD
--att-buffer-size 0x6000000 --att-simd-select 0x3 --att-parse testing
--att-serialize-all 1 -d ${CMAKE_CURRENT_BINARY_DIR}/%argt%-trace/cmd_input -o
out --output-format json ${PRELOAD_ARGS} --
@@ -47,22 +46,20 @@ add_test(
set_tests_properties(
rocprofv3-test-hsa-multiqueue-att-cmd-env-att-lib-path-execute
PROPERTIES TIMEOUT 45 LABELS "integration-tests" ENVIRONMENT
ATT_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib FAIL_REGULAR_EXPRESSION
"HSA_API|HIP_API")
ROCPROF_ATT_LIBRARY_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
# hsa multiqueue dependency test
add_test(
NAME rocprofv3-test-hsa-multiqueue-att-json-execute
COMMAND
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> --att-library-path
${CMAKE_BINARY_DIR}/lib -d ${CMAKE_CURRENT_BINARY_DIR}/%argt%-trace/json_input -i
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> --log-level env --att-library-path
${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -d
${CMAKE_CURRENT_BINARY_DIR}/%argt%-trace/json_input -i
${CMAKE_CURRENT_BINARY_DIR}/att_input.json ${PRELOAD_ARGS} --
$<TARGET_FILE:hsa_code_object_testapp>)
set_tests_properties(
rocprofv3-test-hsa-multiqueue-att-json-execute
PROPERTIES TIMEOUT 45 LABELS "integration-tests" FAIL_REGULAR_EXPRESSION
"HSA_API|HIP_API")
set_tests_properties(rocprofv3-test-hsa-multiqueue-att-json-execute
PROPERTIES TIMEOUT 45 LABELS "integration-tests")
add_test(
NAME rocprofv3-test-hsa-multiqueue-att-cmd-validate
@@ -98,3 +95,101 @@ set_tests_properties(
PROPERTIES TIMEOUT 45 LABELS "integration-tests" DEPENDS
"rocprofv3-test-hsa-multiqueue-att-json-execute" FAIL_REGULAR_EXPRESSION
"AssertionError")
if(TARGET rocprofiler-sdk::att-decoder-testing AND TARGET
rocprofiler-sdk::att-decoder-summary)
set(MISSING_TEST_DECODER_LIBS OFF)
else()
set(MISSING_TEST_DECODER_LIBS ON)
endif()
function(configure_att_input _FILENAME _OUTDIR)
set(LIBRARY_OUTPUT_DIR ${_OUTDIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/att_input.yml.in
${CMAKE_CURRENT_BINARY_DIR}/${_FILENAME} @ONLY)
endfunction()
configure_att_input(att_input.yml "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
configure_att_input(att_input_will_fail.yml "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
#
# Uses att_library_path in YAML input to specify ATT library path
#
add_test(
NAME rocprofv3-test-att-library-path-yaml-input
COMMAND $<TARGET_FILE:rocprofiler-sdk::rocprofv3> -i
${CMAKE_CURRENT_BINARY_DIR}/att_input.yml --log-level env --echo -- sleep 0)
set_tests_properties(
rocprofv3-test-att-library-path-yaml-input
PROPERTIES TIMEOUT 45 LABELS "integration-tests" DISABLED
"${MISSING_TEST_DECODER_LIBS}")
add_test(
NAME rocprofv3-test-att-library-path-yaml-input-will-fail
COMMAND
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> -i
${CMAKE_CURRENT_BINARY_DIR}/att_input_will_fail.yml --log-level env --echo --
sleep 0)
set_tests_properties(
rocprofv3-test-att-library-path-yaml-input-will-fail
PROPERTIES TIMEOUT 45 LABELS "integration-tests" WILL_FAIL ON DISABLED
"${MISSING_TEST_DECODER_LIBS}")
#
# Uses --att-library-path to specify ATT library path
#
add_test(
NAME rocprofv3-test-att-library-path-cmd-line
COMMAND
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> --att --att-library-path
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/att --att-parse summary --log-level env --echo
-- sleep 0)
set_tests_properties(
rocprofv3-test-att-library-path-cmd-line
PROPERTIES TIMEOUT 45 LABELS "integration-tests" DISABLED
"${MISSING_TEST_DECODER_LIBS}")
add_test(
NAME rocprofv3-test-att-library-path-cmd-line-will-fail
COMMAND
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> --att --att-library-path
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/att --att-parse testing --log-level env --echo
-- sleep 0)
set_tests_properties(
rocprofv3-test-att-library-path-cmd-line-will-fail
PROPERTIES TIMEOUT 45 LABELS "integration-tests" WILL_FAIL ON DISABLED
"${MISSING_TEST_DECODER_LIBS}")
#
# Uses ROCPROF_ATT_LIBRARY_PATH to specify ATT library path
#
add_test(NAME rocprofv3-test-att-library-path-env-var
COMMAND $<TARGET_FILE:rocprofiler-sdk::rocprofv3> --att --att-parse summary
--log-level env --echo -- sleep 0)
set_tests_properties(
rocprofv3-test-att-library-path-env-var
PROPERTIES TIMEOUT 45 LABELS "integration-tests" ENVIRONMENT
"ROCPROF_ATT_LIBRARY_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/att" DISABLED
"${MISSING_TEST_DECODER_LIBS}")
add_test(NAME rocprofv3-test-att-library-path-env-var-will-fail
COMMAND $<TARGET_FILE:rocprofiler-sdk::rocprofv3> --att --att-parse testing
--log-level env --echo -- sleep 0)
set_tests_properties(
rocprofv3-test-att-library-path-env-var-will-fail
PROPERTIES TIMEOUT
45
LABELS
"integration-tests"
ENVIRONMENT
"ROCPROF_ATT_LIBRARY_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/att"
WILL_FAIL
ON
DISABLED
"${MISSING_TEST_DECODER_LIBS}")
@@ -9,9 +9,9 @@
],
"truncate_kernels": true,
"advanced_thread_trace": true,
"att_parse" : "testing",
"att_target_cu" : 1,
"att_shader_engine_mask" : "0x11",
"att_parse": "testing",
"att_target_cu": 1,
"att_shader_engine_mask": "0x11",
"att_simd_select": "0x3",
"att_buffer_size": "0x6000000",
"att_perfcounters": "SQ_WAVES:0x1 SQ_INSTS_VALU:0x3 SQ_INSTS_SALU:0xF"
@@ -0,0 +1,30 @@
jobs:
- advanced_thread_trace: True
att_parse: summary
att_library_path:
- @LIBRARY_OUTPUT_DIR@/att
- advanced_thread_trace: True
att_parse: summary
att_library_path:
- @LIBRARY_OUTPUT_DIR@/att
- @LIBRARY_OUTPUT_DIR@
- advanced_thread_trace: True
att_parse: testing
att_library_path:
- @LIBRARY_OUTPUT_DIR@/att
- @LIBRARY_OUTPUT_DIR@
- advanced_thread_trace: True
att_parse: testing
- advanced_thread_trace: True
att_parse: testing
att_library_path:
- @LIBRARY_OUTPUT_DIR@
- advanced_thread_trace: True
att_parse: testing
att_library_path:
- @LIBRARY_OUTPUT_DIR@