kernel iteration filtering for counter collection (#911)

* kernel filtering for counter collection

* fixing trace tests

* removing print statements

* fix CI fail

* handling preload and updating docs

* minor fix

* misc fix

* misc fix

* Typo fix

* Update rocprofv3 + input schema

- "application_passes" -> "jobs"
- removed nesting in YAML/JSON inputs
- improved customAction (now booleanArgAction)
  - supports --<name> (defaults to true)
  - supports --<name>=<truth-value>
  - supports --<name> <truth-value>
- added --kernel-iteration-range to command-line
- automatically support new command-line options in YAML/JSON input
- standardized PMC return from text input to match PMC from YAML/JSON input
- added support for --log-level env
- updated various input*.(yml|json) to modified schema

* Update config.cpp

- added recommended code to get_kernel_filter_range

* Fixing iteration

* misc fix

* support only [-] for iteration

* bug fix

* Fix using-rocprofv3.rst

* Update config.cpp

- patch get_kernel_filter_range

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
Tá an tiomantas seo le fáil i:
SrirakshaNagagusJonathan R. Madsen údaraithe agus GitHub tiomanta 2024-07-26 21:46:53 -05:00
1 tuismitheoir dc671497da
tiomantas ace34abd11
23 comhad athraithe
+1303 -275

Níor tháinig aon chomhaid le do chuardach

+128 -8
Féach ar an gComhad
@@ -16,6 +16,14 @@ else()
set(LOG_LEVEL "info")
endif()
string(REPLACE "LD_PRELOAD=" "ROCPROF_PRELOAD=" PRELOAD_ENV
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV}")
set(tracing-env "${PRELOAD_ENV}")
rocprofiler_configure_pytest_files(
CONFIG pytest.ini COPY validate.py conftest.py input_systrace.json input_trace.json)
add_test(
NAME rocprofv3-test-trace-execute
COMMAND
@@ -24,11 +32,6 @@ add_test(
out --output-format pftrace csv json --log-level ${LOG_LEVEL} --
$<TARGET_FILE:simple-transpose>)
string(REPLACE "LD_PRELOAD=" "ROCPROF_PRELOAD=" PRELOAD_ENV
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV}")
set(tracing-env "${PRELOAD_ENV}")
set_tests_properties(
rocprofv3-test-trace-execute
PROPERTIES
@@ -42,7 +45,26 @@ set_tests_properties(
"HSA_API|HIP_API|HIP_COMPILER_API|MARKER_CORE_API|MARKER_CONTROL_API|MARKER_NAME_API|KERNEL_DISPATCH|CODE_OBJECT"
)
rocprofiler_configure_pytest_files(CONFIG pytest.ini COPY validate.py conftest.py)
add_test(
NAME rocprofv3-test-trace-input-json-execute
COMMAND
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> -i
${CMAKE_CURRENT_BINARY_DIR}/input_trace.json -d
${CMAKE_CURRENT_BINARY_DIR}/%argt%-trace-input-json --log-level ${LOG_LEVEL} --
$<TARGET_FILE:simple-transpose>)
set_tests_properties(
rocprofv3-test-trace-input-json-execute
PROPERTIES
TIMEOUT
45
LABELS
"integration-tests"
ENVIRONMENT
"${tracing-env}"
FAIL_REGULAR_EXPRESSION
"HSA_API|HIP_API|HIP_COMPILER_API|MARKER_CORE_API|MARKER_CONTROL_API|MARKER_NAME_API|KERNEL_DISPATCH|CODE_OBJECT"
)
add_test(
NAME rocprofv3-test-trace-validate
@@ -61,6 +83,24 @@ add_test(
--pftrace-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace/out_results.pftrace)
add_test(
NAME rocprofv3-test-trace-input-json-validate
COMMAND
${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/validate.py --hsa-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_hsa_api_trace.csv
--kernel-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_kernel_trace.csv
--memory-copy-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_memory_copy_trace.csv
--marker-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_marker_api_trace.csv
--agent-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_agent_info.csv
--json-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_results.json
--pftrace-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_results.pftrace)
set(VALIDATION_FILES
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace/out_results.pftrace
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace/out_results.json
@@ -68,7 +108,14 @@ set(VALIDATION_FILES
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace/out_hsa_api_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace/out_kernel_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace/out_marker_api_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace/out_agent_info.csv)
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace/out_agent_info.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_results.pftrace
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_results.json
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_memory_copy_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_hsa_api_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_kernel_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_marker_api_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-trace-input-json/out_agent_info.csv)
set_tests_properties(
rocprofv3-test-trace-validate
@@ -83,6 +130,19 @@ set_tests_properties(
ATTACHED_FILES_ON_FAIL
"${VALIDATION_FILES}")
set_tests_properties(
rocprofv3-test-trace-input-json-validate
PROPERTIES TIMEOUT
45
LABELS
"integration-tests"
DEPENDS
"rocprofv3-test-trace-input-json-execute"
FAIL_REGULAR_EXPRESSION
"AssertionError"
ATTACHED_FILES_ON_FAIL
"${VALIDATION_FILES}")
# sys-trace test: tests --sys-trace command with mangled kernel names and validates
# generated files
@@ -106,6 +166,26 @@ set_tests_properties(
"HSA_API|HIP_API|HIP_COMPILER_API|MARKER_CORE_API|MARKER_CONTROL_API|MARKER_NAME_API|KERNEL_DISPATCH|CODE_OBJECT"
)
add_test(
NAME rocprofv3-test-systrace-input-json-execute
COMMAND
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> -i
${CMAKE_CURRENT_BINARY_DIR}/input_systrace.json -d
${CMAKE_CURRENT_BINARY_DIR}/%argt%-systrace-input-json --
$<TARGET_FILE:simple-transpose>)
set_tests_properties(
rocprofv3-test-systrace-input-json-execute
PROPERTIES
TIMEOUT
45
LABELS
"integration-tests"
ENVIRONMENT
"${tracing-env}"
FAIL_REGULAR_EXPRESSION
"HSA_API|HIP_API|HIP_COMPILER_API|MARKER_CORE_API|MARKER_CONTROL_API|MARKER_NAME_API|KERNEL_DISPATCH|CODE_OBJECT"
)
add_test(
NAME rocprofv3-test-systrace-validate
COMMAND
@@ -125,6 +205,26 @@ add_test(
--pftrace-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace/out_results.pftrace)
add_test(
NAME rocprofv3-test-systrace-input-json-validate
COMMAND
${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/validate.py -k
"not test_hsa_api_trace" --hsa-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_hsa_api_trace.csv
--kernel-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_kernel_trace.csv
--memory-copy-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_memory_copy_trace.csv
--marker-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_marker_api_trace.csv
--agent-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_agent_info.csv
--json-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_results.json
--pftrace-input
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_results.pftrace
)
set(SYS_VALIDATION_FILES
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace/out_results.pftrace
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace/out_results.json
@@ -132,7 +232,14 @@ set(SYS_VALIDATION_FILES
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace/out_hsa_api_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace/out_kernel_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace/out_marker_api_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace/out_agent_info.csv)
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace/out_agent_info.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_results.pftrace
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_results.json
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_memory_copy_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_hsa_api_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_kernel_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_marker_api_trace.csv
${CMAKE_CURRENT_BINARY_DIR}/simple-transpose-systrace-input-json/out_agent_info.csv)
set_tests_properties(
rocprofv3-test-systrace-validate
@@ -146,3 +253,16 @@ set_tests_properties(
"AssertionError"
ATTACHED_FILES_ON_FAIL
"${SYS_VALIDATION_FILES}")
set_tests_properties(
rocprofv3-test-systrace-input-json-validate
PROPERTIES TIMEOUT
45
LABELS
"integration-tests"
DEPENDS
"rocprofv3-test-systrace-input-json-execute"
FAIL_REGULAR_EXPRESSION
"AssertionError"
ATTACHED_FILES_ON_FAIL
"${SYS_VALIDATION_FILES}")
+13
Féach ar an gComhad
@@ -0,0 +1,13 @@
{
"jobs": [
{
"sys_trace": true,
"output_file": "out",
"output_format": [
"csv",
"json",
"pftrace"
]
}
]
}
+16
Féach ar an gComhad
@@ -0,0 +1,16 @@
{
"jobs": [
{
"hsa_trace": true,
"kernel_trace": true,
"memory_copy_trace": true,
"marker_trace": true,
"output_file": "out",
"output_format": [
"csv",
"json",
"pftrace"
]
}
]
}