!3 解决mainline编译失败

From: @jackie_wu123
Reviewed-by: @licihua
Signed-off-by: @licihua
This commit is contained in:
openeuler-ci-bot 2020-11-10 10:38:27 +08:00 committed by Gitee
commit c491e3fc3d
2 changed files with 22 additions and 2 deletions

View File

@ -1,6 +1,6 @@
Name: bpftrace
Version: 0.10.0
Release: 1
Release: 2
Summary: High-level tracing language for Linux eBPF
License: ASL 2.0
@ -16,7 +16,7 @@ BuildRequires: zlib-devel llvm-devel clang-devel
BuildRequires: bcc-devel >= 0.11.0-2
BuildRequires: libbpf-devel libbpf-static
BuildRequires: binutils-devel
Patch0001: fix_build_error.patch
%description
bpftrace is a high-level tracing language for Linux enhanced Berkeley Packet
@ -62,5 +62,8 @@ find %{buildroot}%{_datadir}/%{name}/tools -type f -exec \
%changelog
* 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

17
fix_build_error.patch Normal file
View File

@ -0,0 +1,17 @@
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)