profiled cmd line quoting option

Change-Id: I576065eb289b59829978c7a2acf74799b68bc213
This commit is contained in:
Evgeny
2019-11-08 21:13:44 -06:00
committato da Evgeny Shcherbakov
parent d8560ae0b3
commit b9989fb33c
+20 -8
Vedi File
@@ -53,6 +53,9 @@ HIP_TRACE=0
# Generate stats
GEN_STATS=0
# Quoting profiled cmd line
CMD_QTS=1
export PATH=.:$PATH
# enable error logging
@@ -113,6 +116,7 @@ usage() {
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"
echo " --cmd-qts <on|off> - quoting profiled cmd line [on]"
echo ""
echo " -i <.txt|.xml file> - input file"
echo " Input file .txt format, automatically rerun application for every profiling features line:"
@@ -393,6 +397,10 @@ while [ 1 ] ; do
elif [ "$1" = "--verbose" ] ; then
ARG_VAL=0
export ROCP_VERBOSE_MODE=1
elif [ "$1" = "--cmd-qts" ] ; then
if [ "$2" = "off" ] ; then
CMD_QTS=0
fi
else
break
fi
@@ -431,14 +439,18 @@ else
csv_output=$RUN_DIR/${input_base}.csv
fi
APP_CMD=""
for i in `seq 1 $#`; do
if [ -n "$APP_CMD" ] ; then
APP_CMD=$APP_CMD" "
fi
eval "arg=\${$i}"
APP_CMD=$APP_CMD\"$arg\"
done
# Profiled cmd line string
APP_CMD=$*
if [ "$CMD_QTS" = 1 ] ; then
APP_CMD=""
for i in `seq 1 $#`; do
if [ -n "$APP_CMD" ] ; then
APP_CMD=$APP_CMD" "
fi
eval "arg=\${$i}"
APP_CMD=$APP_CMD\"$arg\"
done
fi
echo "RPL: profiling '$APP_CMD'"
echo "RPL: input file '$INPUT_FILE'"