summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenda Xu <heroxbd@gentoo.org>2021-01-21 22:37:07 +0800
committerBenda Xu <heroxbd@gentoo.org>2021-01-24 15:43:03 +0800
commitd1e25273456a9f38b842f65e9c5bc1ac63c5c13d (patch)
treeae15ee4bd0a2706aea064a6c3a9500cd93363bff /dev-util/roctracer
parentdev-python/CppHeaderParser: Parse C++ header files (diff)
downloadgentoo-d1e25273456a9f38b842f65e9c5bc1ac63c5c13d.tar.gz
gentoo-d1e25273456a9f38b842f65e9c5bc1ac63c5c13d.tar.bz2
gentoo-d1e25273456a9f38b842f65e9c5bc1ac63c5c13d.zip
dev-util/roctracer: performance tracing for AMD GPUs.
Closes: https://github.com/gentoo/gentoo/pull/19148 Suggested-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Suggested-by: Wilfried Holzke <gentoo@holzke.net> Bug: https://bugs.gentoo.org/650804 Bug: https://github.com/gentoo/gentoo/pull/10724 Package-Manager: Portage-3.0.12, Repoman-3.0.1 Signed-off-by: Benda Xu <heroxbd@gentoo.org>
Diffstat (limited to 'dev-util/roctracer')
-rw-r--r--dev-util/roctracer/Manifest1
-rw-r--r--dev-util/roctracer/files/roctracer-3.8.0-gen_ostream_ops-toPython3.patch28
-rw-r--r--dev-util/roctracer/metadata.xml19
-rw-r--r--dev-util/roctracer/roctracer-4.0.0-r1.ebuild58
4 files changed, 106 insertions, 0 deletions
diff --git a/dev-util/roctracer/Manifest b/dev-util/roctracer/Manifest
new file mode 100644
index 000000000000..d6046052c242
--- /dev/null
+++ b/dev-util/roctracer/Manifest
@@ -0,0 +1 @@
+DIST rocm-tracer-4.0.0.tar.gz 462166 BLAKE2B 1294b5639a743a9d32737c72dc0f082b5a33ee1b3365f48221ad6392cdde7637926c42ea344fa96e9fc8410ea04e9ce3f535e188a25130f4be764c4d4a59b69c SHA512 312cd6c4c98a83e28a9f8b9e6123862af2e80a0d0852acff11be65d198f277c6ea194e72f6dbaccab1dd5d4af318bef28ca546e49440f22d024a546a4e5e9e15
diff --git a/dev-util/roctracer/files/roctracer-3.8.0-gen_ostream_ops-toPython3.patch b/dev-util/roctracer/files/roctracer-3.8.0-gen_ostream_ops-toPython3.patch
new file mode 100644
index 000000000000..b73949b92331
--- /dev/null
+++ b/dev-util/roctracer/files/roctracer-3.8.0-gen_ostream_ops-toPython3.patch
@@ -0,0 +1,28 @@
+--- a/script/gen_ostream_ops.py 2020-09-27 11:23:37.833756185 +0200
++++ b/script/gen_ostream_ops.py 2020-09-27 11:21:25.763756688 +0200
+@@ -176,9 +176,9 @@
+ process_struct(f, c, cppHeader, "", apiname)
+ global_str = "\n".join(global_str.split("\n")[0:-2])
+ if structs_depth != -1: #reindent
+- global_str = string.split(global_str, '\n')
+- global_str = [' ' + string.lstrip(line) for line in global_str]
+- global_str = string.join(global_str, '\n')
++ global_str = global_str.split('\n')
++ global_str = [' ' + line.lstrip() for line in global_str]
++ global_str = str.join('\n', global_str)
+ f.write(global_str+"\n")
+ if structs_depth != -1:
+ f.write(" };\n")
+@@ -199,9 +199,9 @@
+ process_struct(f, c, cppHeader, "", apiname)
+ global_str = "\n".join(global_str.split("\n")[0:-2])
+ if structs_depth != -1: #reindent
+- global_str = string.split(global_str, '\n')
+- global_str = [' ' + string.lstrip(line) for line in global_str]
+- global_str = string.join(global_str, '\n')
++ global_str = global_str.split('\n')
++ global_str = [' ' + line.lstrip() for line in global_str]
++ global_str = str.join('\n', global_str)
+ f.write(global_str+"\n")
+ if structs_depth != -1:
+ f.write(" };\n")
diff --git a/dev-util/roctracer/metadata.xml b/dev-util/roctracer/metadata.xml
new file mode 100644
index 000000000000..eec4ce34fdda
--- /dev/null
+++ b/dev-util/roctracer/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>candrews@gentoo.org</email>
+ <name>Craig Andrews</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>gentoo@holzke.net</email>
+ <name>Wilfried Holzke</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">ROCm-Developer-Tools/roctracer</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-util/roctracer/roctracer-4.0.0-r1.ebuild b/dev-util/roctracer/roctracer-4.0.0-r1.ebuild
new file mode 100644
index 000000000000..04c9a3080f20
--- /dev/null
+++ b/dev-util/roctracer/roctracer-4.0.0-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake prefix
+
+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/roctracer/archive/rocm-${PV}.tar.gz -> rocm-tracer-${PV}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="dev-libs/rocr-runtime
+ sys-devel/llvm-roc
+ dev-util/hip"
+DEPEND="dev-python/CppHeaderParser
+ dev-python/ply
+ ${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/roctracer-3.8.0-gen_ostream_ops-toPython3.patch"
+)
+
+S="${WORKDIR}/roctracer-rocm-${PV}"
+
+src_prepare() {
+ # do not build the tool and it´s library;
+ # change destination for headers to include/roctracer;
+ # do not install a second set of header files;
+ sed -e "/LIBRARY DESTINATION/s,lib,$(get_libdir)," \
+ -e "/add_subdirectory ( \${TEST_DIR} \${PROJECT_BINARY_DIR}/d" \
+ -e "/DESTINATION/s,\${DEST_NAME}/include,include/roctracer," \
+ -e "/install ( FILES \${CMAKE_CURRENT_SOURCE_DIR}/d" \
+ -e "/install ( FILES \${PROJECT_BINARY_DIR}/d" \
+ -i CMakeLists.txt || die
+
+ # do not download additional sources via git
+ sed -e "/execute_process ( COMMAND sh -xc \"if/d" \
+ -e "/add_subdirectory ( \${TEST_DIR} \${PROJECT_BINARY_DIR}/d" \
+ -i test/CMakeLists.txt || die
+
+ hprefixify script/*.py
+
+ eapply_user
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DHIP_VDI=1
+ -DCMAKE_PREFIX_PATH="${EPREFIX}/usr/include/hsa:${EPREFIX}/usr/lib"
+ )
+
+ cmake_src_configure
+}