Blame SPECS/bpftrace.spec

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