Compare commits

...

No commits in common. "c8" and "c9" have entirely different histories.
c8 ... c9

6 changed files with 100 additions and 181 deletions

View File

@ -1,4 +1,4 @@
From dfc1f92653707c8d11bdb3be98e68f8297b9bc71 Mon Sep 17 00:00:00 2001
From 7afe3ced2b91d940a8d72755043ac2468687f1ee Mon Sep 17 00:00:00 2001
From: Viktor Malik <viktor.malik@gmail.com>
Date: Mon, 10 Oct 2022 14:26:38 +0200
Subject: [PATCH] IR builder: get rid of getPointerElementType calls

View File

@ -1,7 +1,7 @@
From 7598b2b918835ab71e48bd7617812bde3a2537a7 Mon Sep 17 00:00:00 2001
From b23980e4f6ed33d98f4f09ef25ae17baca215cce Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
Date: Thu, 11 Jun 2020 14:56:36 +0200
Subject: [PATCH 4/6] RHEL-8: aarch64: fixes statsnoop and opensnoop
Subject: [PATCH 6/6] RHEL: aarch64: fixes statsnoop and opensnoop
On aarch64 the open syscall has been dropped. Only openat remains,
wich is called by libc open() function.
@ -12,6 +12,8 @@ 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 <jmarchan@redhat.com>
---
tools/opensnoop.bt | 2 --
tools/statsnoop.bt | 8 ++------

View File

@ -1,82 +0,0 @@
From 7e813d0e3048f52781199384a120f5e5cbad22ae Mon Sep 17 00:00:00 2001
From: Viktor Malik <viktor.malik@gmail.com>
Date: Mon, 5 Dec 2022 13:31:25 +0100
Subject: [PATCH] RHEL8: remove not existing attachpoints from tools
tools/bio* attempt to attach each probe to multiple kprobes to cover all
possible systems. Remove probes which do not exist in RHEL8 to remove
unnecessary warnings.
---
tools/biolatency.bt | 6 ++----
tools/biostacks.bt | 4 +---
tools/old/biosnoop.bt | 6 ++----
3 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/tools/biolatency.bt b/tools/biolatency.bt
index d5af1f29..4ea910b4 100755
--- a/tools/biolatency.bt
+++ b/tools/biolatency.bt
@@ -16,14 +16,12 @@ BEGIN
printf("Tracing block device I/O... Hit Ctrl-C to end.\n");
}
-kprobe:blk_account_io_start,
-kprobe:__blk_account_io_start
+kprobe:blk_account_io_start
{
@start[arg0] = nsecs;
}
-kprobe:blk_account_io_done,
-kprobe:__blk_account_io_done
+kprobe:blk_account_io_done
/@start[arg0]/
{
@usecs = hist((nsecs - @start[arg0]) / 1000);
diff --git a/tools/biostacks.bt b/tools/biostacks.bt
index 1bc9f819..80d8cb9e 100755
--- a/tools/biostacks.bt
+++ b/tools/biostacks.bt
@@ -18,14 +18,12 @@ BEGIN
printf("Tracing block I/O with init stacks. Hit Ctrl-C to end.\n");
}
-kprobe:blk_account_io_start,
-kprobe:__blk_account_io_start
+kprobe:blk_account_io_start
{
@reqstack[arg0] = kstack;
@reqts[arg0] = nsecs;
}
-kprobe:blk_start_request,
kprobe:blk_mq_start_request
/@reqts[arg0]/
{
diff --git a/tools/old/biosnoop.bt b/tools/old/biosnoop.bt
index 1a99643a..327251e3 100755
--- a/tools/old/biosnoop.bt
+++ b/tools/old/biosnoop.bt
@@ -22,8 +22,7 @@ BEGIN
printf("%-12s %-7s %-16s %-6s %7s\n", "TIME(ms)", "DISK", "COMM", "PID", "LAT(ms)");
}
-kprobe:blk_account_io_start,
-kprobe:__blk_account_io_start
+kprobe:blk_account_io_start
{
@start[arg0] = nsecs;
@iopid[arg0] = pid;
@@ -31,8 +30,7 @@ kprobe:__blk_account_io_start
@disk[arg0] = ((struct request *)arg0)->rq_disk->disk_name;
}
-kprobe:blk_account_io_done,
-kprobe:__blk_account_io_done
+kprobe:blk_account_io_done
/@start[arg0] != 0 && @iopid[arg0] != 0 && @iocomm[arg0] != ""/
{
--
2.38.1

View File

@ -1,7 +1,8 @@
From e661f2a043f8b6548e0bb3e0cc5992d7c0ff3b0f Mon Sep 17 00:00:00 2001
From 652562eef0d53649cf29c256bc20abdffdd195ab Mon Sep 17 00:00:00 2001
From: Rong Tao <rongtao@cestc.cn>
Date: Sat, 1 Oct 2022 16:15:27 +0800
Subject: [PATCH] tcpdrop: Fix: ERROR: Error attaching probe: 'kprobe:tcp_drop'
Subject: [PATCH 1/2] tcpdrop: Fix: ERROR: Error attaching probe:
'kprobe:tcp_drop'
kernel commit 8fbf195798b5('tcp_drop() is no longer needed.') remove
the kprobe:tcp_drop, bcc commit 16eab39171eb('Add

View File

@ -1,27 +0,0 @@
From 31a42a47b90f97a2a8c2446101c0007cf09288bc Mon Sep 17 00:00:00 2001
From: Viktor Malik <viktor.malik@gmail.com>
Date: Mon, 5 Dec 2022 11:57:24 +0100
Subject: [PATCH] tools/old/mdflush.bt: fix BPFTRACE_HAVE_BTF macro
The correct macro to use is called BPFTRACE_HAVE_BTF, not
__BPFTRACE_HAVE_BTF.
---
tools/old/mdflush.bt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/old/mdflush.bt b/tools/old/mdflush.bt
index 921c8f1b..23c7dd51 100755
--- a/tools/old/mdflush.bt
+++ b/tools/old/mdflush.bt
@@ -15,7 +15,7 @@
* 08-Sep-2018 Brendan Gregg Created this.
*/
-#ifndef __BPFTRACE_HAVE_BTF
+#ifndef BPFTRACE_HAVE_BTF
#include <linux/genhd.h>
#include <linux/bio.h>
#endif
--
2.38.1

View File

@ -1,8 +1,6 @@
%bcond_without llvm_static
Name: bpftrace
Version: 0.16.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: High-level tracing language for Linux eBPF
License: ASL 2.0
@ -11,15 +9,14 @@ License: ASL 2.0
URL: https://github.com/iovisor/bpftrace
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# Cereal is a header-only serialization library which is not packaged into
# RHEL8, so we download it manually. This is ok to do as it is only necessary
# RHEL9, so we download it manually. This is ok to do as it is only necessary
# for build.
Source1: https://github.com/USCiLab/cereal/archive/v%{cereal_version}/cereal-%{cereal_version}.tar.gz
Patch0: %{name}-%{version}-IR-builder-get-rid-of-getPointerElementType-calls.patch
Patch1: %{name}-%{version}-tools-old-mdflush.bt-fix-BPFTRACE_HAVE_BTF-macro.patch
Patch2: %{name}-%{version}-tcpdrop-Fix-ERROR-Error-attaching-probe-kprobe-tcp_d.patch
Patch3: %{name}-%{version}-RHEL8-remove-not-existing-attachpoints-from-tools.patch
Patch10: %{name}-%{version}-RHEL-8-aarch64-fixes-statsnoop-and-opensnoop.patch
Patch1: %{name}-%{version}-tcpdrop-Fix-ERROR-Error-attaching-probe-kprobe-tcp_d.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
@ -33,17 +30,11 @@ BuildRequires: elfutils-libelf-devel
BuildRequires: zlib-devel
BuildRequires: llvm-devel
BuildRequires: clang-devel
BuildRequires: bcc-devel
BuildRequires: bcc-devel >= 0.19.0-8
BuildRequires: libbpf-devel
BuildRequires: libbpf-static
BuildRequires: binutils-devel
%if %{with llvm_static}
BuildRequires: llvm-static
%endif
# We don't need kernel-devel to use bpftrace, but some tools need it
Recommends: kernel-devel
%description
BPFtrace is a high-level tracing language for Linux enhanced Berkeley Packet
@ -71,7 +62,7 @@ export CPATH
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTING:BOOL=OFF \
-DBUILD_SHARED_LIBS:BOOL=OFF
%make_build
%cmake_build
%install
@ -81,16 +72,12 @@ export CPATH
%global __os_install_post %{nil}
%global _find_debuginfo_opts -g
%make_install
%cmake_install
# Fix shebangs (https://fedoraproject.org/wiki/Packaging:Guidelines#Shebang_lines)
find %{buildroot}%{_datadir}/%{name}/tools -type f -exec \
sed -i -e '1s=^#!/usr/bin/env %{name}\([0-9.]\+\)\?$=#!%{_bindir}/%{name}=' {} \;
# Some tools require old versions for RHEL8
cp %{buildroot}/%{_datadir}/%{name}/tools/old/biosnoop.bt %{buildroot}/%{_datadir}/%{name}/tools
cp %{buildroot}/%{_datadir}/%{name}/tools/old/mdflush.bt %{buildroot}/%{_datadir}/%{name}/tools
%files
%doc README.md CONTRIBUTING-TOOLS.md
@ -99,78 +86,116 @@ cp %{buildroot}/%{_datadir}/%{name}/tools/old/mdflush.bt %{buildroot}/%{_datadir
%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
%{_datadir}/%{name}/tools/doc/*.txt
# Do not include old versions of tools.
# Those that are needed were already installed as normal tools.
# Do not include old versions of tools, they do not work on RHEL 9
%exclude %{_datadir}/%{name}/tools/old
%changelog
* Wed Nov 30 2022 Viktor Malik <vmalik@redhat.com> - 0.16.0-1
- Rebase on bpftrace 0.16.0
- Rebuild for LLVM15
- Download the cereal library (not packaged into RHEL8)
* Tue Jan 03 2023 Viktor Malik <vmalik@redhat.com> - 0.16.0-2
- Fix missing kprobe attachpoints for bio* tools (s390x, ppc64le)
- Rebuild for libbpf 1.0.0
- Resolves: rhbz#2157829
- Related: rhbz#2157592
* Thu Jun 02 2022 Jerome Marchand <jmarchan@redhat.com> - 0.13.1-1
- Rebase on bpftrace 0.13.1
- Rebuild on LLVM14
* Fri Dec 16 2022 Viktor Malik <vmalik@redhat.com> - 0.16.0-1
- Rebase on bpftrace 0.16.0 (rhbz#2121920)
- Rebuild for LLVM 15 (rhbz#2118995)
- Download the cereal library (not packaged into RHEL9)
- Fixed several tools (rhbz#1975148, rhbz#2088577, rhbz#2128208, rhbz#2073675,
rhbz#2073770)
- Resolve conflicts between bpftrace and bcc manpages (rhbz#2075076)
* Thu Dec 02 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-4
* Mon May 16 2022 Jerome Marchand <jmarchan@redhat.com> - 0.13.1-1
- Rebase to bpftrace 0.13.1
- Rebuild for LLVM14
* Mon Feb 21 2022 Viktor Malik <vmalik@redhat.com> - 0.12.1-8
- Fix wildcard listing bug
- Fix bio* tools
* Thu Dec 02 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1.7
- Bump up required bcc version.
* Thu Dec 02 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1.6
- Rebuild on LLVM13
- Small spec cleanup
* Thu Jun 24 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-3
- Have threadsnoop points to libpthread.so.0
* Mon Oct 18 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1.5
- threadsnoop: probe libpthread.so.0
- Fix aarch64 failures
* Wed Jun 09 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-2
- Rebuild on LLVM12
* Mon Oct 18 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1.4
- Fix gating
* Fri Apr 30 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-1
- Rebase on bpftrace 0.12.1
* Fri Oct 15 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.1-3
- Fix mdflush (rhbz#1967567)
* Thu Jan 28 2021 Jerome Marchand <jmarchan@redhat.com> - 0.11.1-3
- Add missing libbpf and binutils-dev dependencies
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.12.1-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Wed Nov 11 2020 Jerome Marchand <jmarchan@redhat.com> - 0.11.1-2
- Fix statsnoop and opensnoop on aarch64 again
* Thu May 27 2021 Jerome Marchand <jmarchan@redhat.com> - 0.12.0-1
- Rebase to bpftrace 0.12.1
* Fri Nov 06 2020 Jerome Marchand <jmarchan@redhat.com> - 0.11.1-1
- Rebase on bpftrace 0.11.1
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 0.11.0-10
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Oct 27 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-5
- Rebuild for bcc 0.16.0
* Fri Feb 12 2021 Jerome Marchand <jmarchan@redhat.com> - 0.11.0-9
- Last build failed: rebuild.
* Thu Jun 11 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-4
- Fix KBUILD_MODNAME
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Thu Jun 11 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-3
- Fix ENOMEM issue on arm64 machine with many cpus
- Fix statsnoop and opensnoop on aarch64
- Drop tcpdrop on ppc64
* Fri Jan 22 2021 Tom Stellard <tstellar@redhat.com> - 0.11.0-7
- Rebuild for clang-11.1.0
* Tue May 05 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-2
- Fix libpthread path in threadsnoop
* Fri Dec 04 2020 Jeff Law <law@redhat.com> - 0.11.0-6
- Fix missing #include for gcc-11
* Wed Apr 22 2020 Jerome Marchand <jmarchan@redhat.com> - 0.10.0-1
- Rebase on bpftrace 0.10.0
* Fri Nov 13 2020 Jerome Marchand <jmarchan@redhat.com> - 0.11.0-5
- Rebuilt for LLVM 11
* Fri Nov 08 2019 Jerome Marchand <jmarchan@redhat.com> - 0.9.2-1
- Rebase on bpftrace 0.9.2
* Tue Aug 04 2020 Augusto Caringi <acaringi@redhat.com> - 0.11.0-4
- Fix FTBFS due to cmake wide changes #1863295
- Fix 'bpftrace symbols are stripped' #1865787
* Tue Jun 18 2019 Jerome Marchand <jmarchan@redhat.com> - 0.9-3
- Don't allow to raw_spin_lock* kprobes that can deadlock the kernel.
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-3
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jun 12 2019 Jerome Marchand <jmarchan@redhat.com> - 0.9-2
- Fixes gethostlatency
- Fixes a struct definition issue that made several tools fail
- Add CI gating
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed May 15 2019 Jerome Marchand <jmarchan@redhat.com> - 0.9.1
- Original build on RHEL 8
* Thu Jul 16 2020 Augusto Caringi <acaringi@redhat.com> - 0.11.0-1
* Rebased to version 0.11.0
* Tue May 19 2020 Augusto Caringi <acaringi@redhat.com> - 0.10.0-2
- Rebuilt for new bcc/libbpf versions
* Tue Apr 14 2020 Augusto Caringi <acaringi@redhat.com> - 0.10.0-1
- Rebased to version 0.10.0
- Dropped support for s390x temporaly due to build error
* Thu Feb 06 2020 Augusto Caringi <acaringi@redhat.com> - 0.9.4-1
- Rebased to version 0.9.4
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Nov 21 2019 Augusto Caringi <acaringi@redhat.com> - 0.9.3-1
- Rebased to version 0.9.3
* Thu Aug 01 2019 Augusto Caringi <acaringi@redhat.com> - 0.9.2-1
- Rebased to version 0.9.2
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Jun 26 2019 Augusto Caringi <acaringi@redhat.com> - 0.9.1-1
- Rebased to version 0.9.1
* Thu Apr 25 2019 Augusto Caringi <acaringi@redhat.com> - 0.9-3
- Rebuilt for bcc 0.9.0