diff --git a/source/bin/rocprofv3 b/source/bin/rocprofv3 index 5f814b103c..b79dda0491 100755 --- a/source/bin/rocprofv3 +++ b/source/bin/rocprofv3 @@ -19,7 +19,12 @@ usage() { if [ -z "${EC}" ]; then EC=1; fi echo -e "${RESET}ROCProfilerV3 Run Script Usage:" echo -e "${GREEN}-h | --help ${RESET} For showing this message" - # echo -e "${GREEN}-i | --input ${RESET} For adding counters file path (every line in the text file represents a counter)" + echo -e "${GREEN}-i | --input ${RESET} For counter collection " + echo -e "\t#${GREY} Input file .txt format, automatically rerun application for every profiling features line" + echo -e "\t# Perf counters group 1" + echo -e "\tpmc : Wavefronts VALUInsts SALUInsts SFetchInsts FlatVMemInsts LDSInsts" + echo -e "\t# Perf counters group 2" + echo -e "\tpmc : WriteSize L2CacheHit ${RESET}" echo -e "${GREEN}--hsa-trace ${RESET} For Collecting HSA API Traces" echo -e "${GREEN}--kernel-trace ${RESET} For Collecting Kernel Dispatch Traces" echo -e "${GREEN}--memory-copy-trace ${RESET} For Collecting Memory Copy Traces" diff --git a/tests/rocprofv3/counter-collection/input1/CMakeLists.txt b/tests/rocprofv3/counter-collection/input1/CMakeLists.txt index 886860bf59..c104d20aa4 100644 --- a/tests/rocprofv3/counter-collection/input1/CMakeLists.txt +++ b/tests/rocprofv3/counter-collection/input1/CMakeLists.txt @@ -20,8 +20,8 @@ add_test( NAME rocprofv3-test-counter-collection-pmc1-execute COMMAND $ -i - ${CMAKE_CURRENT_BINARY_DIR}/input.txt -d ${CMAKE_CURRENT_BINARY_DIR}/out_cc_1 -o - pmc1 $) + ${CMAKE_CURRENT_BINARY_DIR}/input.txt -T -d ${CMAKE_CURRENT_BINARY_DIR}/out_cc_1 + -o pmc1 $) string(REPLACE "LD_PRELOAD=" "ROCPROF_PRELOAD=" PRELOAD_ENV "${ROCPROFILER_MEMCHECK_PRELOAD_ENV}") diff --git a/tests/rocprofv3/counter-collection/input1/validate.py b/tests/rocprofv3/counter-collection/input1/validate.py index 1f3ee23d81..5f94e82628 100644 --- a/tests/rocprofv3/counter-collection/input1/validate.py +++ b/tests/rocprofv3/counter-collection/input1/validate.py @@ -2,15 +2,29 @@ import pandas as pd import sys import pytest +kernel_list = ["addition_kernel", "subtract_kernel", "multiply_kernel", "divide_kernel"] + def test_validate_counter_collection_pmc1(input_data: pd.DataFrame): df = input_data assert df.empty == False - assert df["Agent_Id"].map(type).eq(int).all() + assert (df["Agent_Id"].astype(int).values > 0).all() + assert (df["Queue_Id"].astype(int).values > 0).all() + assert (df["Process_Id"].astype(int).values > 0).all() assert len(df["Kernel-Name"]) > 0 - assert df["Kernel-Name"].str.contains("matrixTranspose").any() + df_list = df["Kernel-Name"].values.flatten().tolist() + # Check if each string in kernel_list is present at least once + missing_kernels = [] + for kernel in kernel_list: + if kernel not in df_list: + missing_kernels.append(kernel) + + assert ( + not missing_kernels + ), f"The following kernel names are missing from the out file: {missing_kernels}" assert df["Counter_Name"].str.contains("SQ_WAVES").all() + assert len(df["Counter_Value"]) > 0 if __name__ == "__main__":