summaryrefslogtreecommitdiff
path: root/bpftrace.spec
blob: 39fab9afacc165fbf097bb7e5be283cb24b680ca (plain)
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
Name:           bpftrace
Version:        0.20.1
Release:        1
Summary:        High-level tracing language for Linux eBPF
License:        ASL 2.0

URL:            https://github.com/iovisor/bpftrace
Source0:        %{url}/archive/refs/tags/%{name}-%{version}.tar.gz

# Arches will be included as upstream support is added and dependencies are
# satisfied in the respective arches
ExclusiveArch:  x86_64 %{power64} aarch64 riscv64 loongarch64

BuildRequires:  gcc-c++ bison flex cmake elfutils-libelf-devel
BuildRequires:  zlib-devel llvm-devel clang clang-tools-extra clang-devel llvm-test
BuildRequires:  bcc-devel >= 0.19.0-1
BuildRequires:  libbpf-devel libbpf-static
BuildRequires:  binutils-devel
BuildRequires:  cereal-devel libdwarf-devel rubygem-asciidoctor

%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
%autosetup -p1


%build
%cmake . \
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
        -DLIBBFD_LIBRARIES="${LIBBFD}" \
        -DBUILD_TESTING:BOOL=OFF \
        -DBUILD_SHARED_LIBS:BOOL=OFF \
        -DENABLE_LLVM_SHARED=1 \
        -DUSE_SYSTEM_BPF_BCC:BOOL=ON
%cmake_build


%install
%global __os_install_post %{nil}
%global _find_debuginfo_opts -g
%cmake_install

find %{buildroot}%{_datadir}/%{name}/tools -type f -exec \
  sed -i -e '1s=^#!/usr/bin/env %{name}\([0-9.]\+\)\?$=#!%{_bindir}/%{name}=' {} \;

%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
%dir %{_datadir}/%{name}/tools/old
%{_bindir}/%{name}
%{_bindir}/%{name}-aotrt
%{_mandir}/man8/*
%attr(0755,-,-) %{_datadir}/%{name}/tools/*.bt
%attr(0755,-,-) %{_datadir}/%{name}/tools/old/*.bt
%{_datadir}/%{name}/tools/doc/*.txt


%changelog
* Mon Nov 04 2024 fu-shanqing<dev01203@linx-info.com> - 0.20.1-1
- update to 0.20.1

* Tue Feb 27 2024 Huang Yang <huangyang@loongson.cn> - 0.19.1-2
- add loongarch64 support

* Mon Jan 08 2024 Paul Thomas <paulthomas100199@gmail.com> - 0.19.1-1
- update to version 0.19.1

* Tue Aug 15 2023 wulei <wu_lei@hoperun.com> - 0.16.0-3
- Fix cannot convert 'bfd*' to 'bfd_architecture'

* Sat Jul 15 2023 cf-zhao <zhaochuanfeng@huawei.com> - 0.16.0-2
- Fix issue after clang and llvm upgrade.

* Thu Mar 02 2023 Ge Wang <wangge20@h-partners.com> - 0.16.0-1
- Update to version 0.16.0

* Tue Feb 14 2023 laokz <zhangkai@iscas.ac.cn> - 0.15.0-3
- add riscv64 to supported arch

* Fri Feb 10 2023 caodongxia <caodongxia@h-partners.com> - 0.15.0-2
- Adapt to bcc >= 0.25.0

* Mon Aug 15 2022 jinzhiguang <jinzhiguang@kylinos.cn> - 0.15.0-1
- update to 0.15.0

* Thu Jun 9 2022 LemmyHuang <huangliming5@huawei.com> - 0.14.1-3
- fix abort on startup caused by llvm compiler

* Sat May 7 2022 liyanan <liyanan32@h-partners.com> - 0.14.1-2
- Fix 'bpftrace symbols are stripped'

* Fri Apr 22 2022 yaoxin <yaoxin30@h-partners.com> - 0.14.1-1
- Update to 0.14.1

* Mon Jan 10 2022 liyanan <liyanan32@huawei.com> - 0.13.0-1
- update to 0.13.0

* Mon Nov 9 2020 wutao <wutao61@huawei.com> - 0.10.0-2
- fix build error

* Thu May 07 2020 openEuler Buildteam <buildteam@openeuler.org> - 0.10.0-1
- Package init