summaryrefslogtreecommitdiff
path: root/dev-util/rocprofiler/files/rocprofiler-5.3.3-gentoo-location.patch
blob: 48e6f6973ac8ce0030e16c9eb0fc1d4f47c49594 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Index: rocprofiler-rocm-5.3.3/bin/rpl_run.sh
===================================================================
--- rocprofiler-rocm-5.3.3.orig/bin/rpl_run.sh
+++ rocprofiler-rocm-5.3.3/bin/rpl_run.sh
@@ -29,11 +29,12 @@ RUN_DIR=`pwd`
 TMP_DIR="/tmp"
 DATA_DIR="rpl_data_${time_stamp}_$$"
 
-RPL_PATH=$ROOT_DIR/lib
-TLIB_PATH=$RPL_PATH/rocprofiler
-TTLIB_PATH=$ROOT_DIR/lib/roctracer
-ROCM_LIB_PATH=$ROOT_DIR/lib
-PROF_BIN_DIR=$ROOT_DIR/libexec/rocprofiler
+RPL_PATH=$ROOT_DIR/@LIB_DIR@
+TLIB_PATH=$RPL_PATH
+TTLIB_PATH=$ROOT_DIR/@LIB_DIR@
+ROCM_LIB_PATH=$ROOT_DIR/@LIB_DIR@
+PROF_BIN_DIR=$ROOT_DIR/bin
+PROF_LIBEXEC_DIR=$ROOT_DIR/libexec/rocprofiler
 
 if [ -z "$ROCP_PYTHON_VERSION" ] ; then
   ROCP_PYTHON_VERSION=python3
@@ -69,7 +70,7 @@ export ROCP_HSA_INTERCEPT=1
 # Disabling internal ROC Profiler proxy queue (simple version supported for testing purposes)
 unset ROCP_PROXY_QUEUE
 # ROC Profiler metrics definition
-export ROCP_METRICS=$TLIB_PATH/metrics.xml
+export ROCP_METRICS=$ROOT_DIR/share/rocprofiler/metrics.xml
 # Disable AQL-profile read API
 export AQLPROFILE_READ_API=0
 # ROC Profiler package path
@@ -103,7 +104,7 @@ usage() {
   bin_name=`basename $0`
   echo "ROCm Profiling Library (RPL) run script, a part of ROCprofiler library package."
   echo "Full path: $BIN_DIR/$bin_name"
-  echo "Metrics definition: $TLIB_PATH/metrics.xml"
+  echo "Metrics definition: $ROOT_DIR/share/rocprofiler/metrics.xml"
   echo ""
   echo "Usage:"
   echo "  $bin_name [-h] [--list-basic] [--list-derived] [-i <input .txt/.xml file>] [-o <output CSV file>] <app command line>"
@@ -211,7 +212,7 @@ fi
 # setting ROCM_LIB_PATH
 set_rocm_lib_path() {
 
-  for ROCM_LIB_PATH in "$ROOT_DIR/lib" "$ROOT_DIR/lib64" ; do
+  for ROCM_LIB_PATH in $TLIB_PATH ; do
      if [ -d "$ROCM_LIB_PATH" ]; then
         return 0
      fi
@@ -385,11 +386,11 @@ while [ 1 ] ; do
     export ROCP_METRICS="$2"
   elif [ "$1" = "--list-basic" ] ; then
     export ROCP_INFO=b
-    HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$TLIB_PATH/rocprof-ctrl"
+    HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$PROF_BIN_DIR/rocprof-ctrl"
     exit 1
   elif [ "$1" = "--list-derived" ] ; then
     export ROCP_INFO=d
-    HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$TLIB_PATH/rocprof-ctrl"
+    HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$PROF_BIN_DIR/rocprof-ctrl"
     exit 1
   elif [ "$1" = "--basenames" ] ; then
     if [ "$2" = "on" ] ; then
@@ -550,7 +551,7 @@ elif [ "$input_type" = "txt" -o "$input_
   mkdir -p $RES_DIR
   echo "RPL: output dir '$RES_DIR'"
   if [ "$input_type" = "txt" ] ; then
-    $PROF_BIN_DIR/txt2xml.sh $INPUT_FILE $RES_DIR
+    $PROF_LIBEXEC_DIR/txt2xml.sh $INPUT_FILE $RES_DIR
   else
     echo "<metric></metric>" > $RES_DIR/input.xml
   fi
@@ -582,9 +583,9 @@ if [ -n "$csv_output" ] ; then
   merge_output $OUTPUT_LIST
   if [ "$GEN_STATS" = "1" ] ; then
     db_output=$(echo $csv_output | sed "s/\.csv/.db/")
-    $ROCP_PYTHON_VERSION $PROF_BIN_DIR/tblextr.py $db_output $OUTPUT_LIST
+    $ROCP_PYTHON_VERSION $PROF_LIBEXEC_DIR/tblextr.py $db_output $OUTPUT_LIST
   else
-    $ROCP_PYTHON_VERSION $PROF_BIN_DIR/tblextr.py $csv_output $OUTPUT_LIST
+    $ROCP_PYTHON_VERSION $PROF_LIBEXEC_DIR/tblextr.py $csv_output $OUTPUT_LIST
   fi
   if [ "$?" -ne 0 ] ; then
     echo "Profiling data corrupted: '$OUTPUT_LIST'" | tee "$ROCPROFILER_SESS/error"
Index: rocprofiler-rocm-5.3.3/CMakeLists.txt
===================================================================
--- rocprofiler-rocm-5.3.3.orig/CMakeLists.txt
+++ rocprofiler-rocm-5.3.3/CMakeLists.txt
@@ -159,10 +159,10 @@ install ( FILES
 install ( FILES
           ${CMAKE_CURRENT_SOURCE_DIR}/test/tool/metrics.xml
           ${CMAKE_CURRENT_SOURCE_DIR}/test/tool/gfx_metrics.xml
-          DESTINATION ${CMAKE_INSTALL_LIBDIR}/${DEST_NAME} )
+		  DESTINATION ${CMAKE_INSTALL_DATADIR}/${DEST_NAME} )
 # librocprof-tool.so
-install ( FILES ${PROJECT_BINARY_DIR}/test/librocprof-tool.so DESTINATION ${CMAKE_INSTALL_LIBDIR}/${DEST_NAME} )
-install ( FILES ${PROJECT_BINARY_DIR}/test/rocprof-ctrl DESTINATION ${CMAKE_INSTALL_LIBDIR}/${DEST_NAME}
+install ( FILES ${PROJECT_BINARY_DIR}/test/librocprof-tool.so DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+install ( FILES ${PROJECT_BINARY_DIR}/test/rocprof-ctrl DESTINATION ${CMAKE_INSTALL_BINDIR}
           PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE )
 
 # File reorg Backward compatibility