1diff --git a/bin/rocprofv2 b/bin/rocprofv2
2index 92f7489..8839d4d 100755
3--- a/bin/rocprofv2
4+++ b/bin/rocprofv2
5@@ -2,7 +2,8 @@
6 set -eo pipefail
7 CURRENT_DIR="$(dirname -- "$0")"
8 ROCPROFV2_DIR=$(dirname -- $(realpath ${BASH_SOURCE[0]}))
9-ROCM_DIR=$(dirname -- "$ROCPROFV2_DIR")
10+ROCPROFILER_DIR=$(dirname -- "$ROCPROFV2_DIR")
11+ROCM_DIR=@rocmtoolkit_merged@
12 PLUGIN_LIST=("ctf" "perfetto" "file" "att")
13 RUN_FROM_BUILD=0
14 if [[ $ROCPROFV2_DIR == *"/build"* ]]; then
15@@ -10,7 +11,7 @@ if [[ $ROCPROFV2_DIR == *"/build"* ]]; then
16 ROCM_DIR=$ROCPROFV2_DIR
17 fi
18
19-export ROCPROFILER_METRICS_PATH=$ROCM_DIR/libexec/rocprofiler/counters/derived_counters.xml
20+export ROCPROFILER_METRICS_PATH=$ROCPROFILER_DIR/libexec/rocprofiler/counters/derived_counters.xml
21 export LD_LIBRARY_PATH=$ROCM_DIR/lib:$LD_LIBRARY_PATH
22
23 usage() {
24@@ -70,8 +71,8 @@ while [ 1 ]; do
25 exit 1
26 fi
27 elif [[ "$1" = "--list-counters" ]]; then
28- export LD_PRELOAD=$LD_PRELOAD:$ROCM_DIR/lib/rocprofiler/librocprofiler_tool.so
29- eval $ROCM_DIR/libexec/rocprofiler/ctrl
30+ export LD_PRELOAD=$LD_PRELOAD:$ROCPROFILER_DIR/lib/rocprofiler/librocprofiler_tool.so
31+ eval $ROCPROFILER_DIR/libexec/rocprofiler/ctrl
32 exit 1
33 elif [[ "$1" = "-i" || "$1" = "--input" ]]; then
34 if [ $2 ] && [ -n $2 ] && [ -r $2 ]; then
35@@ -171,7 +172,7 @@ while [ 1 ]; do
36 if [ $RUN_FROM_BUILD == 1 ]; then
37 ATT_PATH=$ROCM_DIR/plugin/att/att/att.py
38 else
39- ATT_PATH=$ROCM_DIR/libexec/rocprofiler/att/att.py
40+ ATT_PATH=$ROCPROFILER_DIR/libexec/rocprofiler/att/att.py
41 export ROCPROFV2_ATT_LIB_PATH=$ROCM_DIR/lib/hsa-amd-aqlprofile/librocprofv2_att.so
42 fi
43 ATT_ARGV=$3
44@@ -236,13 +237,13 @@ if [ -n "$PMC_LINES" ] && [ ! -n "$ATT_ARGV" ]; then
45 export OUTPUT_PATH=$FINAL_PATH
46 fi
47 let COUNTER=COUNTER+1
48- LD_PRELOAD=$LD_PRELOAD:$ROCM_DIR/lib/rocprofiler/librocprofiler_tool.so $*
49+ LD_PRELOAD=$LD_PRELOAD:$ROCPROFILER_DIR/lib/rocprofiler/librocprofiler_tool.so $*
50 if [ -n "$OUTPUT_PATH" ]; then
51 echo -e "\nThe output path for the following counters: $OUTPUT_PATH"
52 fi
53 done
54 else
55- LD_PRELOAD=$LD_PRELOAD:$ROCM_DIR/lib/rocprofiler/librocprofiler_tool.so $*
56+ LD_PRELOAD=$LD_PRELOAD:$ROCPROFILER_DIR/lib/rocprofiler/librocprofiler_tool.so $*
57 fi
58
59 get_pmc_results_txt_path() {
60diff --git a/bin/rpl_run.sh b/bin/rpl_run.sh
61index c1a3daa..bc868a5 100755
62--- a/bin/rpl_run.sh
63+++ b/bin/rpl_run.sh
64@@ -24,16 +24,17 @@
65
66 time_stamp=`date +%y%m%d_%H%M%S`
67 BIN_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
68-ROOT_DIR=$(dirname $BIN_DIR)
69+ROCPROFILER_DIR=$(dirname $BIN_DIR)
70+ROOT_DIR=@rocmtoolkit_merged@
71 RUN_DIR=`pwd`
72 TMP_DIR="/tmp"
73 DATA_DIR="rpl_data_${time_stamp}_$$"
74
75-RPL_PATH=$ROOT_DIR/lib
76+RPL_PATH=$ROCPROFILER_DIR/lib
77 TLIB_PATH=$RPL_PATH/rocprofiler
78 TTLIB_PATH=$ROOT_DIR/lib/roctracer
79 ROCM_LIB_PATH=$ROOT_DIR/lib
80-PROF_BIN_DIR=$ROOT_DIR/libexec/rocprofiler
81+PROF_BIN_DIR=$ROCPROFILER_DIR/libexec/rocprofiler
82
83 if [ -z "$ROCP_PYTHON_VERSION" ] ; then
84 ROCP_PYTHON_VERSION=python3
85@@ -73,7 +74,7 @@ export ROCP_METRICS=$TLIB_PATH/metrics.xml
86 # Disable AQL-profile read API
87 export AQLPROFILE_READ_API=0
88 # ROC Profiler package path
89-export ROCP_PACKAGE_DIR=$ROOT_DIR
90+export ROCP_PACKAGE_DIR=$ROCPROFILER_DIR
91 # enabled SPM KFD mode
92 export ROCP_SPM_KFD_MODE=1
93
94@@ -350,7 +351,7 @@ convert_time_val() {
95
96 ################################################################################################
97 # main
98-echo "RPL: on '$time_stamp' from '$ROOT_DIR' in '$RUN_DIR'"
99+echo "RPL: on '$time_stamp' from '$ROCPROFILER_DIR' in '$RUN_DIR'"
100 # Parsing arguments
101 if [ -z "$1" ] ; then
102 usage
103@@ -557,7 +558,7 @@ elif [ "$input_type" = "txt" -o "$input_type" = "none" ] ; then
104 else
105 echo "<metric></metric>" > $RES_DIR/input.xml
106 fi
107- input_list=`/bin/ls $RES_DIR/input*.xml`
108+ input_list=`ls $RES_DIR/input*.xml`
109 export ROCPROFILER_SESS=$RES_DIR
110 else
111 fatal "Bad input file type '$INPUT_FILE'"