diff --git a/1001-Skiping-cases-in-libbpf-tools.patch b/1001-Skiping-cases-in-libbpf-tools.patch new file mode 100644 index 0000000000000000000000000000000000000000..1afa2d8dab842f9e436b61dae8b53ebe18746402 --- /dev/null +++ b/1001-Skiping-cases-in-libbpf-tools.patch @@ -0,0 +1,26 @@ +From f67a5908c55568e369e4ab5b36b90aeb38c93caa Mon Sep 17 00:00:00 2001 +Message-Id: +From: "Kun(llfl)" +Date: Thu, 9 Feb 2023 14:53:53 +0800 +Subject: [PATCH 1001/1001] Skiping cases in libbpf-tools + +Signed-off-by: Kun(llfl) +--- + libbpf-tools/Makefile | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/libbpf-tools/Makefile b/libbpf-tools/Makefile +index a48b4e2..bb4b012 100644 +--- a/libbpf-tools/Makefile ++++ b/libbpf-tools/Makefile +@@ -57,7 +57,6 @@ APPS = \ + funclatency \ + gethostlatency \ + hardirqs \ +- javagc \ + klockstat \ + ksnoop \ + llcstat \ +-- +2.39.0 + diff --git a/1001-bcc-fix-man-pages-install-dir.patch b/1001-bcc-fix-man-pages-install-dir.patch deleted file mode 100644 index 317891a38fbb7c75db32d24b1bf1f69e658e399b..0000000000000000000000000000000000000000 --- a/1001-bcc-fix-man-pages-install-dir.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- bcc-0.24.0/man/man8/CMakeLists.txt.orig 2023-02-11 00:02:06.078836658 +0800 -+++ bcc-0.24.0/man/man8/CMakeLists.txt 2023-02-11 00:03:09.599836658 +0800 -@@ -1,12 +1,2 @@ --find_program(GZIP gzip) - file(GLOB FILES *.8) --set(GZFILES "") --foreach(FIL ${FILES}) -- get_filename_component(NAME ${FIL} NAME) -- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz -- COMMAND ${GZIP} -c ${FIL} > ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz -- DEPENDS ${FIL}) -- list(APPEND GZFILES "${CMAKE_CURRENT_BINARY_DIR}/${NAME}.gz") --endforeach() --add_custom_target(man ALL DEPENDS ${GZFILES}) --install(FILES ${GZFILES} DESTINATION share/bcc/man/man8) -+install(FILES ${FILES} DESTINATION share/man/man8) diff --git a/1003-add-u64-define.patch b/1003-add-u64-define.patch new file mode 100644 index 0000000000000000000000000000000000000000..7132712ea32c9220745b99ae5517d78bc6c21bac --- /dev/null +++ b/1003-add-u64-define.patch @@ -0,0 +1,24 @@ +From 57ef40d8219e62f791f25186077cc6fc135e246c Mon Sep 17 00:00:00 2001 +From: "songnannan.snn@alibaba-inc.com" +Date: Sun, 2 Apr 2023 07:32:35 +0800 +Subject: [PATCH 1/1] add u64 define + +--- + libbpf-tools/wakeuptime.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libbpf-tools/wakeuptime.h b/libbpf-tools/wakeuptime.h +index 3c5376a..3f86907 100644 +--- a/libbpf-tools/wakeuptime.h ++++ b/libbpf-tools/wakeuptime.h +@@ -5,6 +5,7 @@ + + #define MAX_ENTRIES 10240 + #define TASK_COMM_LEN 16 ++#define u64 unsigned long long + + struct key_t { + char waker[TASK_COMM_LEN]; +-- +2.31.1 + diff --git a/bcc.spec b/bcc.spec index 1d1eb99286545ea73f12667f26a93e3d6b48c450..c75c720112a07f20c8046e7d0f952b0f8226cfd2 100644 --- a/bcc.spec +++ b/bcc.spec @@ -1,90 +1,80 @@ %define anolis_release 1 - -%global with_llvm_shared 1 +%bcond_with ignore_lua Name: bcc -Version: 0.25.0 +Version: 0.26.0 Release: %{anolis_release}%{?dist} Summary: BPF Compiler Collection (BCC) License: ASL 2.0 URL: https://github.com/iovisor/bcc -Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +Source0: %{url}/archive/refs/tags/v%{version}.tar.gz Patch1000: 1000-bcc-anolis-ali-enhanced-tools-for-fs-schedule-sys.patch -Patch1001: 1001-bcc-fix-man-pages-install-dir.patch +Patch1001: 1001-Skiping-cases-in-libbpf-tools.patch +Patch1003: 1003-add-u64-define.patch -ExclusiveArch: x86_64 aarch64 +BuildRequires: cmake >= 2.8.12 llvm-devel clang-devel +BuildRequires: flex bison +BuildRequires: elfutils-libelf-devel elfutils-debuginfod-client-devel +BuildRequires: ncurses-devel python3-devel libxml2-devel +BuildRequires: libbpf-devel >= 1.0.0 libbpf-static >= 1.0.0 -BuildRequires: bison -BuildRequires: cmake >= 2.8.7 -BuildRequires: flex -BuildRequires: libxml2-devel -BuildRequires: python3-devel -BuildRequires: elfutils-libelf-devel -BuildRequires: elfutils-debuginfod-client-devel -BuildRequires: llvm-devel -BuildRequires: clang-devel -BuildRequires: ncurses-devel +%if %{without ignore_lua} BuildRequires: pkgconfig(luajit) -BuildRequires: libbpf-devel >= 0.0.5, libbpf-static >= 0.0.5 +%endif -Requires: libbpf >= 0.0.5 -Requires: tar +Requires: libbpf >= 1.0.0 tar Recommends: kernel-devel +Recommends: %{name}-tools = %{EVR} -Recommends: %{name}-tools = %{version}-%{release} +ExclusiveArch: x86_64 aarch64 %description BCC is a toolkit for creating efficient kernel tracing and manipulation programs, and includes several useful tools and examples. It makes use of extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature -that was first added to Linux 3.15. BCC makes BPF programs easier to write, -with kernel instrumentation in C (and includes a C wrapper around LLVM), and -front-ends in Python and lua. It is suited for many tasks, including -performance analysis and network traffic control. - +that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1 +and above. %package devel Summary: Shared library for BPF Compiler Collection (BCC) -Requires: %{name} = %{version}-%{release} +Requires: %{name} = %{EVR} Suggests: elfutils-debuginfod-client %description devel The %{name}-devel package contains libraries and header files for developing application that use BPF Compiler Collection (BCC). - %package doc Summary: Examples for BPF Compiler Collection (BCC) -Recommends: python3-%{name} = %{version}-%{release} -Recommends: %{name}-lua = %{version}-%{release} +Recommends: python3-%{name} = %{EVR} +Recommends: %{name}-lua = %{EVR} BuildArch: noarch %description doc Examples for BPF Compiler Collection (BCC) - %package -n python3-%{name} Summary: Python3 bindings for BPF Compiler Collection (BCC) -Requires: %{name} = %{version}-%{release} +Requires: %{name} = %{EVR} BuildArch: noarch %description -n python3-%{name} Python3 bindings for BPF Compiler Collection (BCC) - +%if %{without ignore_lua} %package lua Summary: Standalone tool to run BCC tracers written in Lua -Requires: %{name} = %{version}-%{release} +Requires: %{name} = %{EVR} %description lua Standalone tool to run BCC tracers written in Lua - +%endif %package tools Summary: Command line tools for BPF Compiler Collection (BCC) -Requires: bcc = %{version}-%{release} -Requires: python3-%{name} = %{version}-%{release} +Requires: bcc = %{EVR} +Requires: python3-%{name} = %{EVR} Requires: python3-netaddr %description tools @@ -101,15 +91,14 @@ Command line libbpf tools for BPF Compiler Collection (BCC) %prep %autosetup -p1 - %build %cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DREVISION_LAST=%{version} -DREVISION=%{version} -DPYTHON_CMD=python3 \ -DCMAKE_USE_LIBBPF_PACKAGE:BOOL=TRUE \ - %{?with_llvm_shared:-DENABLE_LLVM_SHARED=1} + -DENABLE_LLVM_SHARED=1 %cmake_build -pushd libbpf-tools; +pushd libbpf-tools make BPFTOOL=bpftool LIBBPF_OBJ=%{_libdir}/libbpf.a CFLAGS="%{optflags}" LDFLAGS="%{build_ldflags}" make DESTDIR=./tmp-install prefix= install ( @@ -117,7 +106,6 @@ make DESTDIR=./tmp-install prefix= install for file in *; do mv $file bpf-$file done - # now fix the broken symlinks for file in `find . -type l`; do dest=$(readlink "$file") ln -s -f bpf-$dest $file @@ -128,32 +116,35 @@ popd %install %cmake_install -# Fix python shebangs find %{buildroot}%{_datadir}/%{name}/{tools,examples} -type f -exec \ sed -i -e '1s=^#!/usr/bin/python\([0-9.]\+\)\?$=#!%{__python3}=' \ -e '1s=^#!/usr/bin/env python\([0-9.]\+\)\?$=#!%{__python3}=' \ -e '1s=^#!/usr/bin/env bcc-lua$=#!/usr/bin/bcc-lua=' {} \; +# Move man pages to the right location to avoid conflict with other manpages +mkdir -p %{buildroot}%{_mandir} +mv %{buildroot}%{_datadir}/%{name}/man/* %{buildroot}%{_mandir}/ +for i in `find %{buildroot}%{_mandir} -name "*.gz"`; do + tname=$(basename $i) + rename $tname %{name}-$tname $i +done + mkdir -p %{buildroot}%{_docdir}/%{name} mv %{buildroot}%{_datadir}/%{name}/examples %{buildroot}%{_docdir}/%{name}/ -# Delete old tools we don't want to ship rm -rf %{buildroot}%{_datadir}/%{name}/tools/old/ +mkdir -p %{buildroot}/%{_sbindir} +install -p libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir}/ %generate_compatibility_deps -%check - -mkdir -p %{buildroot}/%{_sbindir} -cp -a libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir}/ - %files -%dir %{abidir} -%doc README.md -%license LICENSE.txt %{_libdir}/lib%{name}.so.* %{_libdir}/libbcc_bpf.so.* + +%dir %{abidir} %{abidir}/lib%{name}*.dump +%license LICENSE.txt %files devel %exclude %{_libdir}/lib%{name}*.a @@ -161,11 +152,13 @@ cp -a libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir}/ %{_libdir}/libbcc_bpf.so %{_libdir}/pkgconfig/lib%{name}.pc %{_includedir}/%{name}/ +%{abidir}/lib%{name}*.dump %files -n python3-%{name} %{python3_sitelib}/%{name}* %files doc +%doc README.md %dir %{_docdir}/%{name} %doc %{_docdir}/%{name}/examples/ @@ -175,13 +168,20 @@ cp -a libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir}/ %{_datadir}/%{name}/introspection/ %{_mandir}/man8/* +%if %{without ignore_lua} %files lua %{_bindir}/bcc-lua +%endif %files -n libbpf-tools %{_sbindir}/bpf-* +%{abidir}/bpf-*-option.list %changelog +* Thu Apr 13 2023 Yuanhong Peng - 0.26.0-1 +- Update to 0.26.0 +- Fix man page conflict + * Wed Feb 15 2023 Chunmei Xu - 0.25.0-1 - update to 0.25.0 - add ali enhenced tools for fs, schedule and sys diff --git a/bcc-0.25.0.tar.gz b/v0.26.0.tar.gz similarity index 40% rename from bcc-0.25.0.tar.gz rename to v0.26.0.tar.gz index 8e29830181c2114664ff192fc3e28e743c403c0f..8c8723932aab63b88ef7185158d7066450bb8238 100644 Binary files a/bcc-0.25.0.tar.gz and b/v0.26.0.tar.gz differ