SWDEV-388373 : plugins option validates plugin name

Change-Id: Id1aa810bb6f1f8e52fc0b2f2e5332dd44bf71708


[ROCm/rocprofiler commit: b817742d89]
Dieser Commit ist enthalten in:
gobhardw
2023-05-23 15:25:37 +05:30
committet von Gopesh Bhardwaj
Ursprung 31c6169af7
Commit 1ffdf1ed3c
2 geänderte Dateien mit 7 neuen und 0 gelöschten Zeilen
+1
Datei anzeigen
@@ -219,3 +219,4 @@ The resulting `a.out` will depend on
- rocprof in ROCm/5.4.1 fails to generate kernel info.
- rocprof clobbers LD_PRELOAD.
- Samples are fixed to show the new usage of phases.
- Plugin option validates the plugin names.
+6
Datei anzeigen
@@ -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