bpftrace/SPECS/bpftrace.spec

210 lines
7.0 KiB
RPMSpec
Raw Normal View History

2019-08-05 15:45:12 +00:00
%bcond_without llvm_static
Name: bpftrace
2023-03-28 09:49:17 +00:00
Version: 0.16.0
2024-03-27 19:28:16 +00:00
Release: 5%{?dist}
2019-08-05 15:45:12 +00:00
Summary: High-level tracing language for Linux eBPF
License: ASL 2.0
2023-03-28 09:49:17 +00:00
%define cereal_version 1.3.2
2019-08-05 15:45:12 +00:00
URL: https://github.com/iovisor/bpftrace
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
2023-03-28 09:49:17 +00:00
# Cereal is a header-only serialization library which is not packaged into
# RHEL8, so we download it manually. This is ok to do as it is only necessary
# for build.
Source1: https://github.com/USCiLab/cereal/archive/v%{cereal_version}/cereal-%{cereal_version}.tar.gz
Patch0: %{name}-%{version}-IR-builder-get-rid-of-getPointerElementType-calls.patch
Patch1: %{name}-%{version}-tools-old-mdflush.bt-fix-BPFTRACE_HAVE_BTF-macro.patch
Patch2: %{name}-%{version}-tcpdrop-Fix-ERROR-Error-attaching-probe-kprobe-tcp_d.patch
Patch3: %{name}-%{version}-RHEL8-remove-not-existing-attachpoints-from-tools.patch
2023-09-27 12:44:27 +00:00
Patch4: %{name}-%{version}-cmake-Raise-max-llvm-major-version-to-16.patch
2024-03-27 19:28:16 +00:00
Patch5: %{name}-%{version}-Adjust-to-build-with-llvm-17.patch
2020-07-28 09:32:19 +00:00
Patch10: %{name}-%{version}-RHEL-8-aarch64-fixes-statsnoop-and-opensnoop.patch
2019-08-05 15:45:12 +00:00
# Arches will be included as upstream support is added and dependencies are
# satisfied in the respective arches
ExclusiveArch: x86_64 %{power64} aarch64 s390x
BuildRequires: gcc-c++
BuildRequires: bison
BuildRequires: flex
BuildRequires: cmake
BuildRequires: elfutils-libelf-devel
BuildRequires: zlib-devel
BuildRequires: llvm-devel
BuildRequires: clang-devel
BuildRequires: bcc-devel
2021-03-30 11:20:10 +00:00
BuildRequires: libbpf-devel
BuildRequires: libbpf-static
BuildRequires: binutils-devel
2019-08-05 15:45:12 +00:00
%if %{with llvm_static}
BuildRequires: llvm-static
%endif
2021-10-06 08:33:00 +00:00
# We don't need kernel-devel to use bpftrace, but some tools need it
Recommends: kernel-devel
2019-08-05 15:45:12 +00:00
%description
BPFtrace is a high-level tracing language for Linux enhanced Berkeley Packet
Filter (eBPF) available in recent Linux kernels (4.x). BPFtrace uses LLVM as a
backend to compile scripts to BPF-bytecode and makes use of BCC for
interacting with the Linux BPF system, as well as existing Linux tracing
capabilities: kernel dynamic tracing (kprobes), user-level dynamic tracing
(uprobes), and tracepoints. The BPFtrace language is inspired by awk and C,
and predecessor tracers such as DTrace and SystemTap
%prep
2023-03-28 09:49:17 +00:00
%autosetup -N -a 1
2022-03-29 10:42:21 +00:00
%autopatch -p1 -M 9
2020-07-28 09:32:19 +00:00
%ifarch aarch64
%patch10 -p1
%endif
2019-08-05 15:45:12 +00:00
%build
2023-03-28 09:49:17 +00:00
# Set CPATH so that CMake finds the cereal headers
CPATH=$PWD/cereal-%{cereal_version}/include:$CPATH
export CPATH
2019-08-05 15:45:12 +00:00
%cmake . \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTING:BOOL=OFF \
2021-10-06 08:33:00 +00:00
-DBUILD_SHARED_LIBS:BOOL=OFF
2019-08-05 15:45:12 +00:00
%make_build
%install
2021-03-30 11:20:10 +00:00
# The post hooks strip the binary which removes
# the BEGIN_trigger and END_trigger functions
# which are needed for the BEGIN and END probes
%global __os_install_post %{nil}
%global _find_debuginfo_opts -g
2019-08-05 15:45:12 +00:00
%make_install
# Fix shebangs (https://fedoraproject.org/wiki/Packaging:Guidelines#Shebang_lines)
find %{buildroot}%{_datadir}/%{name}/tools -type f -exec \
sed -i -e '1s=^#!/usr/bin/env %{name}\([0-9.]\+\)\?$=#!%{_bindir}/%{name}=' {} \;
2023-03-28 09:49:17 +00:00
# Some tools require old versions for RHEL8
cp %{buildroot}/%{_datadir}/%{name}/tools/old/biosnoop.bt %{buildroot}/%{_datadir}/%{name}/tools
cp %{buildroot}/%{_datadir}/%{name}/tools/old/mdflush.bt %{buildroot}/%{_datadir}/%{name}/tools
2019-08-05 15:45:12 +00:00
%files
%doc README.md CONTRIBUTING-TOOLS.md
%doc docs/reference_guide.md docs/tutorial_one_liners.md
%license LICENSE
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/tools
%dir %{_datadir}/%{name}/tools/doc
2023-03-28 09:49:17 +00:00
%dir %{_datadir}/%{name}/tools/old
2019-08-05 15:45:12 +00:00
%{_bindir}/%{name}
2023-03-28 09:49:17 +00:00
%{_bindir}/%{name}-aotrt
2019-08-05 15:45:12 +00:00
%{_mandir}/man8/*
%attr(0755,-,-) %{_datadir}/%{name}/tools/*.bt
%{_datadir}/%{name}/tools/doc/*.txt
2023-03-28 09:49:17 +00:00
# Do not include old versions of tools.
# Those that are needed were already installed as normal tools.
%exclude %{_datadir}/%{name}/tools/old
2019-08-05 15:45:12 +00:00
%changelog
2024-03-27 19:28:16 +00:00
* Mon Nov 06 2023 - 0.16.0-5
- Rebuild for LLVM17
- Resolves: RHEL-10690
2023-09-27 12:44:27 +00:00
* Fri Jun 09 2023 Viktor Malik <vmalik@redhat.com> - 0.16.0-3
- Add forgotten patch raising LLVM version in CMake
- Resolves: rhbz#2192950
* Fri Jun 09 2023 Viktor Malik <vmalik@redhat.com> - 0.16.0-2
- Rebuild for LLVM16
- Resolves: rhbz#2192950
2023-03-28 09:49:17 +00:00
* Wed Nov 30 2022 Viktor Malik <vmalik@redhat.com> - 0.16.0-1
- Rebase on bpftrace 0.16.0
- Rebuild for LLVM15
- Download the cereal library (not packaged into RHEL8)
2022-09-27 09:16:33 +00:00
* Thu Jun 02 2022 Jerome Marchand <jmarchan@redhat.com> - 0.13.1-1
- Rebase on bpftrace 0.13.1
- Rebuild on LLVM14
2022-03-29 10:42:21 +00:00
* Thu Dec 02 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-4
- Rebuild on LLVM13
- Small spec cleanup
2021-10-06 08:33:00 +00:00
* Thu Jun 24 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-3
- Have threadsnoop points to libpthread.so.0
* Wed Jun 09 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-2
- Rebuild on LLVM12
* Fri Apr 30 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-1
- Rebase on bpftrace 0.12.1
2021-03-30 11:20:10 +00:00
* Thu Jan 28 2021 Jerome Marchand <jmarchan@redhat.com> - 0.11.1-3
- Add missing libbpf and binutils-dev dependencies
* Wed Nov 11 2020 Jerome Marchand <jmarchan@redhat.com> - 0.11.1-2
- Fix statsnoop and opensnoop on aarch64 again
* Fri Nov 06 2020 Jerome Marchand <jmarchan@redhat.com> - 0.11.1-1
- Rebase on bpftrace 0.11.1
* Tue Oct 27 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-5
- Rebuild for bcc 0.16.0
2020-07-28 09:32:19 +00:00
* Thu Jun 11 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-4
- Fix KBUILD_MODNAME
* Thu Jun 11 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-3
- Fix ENOMEM issue on arm64 machine with many cpus
- Fix statsnoop and opensnoop on aarch64
- Drop tcpdrop on ppc64
* Tue May 05 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-2
- Fix libpthread path in threadsnoop
* Wed Apr 22 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-1
- Rebase on bpftrace 0.10.0
2020-01-21 21:29:52 +00:00
* Fri Nov 08 2019 Jerome Marchand <jmarchan@redhat.com> - 0.9.2-1
- Rebase on bpftrace 0.9.2
* Tue Jun 18 2019 Jerome Marchand <jmarchan@redhat.com> - 0.9-3
- Don't allow to raw_spin_lock* kprobes that can deadlock the kernel.
* Wed Jun 12 2019 Jerome Marchand <jmarchan@redhat.com> - 0.9-2
2019-08-05 15:45:12 +00:00
- Fixes gethostlatency
- Fixes a struct definition issue that made several tools fail
- Add CI gating
* Wed May 15 2019 Jerome Marchand <jmarchan@redhat.com> - 0.9.1
- Original build on RHEL 8
* Thu Apr 25 2019 Augusto Caringi <acaringi@redhat.com> - 0.9-3
- Rebuilt for bcc 0.9.0
* Mon Apr 22 2019 Neal Gompa <ngompa@datto.com> - 0.9-2
- Fix Source0 reference
- Use make_build macro for calling make
* Mon Apr 1 2019 Peter Robinson <pbrobinson@fedoraproject.org> 0.9-1
- Build on aarch64 and s390x
* Mon Mar 25 2019 Augusto Caringi <acaringi@redhat.com> - 0.9-0
- Updated to version 0.9
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0-2.20181210gitc49b333
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Dec 10 2018 Augusto Caringi <acaringi@redhat.com> - 0.0-1.20181210gitc49b333
- Updated to latest upstream (c49b333c034a6d29a7ce90f565e27da1061af971)
* Wed Nov 07 2018 Augusto Caringi <acaringi@redhat.com> - 0.0-1.20181107git029717b
- Initial import