public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Patrick McLean" <chutzpah@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/files/, dev-util/bpftrace/
Date: Tue, 12 Mar 2019 02:16:19 +0000 (UTC)	[thread overview]
Message-ID: <1552356959.8ba9e3e616b62ef293d2223b347e2cea6e25b1eb.chutzpah@gentoo> (raw)

commit:     8ba9e3e616b62ef293d2223b347e2cea6e25b1eb
Author:     Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Tue Mar 12 02:15:59 2019 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Mar 12 02:15:59 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ba9e3e6

dev-util/bpftrace: New package

Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 dev-util/bpftrace/Manifest                         |   1 +
 dev-util/bpftrace/bpftrace-0.9_pre20190311.ebuild  |  58 +++++++++++
 dev-util/bpftrace/bpftrace-9999.ebuild             |  58 +++++++++++
 .../files/bpftrace-0.9_pre20190311-bcc-0.9.patch   |  13 +++
 .../bpftrace-0.9_pre20190311-install-libs.patch    | 111 +++++++++++++++++++++
 dev-util/bpftrace/files/bpftrace-mandir.patch      |  22 ++++
 dev-util/bpftrace/metadata.xml                     |  10 ++
 7 files changed, 273 insertions(+)

diff --git a/dev-util/bpftrace/Manifest b/dev-util/bpftrace/Manifest
new file mode 100644
index 00000000000..fbf71324c93
--- /dev/null
+++ b/dev-util/bpftrace/Manifest
@@ -0,0 +1 @@
+DIST bpftrace-0.9_pre20190311.tar.xz 613856 BLAKE2B 7f670647305e61d9a11a87be44bc2228fee6b474bd920b460ecd6375f23d371e2cc8b0bb22eb4473807b92fc44c4f13eb3be72d048f75f3f59e814c201eddba6 SHA512 7091b16ef1dafdc75dd8e6f172da68ea31d0a89ad42192dc86ced6d22a3c200a385a3e63f5a829cfad42ee5ba44e806b50ac450d17a96ef438ed5668d5b0c55f

diff --git a/dev-util/bpftrace/bpftrace-0.9_pre20190311.ebuild b/dev-util/bpftrace/bpftrace-0.9_pre20190311.ebuild
new file mode 100644
index 00000000000..1f874815e93
--- /dev/null
+++ b/dev-util/bpftrace/bpftrace-0.9_pre20190311.ebuild
@@ -0,0 +1,58 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs cmake-utils
+
+DESCRIPTION="High-level tracing language for eBPF"
+HOMEPAGE="https://github.com/iovisor/bpftrace"
+
+if [[ ${PV} =~ 9{4,} ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/iovisor/${PN}"
+	BDEPEND=""
+else
+	SRC_URI="mirror://gentoo/${P}.tar.xz"
+	#SRC_URI="https://github.com/iovisor/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64 ~x86"
+	BDEPEND="app-arch/xz-utils "
+fi
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="test"
+
+COMMON_DEPEND="sys-devel/clang:=
+	>=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
+	>=dev-util/bcc-0.9.0:=
+	virtual/libelf"
+DEPEND="${COMMON_DEPEND}
+	test? ( dev-cpp/gtest )"
+RDEPEND="${COMMON_DEPEND}"
+BDEPEND+="dev-util/cmake
+	sys-devel/flex
+	sys-devel/bison"
+
+PATCHES=(
+	"${FILESDIR}/bpftrace-0.9_pre20190311-bcc-0.9.patch"
+	"${FILESDIR}/bpftrace-0.9_pre20190311-install-libs.patch"
+	"${FILESDIR}/bpftrace-mandir.patch"
+)
+
+# lots of fixing needed
+RESTRICT="test"
+
+src_prepare() {
+	cmake-utils_src_prepare
+}
+
+src_configure() {
+	local -a mycmakeargs
+	mycmakeargs=(
+		"-DSTATIC_LINKING:BOOL=OFF"
+		"-DBUILD_TESTING:BOOL=OFF"
+	)
+
+	cmake-utils_src_configure
+}

diff --git a/dev-util/bpftrace/bpftrace-9999.ebuild b/dev-util/bpftrace/bpftrace-9999.ebuild
new file mode 100644
index 00000000000..1f874815e93
--- /dev/null
+++ b/dev-util/bpftrace/bpftrace-9999.ebuild
@@ -0,0 +1,58 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs cmake-utils
+
+DESCRIPTION="High-level tracing language for eBPF"
+HOMEPAGE="https://github.com/iovisor/bpftrace"
+
+if [[ ${PV} =~ 9{4,} ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/iovisor/${PN}"
+	BDEPEND=""
+else
+	SRC_URI="mirror://gentoo/${P}.tar.xz"
+	#SRC_URI="https://github.com/iovisor/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64 ~x86"
+	BDEPEND="app-arch/xz-utils "
+fi
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="test"
+
+COMMON_DEPEND="sys-devel/clang:=
+	>=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
+	>=dev-util/bcc-0.9.0:=
+	virtual/libelf"
+DEPEND="${COMMON_DEPEND}
+	test? ( dev-cpp/gtest )"
+RDEPEND="${COMMON_DEPEND}"
+BDEPEND+="dev-util/cmake
+	sys-devel/flex
+	sys-devel/bison"
+
+PATCHES=(
+	"${FILESDIR}/bpftrace-0.9_pre20190311-bcc-0.9.patch"
+	"${FILESDIR}/bpftrace-0.9_pre20190311-install-libs.patch"
+	"${FILESDIR}/bpftrace-mandir.patch"
+)
+
+# lots of fixing needed
+RESTRICT="test"
+
+src_prepare() {
+	cmake-utils_src_prepare
+}
+
+src_configure() {
+	local -a mycmakeargs
+	mycmakeargs=(
+		"-DSTATIC_LINKING:BOOL=OFF"
+		"-DBUILD_TESTING:BOOL=OFF"
+	)
+
+	cmake-utils_src_configure
+}

diff --git a/dev-util/bpftrace/files/bpftrace-0.9_pre20190311-bcc-0.9.patch b/dev-util/bpftrace/files/bpftrace-0.9_pre20190311-bcc-0.9.patch
new file mode 100644
index 00000000000..0f3706fadf5
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.9_pre20190311-bcc-0.9.patch
@@ -0,0 +1,13 @@
+diff --git a/src/attached_probe.cpp b/src/attached_probe.cpp
+index d7905cd..adbd40c 100644
+--- a/src/attached_probe.cpp
++++ b/src/attached_probe.cpp
+@@ -376,7 +376,7 @@ void AttachedProbe::load_prog()
+ void AttachedProbe::attach_kprobe()
+ {
+   int perf_event_fd = bpf_attach_kprobe(progfd_, attachtype(probe_.type),
+-      eventname().c_str(), probe_.attach_point.c_str(), 0);
++      eventname().c_str(), probe_.attach_point.c_str(), 0, -1);
+ 
+   if (perf_event_fd < 0) {
+     if (probe_.orig_name != probe_.name) {

diff --git a/dev-util/bpftrace/files/bpftrace-0.9_pre20190311-install-libs.patch b/dev-util/bpftrace/files/bpftrace-0.9_pre20190311-install-libs.patch
new file mode 100644
index 00000000000..68bd8255944
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-0.9_pre20190311-install-libs.patch
@@ -0,0 +1,111 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8ff6e1f..a276ba2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -43,9 +43,10 @@ find_package(FLEX REQUIRED)
+ bison_target(bison_parser src/parser.yy ${CMAKE_BINARY_DIR}/parser.tab.cc)
+ flex_target(flex_lexer src/lexer.l ${CMAKE_BINARY_DIR}/lex.yy.cc)
+ add_flex_bison_dependency(flex_lexer bison_parser)
+-add_library(parser ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS})
+-target_compile_options(parser PRIVATE "-w")
+-target_include_directories(parser PUBLIC src src/ast ${CMAKE_BINARY_DIR})
++add_library(bpftraceparser ${BISON_bison_parser_OUTPUTS} ${FLEX_flex_lexer_OUTPUTS})
++target_compile_options(bpftraceparser PRIVATE "-w")
++target_include_directories(bpftraceparser PUBLIC src src/ast ${CMAKE_BINARY_DIR})
++install(TARGETS bpftraceparser LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt
+index b8b0d96..0803c1e 100644
+--- a/resources/CMakeLists.txt
++++ b/resources/CMakeLists.txt
+@@ -1,6 +1,7 @@
+-add_library(resources headers.cpp)
++add_library(bpftraceresources headers.cpp)
+ 
+-target_include_directories(resources PUBLIC ../src)
++target_include_directories(bpftraceresources PUBLIC ../src)
++install(TARGETS bpftraceresources LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+ function(embed_headers output)
+   file(WRITE ${output} "#include \"headers.h\"\n\nnamespace bpftrace {\n")
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index b47f66d..36de26b 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -27,7 +27,8 @@ endif(HAVE_BCC_CREATE_MAP)
+ if(HAVE_GET_CURRENT_CGROUP_ID)
+   target_compile_definitions(bpftrace PRIVATE HAVE_GET_CURRENT_CGROUP_ID)
+ endif(HAVE_GET_CURRENT_CGROUP_ID)
+-target_link_libraries(bpftrace arch ast parser resources)
++target_link_libraries(bpftrace bpftracearch bpftraceast bpftraceparser
++	bpftraceresources)
+ 
+ if (STATIC_LINKING)
+   target_link_libraries(bpftrace ${LIBBCC_LIBRARIES})
+diff --git a/src/arch/CMakeLists.txt b/src/arch/CMakeLists.txt
+index 425926e..13b5d31 100644
+--- a/src/arch/CMakeLists.txt
++++ b/src/arch/CMakeLists.txt
+@@ -1,5 +1,7 @@
+ if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
+-    add_library(arch aarch64.cpp)
++    add_library(bpftracearch aarch64.cpp)
+ else()
+-    add_library(arch x86_64.cpp)
++    add_library(bpftracearch x86_64.cpp)
+ endif()
++
++install(TARGETS bpftracearch LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff --git a/src/ast/CMakeLists.txt b/src/ast/CMakeLists.txt
+index 64db7b9..1a2eb6e 100644
+--- a/src/ast/CMakeLists.txt
++++ b/src/ast/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-add_library(ast
++add_library(bpftraceast
+   ast.cpp
+   codegen_llvm.cpp
+   irbuilderbpf.cpp
+@@ -6,12 +6,13 @@ add_library(ast
+   semantic_analyser.cpp
+ )
+ 
+-target_include_directories(ast PUBLIC ${CMAKE_SOURCE_DIR}/src)
+-target_include_directories(ast PUBLIC ${CMAKE_SOURCE_DIR}/src/ast)
+-target_include_directories(ast PUBLIC ${CMAKE_BINARY_DIR})
+-target_link_libraries(ast arch)
++target_include_directories(bpftraceast PUBLIC ${CMAKE_SOURCE_DIR}/src)
++target_include_directories(bpftraceast PUBLIC ${CMAKE_SOURCE_DIR}/src/ast)
++target_include_directories(bpftraceast PUBLIC ${CMAKE_BINARY_DIR})
++target_link_libraries(bpftraceast bpftracearch)
+ 
+-add_dependencies(ast parser)
++add_dependencies(bpftraceast bpftraceparser)
++install(TARGETS bpftraceast LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+ if (STATIC_LINKING)
+   set(clang_libs
+@@ -31,16 +32,16 @@ if (STATIC_LINKING)
+       clangSerialization
+       clangToolingCore)
+   llvm_map_components_to_libnames(llvm_libs bpfcodegen ipo irreader mcjit orcjit ${LLVM_TARGETS_TO_BUILD})
+-  target_link_libraries(ast ${clang_libs})
+-  target_link_libraries(ast ${llvm_libs})
++  target_link_libraries(bpftraceast ${clang_libs})
++  target_link_libraries(bpftraceast ${llvm_libs})
+ else()
+   find_library(found_LLVM LLVM HINTS ${LLVM_LIBRARY_DIRS})
+   if(found_LLVM)
+-    target_link_libraries(ast LLVM)
++    target_link_libraries(bpftraceast LLVM)
+   else()
+     llvm_map_components_to_libnames(_llvm_libs bpfcodegen ipo irreader mcjit orcjit ${LLVM_TARGETS_TO_BUILD})
+     llvm_expand_dependencies(llvm_libs ${_llvm_libs})
+-    target_link_libraries(ast ${llvm_libs})
++    target_link_libraries(bpftraceast ${llvm_libs})
+   endif()
+-  target_link_libraries(ast libclang)
++  target_link_libraries(bpftraceast libclang)
+ endif()

diff --git a/dev-util/bpftrace/files/bpftrace-mandir.patch b/dev-util/bpftrace/files/bpftrace-mandir.patch
new file mode 100644
index 00000000000..d18c1e2f321
--- /dev/null
+++ b/dev-util/bpftrace/files/bpftrace-mandir.patch
@@ -0,0 +1,22 @@
+diff --git a/man/man8/CMakeLists.txt b/man/man8/CMakeLists.txt
+index 45cfe5d..d13229e 100644
+--- a/man/man8/CMakeLists.txt
++++ b/man/man8/CMakeLists.txt
+@@ -1,12 +1,12 @@
+-find_program(GZIP gzip)
++find_program(CAT cat)
+ file(GLOB FILES *.8)
+ set(GZFILES "")
+ foreach(FIL ${FILES})
+   get_filename_component(NAME ${FIL} NAME)
+-  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz
+-    COMMAND ${GZIP} -c ${FIL} > ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz
++  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}
++    COMMAND ${CAT} ${FIL} > ${CMAKE_CURRENT_BINARY_DIR}/${NAME}
+     DEPENDS ${FIL})
+-  list(APPEND GZFILES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz")
++  list(APPEND GZFILES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}")
+ endforeach()
+ add_custom_target(man ALL DEPENDS ${GZFILES})
+-install(FILES ${GZFILES} DESTINATION man/man8)
++install(FILES ${GZFILES} DESTINATION share/man/man8)

diff --git a/dev-util/bpftrace/metadata.xml b/dev-util/bpftrace/metadata.xml
new file mode 100644
index 00000000000..777f99f832c
--- /dev/null
+++ b/dev-util/bpftrace/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>chutzpah@gentoo.org</email>
+  </maintainer>
+  <upstream>
+    <remote-id type="github">iovisor/bpftrace</remote-id>
+  </upstream>
+</pkgmetadata>


             reply	other threads:[~2019-03-12  2:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12  2:16 Patrick McLean [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-03-20 21:27 [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftrace/files/, dev-util/bpftrace/ Patrick McLean
2019-11-21 18:29 Patrick McLean
2020-03-09  6:01 Patrick McLean
2020-04-14  2:07 Patrick McLean
2020-06-20 19:23 Patrick McLean
2020-11-27 19:01 Patrick McLean
2021-04-19 23:50 Patrick McLean
2021-07-09 17:11 Patrick McLean
2021-10-26 22:07 Patrick McLean
2021-11-07 20:59 Jakov Smolić
2021-12-02 17:30 Patrick McLean
2021-12-02 18:02 Patrick McLean
2022-05-24 17:47 Patrick McLean
2022-08-29 17:40 Patrick McLean
2022-09-17 21:46 Sam James
2023-01-26 18:57 Patrick McLean
2023-02-06  2:04 Patrick McLean
2023-03-19 17:34 Michał Górny
2023-05-15 19:34 Patrick McLean
2023-05-15 19:34 Patrick McLean
2023-08-31 18:35 Patrick McLean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1552356959.8ba9e3e616b62ef293d2223b347e2cea6e25b1eb.chutzpah@gentoo \
    --to=chutzpah@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox