Compare commits
10 Commits
c491e3fc3d
...
e93bd624cb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e93bd624cb | ||
|
|
82e67bd879 | ||
|
|
fe696cfb61 | ||
|
|
99c9da00b6 | ||
|
|
85cfe475cc | ||
|
|
8baf3b5591 | ||
|
|
e7462a1757 | ||
|
|
ed2833626a | ||
|
|
6ec5e35415 | ||
|
|
79240a0d1e |
@ -0,0 +1,41 @@
|
||||
From e3894c8fac52ce6b7861bd491ef70406545d0f40 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Marchand <jmarchan@redhat.com>
|
||||
Date: Wed, 23 Mar 2022 09:47:25 +0100
|
||||
Subject: [PATCH] Fix libbtf 0.6.0 build
|
||||
|
||||
Libbpf 0.6.0 introduced a new version of btf_dump__new(). The new
|
||||
version is btf_dump__new_v0_6_0() while the old version was renamed
|
||||
btf_dump__new_deprecated(). btf_dump__new() is now overloaded,
|
||||
unfortunately the macro doesn't work on cpp.
|
||||
|
||||
Let's call btf_dump__new_deprecated() explicitely when libbpbf version
|
||||
is above 0.6.0. That should work till support for the deprecated
|
||||
function is removed in libbpf 1.0.0.
|
||||
|
||||
Fixes #2068
|
||||
|
||||
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
|
||||
---
|
||||
src/btf.cpp | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/src/btf.cpp b/src/btf.cpp
|
||||
index 7d83cf687e..83bc6e901e 100644
|
||||
--- a/src/btf.cpp
|
||||
+++ b/src/btf.cpp
|
||||
@@ -24,6 +24,15 @@
|
||||
#pragma GCC diagnostic pop
|
||||
#include <bpf/libbpf.h>
|
||||
|
||||
+/*
|
||||
+ * Since libbtf 0.6, btf_dump__new() has been overloaded and now can design
|
||||
+ * either btf_dump__new_v0_6_0() or btf_dump__new_deprecated(), which is the
|
||||
+ * same as btf_dump__new() for libbtf < 0.6, and the one we still use.
|
||||
+ */
|
||||
+#if LIBBPF_MAJOR_VERSION == 0 && LIBBPF_MINOR_VERSION >= 6
|
||||
+#define btf_dump__new(a1, a2, a3, a4) btf_dump__new_deprecated(a1, a2, a3, a4)
|
||||
+#endif
|
||||
+
|
||||
#include "bpftrace.h"
|
||||
|
||||
namespace bpftrace {
|
||||
Binary file not shown.
BIN
bpftrace-0.14.1.tar.gz
Normal file
BIN
bpftrace-0.14.1.tar.gz
Normal file
Binary file not shown.
@ -1,11 +1,12 @@
|
||||
Name: bpftrace
|
||||
Version: 0.10.0
|
||||
Release: 2
|
||||
Version: 0.14.1
|
||||
Release: 4
|
||||
Summary: High-level tracing language for Linux eBPF
|
||||
License: ASL 2.0
|
||||
|
||||
URL: https://github.com/iovisor/bpftrace
|
||||
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||
Patch0000: Choose-to-use-a-functional-interface-to-fix-build-error.patch
|
||||
|
||||
# Arches will be included as upstream support is added and dependencies are
|
||||
# satisfied in the respective arches
|
||||
@ -13,10 +14,10 @@ ExclusiveArch: x86_64 %{power64} aarch64
|
||||
|
||||
BuildRequires: gcc-c++ bison flex cmake elfutils-libelf-devel
|
||||
BuildRequires: zlib-devel llvm-devel clang-devel
|
||||
BuildRequires: bcc-devel >= 0.11.0-2
|
||||
BuildRequires: bcc-devel >= 0.19.0-1
|
||||
BuildRequires: libbpf-devel libbpf-static
|
||||
BuildRequires: binutils-devel
|
||||
Patch0001: fix_build_error.patch
|
||||
BuildRequires: cereal-devel libdwarf-devel rubygem-asciidoctor
|
||||
|
||||
%description
|
||||
bpftrace is a high-level tracing language for Linux enhanced Berkeley Packet
|
||||
@ -37,11 +38,13 @@ and predecessor tracers such as DTrace and SystemTap.
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DBUILD_TESTING:BOOL=OFF \
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF \
|
||||
-DLIBBCC_LIBRARIES:PATH=/usr/lib64/libbcc-no-libbpf.so
|
||||
-DENABLE_LLVM_SHARED=1
|
||||
%make_build
|
||||
|
||||
|
||||
%install
|
||||
%global __os_install_post %{nil}
|
||||
%global _find_debuginfo_opts -g
|
||||
%make_install
|
||||
|
||||
find %{buildroot}%{_datadir}/%{name}/tools -type f -exec \
|
||||
@ -56,12 +59,28 @@ find %{buildroot}%{_datadir}/%{name}/tools -type f -exec \
|
||||
%dir %{_datadir}/%{name}/tools
|
||||
%dir %{_datadir}/%{name}/tools/doc
|
||||
%{_bindir}/%{name}
|
||||
%{_bindir}/%{name}-aotrt
|
||||
%{_mandir}/man8/*
|
||||
%attr(0755,-,-) %{_datadir}/%{name}/tools/*.bt
|
||||
%{_datadir}/%{name}/tools/doc/*.txt
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Nov 11 2022 xu_ping <xuping33@h-partners.com> - 0.14.1-4
|
||||
- Use a functional interface depending on the version to fix build error
|
||||
|
||||
* 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
|
||||
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
From b7a8159fcaaeb7d0e2e64c2474f05ca199d970e8 Mon Sep 17 00:00:00 2001
|
||||
From: William Findlay <william@williamfindlay.com>
|
||||
Date: Sun, 21 Jun 2020 13:18:54 -0400
|
||||
Subject: [PATCH] Return 0 in detach_kfunc
|
||||
diff --git a/bpftrace-0.10.0-old/src/attached_probe.cpp b/bpftrace-0.10.0/src/attached_probe.cpp
|
||||
index 16486b6..8a2f739 100644
|
||||
--- a/src/attached_probe.cpp
|
||||
+++ b/src/attached_probe.cpp
|
||||
@@ -115,7 +115,7 @@ void AttachedProbe::attach_kfunc(void)
|
||||
int AttachedProbe::detach_kfunc(void)
|
||||
{
|
||||
close(tracing_fd_);
|
||||
- return bpf_detach_kfunc(progfd_, NULL);
|
||||
+ return 0;
|
||||
}
|
||||
#else
|
||||
void AttachedProbe::attach_kfunc(void)
|
||||
Loading…
x
Reference in New Issue
Block a user