Blame SPECS/bpftrace.spec

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