Package bpftrace: Specfile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | # SPDX-License-Identifier: GPL-2.0-only %define _unpackaged_files_terminate_build 1 %define _stripped_files_terminate_build 1 # Based on https://github.com/iovisor/bpftrace/blob/master/INSTALL.md Name: bpftrace Version: 0.12.1 Release: alt2 Summary: High-level tracing language for Linux eBPF Group: Development/Debuggers License: Apache-2.0 URL: https://github.com/iovisor/bpftrace Vcs: https://github.com/iovisor/bpftrace.git # Docs: https://github.com/iovisor/bpftrace/blob/master/docs/reference_guide.md # Docs: https://github.com/iovisor/bpftrace/blob/master/docs/tutorial_one_liners.md # Docs: http://www.brendangregg.com/BPF/bpftrace-cheat-sheet.html # Docs: http://www.brendangregg.com/ebpf.html#bpftrace # PR: https://lwn.net/Articles/793749/ # PR: http://www.brendangregg.com/blog/2018-10-08/dtrace-for-linux-2018.html Source: %name-%version.tar ExclusiveArch: x86_64 aarch64 BuildRequires(pre): rpm-macros-cmake BuildRequires: cmake BuildRequires: flex BuildRequires: libstdc++-devel BuildRequires: libstdc++-devel-static BuildRequires: clangd >= 11 BuildRequires: clang-devel >= 11 BuildRequires: clang-tools >= 11 BuildRequires: llvm-devel >= 11 BuildRequires: llvm-devel-static >= 11 BuildRequires: clang-devel-static >= 11 BuildRequires: lld >= 11 BuildRequires: libbcc-devel BuildRequires: libelf-devel BuildRequires: binutils-devel BuildRequires: /proc # Assuming 'kernel' dependency will bring un-def kernel %{?!_without_check:%{?!_disable_check:BuildRequires: rpm-build-vm kernel-headers-modules-un-def}} %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 %setup %build %remove_optflags -frecord-gcc-switches export CC=clang export CXX=clang++ export LDFLAGS="-fuse-ld=lld $LDFLAGS" export Clang_DIR=/usr/share/cmake/Modules/clang # -DBUILD_TESTING:BOOL=ON will require googletest and try to clone it from github %cmake \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DBUILD_TESTING:BOOL=OFF \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DLLVM_DIR=$(llvm-config --cmakedir) \ -DOFFLINE_BUILDS:BOOL=ON \ -DALLOW_UNSAFE_PROBE:BOOL=ON \ %cmake_build %install %set_verify_elf_method relaxed %cmake_install find %buildroot%_datadir/%name/tools -name '*.bt' | xargs chmod a+x # Fix man pages. pushd %buildroot%_man8dir rename '' bpftrace- *.gz rename bpftrace- '' bpftrace-bpftrace.8.gz popd %check %_cmake__builddir/src/bpftrace --version # not requires root vm-run %_cmake__builddir/src/bpftrace --info # should be fast enough even w/o kvm [ -w /dev/kvm ] && vm-run %_cmake__builddir/src/bpftrace -l 'kprobe:*_sleep_*' if [ -w /dev/kvm ]; then # Great run-time tests # Some fail due to no BUILD_TESTING .gear/delete-blocks syscalls: tests/runtime/* .gear/delete-blocks testprogs tests/runtime/* .gear/delete-blocks uprobe tests/runtime/* .gear/delete-blocks usdt tests/runtime/usdt .gear/delete-blocks vfs_read tests/runtime/* # TIMEOUT .gear/delete-blocks hardware tests/runtime/probe # TIMEOUT .gear/delete-blocks k.*_order tests/runtime/probe # TIMEOUT .gear/delete-blocks watchpoint: tests/runtime/watchpoint .gear/delete-blocks string_args tests/runtime/other .gear/delete-blocks interval_order tests/runtime/probe .gear/delete-blocks tracepoint_order tests/runtime/probe .gear/delete-blocks uint64_t tests/runtime/signed_ints .gear/delete-blocks tracepoint:random:random_read tests/runtime/variable %ifarch aarch64 # TIMEOUT on aarch64 .gear/delete-blocks python tests/runtime/json-output %endif export BPFTRACE_RUNTIME_TEST_EXECUTABLE=$PWD/%_cmake__builddir/src/ vm-run --sbin tests/runtime-tests.sh fi %files %doc LICENSE README.md CONTRIBUTING-TOOLS.md %doc docs/reference_guide.md docs/tutorial_one_liners.md %_bindir/* %_datadir/%name %_man8dir/* %changelog * Wed May 12 2021 Arseny Maslennikov <arseny@altlinux.org> 0.12.1-alt2 - NMU: spec: adapt to new cmake macros. * Fri Apr 30 2021 Vitaly Chikunov <vt@altlinux.org> 0.12.1-alt1 - Update to v0.12.1 (2021-04-16). - spec: Build with default Clang/LLVM (>= 11). * Mon Nov 30 2020 Vitaly Chikunov <vt@altlinux.org> 0.11.4-alt1 - Update to v0.11.4 (2020-11-13). * Tue Aug 25 2020 Vitaly Chikunov <vt@altlinux.org> 0.11.0-alt3 - Rename man pages with bpftrace- prefix. - Rebuild with debuginfo. * Mon Aug 10 2020 Vitaly Chikunov <vt@altlinux.org> 0.11.0-alt2 - Rebuild with clang10. * Fri Jul 17 2020 Vitaly Chikunov <vt@altlinux.org> 0.11.0-alt1 - Update to v0.11.0. * Sat Jul 04 2020 Vitaly Chikunov <vt@altlinux.org> 0.10.0-alt2 - Fix build with libbcc-devel-0.15.0. * Wed Apr 15 2020 Vitaly Chikunov <vt@altlinux.org> 0.10.0-alt1 - Update to v0.10.0 released at 2020-04-12. New features: kfuncs, C++ Symbol demangling, if-else control flow. * Sat Mar 28 2020 Vitaly Chikunov <vt@altlinux.org> 0.9.4-alt2 - spec: Rework BuildRequires. * Sat Mar 14 2020 Vitaly Chikunov <vt@altlinux.org> 0.9.4-alt1 - Update to v0.9.4. - Update license tag from ASL 2.0 to Apache-2.0. - Add %%check with some tests. * Fri May 17 2019 Vitaly Chikunov <vt@altlinux.org> 0.9.0.0.169.ga4bf870-alt1 - First import v0.9-169-ga4bf870. |