SWDEV-391589: Addressing changes requested by Omniperf:

Adding Versioning to rocprof main script
Adding Versioning to file plugins to support legacy v1 output and new v2 output
Fixing headers for v2 output

Change-Id: I352e8c8ed03871466269a792d1bfa572da58bd8a
Este cometimento está contido em:
Ammar ELWazir criou e Ammar Elwazir cometeu 2023-10-16 15:19:20 -04:00
1 ascendente def7fa710a
cometimento 4f40fb8a40
13 ficheiros modificados
+605 -28

Não existem ficheiros que correspondam à sua pesquisa

+10 -3
Ver ficheiro
@@ -24,7 +24,7 @@ GREY='\033[0;90m'
RESET='\033[0m'
usage() {
echo -e "ROCProfilerV2 Run Script Usage:"
echo -e "${RESET}ROCProfilerV2 Run Script Usage:"
echo -e "${GREEN}-h | --help ${RESET} For showing this message"
echo -e "${GREEN}--list-counters ${RESET} For showing all available counters for the current GPUs"
if [ $RUN_FROM_BUILD == 1 ]; then
@@ -41,11 +41,12 @@ 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 (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 "\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 "${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)"
echo -e "\t#${GREY} usage: rocprofv2 -i pmc.txt -d <executable>${RESET}\n"
echo -e "${GREEN}-o | --output-file ${RESET} For the output file name"
@@ -177,6 +178,12 @@ while [ 1 ]; do
shift
elif [ "$1" = "--basenames" ]; then
export ROCPROFILER_TRUNCATE_KERNEL_PATH=1
elif [ "$1" = "--version" ]; then
shift
shift
elif [ "$1" = "--plugin-version" ]; then
export ROCPROFILER_PLUGIN_LIB=$ROCPROFILER_PLUGIN_LIB.$2
shift
shift
elif [ "$1" = "--plugin" ]; then
if [ -n $2 ]; then
@@ -186,7 +193,7 @@ while [ 1 ]; do
usage
exit 1
fi
export ROCPROFILER_PLUGIN_LIB=lib${PLUGIN}_plugin.so
export ROCPROFILER_PLUGIN_LIB=lib${PLUGIN}_plugin.so$ROCPROFILER_PLUGIN_LIB
else
echo -e "Wrong input \"$2\" for plugin!"
usage
+15 -1
Ver ficheiro
@@ -22,6 +22,7 @@
# THE SOFTWARE.
################################################################################
ROCPROF_ARGS="$*"
time_stamp=`date +%y%m%d_%H%M%S`
BIN_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
ROOT_DIR=$(dirname $BIN_DIR)
@@ -110,6 +111,9 @@ usage() {
echo ""
echo "Options:"
echo " -h - this help"
echo " --tool-version <1|2> - to use specific version of rocprof tool, by default v1 is used"
echo " 1 - rocprofiler tool v1"
echo " 2 - rocprofiler tool v2"
echo " --verbose - verbose mode, dumping all base counters used in the input metrics"
echo " --list-basic - to print the list of basic HW counters"
echo " --list-derived - to print the list of derived metrics with formulas"
@@ -367,7 +371,17 @@ ARG_IN=""
while [ 1 ] ; do
ARG_IN=$1
ARG_VAL=1
if [ "$1" = "-h" ] ; then
if [ "$1" = "--tool-version" ] ; then
if [ $2 = 1 ] ; then
:
elif [ $2 = 2 ] ; then
eval $BIN_DIR/rocprofv2 $ROCPROF_ARGS
exit 0
else
echo "Wrong option '$1 $2'"
usage
fi
elif [ "$1" = "-h" ] ; then
usage
elif [ "$1" = "-i" ] ; then
INPUT_FILE="$2"