summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/systemtap/systemtap
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/systemtap/systemtap')
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/0001-Makefile.am-remove-runtime-linux-uprobes-and-runtime.patch40
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/0001-PR28778-gcc-warning-tweak-for-sprintf-precision-para.patch45
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/0001-PR28804-tune-default-stap-s-buffer-size-on-small-RAM.patch84
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch40
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/0001-configure.ac-fix-broken-libdebuginfod-library-auto-d.patch51
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/0001-gcc12-c-compatibility-re-tweak-for-rhel6-use-functio.patch49
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/0001-prerelease-datestamp-fixes.patch23
-rw-r--r--meta/recipes-kernel/systemtap/systemtap/0001-staprun-fix-build-against-upcoming-gcc-14-Werror-cal.patch36
8 files changed, 190 insertions, 178 deletions
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-Makefile.am-remove-runtime-linux-uprobes-and-runtime.patch b/meta/recipes-kernel/systemtap/systemtap/0001-Makefile.am-remove-runtime-linux-uprobes-and-runtime.patch
new file mode 100644
index 0000000000..2d46a3962d
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/0001-Makefile.am-remove-runtime-linux-uprobes-and-runtime.patch
@@ -0,0 +1,40 @@
+From 5a01e28bd806326b2143e3e6bb28d4780c5d879d Mon Sep 17 00:00:00 2001
+From: Victor Kamensky <victor.kamensky7@gmail.com>
+Date: Sun, 3 Dec 2023 18:40:05 -0800
+Subject: [PATCH] Makefile.am: remove runtime/linux/uprobes and
+ runtime/linux/uprobes2 install
+
+"PR30434 continuation: Removed old uprobes, uprobes2 implementation,
+uprobes-inc.h & any mentions of CONFIG_UTRACE." commit removed uprobes,
+and uprobes2 sources and directories, but Makefile.am still tries to
+install them. In fact after failing to 'cd' into runtime/linux/uprobes
+directory it copies top level *.[ch] files into
+${prefix}/share/systemtap/runtime/linux/uprobes directory.
+
+The issue was caught by OpenEmbedded project do_package_qa checks.
+
+Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com>
+
+Upstream-Status: Submitted [https://sourceware.org/pipermail/systemtap/2023q4/027880.html]
+---
+ Makefile.am | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 5737c6b20..2ba896088 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -277,10 +277,6 @@ endif
+ do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/softfloat/$$f; done)
+ (cd $(srcdir)/runtime/linux; for f in *.[ch]; \
+ do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/linux/$$f; done)
+- (cd $(srcdir)/runtime/linux/uprobes; for f in Makefile *.[ch]; \
+- do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/linux/uprobes/$$f; done)
+- (cd $(srcdir)/runtime/linux/uprobes2; for f in *.[ch]; \
+- do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/linux/uprobes2/$$f; done)
+ (cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name '*.stpm' -o -name README \) -print \
+ | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done)
+ (cd $(srcdir)/testsuite/systemtap.examples; find . -type f -print \
+--
+2.31.1
+
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-PR28778-gcc-warning-tweak-for-sprintf-precision-para.patch b/meta/recipes-kernel/systemtap/systemtap/0001-PR28778-gcc-warning-tweak-for-sprintf-precision-para.patch
deleted file mode 100644
index 0801cb57ec..0000000000
--- a/meta/recipes-kernel/systemtap/systemtap/0001-PR28778-gcc-warning-tweak-for-sprintf-precision-para.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-Upstream-Status: Backport
-Signed-off-by: Ross Burton <ross.burton@arm.com>
-
-From b0422e9e5a539164af75cddcaeb01bceca56bf12 Mon Sep 17 00:00:00 2001
-From: "Frank Ch. Eigler" <fche@redhat.com>
-Date: Thu, 13 Jan 2022 18:33:15 -0500
-Subject: [PATCH] PR28778: gcc warning tweak for sprintf precision parameter
-
-A precision=-1 sentinel value got interpreted as UINT_MAX in a
-context, leading to diagnostics like:
-
-/usr/share/systemtap/runtime/vsprintf.c:341:23: error: 'strnlen' specified bound 4294967295 may exceed maximum object size 2147483647 [-Werror=stringop-overread]
-
-Adding a clamp_t() around the parameter field to keep it limited to
-STP_BUFFER_SIZE (8K by default), which is apprx. the limit for a
-single printf.
----
- runtime/vsprintf.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/runtime/vsprintf.c b/runtime/vsprintf.c
-index cd31a938b..606f685e8 100644
---- a/runtime/vsprintf.c
-+++ b/runtime/vsprintf.c
-@@ -338,7 +338,7 @@ _stp_vsprint_memory(char * str, char * end, const char * ptr,
- if (format == 's') {
- if ((unsigned long)ptr < PAGE_SIZE)
- ptr = "<NULL>";
-- len = strnlen(ptr, precision);
-+ len = strnlen(ptr, clamp_t(size_t, precision, 0, STP_BUFFER_SIZE));
- }
- else if (precision > 0)
- len = precision;
-@@ -410,7 +410,7 @@ _stp_vsprint_memory_size(const char * ptr, int width, int precision,
- if (format == 's') {
- if ((unsigned long)ptr < PAGE_SIZE)
- ptr = "<NULL>";
-- len = strnlen(ptr, precision);
-+ len = strnlen(ptr, clamp_t(size_t, precision, 0, STP_BUFFER_SIZE));
- }
- else if (precision > 0)
- len = precision;
---
-2.25.1
-
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-PR28804-tune-default-stap-s-buffer-size-on-small-RAM.patch b/meta/recipes-kernel/systemtap/systemtap/0001-PR28804-tune-default-stap-s-buffer-size-on-small-RAM.patch
deleted file mode 100644
index 931310db53..0000000000
--- a/meta/recipes-kernel/systemtap/systemtap/0001-PR28804-tune-default-stap-s-buffer-size-on-small-RAM.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-Upstream-Status: Backport
-Signed-off-by: Ross Burton <ross.burton@arm.com>
-
-PR28804: tune default stap -s ## buffer size on small RAM machines
-
-Insert a forgotten division by num_online_cpu() to adjust downward the
-calculated bufsize. Tweak normal defaults back to 128 * 2 * 64K
-(16MB) per CPU, as the stap man page indicates. This may need further
-tweaking when balancing against staprun consumption performance, but
-at least we have the docs lined up with the code at the moment.
-
-PR28804: tune default stap -s ## buffer size on small RAM machines
-
-Use si_meminfo to limit default buffer size. Note in the man page
-that the "-s ##" parameter is per-CPU.
-
-diff --git a/man/stap.1.in b/man/stap.1.in
-index 55dbc2c93..285a27b34 100644
---- a/man/stap.1.in
-+++ b/man/stap.1.in
-@@ -239,8 +239,8 @@ and average amount of time spent in each probe-point. Also shows
- the derivation for each probe-point.
- .TP
- .BI \-s " NUM"
--Use NUM megabyte buffers for kernel-to-user data transfer. On a
--multiprocessor in bulk mode, this is a per-processor amount.
-+Use NUM megabyte buffers for kernel-to-user data transfer per processor.
-+The default is 16MB, or less on smaller memory machines.
- .TP
- .BI \-I " DIR"
- Add the given directory to the tapset search directory. See the
-diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c
-index 18ecccea2..44afff814 100644
---- a/runtime/transport/transport.c
-+++ b/runtime/transport/transport.c
-@@ -72,8 +72,11 @@ static inline void _stp_unlock_inode(struct inode *inode);
- #include "procfs.c"
- #include "control.c"
-
--static unsigned _stp_nsubbufs = 256;
--static unsigned _stp_subbuf_size = 8 * STP_BUFFER_SIZE; /* 64K */
-+/* set default buffer parameters. User may override these via stap -s #, and
-+ the runtime may auto-shrink it on low memory machines too. */
-+/* NB: Note default in man/stap.1.in */
-+static unsigned _stp_nsubbufs = 128;
-+static unsigned _stp_subbuf_size = 2 * STP_BUFFER_SIZE; /* 2 * 64K */
-
- /* module parameters */
- static int _stp_bufsize;
-@@ -602,17 +605,30 @@ static int _stp_transport_init(void)
- _stp_need_kallsyms_stext = 0;
- #endif
-
-- if (_stp_bufsize) {
-- unsigned size = _stp_bufsize * 1024 * 1024;
-+ if (_stp_bufsize == 0) { // option not specified?
-+ struct sysinfo si;
-+ long _stp_bufsize_avail;
-+ si_meminfo(&si);
-+ _stp_bufsize_avail = (long)((si.freeram + si.bufferram) / 4 / num_online_cpus())
-+ << PAGE_SHIFT; // limit to quarter of free ram total
-+ if ((_stp_nsubbufs * _stp_subbuf_size * num_online_cpus()) > _stp_bufsize_avail) {
-+ _stp_bufsize = max_t (int, 1, _stp_bufsize_avail / 1024 / 1024);
-+ dbug_trans(1, "Shrinking default _stp_bufsize to %d MB/cpu due to low free memory\n", _stp_bufsize);
-+ }
-+ }
-+
-+ if (_stp_bufsize) { // overridden by user or by si_meminfo heuristic?
-+ long size = _stp_bufsize * 1024 * 1024;
- _stp_subbuf_size = 65536;
-+ // bump up subbuf size from 64K to 1M to keep _stp_nsubbufs not too large
- while (size / _stp_subbuf_size > 64 &&
- _stp_subbuf_size < 1024 * 1024) {
- _stp_subbuf_size <<= 1;
- }
- _stp_nsubbufs = size / _stp_subbuf_size;
-- dbug_trans(1, "Using %d subbufs of size %d\n", _stp_nsubbufs, _stp_subbuf_size);
- }
--
-+ dbug_trans(1, "Using %d subbufs of size %d\n", _stp_nsubbufs, _stp_subbuf_size);
-+
- ret = _stp_transport_fs_init(THIS_MODULE->name);
- if (ret)
- goto err0;
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch b/meta/recipes-kernel/systemtap/systemtap/0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch
new file mode 100644
index 0000000000..e3d94d9312
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch
@@ -0,0 +1,40 @@
+From d42139cf9cd26d0c0363fcfe007716baeb8de517 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Fri, 22 Dec 2023 19:42:38 +0000
+Subject: [PATCH] bpf-translate.cxx: fix build against upcoming `gcc-14`
+ (`-Werror=calloc-transposed-args`)
+
+`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
+detected minor infelicity in `calloc()` API usage in `systemtap`:
+
+ bpf-translate.cxx: In function 'bpf::BPF_Section* bpf::output_probe(BPF_Output&, program&, const std::string&, unsigned int)':
+ bpf-translate.cxx:5044:39: error: 'void* calloc(size_t, size_t)' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
+ 5044 | bpf_insn *buf = (bpf_insn*) calloc (sizeof(bpf_insn), ninsns);
+ | ^~~~~~~~~~~~~~~~
+ bpf-translate.cxx:5044:39: note: earlier argument should specify number of elements, later size of each element
+
+Upstream-Status: Backport [https://sourceware.org/git/?p=systemtap.git;a=commit;h=d42139cf9cd26d0c0363fcfe007716baeb8de517]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ bpf-translate.cxx | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/bpf-translate.cxx b/bpf-translate.cxx
+index 1a9302463..aa8ef65ce 100644
+--- a/bpf-translate.cxx
++++ b/bpf-translate.cxx
+@@ -5041,9 +5041,9 @@ output_probe(BPF_Output &eo, program &prog,
+ }
+ }
+
+- bpf_insn *buf = (bpf_insn*) calloc (sizeof(bpf_insn), ninsns);
++ bpf_insn *buf = (bpf_insn*) calloc (ninsns, sizeof(bpf_insn));
+ assert (buf);
+- Elf64_Rel *rel = (Elf64_Rel*) calloc (sizeof(Elf64_Rel), nreloc);
++ Elf64_Rel *rel = (Elf64_Rel*) calloc (nreloc, sizeof(Elf64_Rel));
+ assert (rel);
+
+ unsigned i = 0, r = 0;
+--
+2.43.0
+
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-configure.ac-fix-broken-libdebuginfod-library-auto-d.patch b/meta/recipes-kernel/systemtap/systemtap/0001-configure.ac-fix-broken-libdebuginfod-library-auto-d.patch
new file mode 100644
index 0000000000..98641826f6
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/0001-configure.ac-fix-broken-libdebuginfod-library-auto-d.patch
@@ -0,0 +1,51 @@
+From 3913ad3e28a19811e1b52338112344a487057e4f Mon Sep 17 00:00:00 2001
+From: Victor Kamensky <victor.kamensky7@gmail.com>
+Date: Mon, 18 Dec 2023 03:13:38 +0000
+Subject: [PATCH 1/2] configure.ac: fix broken libdebuginfod library auto
+ detection
+
+After 2e67b053e3796ee7cf29a39f9698729b52078406 "configury: rework debuginfod searches"
+commit, libdebuginfod.so library auto detection is broken. It was reported by Martin Jansa
+on openembedded-core mailing list [1].
+
+Currently configure.ac does "AC_DEFINE([HAVE_LIBDEBUGINFOD], [1] ..." as long as
+no --without-debuginfod option is passed, regardless PKG_CHECK_MODULES check result.
+It seems to be bad copy/paste. Address the issue by moving the AC_DEFINE back to
+PKG_CHECK_MODULES action-if-found block.
+
+To reproduce the issue on FC system, one can do the following
+"sudo dnf remove elfutils-debuginfod-client-devel" and then try to build SystemTap
+util.cxx will fail to compile because of missing elfutils/debuginfod.h because
+config.h will have "#define HAVE_LIBDEBUGINFOD 1", while config.log and configure
+output indicates that check for libdebuginfod library failed.
+
+[1] https://lists.openembedded.org/g/openembedded-core/message/192109?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3Acreated%2C0%2Csystemtap%2C20%2C2%2C0%2C102987514
+
+Upstream-Status: Submitted [https://sourceware.org/pipermail/systemtap/2023q4/027914.html]
+Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com>
+---
+ configure.ac | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index d9559c5c3..18cd7f84a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -219,12 +219,11 @@ dnl take the user at his or her word
+ elif test "x$with_debuginfod" != xno; then
+ dnl check in the system pkgconfig
+ PKG_CHECK_MODULES([debuginfod], [libdebuginfod >= 0.179],
+- [have_debuginfod=1],
++ [have_debuginfod=1
++ AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])],
+ [if test "x$with_debuginfod" = xyes; then
+ AC_MSG_ERROR(["--with-debuginfod was given, but libdebuginfod is missing or unusable."])
+ fi])
+- AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is enabled.])
+- AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+--
+2.31.1
+
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-gcc12-c-compatibility-re-tweak-for-rhel6-use-functio.patch b/meta/recipes-kernel/systemtap/systemtap/0001-gcc12-c-compatibility-re-tweak-for-rhel6-use-functio.patch
deleted file mode 100644
index f885c44460..0000000000
--- a/meta/recipes-kernel/systemtap/systemtap/0001-gcc12-c-compatibility-re-tweak-for-rhel6-use-functio.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From f199d1982ef8a6c6d5c06c082d057b8793bcc6aa Mon Sep 17 00:00:00 2001
-From: Serhei Makarov <serhei@serhei.io>
-Date: Fri, 21 Jan 2022 18:21:46 -0500
-Subject: [PATCH] gcc12 c++ compatibility re-tweak for rhel6: use function
- pointer instead of lambdas instead of ptr_fun<>
-
-Saving 2 lines in ltrim/rtrim is probably not a good reason to drop
-compatibility with the RHEL6 system compiler. Actually declaring a
-named function and passing the function pointer is compatible with
-everything.
-
-Upstream-Status: Backport [https://sourceware.org/git/?p=systemtap.git;a=commit;h=f199d1982ef8a6c6d5c06c082d057b8793bcc6aa]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- util.cxx | 13 ++++++++-----
- 1 file changed, 8 insertions(+), 5 deletions(-)
-
---- a/util.cxx
-+++ b/util.cxx
-@@ -1757,21 +1757,24 @@ flush_to_stream (const string &fname, os
- return 1; // Failure
- }
-
-+int
-+not_isspace(unsigned char c)
-+{
-+ return !std::isspace(c);
-+}
-+
- // trim from start (in place)
- void
- ltrim(std::string &s)
- {
-- s.erase(s.begin(),
-- std::find_if(s.begin(), s.end(),
-- std::not1(std::ptr_fun<int, int>(std::isspace))));
-+ s.erase(s.begin(), std::find_if(s.begin(), s.end(), not_isspace));
- }
-
- // trim from end (in place)
- void
- rtrim(std::string &s)
- {
-- s.erase(std::find_if(s.rbegin(), s.rend(),
-- std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
-+ s.erase(std::find_if(s.rbegin(), s.rend(), not_isspace).base(), s.end());
- }
-
- // trim from both ends (in place)
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-prerelease-datestamp-fixes.patch b/meta/recipes-kernel/systemtap/systemtap/0001-prerelease-datestamp-fixes.patch
new file mode 100644
index 0000000000..afdc10a3fe
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/0001-prerelease-datestamp-fixes.patch
@@ -0,0 +1,23 @@
+From cfc2c1d53924face11e3fab78ded61c359778eb9 Mon Sep 17 00:00:00 2001
+From: "Frank Ch. Eigler" <fche@redhat.com>
+Date: Sat, 4 Nov 2023 12:19:59 -0400
+Subject: [PATCH] prerelease datestamp fixes
+
+Upstream-Status: Backport
+---
+ NEWS | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/NEWS b/NEWS
+index c7f31e8b7..f0f9056c4 100644
+--- a/NEWS
++++ b/NEWS
+@@ -1,4 +1,4 @@
+-* What's new in version 5.0, 2023-11-03
++* What's new in version 5.0, 2023-11-04
+
+ - Performance improvements in uprobe registration and module startup.
+
+--
+2.31.1
+
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-staprun-fix-build-against-upcoming-gcc-14-Werror-cal.patch b/meta/recipes-kernel/systemtap/systemtap/0001-staprun-fix-build-against-upcoming-gcc-14-Werror-cal.patch
new file mode 100644
index 0000000000..22578fb3f6
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/0001-staprun-fix-build-against-upcoming-gcc-14-Werror-cal.patch
@@ -0,0 +1,36 @@
+From 52596f023652114642faba5726c99488529029ce Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyich@gmail.com>
+Date: Thu, 21 Dec 2023 10:00:06 +0000
+Subject: [PATCH] staprun: fix build against upcoming `gcc-14`
+ (`-Werror=calloc-transposed-args`)
+
+`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
+detected minor infelicity in `calloc()` API usage in `systemtap`:
+
+ staprun.c: In function 'main':
+ staprun.c:550:50: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
+ 550 | char ** new_argv = calloc(sizeof(char *),argc+2);
+ | ^~~~
+
+Upstream-Status: Backport [https://sourceware.org/git/?p=systemtap.git;a=commit;h=52596f023652114642faba5726c99488529029ce]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ staprun/staprun.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/staprun/staprun.c b/staprun/staprun.c
+index 8437f3af6..d1b0b221b 100644
+--- a/staprun/staprun.c
++++ b/staprun/staprun.c
+@@ -547,7 +547,7 @@ int main(int argc, char **argv)
+ us to extend argv[], with all the C fun that entails. */
+ #ifdef HAVE_OPENAT
+ if (relay_basedir_fd >= 0) {
+- char ** new_argv = calloc(sizeof(char *),argc+2);
++ char ** new_argv = calloc(argc+2, sizeof(char *));
+ const int new_Foption_size = 10; /* -FNNNNN */
+ char * new_Foption = malloc(new_Foption_size);
+ int i;
+--
+2.43.0
+