diff options
author | V3n3RiX <venerix@koprulu.sector> | 2025-02-06 00:10:59 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2025-02-06 00:10:59 +0000 |
commit | 22eaa60297c2dbc92dd1658fb7d8e46878552755 (patch) | |
tree | c3e1147cecf778a6418d736658cedc5d7f2dfa2d /dev-debug | |
parent | e019d91362a4788fe5cc5788877327b813d0f730 (diff) |
gentoo auto-resync : 06:02:2025 - 00:10:59
Diffstat (limited to 'dev-debug')
-rw-r--r-- | dev-debug/Manifest.gz | bin | 4190 -> 4189 bytes | |||
-rw-r--r-- | dev-debug/dtrace/Manifest | 2 | ||||
-rw-r--r-- | dev-debug/dtrace/dtrace-2.0.2.ebuild | 225 |
3 files changed, 227 insertions, 0 deletions
diff --git a/dev-debug/Manifest.gz b/dev-debug/Manifest.gz Binary files differindex a23b8be26a82..5c9caa2e18c6 100644 --- a/dev-debug/Manifest.gz +++ b/dev-debug/Manifest.gz diff --git a/dev-debug/dtrace/Manifest b/dev-debug/dtrace/Manifest index a0050b368b79..2c99b7e9ccdf 100644 --- a/dev-debug/dtrace/Manifest +++ b/dev-debug/dtrace/Manifest @@ -1,5 +1,7 @@ AUX dtprobed.init 209 BLAKE2B f97bd2c0c681697becc2c6c7f87b8fdf779251d0473dd440bf30f0c3ce95e26e24b2496a2e8de4ff33a9ffc8a05e5bc64d066969dd7e4458ea65d2d10ae61723 SHA512 12a8e07747d8a8c3456675ea88060656dad2b594abc69daa15384abab4d11ea888d88287f921a095cad84f2e254dc858ea50e29f5e17b663f7b6be25dcbfd7b5 DIST dtrace-2.0.1.1.tar.gz 1435524 BLAKE2B 761a931b9d871e9316f11ebe960f6bbfd3c16a82cf1cdd9ae5d69b22e0d8cea8d4b3924c960b7915f8843ce1e5c37bd257a52f1ce346957002b0ab00e59306fb SHA512 15809f2bc996bac9bd6cbb2b03eaa9a0c6a2aea9404642280f14d75b7d6feaec31b5d2c16915255cd202006cdff7835f578c042b087605708a9eb935407f1b95 +DIST dtrace-2.0.2.tar.gz 1466888 BLAKE2B 82bcf55f46802b525dd5bfb8d2ee96223d6ee3e76b752632b61cdc652308efa143f8158fbdfff7f2af1e63d5fc57aa44b0ca826e313b3c5c9d3019528101fccb SHA512 7d3fcb6ffcbfc6732b66e217cee6d45a504beb7c8b9f887b2a781eea68ef2f44de9aa373728a91d3a91e59a0be0664e2d7d92d42fd25b88de4c5005e62505c78 EBUILD dtrace-2.0.1.1-r2.ebuild 6365 BLAKE2B 36e1f2ac964825fce09402200a5f92412aa84cb8e6b0ee4945ef6826d4a225ae11a5e2f5daaf6699ef6c99452ac01b302c1419fc14831c96f51d0f2bd48baa83 SHA512 68d337bc7b378e17aa58c01513aeca69fc1e15aaf23556a72da1d15ae5df816e0858b406b2ff7ebcad69e39c2243bb4d57b401d8132bf1c0239bcb2ee641fdd0 +EBUILD dtrace-2.0.2.ebuild 6059 BLAKE2B 6232a89fb7961426316de5103f538e276c26058bebf1a8d00fcacff3074134384e320f702deb566e9a86437b47721a2a8ba29dc044002676e63276a3a6e971d9 SHA512 0ccfc1e9bac4da86d505c90116fbe66cea21e30bae0055f25507facf8f9f13b851a3a5888d2352f0a47f499cfc9659074624db1dfabad47fb63a255ebbd60de4 EBUILD dtrace-9999.ebuild 6054 BLAKE2B 5a77939a92131662f83f9a6c522ab50fc69edd673db8f18eee86e72cbf2dc83eb4508340a201b96280a90e0bd7eda4c41451f427ce48d74f29441a937d77a2e7 SHA512 8828e405f4520ac2c035b9644a8130212452db742c771ddca3b6a47c4ce2ff02e85cbca45208d6a7fe4da015a3a95214f468b561ccc71f399c6a01391b6680df MISC metadata.xml 632 BLAKE2B 695cab30d4a45e94a1a69ca4c071e2aa2d99cb0457f4b02d0ea6e88db0574976082e96e9c9ebd620bcdacd9f30f97938301a70e67df1b9baebb692184598820a SHA512 b028b76d8d153ee8db9036c78342828543ce2675092f0daf9e1a82af7d7c249b3ea450567e1c3c04009764004c45424e2f9dfebd362d1364ff7cb2da40be3962 diff --git a/dev-debug/dtrace/dtrace-2.0.2.ebuild b/dev-debug/dtrace/dtrace-2.0.2.ebuild new file mode 100644 index 000000000000..d514c846de59 --- /dev/null +++ b/dev-debug/dtrace/dtrace-2.0.2.ebuild @@ -0,0 +1,225 @@ +# Copyright 2024-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit edo flag-o-matic linux-info systemd toolchain-funcs udev + +DESCRIPTION="Dynamic BPF-based system-wide tracing tool" +HOMEPAGE="https://github.com/oracle/dtrace-utils https://wiki.gentoo.org/wiki/DTrace" + +if [[ ${PV} == 9999 ]]; then + EGIT_BRANCH="devel" + EGIT_REPO_URI="https://github.com/oracle/dtrace-utils" + inherit git-r3 +else + SRC_URI="https://github.com/oracle/dtrace-utils/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}"/dtrace-utils-${PV} + + KEYWORDS="-* ~amd64 ~arm64" +fi + +LICENSE="UPL-1.0" +SLOT="0" +IUSE="test-install valgrind" + +# XXX: right now, we auto-adapt to whether multilibs are present: +# should we force them to be? how? +# +# TODO: can we make the wireshark dep conditional? +DEPEND=" + dev-libs/elfutils + dev-libs/libbpf + dev-libs/libpfm:= + net-analyzer/wireshark[dumpcap] + net-libs/libpcap + >=sys-fs/fuse-3.2.0:3 + >=sys-libs/binutils-libs-2.42:= + sys-libs/zlib +" +RDEPEND=" + ${DEPEND} + !dev-debug/systemtap[dtrace-symlink(+)] + net-analyzer/wireshark + test-install? ( + app-alternatives/bc + app-editors/vim-core + dev-build/make + dev-lang/perl + dev-util/perf + net-fs/nfs-utils + sys-apps/coreutils + sys-fs/xfsprogs + sys-process/time + virtual/jdk + virtual/perl-IO-Socket-IP + ) +" +BDEPEND=" + dev-build/make + sys-apps/gawk + sys-devel/bison + >=sys-devel/bpf-toolchain-14.1.0 + sys-devel/flex +" +DEPEND+=" valgrind? ( dev-debug/valgrind )" + +QA_PRESTRIPPED=" + usr/.*/dtrace/testsuite/test/triggers/.* +" +QA_FLAGS_IGNORED=" + usr/.*/dtrace/testsuite/test/triggers/.* +" + +# TODO: report upstream (bug #938221) although it seems like it's +# not relevant given it's a BPF object. +QA_EXECSTACK=" + usr/*/dtrace/bpf_dlib.* +" + +pkg_pretend() { + # TODO: optional kernel patches + + # Basics for debugging information, BPF + local CONFIG_CHECK="~BPF ~DEBUG_INFO_BTF ~KALLSYMS_ALL" + + CONFIG_CHECK+=" ~CUSE" + + # Tracing + CONFIG_CHECK+=" ~TRACING" + CONFIG_CHECK+=" ~UPROBES ~UPROBE_EVENTS" + CONFIG_CHECK+=" ~FTRACE ~FTRACE_SYSCALLS ~DYNAMIC_FTRACE ~FUNCTION_TRACER" + CONFIG_CHECK+=" ~FPROBE" + # DTrace can fallback to kprobes for fbt but people often want them off + # for security and newer kernels work fine with BPF for that, so + # let's omit it. kprobes are slower and scale poorly. + + # https://gcc.gnu.org/PR84052 + CONFIG_CHECK+=" !GCC_PLUGIN_RANDSTRUCT" + + if use test-install ; then + # See test/modules + CONFIG_CHECK+=" ~EXT4_FS ~ISO9660_FS ~NFS_FS ~RDS ~TUN" + fi + + check_extra_config +} + +pkg_setup() { + eval unset ${!LC_*} LANG +} + +src_configure() { + if tc-is-cross-compiler; then + die "DTrace does not yet support cross-compilation." + fi + + tc-export CC + + # lld does this by default, so fix that, although lld fails anyway... + # 'LIBDTRACE_1.0' to symbol 'dtrace_provider_modules' failed: symbol not defined + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) + # mold and lld can't cope with some relocation types used, e.g. + # 'test-triggers--usdt-tst-forker-prov.o:(.SUNW_dof): unknown relocation: R_X86_64_GLOB_DAT' + tc-ld-force-bfd + + # -fno-semantic-interposition seems to lead to a broken dtrace + # that can't actually obtain results from probes, even trivial examples + # just hang. + filter-flags -fno-semantic-interposition + # https://github.com/oracle/dtrace-utils/issues/86 + filter-lto + + local confargs=( + # TODO: Maybe we should set the UNPRIV_UID to something? -3 is a bit... kludgy + --prefix="${EPREFIX}"/usr + --mandir="${EPREFIX}"/usr/share/man + --docdir="${EPREFIX}"/usr/share/doc/${PF} + --with-systemd + HAVE_LIBCTF=yes + HAVE_BPFV3=yes + HAVE_VALGRIND=$(usex valgrind) + ) + + edo ./configure "${confargs[@]}" +} + +src_compile() { + # -j1: https://github.com/oracle/dtrace-utils/issues/82 + emake verbose=1 -j1 $(usev !test-install TRIGGERS='') +} + +src_test() { + # Needs root and is also very time-consuming + :; +} + +src_install() { + emake DESTDIR="${D}" -j1 install $(usev test-install install-test) + + # Stripping the BPF libs breaks them + dostrip -x "/usr/$(get_libdir)" + + # It's a binary (TODO: move it?) + docompress -x /usr/share/doc/${PF}/showUSDT + + newinitd "${FILESDIR}"/dtprobed.init dtprobed +} + +pkg_postinst() { + # We need a udev reload to pick up the CUSE device node rules. + udev_reload + + if [[ -n ${REPLACING_VERSIONS} ]]; then + # TODO: Make this more intelligent wrt comparison + # One option for this is to detect when it's needed (DOF stash layout changes) + # and then e.g. sleep and restart for the user. + if systemd_is_booted ; then + einfo "Restart the DTrace 'dtprobed' service after upgrades once all dtraces are stopped with:" + einfo " systemctl try-restart dtprobed" + else + einfo "Restart the DTrace 'dtprobed' service after upgrades once all dtraces are stopped with:" + einfo " /etc/init.d/dtprobed restart" + fi + else + einfo "See https://wiki.gentoo.org/wiki/DTrace for getting started." + + # We can't do magic for people with ROOT=. + if [[ -n ${ROOT} ]] ; then + einfo "Enable and start the DTrace 'dtprobed' service for systemd with:" + einfo " systemctl enable --now dtprobed" + einfo + einfo "Enable and start the DTrace 'dtprobed' service for OpenRC with:" + einfo " rc-update add dtprobed" + einfo " /etc/init.d/dtprobed start" + return + fi + + # For first installs, we enable the service and start it. + # + # This is unusual, but the behaviour without dtprobed running + # is untested/unsupported. It's not a network service, it + # has no configuration, reads a single device node, and + # does all parsing within a seccomp jail. It also leads + # to hard-to-diagnose issues because USDT probes won't + # be registered and an application might have already + # started up which needs to be traced. + if systemd_is_booted ; then + ebegin "Enabling & starting DTrace 'dtprobed' service" + systemctl enable --now dtprobed + eend $? + else + ebegin "Enabling DTrace 'dtprobed' service" + rc-update add dtprobed + eend $? + + ebegin "Starting DTrace 'dtprobed' service" + rc-service dtprobed start + eend $? + fi + fi +} + +pkg_postrm() { + udev_reload +} |