diff --git a/.gitignore b/.gitignore index fda61d0..a114228 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ /bpftrace-0.18.0.tar.gz /bpftrace-0.19.1.tar.gz /bpftrace-0.20.1.tar.gz +/bpftrace-0.21.1.tar.gz diff --git a/0001-Workaround-OpaquePointers-for-LLVM-15.patch b/0001-Workaround-OpaquePointers-for-LLVM-15.patch deleted file mode 100644 index a8bd291..0000000 --- a/0001-Workaround-OpaquePointers-for-LLVM-15.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 07fa48a94ef6d6bb1f335de345de18fe9776ca57 Mon Sep 17 00:00:00 2001 -From: kenneth topp -Date: Mon, 26 Sep 2022 00:33:29 -0400 -Subject: [PATCH] Workaround OpaquePointers for LLVM 15 - -This workaround allows bpftrace to be compiled against -LLVM-15. This will have to be address properly before LLVM-16 -More details from LLVM here: https://llvm.org/docs/OpaquePointers.html ---- - src/ast/irbuilderbpf.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/ast/irbuilderbpf.cpp b/src/ast/irbuilderbpf.cpp -index d49883f7..00f0f172 100644 ---- a/src/ast/irbuilderbpf.cpp -+++ b/src/ast/irbuilderbpf.cpp -@@ -123,6 +123,9 @@ IRBuilderBPF::IRBuilderBPF(LLVMContext &context, - module_(module), - bpftrace_(bpftrace) - { -+#if LLVM_VERSION_MAJOR == 15 -+ context.setOpaquePointers(false); -+#endif - // Declare external LLVM function - FunctionType *pseudo_func_type = FunctionType::get( - getInt64Ty(), --- -2.37.3 - diff --git a/bpftrace-0.21.1-RHEL-aarch64-fixes-statsnoop-and-opensnoop.patch b/bpftrace-0.21.1-RHEL-aarch64-fixes-statsnoop-and-opensnoop.patch new file mode 100644 index 0000000..bb19d11 --- /dev/null +++ b/bpftrace-0.21.1-RHEL-aarch64-fixes-statsnoop-and-opensnoop.patch @@ -0,0 +1,66 @@ +From 6c8eccec1d7112ac5c64ced79df599215de9bd34 Mon Sep 17 00:00:00 2001 +From: Jerome Marchand +Date: Thu, 11 Jun 2020 14:56:36 +0200 +Subject: [PATCH] RHEL: aarch64: fixes statsnoop and opensnoop + +On aarch64 the open syscall has been dropped. Only openat remains, +wich is called by libc open() function. + +The state of *stat* syscalls, is a mess. They are several generations +of the system calls, and not all arches provides all of them. For +instance, new(l)stat are missing from aarch64. + +The only way I can think of fixing thess is RHEL-8 only arch specific +patches. + +Signed-off-by: Jerome Marchand +--- + tools/opensnoop.bt | 2 -- + tools/statsnoop.bt | 8 ++------ + 2 files changed, 2 insertions(+), 8 deletions(-) + +diff --git a/tools/opensnoop.bt b/tools/opensnoop.bt +index bbb26419..95185e5f 100755 +--- a/tools/opensnoop.bt ++++ b/tools/opensnoop.bt +@@ -21,13 +21,11 @@ BEGIN + printf("%-6s %-16s %4s %3s %s\n", "PID", "COMM", "FD", "ERR", "PATH"); + } + +-tracepoint:syscalls:sys_enter_open, + tracepoint:syscalls:sys_enter_openat + { + @filename[tid] = args.filename; + } + +-tracepoint:syscalls:sys_exit_open, + tracepoint:syscalls:sys_exit_openat + /@filename[tid]/ + { +diff --git a/tools/statsnoop.bt b/tools/statsnoop.bt +index a76b2bcc..89c2c8ea 100755 +--- a/tools/statsnoop.bt ++++ b/tools/statsnoop.bt +@@ -30,17 +30,13 @@ tracepoint:syscalls:sys_enter_statfs + @filename[tid] = args.pathname; + } + +-tracepoint:syscalls:sys_enter_statx, +-tracepoint:syscalls:sys_enter_newstat, +-tracepoint:syscalls:sys_enter_newlstat ++tracepoint:syscalls:sys_enter_statx + { + @filename[tid] = args.filename; + } + + tracepoint:syscalls:sys_exit_statfs, +-tracepoint:syscalls:sys_exit_statx, +-tracepoint:syscalls:sys_exit_newstat, +-tracepoint:syscalls:sys_exit_newlstat ++tracepoint:syscalls:sys_exit_statx + /@filename[tid]/ + { + $ret = args.ret; +-- +2.45.0 + diff --git a/bpftrace.spec b/bpftrace.spec index ef98e4c..1669bf4 100644 --- a/bpftrace.spec +++ b/bpftrace.spec @@ -1,12 +1,13 @@ Name: bpftrace -Version: 0.20.1 -Release: 2%{?dist} +Version: 0.21.1 +Release: 1%{?dist} Summary: High-level tracing language for Linux eBPF License: Apache-2.0 URL: https://github.com/iovisor/bpftrace Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -Patch1: 0001-Workaround-OpaquePointers-for-LLVM-15.patch + +Patch10: %{name}-%{version}-RHEL-aarch64-fixes-statsnoop-and-opensnoop.patch # Arches will be included as upstream support is added and dependencies are # satisfied in the respective arches @@ -25,9 +26,7 @@ BuildRequires: libbpf-devel BuildRequires: libbpf-static BuildRequires: binutils-devel BuildRequires: cereal-devel -%if ! 0%{?rhel} -BuildRequires: libdwarf-devel -%endif +BuildRequires: lldb-devel BuildRequires: rubygem-asciidoctor @@ -69,21 +68,27 @@ find %{buildroot}%{_datadir}/%{name}/tools -type f -exec \ %files %doc README.md CONTRIBUTING-TOOLS.md -%doc docs/reference_guide.md docs/tutorial_one_liners.md +%doc man/adoc/bpftrace.adoc 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 +# Do not include old versions of tools, they do not work on RHEL 10 +%exclude %{_datadir}/%{name}/tools/old %changelog +* Tue Jun 25 2024 Viktor Malik - 0.21.1-1 +- Rebased to version 0.21.1 +- Resolves: RHEL-36076 +- Rebuilt for LLVM 18 +- Resolves: RHEL-27729 + * Mon Jun 24 2024 Troy Dawson - 0.20.1-2 - Bump release for June 2024 mass rebuild diff --git a/sources b/sources index d027243..c00bb53 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (bpftrace-0.20.1.tar.gz) = fdcc2b0d091d4ab428207877626b0fb37f3e0778730e6a6db26be869a086264e1f24186857c47597813aacde98621a66301bcf6c8004f77bdf9ebf180f198ba0 +SHA512 (bpftrace-0.21.1.tar.gz) = db6f5faf65fc2ac55ffbd1799b70941b8a6e4036c7fc2f56fe134f932dcf8a14fdd11a5a8b1d4b20261932d2d1ac18636cc1d7d4b87b31e366a9e53514a84ad3