From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 675D4158091 for ; Mon, 13 Jun 2022 12:01:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 12B3BE086C; Mon, 13 Jun 2022 12:01:00 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BB507E0839 for ; Mon, 13 Jun 2022 12:00:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CAFE734188A for ; Mon, 13 Jun 2022 12:00:58 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1549C4FB for ; Mon, 13 Jun 2022 12:00:57 +0000 (UTC) From: "Benda XU" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Benda XU" Message-ID: <1655121649.dc49ab61dfce7423b1cd908788a6630aa53b64e3.heroxbd@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/rocprofiler/, dev-util/rocprofiler/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-util/rocprofiler/Manifest dev-util/rocprofiler/files/rocprofiler-4.3.0-fix-gcc11.patch dev-util/rocprofiler/files/rocprofiler-4.3.0-gentoo-location.patch dev-util/rocprofiler/files/rocprofiler-5.0.2-gentoo-location.patch dev-util/rocprofiler/metadata.xml dev-util/rocprofiler/rocprofiler-4.3.0.ebuild dev-util/rocprofiler/rocprofiler-5.0.2.ebuild X-VCS-Directories: dev-util/rocprofiler/ dev-util/rocprofiler/files/ X-VCS-Committer: heroxbd X-VCS-Committer-Name: Benda XU X-VCS-Revision: dc49ab61dfce7423b1cd908788a6630aa53b64e3 X-VCS-Branch: master Date: Mon, 13 Jun 2022 12:00:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e32b9af2-e8af-45bf-8426-90aa40157bbc X-Archives-Hash: 7f862ae58d9c23a57c8adf77bfaa3abe commit: dc49ab61dfce7423b1cd908788a6630aa53b64e3 Author: Yiyang Wu gmail com> AuthorDate: Tue May 10 14:45:42 2022 +0000 Commit: Benda XU gentoo org> CommitDate: Mon Jun 13 12:00:49 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc49ab61 dev-util/rocprofiler: initial import Closes: https://github.com/gentoo/gentoo/pull/25536 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Yiyang Wu gmail.com> Signed-off-by: Benda Xu gentoo.org> dev-util/rocprofiler/Manifest | 2 + .../files/rocprofiler-4.3.0-fix-gcc11.patch | 13 ++++ .../files/rocprofiler-4.3.0-gentoo-location.patch | 71 ++++++++++++++++++++++ .../files/rocprofiler-5.0.2-gentoo-location.patch | 59 ++++++++++++++++++ dev-util/rocprofiler/metadata.xml | 15 +++++ dev-util/rocprofiler/rocprofiler-4.3.0.ebuild | 58 ++++++++++++++++++ dev-util/rocprofiler/rocprofiler-5.0.2.ebuild | 57 +++++++++++++++++ 7 files changed, 275 insertions(+) diff --git a/dev-util/rocprofiler/Manifest b/dev-util/rocprofiler/Manifest new file mode 100644 index 000000000000..ad88feaed619 --- /dev/null +++ b/dev-util/rocprofiler/Manifest @@ -0,0 +1,2 @@ +DIST rocprofiler-4.3.0.tar.gz 1402250 BLAKE2B 3826c3b26b0d5838ab3475614c2ecd2265e177fe40b8a90abb491746513bd50841e5ceb34d1fcb4bcb2fbe8a6854b9715d0670d38f08775e5e14cd855f15629b SHA512 e327146604459f2f827ab943a21d0eaa0ee41cf6770ab94dd019d461cf6438e70a48139ce67ec1553d0f450fa5bb233a7ed39438e8bf39b33218d53e2c270d3b +DIST rocprofiler-5.0.2.tar.gz 1401732 BLAKE2B ae870bc50dbd39c11e24f77ccb41773df1107b76cb7a12e1cebc66f8d66ddba6ad3bd6f9fe61657b03b22ef35f88fb608cf6070178f6aab24fe7a1bdcac43a96 SHA512 244e2b827126b7299ec0510daa5e1245a4a5a877394419f8bc9113f443231f67fc935609cbde6eeb26bb138ab4e95e2a88829ffa79ecc8f9881b5a77b5910c02 diff --git a/dev-util/rocprofiler/files/rocprofiler-4.3.0-fix-gcc11.patch b/dev-util/rocprofiler/files/rocprofiler-4.3.0-fix-gcc11.patch new file mode 100644 index 000000000000..0aec99627a4a --- /dev/null +++ b/dev-util/rocprofiler/files/rocprofiler-4.3.0-fix-gcc11.patch @@ -0,0 +1,13 @@ +Index: rocprofiler-rocm-4.3.0/test/ctrl/test_kernel.h +=================================================================== +--- rocprofiler-rocm-4.3.0.orig/test/ctrl/test_kernel.h ++++ rocprofiler-rocm-4.3.0/test/ctrl/test_kernel.h +@@ -23,7 +23,7 @@ THE SOFTWARE. + #ifndef TEST_CTRL_TEST_KERNEL_H_ + #define TEST_CTRL_TEST_KERNEL_H_ + +-#include ++#include + #include + #include + diff --git a/dev-util/rocprofiler/files/rocprofiler-4.3.0-gentoo-location.patch b/dev-util/rocprofiler/files/rocprofiler-4.3.0-gentoo-location.patch new file mode 100644 index 000000000000..b6d8454dfedd --- /dev/null +++ b/dev-util/rocprofiler/files/rocprofiler-4.3.0-gentoo-location.patch @@ -0,0 +1,71 @@ +Index: rocprofiler-rocm-4.3.0/bin/rpl_run.sh +=================================================================== +--- rocprofiler-rocm-4.3.0.orig/bin/rpl_run.sh ++++ rocprofiler-rocm-4.3.0/bin/rpl_run.sh +@@ -25,18 +25,18 @@ + time_stamp=`date +%y%m%d_%H%M%S` + BIN_DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) + PKG_DIR=$(dirname $BIN_DIR) +-ROOT_DIR=$(dirname $PKG_DIR) +-TT_DIR=$ROOT_DIR/roctracer ++ROOT_DIR=$PKG_DIR ++TT_DIR=$ROOT_DIR + RUN_DIR=`pwd` + TMP_DIR="/tmp" + DATA_DIR="rpl_data_${time_stamp}_$$" + +-RPL_PATH=$PKG_DIR/lib +-TLIB_PATH=$PKG_DIR/tool +-TTLIB_PATH=$TT_DIR/tool +-ROCM_LIB_PATH=$ROOT_DIR/lib ++RPL_PATH=$PKG_DIR/@LIB_DIR@ ++TLIB_PATH=$PKG_DIR/@LIB_DIR@ ++TTLIB_PATH=$TT_DIR/@LIB_DIR@ ++ROCM_LIB_PATH=$ROOT_DIR/@LIB_DIR@ + +-GFX=`/opt/rocm/bin/rocm_agent_enumerator | tail -1` ++GFX=`rocm_agent_enumerator | tail -1` + + SPM_COUNTERS_FILE="spm_counters.txt" + +@@ -75,7 +75,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=$PKG_DIR/lib/metrics.xml ++export ROCP_METRICS=$PKG_DIR/share/rocprofiler/metrics.xml + # Disable AQL-profile read API + export AQLPROFILE_READ_API=0 + # ROC Profiler package path +@@ -109,7 +109,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: $PKG_DIR/lib/metrics.xml" ++ echo "Metrics definition: $PKG_DIR/share/rocprofiler/metrics.xml" + echo "" + echo "Usage:" + echo " $bin_name [-h] [--list-basic] [--list-derived] [-i ] [-o ] " +@@ -270,7 +270,7 @@ run() { + fi + if [ "$KFD_TRACE" = 1 ] ; then + API_TRACE=${API_TRACE}":kfd" +- MY_LD_PRELOAD="$TT_DIR/lib/libkfdwrapper64.so $ROCM_LIB_PATH/libhsakmt.so.1 $MY_LD_PRELOAD" ++ MY_LD_PRELOAD="$TTLIB_PATH/libkfdwrapper64.so $ROCM_LIB_PATH/libhsakmt.so.1 $MY_LD_PRELOAD" + fi + if [ "$HIP_TRACE" = 1 ] ; then + API_TRACE=${API_TRACE}":hip" +@@ -380,11 +380,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 "$PKG_DIR/tool/ctrl" ++ HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$PKG_DIR/bin/ctrl" + exit 1 + elif [ "$1" = "--list-derived" ] ; then + export ROCP_INFO=d +- HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$PKG_DIR/tool/ctrl" ++ HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$PKG_DIR/bin/ctrl" + exit 1 + elif [ "$1" = "--basenames" ] ; then + if [ "$2" = "on" ] ; then diff --git a/dev-util/rocprofiler/files/rocprofiler-5.0.2-gentoo-location.patch b/dev-util/rocprofiler/files/rocprofiler-5.0.2-gentoo-location.patch new file mode 100644 index 000000000000..0605675e41c6 --- /dev/null +++ b/dev-util/rocprofiler/files/rocprofiler-5.0.2-gentoo-location.patch @@ -0,0 +1,59 @@ +Index: rocprofiler-rocm-5.0.2/bin/rpl_run.sh +=================================================================== +--- rocprofiler-rocm-5.0.2.orig/bin/rpl_run.sh ++++ rocprofiler-rocm-5.0.2/bin/rpl_run.sh +@@ -25,16 +25,16 @@ + time_stamp=`date +%y%m%d_%H%M%S` + BIN_DIR=$(dirname $(realpath ${BASH_SOURCE[0]})) + PKG_DIR=$(dirname $BIN_DIR) +-ROOT_DIR=$(dirname $PKG_DIR) +-TT_DIR=$ROOT_DIR/roctracer ++ROOT_DIR=$PKG_DIR ++TT_DIR=ROOT_DIR + RUN_DIR=`pwd` + TMP_DIR="/tmp" + DATA_DIR="rpl_data_${time_stamp}_$$" + +-RPL_PATH=$PKG_DIR/lib +-TLIB_PATH=$PKG_DIR/tool +-TTLIB_PATH=$TT_DIR/tool +-ROCM_LIB_PATH=$ROOT_DIR/lib ++RPL_PATH=$PKG_DIR/@LIB_DIR@ ++TLIB_PATH=$PKG_DIR/@LIB_DIR@ ++TTLIB_PATH=$TT_DIR/@LIB_DIR@ ++ROCM_LIB_PATH=$ROOT_DIR/@LIB_DIR@ + + if [ -z "$ROCP_PYTHON_VERSION" ] ; then + ROCP_PYTHON_VERSION=python3 +@@ -70,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=$PKG_DIR/lib/metrics.xml ++export ROCP_METRICS=$PKG_DIR/share/rocprofiler/metrics.xml + # Disable AQL-profile read API + export AQLPROFILE_READ_API=0 + # ROC Profiler package path +@@ -104,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: $PKG_DIR/lib/metrics.xml" ++ echo "Metrics definition: $PKG_DIR/share/rocprofiler/metrics.xml" + echo "" + echo "Usage:" + echo " $bin_name [-h] [--list-basic] [--list-derived] [-i ] [-o ] " +@@ -374,11 +374,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 "$PKG_DIR/tool/ctrl" ++ HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$PKG_DIR/bin/ctrl" + exit 1 + elif [ "$1" = "--list-derived" ] ; then + export ROCP_INFO=d +- HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$PKG_DIR/tool/ctrl" ++ HSA_TOOLS_LIB="$MY_HSA_TOOLS_LIB" eval "$PKG_DIR/bin/ctrl" + exit 1 + elif [ "$1" = "--basenames" ] ; then + if [ "$2" = "on" ] ; then diff --git a/dev-util/rocprofiler/metadata.xml b/dev-util/rocprofiler/metadata.xml new file mode 100644 index 000000000000..922afe7981b0 --- /dev/null +++ b/dev-util/rocprofiler/metadata.xml @@ -0,0 +1,15 @@ + + + + + sci@gentoo.org + Gentoo Science Project + + + xgreenlandforwyy@gmail.com + Yiyang Wu + + + ROCm-Developer-Tools/rocprofiler + + diff --git a/dev-util/rocprofiler/rocprofiler-4.3.0.ebuild b/dev-util/rocprofiler/rocprofiler-4.3.0.ebuild new file mode 100644 index 000000000000..28e57bde66a4 --- /dev/null +++ b/dev-util/rocprofiler/rocprofiler-4.3.0.ebuild @@ -0,0 +1,58 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) + +inherit cmake python-any-r1 + +DESCRIPTION="Callback/Activity Library for Performance tracing AMD GPU's" +HOMEPAGE="https://github.com/ROCm-Developer-Tools/roctracer.git" +SRC_URI="https://github.com/ROCm-Developer-Tools/${PN}/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +RDEPEND="dev-libs/rocr-runtime:${SLOT} + dev-util/roctracer:${SLOT} + " +DEPEND="${RDEPEND}" +BDEPEND=" + $(python_gen_any_dep ' + dev-python/CppHeaderParser[${PYTHON_USEDEP}] + ') +" + +PATCHES=( "${FILESDIR}/${P}-fix-gcc11.patch" + "${FILESDIR}/${PN}-4.3.0-gentoo-location.patch" ) + +python_check_deps() { + has_version "dev-python/CppHeaderParser[${PYTHON_USEDEP}]" +} + +src_prepare() { + sed -e "s,\${DEST_NAME}/lib,$(get_libdir),g" \ + -e "s,\${DEST_NAME}/include,include/\${DEST_NAME},g" \ + -e "s,\${DEST_NAME}/bin,bin,g" \ + -e "/ctrl DESTINATION/s,\${DEST_NAME}/tool,bin,g" \ + -e "/CPACK_RESOURCE_FILE_LICENSE/d" \ + -e "/libtool.so DESTINATION/s,\${DEST_NAME}/tool,$(get_libdir),g" -i CMakeLists.txt || die + + cmake_src_prepare + + sed -e "s,@LIB_DIR@,$(get_libdir),g" -i bin/rpl_run.sh || die +} + +src_configure() { + local mycmakeargs=( + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/include/hsa" + -DPROF_API_HEADER_PATH="${EPREFIX}"/usr/include/roctracer/ext + -DUSE_PROF_API=1 + ) + + cmake_src_configure +} diff --git a/dev-util/rocprofiler/rocprofiler-5.0.2.ebuild b/dev-util/rocprofiler/rocprofiler-5.0.2.ebuild new file mode 100644 index 000000000000..ff321726622e --- /dev/null +++ b/dev-util/rocprofiler/rocprofiler-5.0.2.ebuild @@ -0,0 +1,57 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{8..10} ) + +inherit cmake python-any-r1 + +DESCRIPTION="Callback/Activity Library for Performance tracing AMD GPU's" +HOMEPAGE="https://github.com/ROCm-Developer-Tools/roctracer.git" +SRC_URI="https://github.com/ROCm-Developer-Tools/${PN}/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +RDEPEND="dev-libs/rocr-runtime:${SLOT} + dev-util/roctracer:${SLOT} + " +DEPEND="${RDEPEND}" +BDEPEND=" + $(python_gen_any_dep ' + dev-python/CppHeaderParser[${PYTHON_USEDEP}] + ') +" + +PATCHES=( "${FILESDIR}/${PN}-5.0.2-gentoo-location.patch" ) + +python_check_deps() { + has_version "dev-python/CppHeaderParser[${PYTHON_USEDEP}]" +} + +src_prepare() { + sed -e "s,\${DEST_NAME}/lib,$(get_libdir),g" \ + -e "s,\${DEST_NAME}/include,include/\${DEST_NAME},g" \ + -e "s,\${DEST_NAME}/bin,bin,g" \ + -e "/ctrl DESTINATION/s,\${DEST_NAME}/tool,bin,g" \ + -e "/CPACK_RESOURCE_FILE_LICENSE/d" \ + -e "/libtool.so DESTINATION/s,\${DEST_NAME}/tool,$(get_libdir),g" -i CMakeLists.txt || die + + cmake_src_prepare + + sed -e "s,@LIB_DIR@,$(get_libdir),g" -i bin/rpl_run.sh || die +} + +src_configure() { + local mycmakeargs=( + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/include/hsa" + -DPROF_API_HEADER_PATH="${EPREFIX}"/usr/include/roctracer/ext + -DUSE_PROF_API=1 + ) + + cmake_src_configure +}