Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
e93bd624cb
!22 修复由于函数接口变更导致的编译问题
From: @cherry530 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2022-11-11 02:46:42 +00:00
cherry530
82e67bd879 fix build error
Signed-off-by: cherry530 <xuping33@huawei.com>
2022-11-11 10:31:01 +08:00
openeuler-ci-bot
fe696cfb61
!18 [sync] PR-16: fix abort on startup caused by llvm compiler
From: @openeuler-sync-bot 
Reviewed-by: @myeuler 
Signed-off-by: @myeuler
2022-09-15 07:08:13 +00:00
LemmyHuang
99c9da00b6 fix abort on startup caused by llvm compiler
Signed-off-by: LemmyHuang <huangliming5@huawei.com>
(cherry picked from commit c41670a166908a84baace12631df132df30eef67)
2022-06-09 21:18:41 +08:00
openeuler-ci-bot
85cfe475cc
!12 [sync] PR-10: Fix 'bpftrace symbols are stripped'
From: @openeuler-sync-bot 
Reviewed-by: @overweight 
Signed-off-by: @overweight
2022-05-10 01:14:23 +00:00
lyn1001
8baf3b5591 Fix'bpftracesymbolsarestripped'
(cherry picked from commit d38d35ba3aa565944a849ca0f51aecaed21b012a)
2022-05-09 20:02:43 +08:00
openeuler-ci-bot
e7462a1757
!9 [sync] PR-7: Update to 0.14.1
From: @openeuler-sync-bot 
Reviewed-by: @licihua 
Signed-off-by: @licihua
2022-05-09 02:21:59 +00:00
starlet-dx
ed2833626a Update to 0.14.1
(cherry picked from commit 4afcffd7f0890f93285b70d0baaee0ddf44cc49a)
2022-05-07 17:21:53 +08:00
openeuler-ci-bot
6ec5e35415
!5 update to 0.13.0
Merge pull request !5 from lyn/openEuler-22.03-LTS-Next
2022-01-11 03:42:13 +00:00
lyn1001
79240a0d1e update to 0.13.0 2022-01-10 18:17:34 +08:00
5 changed files with 65 additions and 22 deletions

View File

@ -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

Binary file not shown.

View File

@ -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

View File

@ -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)