Adding JSON & Major fixes

Adding Chrome Tracing JSON for V2
Some fixes for the Kernel Dispatch tracing
Changes related to the HIP Runtime Destruction fix

Change-Id: I2fe1f1ef66b415df17c503a4a9fadcfa107d8c49


[ROCm/rocprofiler commit: b8726a6225]
This commit is contained in:
Ammar ELWazir
2024-05-17 12:53:59 +00:00
committed by Ammar Elwazir
parent d24a280079
commit d0dfb4f3e2
16 changed files with 26281 additions and 200 deletions
+7 -4
View File
@@ -8,7 +8,7 @@ if [ -n "${ROCP_PRELOAD}" ]; then LD_PRELOAD="${ROCP_PRELOAD}"; fi
CURRENT_DIR="$( dirname -- "$0"; )";
ROCPROFV2_DIR=$(dirname -- $(realpath ${BASH_SOURCE[0]}));
ROCM_DIR=$( dirname -- "$ROCPROFV2_DIR"; )
PLUGIN_LIST=("ctf" "perfetto" "file" "att" "cli")
PLUGIN_LIST=("ctf" "perfetto" "file" "att" "cli" "json")
RUN_FROM_BUILD=0
if [[ $ROCPROFV2_DIR == *"/build"* ]]; then
RUN_FROM_BUILD=1
@@ -42,10 +42,11 @@ usage() {
echo -e "${GREEN}--kernel-trace ${RESET} For Collecting Kernel dispatch Traces"
echo -e "${GREEN}--sys-trace ${RESET} For Collecting HIP and HSA APIs and their Activities Traces along ROCTX and Kernel Dispatch traces\n"
echo -e "\t#${GREY}usage e.g: rocprofv2 --[hip-trace|hsa-trace|roctx-trace|kernel-trace|sys-trace] <executable>\n"${RESET}
echo -e "${GREEN}--plugin ${RESET} PLUGIN_NAME For enabling a plugin (cli/file/perfetto/att/ctf)"
echo -e "\t#${GREY} usage(file/perfetto/ctf) e.g: rocprofv2 -i pmc.txt --plugin [file/perfetto/ctf] -d out_dir <executable>"
echo -e "${GREEN}--plugin ${RESET} PLUGIN_NAME For enabling a plugin (cli/file/perfetto/att/ctf/speedscope)"
echo -e "\t#${GREY} usage(file/perfetto/ctf) e.g: rocprofv2 -i pmc.txt --plugin [file/perfetto/ctf/json] -d out_dir <executable>"
echo -e "\t# usage(att): rocprofv2 <rocprofv2_params> --plugin att <ISA_file> <att_parameters> <executable>"
echo -e "\t# use \"rocprofv2 --plugin att --help\" for ATT-specific parameters help.${RESET}\n"
echo -e "\t# use \"rocprofv2 --plugin json --disable-json-data-flows ...\" for SpeedScope support as speedscope doesn't support data flows.${RESET}\n"
echo -e "${GREEN}--plugin-version ${RESET} <1|2> For selecting the version for the plugin (1/2)"
echo -e "\t#${GREY} 1 - Legacy output format, 2 - New output format (default)${RESET}\n"
echo -e "${GREEN}-i | --input ${RESET} For adding counters file path (every line in the text file represents a counter)"
@@ -157,7 +158,6 @@ while [ 1 ]; do
export ROCPROFILER_KERNEL_TRACE=1
shift
elif [ "$1" == "--sys-trace" ]; then
export ROCPROFILER_KERNEL_TRACE=1
export ROCPROFILER_HIP_API_TRACE=1
export ROCPROFILER_HIP_ACTIVITY_TRACE=1
export ROCPROFILER_HSA_API_TRACE=1
@@ -247,6 +247,9 @@ while [ 1 ]; do
fi
shift
shift
elif [ "$1" == "--disable-json-data-flows" ]; then
export ROCPROFILER_DISABLE_JSON_DATA_FLOWS=1
shift
elif [[ "$1" == "-"* || "$1" == "--"* ]]; then
echo -e "Wrong option \"$1\", Please use the following options:\n"
usage