From 4dadf66bc7052fe4a08edd860b2b9a328234819c8758320b86bd9f46ba71af46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 30 Aug 2024 15:31:50 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main bpftrace revision 918c164f88d082f279cc904640235cb9 --- .gitattributes | 23 +++ bpftrace-0.20.4.tar.gz | 3 + bpftrace.changes | 413 +++++++++++++++++++++++++++++++++++++++++ bpftrace.spec | 135 ++++++++++++++ 4 files changed, 574 insertions(+) create mode 100644 .gitattributes create mode 100644 bpftrace-0.20.4.tar.gz create mode 100644 bpftrace.changes create mode 100644 bpftrace.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/bpftrace-0.20.4.tar.gz b/bpftrace-0.20.4.tar.gz new file mode 100644 index 0000000..65ac90d --- /dev/null +++ b/bpftrace-0.20.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7182c59db82dd4eac69fc74d6eb43656e2b45795df0a89840ae0456966d985da +size 1233327 diff --git a/bpftrace.changes b/bpftrace.changes new file mode 100644 index 0000000..9d85704 --- /dev/null +++ b/bpftrace.changes @@ -0,0 +1,413 @@ +------------------------------------------------------------------- +Wed May 22 07:17:45 UTC 2024 - Shung-Hsi Yu + +- Update to 0.20.4 + * Drop the kernel headers unpack and caching feature + +------------------------------------------------------------------- +Tue Mar 26 13:01:31 UTC 2024 - Shung-Hsi Yu + +- Update to 0.20.3 to fix build on pre-v5.14 kernel +- Drop fix-build-issue-when-using-UAPI-of-older-kernel.patch which is + now included + +------------------------------------------------------------------- +Tue Mar 19 05:31:53 UTC 2024 - Shung-Hsi Yu + +- Change LLVM version macro to the cleaner alternative that supports SLE as + well, matching the one used in bcc package + +------------------------------------------------------------------- +Fri Mar 8 06:42:00 UTC 2024 - Shung-Hsi Yu + +- Update to 0.20.2 + * Fix security hole checking unpacked kernel headers (CVE-2024-2313) +- Add fix-build-issue-when-using-UAPI-of-older-kernel.patch to + fix build issue on pre-v6.0 kernel + +------------------------------------------------------------------- +Wed Jan 31 07:31:21 UTC 2024 - Shung-Hsi Yu + +- Change LLVM version macro to the cleaner alternative suggested in + SR#1134405 +- Update to 0.20.1 + * Add log2 histograms with finer granularity + * Add support for uprobe_multi link + * Attach BTF to generated BPF programs + * Add fentry/fexit aliases for kfunc/kretfunc + * Support pid targeting for uprobe + * New builtin for getting the number of map elements + * New config block syntax and standardize config and env var names + * Add a jiffies builtin for advanced usages + * Fix silent truncation of 64-bit values in hist() + * Fix retval for kretfunc/fexit + * Add PPID field to execsnoop.bt + +------------------------------------------------------------------- +Wed Dec 20 22:44:04 UTC 2023 - Aaron Puchert + +- No longer keep debug info: this is not needed since version 0.16 + because of gh#iovisor/bpftrace#2264. This reduces binary and + package size significantly, and shouldn't regress on bsc#1178928. +- Enable (Thin)LTO via CMake. + +------------------------------------------------------------------- +Thu Dec 14 11:21:31 UTC 2023 - Shung-Hsi Yu + +- Bump LLVM major version to 17 +- Support DWARF parsing (boo#1217737) + +------------------------------------------------------------------- +Mon Nov 13 09:17:21 UTC 2023 - Shung-Hsi Yu + +- Update to 0.19.1 + * Support all iterators + * Support parsing bitfields from BTF/DWARF and printing entire + structs + * Support using BTF for tracepoints defined in modules + * PowerPC + * Enable watchpoint support + * Add new function, offsetof, get the offset of the element in + the struct + * Add iter:task_vma iterators detection + * Add trailer to truncated strings + * Support func builtin for k(ret)func probes + * Support casting int <-> int array + * Support targeting all running processes for USDTs + * Improve attaching to uprobes with size 0 + * Make args a structure (instead of a pointer) + * Improve user symbol resolution + * uprobes: make C++ symbol demangling explicit + * uprobe: improve C++ probes listing + * Fix segfaults in dwarf_parser + * Fix resolving username for malformed /etc/passwd + * Fix crashes when maps are concurrently modified + * Fix alignment of byte arrays inside tuples + * Allow '+' in attach point path + * Improve listing and 'probe' builtin for several probe types + * Allow probe builtin with aliased software/hardware probes + * Support executing symlinked binaries with -c + * Add access to CLOCK_MONOTONIC with nsecs(monotonic) + * iter: Skip structures with '__safe_trusted' suffix + * Improve detection of unknown typedefs in ClangParser +- Drop Vendor-BPF_F_KPROBE_MULTI_RETURN-definition.patch since it + is included from v0.18.0 + +------------------------------------------------------------------- +Mon Mar 6 08:57:00 UTC 2023 - Shung-Hsi Yu + +- Add Vendor-BPF_F_KPROBE_MULTI_RETURN-definition.patch to fix build on + Leap 15.5/SLES 15-SP5 + +------------------------------------------------------------------- +Thu Feb 9 07:35:30 UTC 2023 - Shung-Hsi Yu + +- Set USE_SYSTEM_BPF_BCC to ON so system libraries are used +- Update to 0.17.0 + + Support opaque pointer (boo#1207295) + + Support 32-bit ARM systems + + Support BTF in kernel modules + + Add %rh option to print buffer as hex without \x + + Add stdbool.h to built-in headers + + Raise minimum versions for libbpf and bcc and vendor them for local builds + + Support comparison for integer arrays + + Drop Ubuntu 19.10 lockdown detection + + Fix pointer/register loads on 32-bit architectures + + Fix kprobe multi-attachment + + Fix attaching to multiple USDT probes using the same wildcard + + Fix pointer arithmetics codegen + + Fix segfault for invalid AssignVarStatement visit + + Better handling of missing function trace support files + + Fix unroll ID reset + + Support profile and interval probes in probe matcher + + Fix BTF detection macro in tools/old/mdflush.bt + +------------------------------------------------------------------- +Mon Jan 9 07:19:16 UTC 2023 - Shung-Hsi Yu + +- Bump LLVM major version to 15 in preparation for Leap 15.5/SLES 15-SP5 + +------------------------------------------------------------------- +Thu Sep 1 04:58:08 UTC 2022 - Shung-Hsi Yu + +- Drop Detect-new-BTF-api-btf_dump__new-btf_dump__new_v0_6_0.patch, which is + incorporated since 0.16.0 +- Update to 0.16.0 + + Add builtin: numaid + + Add helper verifier error handling + + Add builtin: pton + + Add builtin: debugf + + Add builtin: strerror + + Move from BCC to libbpf (although BCC is still a dependency) + + Add non-uprobe based BEGIN/END implementation + + Helper errors (-k, -kk options) are now emitted to text or json output + + kprobe offset verification is now optional, without requiring --unsafe + + Disallow different lhist bounds in a single map + + Serialize empty histogram as an empty JSON array + + Handle enum values in tracepoint format defs + + Fix compound assignments with non-unary expr + + Fix invalid LLVM IR in join builtin + + Fix lexer buffer size check + + Fix invalid LLVM IR as detected by tests + + Fix builds against libbfd(binutils) >=2.39 + + Fix access to ctx + + Add sslsnoop and ssllatency tools + + Add undump tool. +- Update to 0.15.0 + + Add option for unconditional hex output + + Add builtin function: cgroup_path + + Limit number of generated BPF programs + + Support the octal format specifier (%o) in printf + + Improve include paths resolution + + Automatic type resolution from DWARF + + Add builtin function: bswap + + Print all maps to stdout on SIGUSR1 + + Use auto-resolution of library paths for tools + + Improve handling empty attach points + + Fix precedence of multiplicative operations + + Fix probe matching for uprobes with absolute address + + Fix tools to work on new kernel versions + + Fix uprobe target resolution + + Fix using wildcards in kfunc + + Improve handling of format strings + + Fix codegen for buf + + Update biosnoop.bt for kernel >=5.17 + +------------------------------------------------------------------- +Tue Jun 21 08:36:57 UTC 2022 - pgajdos@suse.com + +- do not link against the shared BFD libraries [bsc#1200630] + +------------------------------------------------------------------- +Fri Apr 22 07:35:09 UTC 2022 - Shung-Hsi Yu + +- Update to 0.14.1 + + Fix precedence of multiplicative operations +- Add Detect-new-BTF-api-btf_dump__new-btf_dump__new_v0_6_0.patch to fix + compilation error when building with libbpf v0.6 + +------------------------------------------------------------------- +Tue Oct 26 07:46:27 UTC 2021 - Stephan Kulow + +- Update to 0.14.0 + + Support microsecond timestamps in stftime() + + Add _ as integer literal digit separator + + Support for C style integer suffix in parser + + Add C like pointer arithmetic + + Automatic resolution of library paths for uprobes + + Support positional parameters as integer literals + + Access to uprobe arguments by name + + Prevent LLVM from unrolling loops + + Fix memory leaks in struct types + + Fix strncmp() when N is bigger than on-stack buffer + + Fix strncmp() to check for NUL terminator + + Fix unroll() with async calls + + Fix string comparison codegen + + Fix verifier error when accessing same tracepoint field twice + + Fix reading too many bits for <64 bit kfunc args + + Fix misaligned stack access for map keys + + Write new man page for bpftrace(8) + +------------------------------------------------------------------- +Thu Oct 14 23:54:40 UTC 2021 - Aleksa Sarai + +- Ensure we always use a fixed LLVM major version to match upstream (12 at the + moment). On Leap we use the latest LLVM (9 at the moment) because 12 is not + available. + +------------------------------------------------------------------- +Mon Oct 4 04:11:02 UTC 2021 - Shung-Hsi Yu + +- Update to bpftrace 0.13.0. + + support for LLVM 12 + + warn if attaching a kprobe to a non-traceable function + + support for -k[k] and elapsed in iter probes + + improve JSON printing (nested structs) + + return 1 from tracepoint probes + + preserve original order of struct types + - disallow accessing common tracepoint fields + - forbid casting from/to struct types + +------------------------------------------------------------------- +Fri Apr 16 17:42:10 UTC 2021 - Aleksa Sarai + +- Update to bpftrace 0.12.1. + * Incorrect --info output bug fix release + +------------------------------------------------------------------- +Sat Apr 3 04:19:14 UTC 2021 - Aleksa Sarai + +- Update to bpftrace 0.12.0. + + add path, macaddr, strftime builtin + + allow wildcards for tracepoint categories + + add wildcard support for kfunc probe types + + support scientific notation for integer literals + + list retprobes + + resolve unknown typedefs using BTF and give a hint when a type cannot be found + + support multi-matched globbed targets for uprobe and ustd probes + + positional parameters: support numbers as strings and params as string literals + + support for tracepoint __data_loc fields + + set addrspace info for various builtins + + support watchpoint for kernel space address + + support for pointer to pointer + + support for uprobe refcounts + + support for usdt arguments utilising the index register and scale + + printing structures + - disable str($# + 1) + * array improvements (support assignment to variables and usage as a map key) +- Remove upstreamed patches: + - bpftrace-bsc1180670-sync-man-page-and-help.patch + +------------------------------------------------------------------- +Fri Jan 8 02:54:33 UTC 2021 - Gary Ching-Pang Lin + +- Add bpftrace-bsc1180670-sync-man-page-and-help.patch to sync + man page and help (bsc1180670) + +------------------------------------------------------------------- +Mon Nov 23 06:25:32 UTC 2020 - Aleksa Sarai + +- Do not strip bpftrace binaries -- bpftrace depends on debuginfos for + /proc/self/exe in order to implement the BEGIN trigger. bsc#1178928 + +------------------------------------------------------------------- +Sat Nov 14 23:44:23 UTC 2020 - Aleksa Sarai + +- Update to bpftrace 0.11.4. + * Alpine build bug fix release + * bcc 0.17 support release +- Remove upstreamed patches: + - detect-7-arg-bpf_attach_uprobe.patch + +------------------------------------------------------------------- +Mon Nov 9 01:17:21 UTC 2020 - Marcus Rueckert + +- added detect-7-arg-bpf_attach_uprobe.patch: + fix build with new bpf_attach_uprobe in TW + +------------------------------------------------------------------- +Sat Oct 31 06:05:03 UTC 2020 - Aleksa Sarai + +- Update to bpftrace 0.11.2. + * Support for LLVM 11. + +------------------------------------------------------------------- +Wed Jul 15 22:26:55 UTC 2020 - Aleksa Sarai + +- Update to bpftrace 0.11.0. + +------------------------------------------------------------------- +Tue Apr 14 06:57:29 UTC 2020 - Ismail Dönmez + +- Update to version 0.10.0 + * Support for LLVM 9 and LLVM 10 has been added. + * See the complete changelog at https://github.com/iovisor/bpftrace/releases/tag/v0.10.0 +- Drop upstreamed patches: + - boo1162312-cmake-use-_LIBRARIES-when-testing-for-libbfd-version.patch + - install-man-dir.patch + +------------------------------------------------------------------- +Wed Feb 5 02:21:50 UTC 2020 - Aleksa Sarai + +- Update to bpftrace 0.9.4. + * New calls: signal, override, strncmp. + * Support for attaching to `kprobes` at an offset. + * Support for struct bitfields. + See the upstream changelog for more details: + + +------------------------------------------------------------------- +Fri Jan 31 09:19:26 UTC 2020 - Aleksa Sarai + +- Fix builds on Leap 15.1. This requires quite a bit of trickery related to + binutils (see boo#1162312), but it's nothing too hard. +- Added patch to workaround boo#1162312. + + boo1162312-cmake-use-_LIBRARIES-when-testing-for-libbfd-version.patch + +------------------------------------------------------------------- +Thu Nov 21 20:49:17 UTC 2019 - Luigi Baldoni + +- Update to version 0.9.3 + * Allow attaching to uprobes at an offset + * BTF support + * integer casts + * integer pointer casts + +------------------------------------------------------------------- +Tue Nov 19 06:41:39 UTC 2019 - Gary Ching-Pang Lin + +- Update bpftrace to v0.9.2 + + New environment variables (BPFTRACE_NO_USER_SYMBOLS, + BPFTRACE_LOG_SIZE) + + New probe type: memory watchpoint + + Support for JSON output +- Exclude armv7 and i586 since bcc doesn't support USDT for these + two architectures + +------------------------------------------------------------------- +Tue Aug 20 14:05:31 UTC 2019 - Martin Pluskal + +- Cleanup using spec-cleaner + +------------------------------------------------------------------- +Tue Aug 20 08:50:27 UTC 2019 - Antonio Ojea + +- Add readline missing dependency + +------------------------------------------------------------------- +Sat Jul 13 21:54:11 UTC 2019 - Aaron Puchert + +- Use %cmake for building, don't set flags manually. +- Use %cmake_install instead of installing manually. +- install-man-dir.patch: Fix installation directory for man pages. +- Fix executable bit for tools. +- Fix shebangs in %prep, use -exec instead of piping to xargs. +- Disable LTO, because -flto= isn't supported by Clang. + Also LTO is perhaps not so important here. + +------------------------------------------------------------------- +Wed Jun 26 01:49:06 UTC 2019 - Aleksa Sarai + +- Update bpftrace to v0.9.1. Upstream changelog: + * Additions: + + Introduce compound assignment operators (+= and friends). + + Add support for arrays and IPv6 for the ntop builtin function. + + Add basic support to enums (treat them as constants). + + Add macro definition support. + + Add support for arrays and IPv6 for the ntop builtin function. + + Allow comparison of two string variables. + + Add pre and post behavior to ++ and -- operators. + * Breaking changes: + - Ban kprobes that cause CPU deadlocks. + + Add unsafe-mode and make default execution mode safe-mode. + +------------------------------------------------------------------- +Wed Apr 24 14:58:42 UTC 2019 - Aleksa Sarai + +- Update bpftrace to v0.9. +- Deprecated: sym() and stack() are deprecated. + Use ksym() and kstack() instead. + +------------------------------------------------------------------- +Tue Jan 15 09:56:40 UTC 2019 - Aleksa Sarai + +- Update bpftrace import to 0.0.0 (again). +- Remove patch for bcc-devel now that there is an upstream fix for it + (https://github.com/iovisor/bpftrace/pull/327). boo#1117223 + - 0001-cmake-fix-builds-within-OBS.patch + +------------------------------------------------------------------- +Sun Nov 25 01:11:33 UTC 2018 - Aleksa Sarai + +- Switch to using bcc-devel from Base:System. This required a few backports + from upstream and some other various changes. boo#1117223 + https://github.com/iovisor/bpftrace/pull/227 + * 0001-cmake-fix-builds-within-OBS.patch + +------------------------------------------------------------------- +Tue Oct 30 18:51:01 UTC 2018 - Aleksa Sarai + +- Initial bpftrace 0.0.0 import. Upstream doesn't really have versioning, so + now we just use _service and pull from master. BCC required a bit of + vendoring work, though hopefully we can switch to using bcc-tool-devel. + boo#1117223 diff --git a/bpftrace.spec b/bpftrace.spec new file mode 100644 index 0000000..13e9570 --- /dev/null +++ b/bpftrace.spec @@ -0,0 +1,135 @@ +# +# spec file for package bpftrace +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +# Use default LLVM on openSUSE unless it is not yet supported +%if 0%{?suse_version} >= 1600 || 0%{?is_opensuse} + %if 0%{?product_libs_llvm_ver} > 17 + %define llvm_major_version 17 + %else + %define llvm_major_version %{nil} + %endif +%else + # Hard-code latest LLVM for SLES, the default version is too old + %if 0%{?sle_version} == 150600 + %define llvm_major_version 17 + %else + %if 0%{?sle_version} == 150500 + %define llvm_major_version 15 + %else + %if 0%{?sle_version} == 150400 + %define llvm_major_version 11 + %endif + %endif + %endif +%endif + +Name: bpftrace +Version: 0.20.4 +Release: 0 +Summary: High-level tracing language for Linux eBPF +License: Apache-2.0 +Group: Development/Tools/Debuggers +URL: https://github.com/iovisor/bpftrace +Source: https://github.com/iovisor/bpftrace/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +BuildRequires: binutils +BuildRequires: binutils-devel +BuildRequires: bison +BuildRequires: clang%{llvm_major_version} +BuildRequires: clang%{llvm_major_version}-devel +BuildRequires: cmake +BuildRequires: flex +BuildRequires: libbpf-devel +BuildRequires: libdw-devel +BuildRequires: libxml2-devel +BuildRequires: llvm%{llvm_major_version}-devel +BuildRequires: pkgconfig +BuildRequires: readline-devel +BuildRequires: cmake(cereal) +BuildRequires: pkgconfig(libbcc) >= 0.11 +BuildRequires: pkgconfig(libelf) +BuildRequires: pkgconfig(zlib) +BuildRequires: rubygem(asciidoctor) +ExcludeArch: %arm %ix86 + +%description +High-level tracing language for Linux, allowing for instrumentation of +in-kernel and userspace state. It makes use of only upstream features such as +eBPF tracing (which builds on kprobes, uprobes, and a variety of other kernel +technologies). BPFtrace's language is inspired by awk and C, as well as other +tracers such as DTrace and SystemTap. + +%package tools +Summary: Example bpftrace scripts and other useful snippets +Group: Development/Tools/Debuggers +Requires: %{name} = %{version} +BuildArch: noarch + +%description tools +Collection of tools for quick instrumentation and inspection of a running +system. These are all BPFtrace scripts within %{_datadir}/bpftrace, and can be +easily modified to allow for different types of debugging. + +%prep +%setup -q +%autopatch -p1 + +# Correct the #!-line to avoid rpmlint warnings. +find tools -name '*.bt' -type f \ + -exec sed -i '1s|^#!%{_bindir}/env bpftrace|#!%{_bindir}/bpftrace|' '{}' ';' + +%build +# We need to build with clang, enable LTO via CMake instead. +%define _lto_cflags %{nil} +export CC="clang" +export CXX="clang++" +%cmake \ + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=TRUE \ + -DLLVM_REQUESTED_VERSION="${LLVM_VERSION}" \ + -DLIBBFD_LIBRARIES="${LIBBFD}" \ + -DLIBOPCODES_LIBRARIES="${LIBOPCODES}" \ + -DUSE_SYSTEM_BPF_BCC:BOOL=ON \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ + -DBUILD_STATIC_LIBS:BOOL=ON \ + -DBUILD_TESTING:BOOL=OFF +%cmake_build + +%install +%cmake_install +# Set executable bit for tools. +chmod +x %{buildroot}%{_datadir}/bpftrace/tools/*.bt +chmod +x %{buildroot}%{_datadir}/bpftrace/tools/old/*.bt + +%files +%{_bindir}/bpftrace +%{_bindir}/bpftrace-aotrt +%{_mandir}/man8/bpftrace.8%{?ext_man} +%doc README.md docs/ +%license LICENSE + +%files tools +%dir %{_datadir}/bpftrace/ +%dir %{_datadir}/bpftrace/tools +%{_datadir}/bpftrace/tools/*.bt +%dir %{_datadir}/bpftrace/tools/old +%{_datadir}/bpftrace/tools/old/*.bt +%dir %{_datadir}/bpftrace/tools/doc +%{_datadir}/bpftrace/tools/doc/*_example.txt +%{_mandir}/man8/*.8%{?ext_man} +%exclude %{_mandir}/man8/bpftrace.8%{ext_man} + +%changelog