SWDEV-388373 : plugins option validates plugin name

Change-Id: Id1aa810bb6f1f8e52fc0b2f2e5332dd44bf71708


[ROCm/rocprofiler commit: b817742d89]
This commit is contained in:
gobhardw
2023-05-23 15:25:37 +05:30
committed by Gopesh Bhardwaj
parent 31c6169af7
commit 1ffdf1ed3c
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -3,6 +3,7 @@ CURRENT_DIR="$( dirname -- "$0"; )";
ROCPROFV2_DIR=$(dirname -- $(realpath ${BASH_SOURCE[0]}));
ROCM_DIR=$(dirname -- ${ROCPROFV2_DIR})
ROCM_PATH="${ROCM_PATH:=/opt/rocm}"
PLUGIN_LIST=("ctf" "perfetto" "file" "att")
RUN_FROM_BUILD=0
if [[ $ROCPROFV2_DIR == *"/build"* ]]; then
RUN_FROM_BUILD=1
@@ -198,6 +199,11 @@ while [ 1 ] ; do
elif [ "$1" = "--plugin" ] ; then
if [ -n $2 ] ; then
PLUGIN=$2
if [[ ! "${PLUGIN_LIST[*]}" =~ $PLUGIN ]]; then
echo -e "Wrong input \"$2\" for plugin!"
usage
exit 1
fi
if [ $RUN_FROM_BUILD == 1 ]; then
export ROCPROFILER_PLUGIN_LIB=lib${PLUGIN}_plugin.so
else