diff options
Diffstat (limited to 'meta/recipes-kernel/systemtap')
19 files changed, 411 insertions, 308 deletions
diff --git a/meta/recipes-kernel/systemtap/systemtap-native_git.bb b/meta/recipes-kernel/systemtap/systemtap-native_git.bb index 19cc1cf0f0..2690b259c8 100644 --- a/meta/recipes-kernel/systemtap/systemtap-native_git.bb +++ b/meta/recipes-kernel/systemtap/systemtap-native_git.bb @@ -1,6 +1,6 @@ require systemtap_git.bb -inherit native +inherit_defer native addtask addto_recipe_sysroot after do_populate_sysroot before do_build diff --git a/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb b/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb deleted file mode 100644 index 46820ef489..0000000000 --- a/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb +++ /dev/null @@ -1,40 +0,0 @@ -SUMMARY = "UProbes kernel module for SystemTap" - -require systemtap_git.inc - -DEPENDS = "systemtap virtual/kernel" - -# On systems without CONFIG_UTRACE, this package is empty. -ALLOW_EMPTY_${PN} = "1" - -inherit module-base gettext - -FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:" - -FILES_${PN} += "${datadir}/systemtap/runtime/uprobes" - -# Compile and install the uprobes kernel module on machines with utrace -# support. Note that staprun expects it in the systemtap/runtime directory, -# not in /lib/modules. -do_compile() { - if grep -q "CONFIG_UTRACE=y" ${STAGING_KERNEL_BUILDDIR}/.config - then - unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS CC LD CPP - oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ - AR="${KERNEL_AR}" \ - -C ${STAGING_KERNEL_DIR} scripts - oe_runmake KDIR=${STAGING_KERNEL_DIR} \ - M="${S}/runtime/uprobes/" \ - CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ - AR="${KERNEL_AR}" \ - -C "${S}/runtime/uprobes/" - fi -} - -do_install() { - if [ -e "${S}/runtime/uprobes/uprobes.ko" ] - then - install -d ${D}${datadir}/systemtap/runtime/uprobes/ - install -m 0644 ${S}/runtime/uprobes/uprobes.ko ${D}${datadir}/systemtap/runtime/uprobes/ - fi -} diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch b/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch index 528864cc93..48cf4aee85 100644 --- a/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch +++ b/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch @@ -5,32 +5,52 @@ Subject: [PATCH] Install python modules to correct library dir. Upstream-Status: Inappropriate [oe-core specific] Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> + +Add OE's CFLAGS which contains `-fdebug-prefix-map' options to +setup.py + +Supply "--root" directory to the "install" command, and use +it as a prefix to strip off the purported filename encoded +in bytecode files. (It strips build path prefix from .pyc files) + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> --- - python/Makefile.am | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + python/Makefile.am | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/Makefile.am b/python/Makefile.am -index a254480f9..efe9f3c01 100644 +index a254480..578602f 100644 --- a/python/Makefile.am +++ b/python/Makefile.am -@@ -47,7 +47,7 @@ install-exec-local: +@@ -8,6 +8,10 @@ AUTOMAKE_OPTIONS = subdir-objects + AM_CPPFLAGS = -I$(srcdir)/../includes + AM_CPPFLAGS += -I$(abs_builddir)/../includes/sys + ++# Add OE's CFLAGS which contains `-fdebug-prefix-map' options to ++# fix build path issue ++AM_CPPFLAGS += $(CFLAGS) ++ + # Any script in the following variable will get byte-compiled at + # install time. + pkglibexecpython_PYTHON = +@@ -47,7 +51,7 @@ install-exec-local: if HAVE_PYTHON2_PROBES (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON) setup.py build \ --build-base $(shell readlink -f $(builddir))/py2build \ - install --prefix $(DESTDIR)$(prefix) \ -+ install --prefix $(DESTDIR)$(prefix) --install-lib=$(DESTDIR)${pythondir} \ ++ install --root $(DESTDIR) --prefix $(prefix) --prefix $(prefix) --install-lib=${pythondir} \ --single-version-externally-managed \ --record $(shell readlink -f $(builddir))/py2build/install_files.txt \ --verbose) -@@ -55,7 +55,7 @@ endif +@@ -55,7 +59,7 @@ endif if HAVE_PYTHON3_PROBES (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON3) setup.py build \ --build-base $(shell readlink -f $(builddir))/py3build \ - install --prefix $(DESTDIR)$(prefix) \ -+ install --prefix $(DESTDIR)$(prefix) --install-lib=$(DESTDIR)${python3dir} \ ++ install --root $(DESTDIR) --prefix $(prefix) --install-lib=${python3dir} \ --single-version-externally-managed \ --record $(shell readlink -f $(builddir))/py3build/install_files.txt \ --verbose) -- -2.11.0 +2.7.4 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-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-buildrun-remove-quotes-around-I-include-line.patch b/meta/recipes-kernel/systemtap/systemtap/0001-buildrun-remove-quotes-around-I-include-line.patch deleted file mode 100644 index 7996fdde73..0000000000 --- a/meta/recipes-kernel/systemtap/systemtap/0001-buildrun-remove-quotes-around-I-include-line.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 75c4aec6de3a615909f3283eac585760de101b8c Mon Sep 17 00:00:00 2001 -From: Saul Wold <sgw@linux.intel.com> -Date: Tue, 7 Mar 2017 10:46:12 -0800 -Subject: [PATCH] buildrun: remove quotes around -I include line - -By having the quotes, the kernel Makefile addtree macro adds the -kernel $srctree directory as a prefix and causes compilation failures. -Removing the quotes resolves the issue. - -This is trimmed from the verbose output of the GCC command line -Before: - -I/srv/sdb/builds/4.9/tmp/work-shared/qemux86-64/kernel-source/"/srv/sdb/releases/jethro/builds/4.1/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime" - -After: - -I/srv/sdb/builds/4.9/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime - -Upstream-Status: Pending -Signed-off-by: Saul Wold <sgw@linux.intel.com> ---- - buildrun.cxx | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/buildrun.cxx b/buildrun.cxx -index aaea64c..8a8ee9f 100644 ---- a/buildrun.cxx -+++ b/buildrun.cxx -@@ -495,7 +495,7 @@ compile_pass (systemtap_session& s) - #if CHECK_POINTER_ARITH_PR5947 - o << "EXTRA_CFLAGS += -Wpointer-arith" << endl; - #endif -- o << "EXTRA_CFLAGS += -I\"" << s.runtime_path << "\"" << endl; -+ o << "EXTRA_CFLAGS += -I" << s.runtime_path << endl; - // XXX: this may help ppc toc overflow - // o << "CFLAGS := $(subst -Os,-O2,$(CFLAGS)) -fminimal-toc" << endl; - o << "obj-m := " << s.module_name << ".o" << endl; --- -2.7.4 - 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-improve-reproducibility-for-c-compiling.patch b/meta/recipes-kernel/systemtap/systemtap/0001-improve-reproducibility-for-c-compiling.patch new file mode 100644 index 0000000000..15a6f2a9a5 --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/0001-improve-reproducibility-for-c-compiling.patch @@ -0,0 +1,31 @@ +From 6288ba5df0a8c73ef842b609081449ac4de86123 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Wed, 18 Jul 2018 16:58:33 +0800 +Subject: [PATCH] improve reproducibility for c++ compiling + +Use relative dir to include header string_ref to +strip build path prefix in c++ object file + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + stringtable.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/stringtable.h b/stringtable.h +index 5fc42e7..6fd8a1e 100644 +--- a/stringtable.h ++++ b/stringtable.h +@@ -19,7 +19,7 @@ + + #if defined(HAVE_BOOST_UTILITY_STRING_REF_HPP) + #include <boost/version.hpp> +-#include <boost/utility/string_ref.hpp> //header with string_ref ++#include "@RELATIVE_STAGING_INCDIR@/boost/utility/string_ref.hpp" //header with string_ref + + // XXX: experimental tunables + #define INTERNED_STRING_FIND_MEMMEM 1 /* perf stat indicates a very slight benefit */ +-- +2.7.4 + 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-address-ncurses-6.3-failures.patch b/meta/recipes-kernel/systemtap/systemtap/0001-staprun-address-ncurses-6.3-failures.patch new file mode 100644 index 0000000000..1decf21593 --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/0001-staprun-address-ncurses-6.3-failures.patch @@ -0,0 +1,61 @@ +From 191f528da19193d713d94ee252e2485efd9af4d3 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin <alex@linutronix.de> +Date: Mon, 25 Oct 2021 17:59:24 +0200 +Subject: [PATCH] staprun: address ncurses 6.3 failures + +Upstream-Status: Submitted [by email to smakarov@redhat.com,systemtap@sourceware.org] +Signed-off-by: Alexander Kanavin <alex@linutronix.de> +--- + staprun/monitor.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/staprun/monitor.c b/staprun/monitor.c +index 478634c09..f4fbfd686 100644 +--- a/staprun/monitor.c ++++ b/staprun/monitor.c +@@ -448,12 +448,12 @@ void monitor_render(void) + if (active_window == 0) + wattron(status, A_BOLD); + wprintw(status, "\n%*s\t%*s\t%*s\t%*s\t%*s\t%*s\t%s\n", +- width[p_index], HIGHLIGHT("index", p_index, comp_fn_index), +- width[p_state], HIGHLIGHT("state", p_state, comp_fn_index), +- width[p_hits], HIGHLIGHT("hits", p_hits, comp_fn_index), +- width[p_min], HIGHLIGHT("min", p_min, comp_fn_index), +- width[p_avg], HIGHLIGHT("avg", p_avg, comp_fn_index), +- width[p_max], HIGHLIGHT("max", p_max, comp_fn_index), ++ (int)width[p_index], HIGHLIGHT("index", p_index, comp_fn_index), ++ (int)width[p_state], HIGHLIGHT("state", p_state, comp_fn_index), ++ (int)width[p_hits], HIGHLIGHT("hits", p_hits, comp_fn_index), ++ (int)width[p_min], HIGHLIGHT("min", p_min, comp_fn_index), ++ (int)width[p_avg], HIGHLIGHT("avg", p_avg, comp_fn_index), ++ (int)width[p_max], HIGHLIGHT("max", p_max, comp_fn_index), + HIGHLIGHT("name", p_name, comp_fn_index)); + if (active_window == 0) + wattroff(status, A_BOLD); +@@ -466,17 +466,17 @@ void monitor_render(void) + json_object *probe, *field; + probe = json_object_array_get_idx(jso_probe_list, i); + json_object_object_get_ex(probe, "index", &field); +- wprintw(status, "%*s\t", width[p_index], json_object_get_string(field)); ++ wprintw(status, "%*s\t", (int)width[p_index], json_object_get_string(field)); + json_object_object_get_ex(probe, "state", &field); +- wprintw(status, "%*s\t", width[p_state], json_object_get_string(field)); ++ wprintw(status, "%*s\t", (int)width[p_state], json_object_get_string(field)); + json_object_object_get_ex(probe, "hits", &field); +- wprintw(status, "%*s\t", width[p_hits], json_object_get_string(field)); ++ wprintw(status, "%*s\t", (int)width[p_hits], json_object_get_string(field)); + json_object_object_get_ex(probe, "min", &field); +- wprintw(status, "%*s\t", width[p_min], json_object_get_string(field)); ++ wprintw(status, "%*s\t", (int)width[p_min], json_object_get_string(field)); + json_object_object_get_ex(probe, "avg", &field); +- wprintw(status, "%*s\t", width[p_avg], json_object_get_string(field)); ++ wprintw(status, "%*s\t", (int)width[p_avg], json_object_get_string(field)); + json_object_object_get_ex(probe, "max", &field); +- wprintw(status, "%*s\t", width[p_max], json_object_get_string(field)); ++ wprintw(status, "%*s\t", (int)width[p_max], json_object_get_string(field)); + getyx(status, discard, cur_x); + json_object_object_get_ex(probe, "name", &field); + wprintw(status, "%.*s", max_cols-cur_x-1, json_object_get_string(field)); +-- +2.20.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 + diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch b/meta/recipes-kernel/systemtap/systemtap/0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch index 9f11648fef..e2f8b3b057 100644 --- a/meta/recipes-kernel/systemtap/systemtap/0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch +++ b/meta/recipes-kernel/systemtap/systemtap/0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch @@ -14,49 +14,24 @@ Signed-off-by: Saul Wold <sgw@linux.intel.com> staprun/Makefile.am | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) -diff --git a/stapbpf/Makefile.am b/stapbpf/Makefile.am -index 421b044ef..f7daeb2b2 100644 ---- a/stapbpf/Makefile.am -+++ b/stapbpf/Makefile.am -@@ -39,11 +39,11 @@ git_version.stamp ../git_version.h: +Index: git/stapbpf/Makefile.am +=================================================================== +--- git.orig/stapbpf/Makefile.am ++++ git/stapbpf/Makefile.am +@@ -41,10 +41,10 @@ # Why the "id -u" condition? This way, an unprivileged user can run # make install, and have "sudo stap ...." or "sudo stapbpf ...." work later. -install-exec-hook: -- if [ `id -u` -eq 0 ]; then \ -- getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \ -- getent group stapusr >/dev/null \ -- && chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \ +- if [ `id -u` -eq 0 ] && (getent group stapusr >/dev/null \ +- || groupadd -f -g 156 -r stapusr); then \ +- chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \ - && chmod 04110 "$(DESTDIR)$(bindir)/stapbpf"; \ - fi +#install-exec-hook: -+# if [ `id -u` -eq 0 ]; then \ -+# getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \ -+# getent group stapusr >/dev/null \ -+# && chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \ ++## if [ `id -u` -eq 0 ] && (getent group stapusr >/dev/null \ ++## || groupadd -f -g 156 -r stapusr); then \ ++## chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \ +# && chmod 04110 "$(DESTDIR)$(bindir)/stapbpf"; \ +# fi endif -diff --git a/staprun/Makefile.am b/staprun/Makefile.am -index 4073aa01c..2925e34c3 100644 ---- a/staprun/Makefile.am -+++ b/staprun/Makefile.am -@@ -72,9 +72,9 @@ git_version.stamp ../git_version.h: - - # Why the "id -u" condition? This way, an unprivileged user can run - # make install, and have "sudo stap ...." or "sudo staprun ...." work later. --install-exec-hook: -- if [ `id -u` -eq 0 ]; then \ -- getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \ -- getent group stapusr >/dev/null && chgrp stapusr "$(DESTDIR)$(bindir)/staprun"; \ -- chmod 04110 "$(DESTDIR)$(bindir)/staprun"; \ -- fi -+#install-exec-hook: -+# if [ `id -u` -eq 0 ]; then \ -+# getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \ -+# getent group stapusr >/dev/null && chgrp stapusr "$(DESTDIR)$(bindir)/staprun"; \ -+# chmod 04110 "$(DESTDIR)$(bindir)/staprun"; \ -+# fi --- -2.11.0 - diff --git a/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch b/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch deleted file mode 100644 index b4f2fbc066..0000000000 --- a/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 5eb10d90af9178edb65e6091ae939d1b5b19bb78 Mon Sep 17 00:00:00 2001 -From: Wenzong Fan <wenzong.fan@windriver.com> -Date: Tue, 23 Sep 2014 04:47:10 -0400 -Subject: [PATCH] systemtap: allow to disable libvirt - -Upstream-Status: Pending - -Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> ---- - configure.ac | 13 +++++++++---- - 1 file changed, 9 insertions(+), 4 deletions(-) - -diff --git a/configure.ac b/configure.ac -index a631ae7..cb4885b 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -525,10 +525,15 @@ dnl Check for the libvirt and libxml2 devel packages - - dnl We require libvirt >= 1.0.2 because stapvirt relies on the - dnl virDomainOpenChannel function, which was implemented in 1.0.2. --PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [ -- have_libvirt=yes -- AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed]) -- ], [have_libvirt=no]) -+AC_ARG_ENABLE([libvirt], -+ AS_HELP_STRING([--disable-libvirt], [Do not use libvirt even if present])) -+ -+if test "$enable_libvirt" != no; then -+ PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [ -+ have_libvirt=yes -+ AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed]) -+ ], [have_libvirt=no]) -+fi - AM_CONDITIONAL([HAVE_LIBVIRT], [test "${have_libvirt}" = "yes"]) - PKG_CHECK_MODULES([libxml2], [libxml-2.0], [ - have_libxml2=yes --- -1.7.9.5 - diff --git a/meta/recipes-kernel/systemtap/systemtap/monitor-option.patch b/meta/recipes-kernel/systemtap/systemtap/monitor-option.patch deleted file mode 100644 index b7ee0701b1..0000000000 --- a/meta/recipes-kernel/systemtap/systemtap/monitor-option.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 93fc4744fedf6fc593ee656968da97f7b1862ada Mon Sep 17 00:00:00 2001 -From: Ross Burton <ross.burton@intel.com> -Date: Tue, 4 Oct 2016 16:37:53 +0100 -Subject: [PATCH 4/6] systemtap: rationalise dependencies - -Add an option to explicitly disable the monitor (and therefore the dependency on -json-c and ncurses). - -Upstream-Status: Pending -Signed-off-by: Ross Burton <ross.burton@intel.com> - ---- - configure.ac | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 6bd0c5fc4..2ea9b3cbf 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -752,13 +752,16 @@ dnl We want either (or both) python probe support. - AM_CONDITIONAL([HAVE_PYTHON_PROBES], - [test "x$have_python2_support" = "xyes" -o "x$have_python3_support" = "xyes"]) - -+AC_ARG_ENABLE([monitor], AS_HELP_STRING([--disable-monitor],[Disable monitor])) -+if test "$enable_monitor" != "no"; then - dnl Check for presence of json-c and ncurses for use in monitor mode - PKG_CHECK_MODULES([jsonc], [json-c >= 0.12], [have_jsonc=yes], [have_jsonc=no]) - PKG_CHECK_MODULES([ncurses], [ncurses], [have_ncurses=yes], [have_ncurses=no]) --AM_CONDITIONAL([HAVE_MONITOR_LIBS], [test "${have_jsonc}" == "yes" -a "${have_ncurses}" == "yes"]) - if test "${have_jsonc}" == "yes" -a "${have_ncurses}" == yes; then - AC_DEFINE([HAVE_MONITOR_LIBS],[1],[Define to 1 if json-c and ncurses libraries are installed]) - fi -+fi -+AM_CONDITIONAL([HAVE_MONITOR_LIBS], [test "${have_jsonc}" == "yes" -a "${have_ncurses}" == "yes" -a "$enable_monitor" != "no"]) - - AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [ - old_CFLAGS="$CFLAGS" --- -2.11.0 - diff --git a/meta/recipes-kernel/systemtap/systemtap/no-msgfmt-check.patch b/meta/recipes-kernel/systemtap/systemtap/no-msgfmt-check.patch deleted file mode 100644 index 2c860b19e5..0000000000 --- a/meta/recipes-kernel/systemtap/systemtap/no-msgfmt-check.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 43f1b04449bb1cf7e0092263f1c2a25f3fca08ef Mon Sep 17 00:00:00 2001 -From: Ross Burton <ross.burton@intel.com> -Date: Tue, 8 Nov 2016 23:07:41 +0000 -Subject: [PATCH 5/6] systemtap: remove explicit msgfmt check - -There is no need to explicitly check that msgfmt was found as the gettext macros -handle this for us if NLS is enabled. - -Upstream-Status: Pending -Signed-off-by: Ross Burton <ross.burton@intel.com> - ---- - configure.ac | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 2ea9b3cbf..95417f59c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -36,10 +36,6 @@ AC_CHECK_FUNCS(openat) - AM_GNU_GETTEXT(external) - AM_GNU_GETTEXT_VERSION([0.19.4]) - --if test "x$GMSGFMT" = "x:"; then -- AC_MSG_ERROR([missing gnu /usr/bin/msgfmt]) --fi -- - # We want the 'PYTHON' varible to be python version 2. We also want - # our custom 'PYTHON3' varible to be python version 3. - # --- -2.11.0 - diff --git a/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch b/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch deleted file mode 100644 index 013af5c3a4..0000000000 --- a/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch +++ /dev/null @@ -1,23 +0,0 @@ -systemtap: Cross compilation fix - -This is a cross compilation fix. It allows systemtap to find -the kernel map file in the right place, i.e. in the kernel build tree. -Without this fix it takes a map file from the build host, if available. - -Upstream-Status: Pending - -Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com> - -Index: git/session.cxx -=================================================================== ---- git.orig/session.cxx -+++ git/session.cxx -@@ -1634,7 +1634,7 @@ systemtap_session::parse_kernel_function - clog << _F("Kernel symbol table %s unavailable, (%s)", - system_map_path.c_str(), strerror(errno)) << endl; - -- system_map_path = "/boot/System.map-" + kernel_release; -+ system_map_path = kernel_build_tree + "/System.map-" + kernel_release; - system_map.clear(); - system_map.open(system_map_path.c_str(), ifstream::in); - if (! system_map.is_open()) diff --git a/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch b/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch deleted file mode 100644 index 28a7eae407..0000000000 --- a/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch +++ /dev/null @@ -1,34 +0,0 @@ -Fix time_t print because in x32 ABI is long long int instead of long int. - -Upstream-Status: Pending - -Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> - -diff --git a/cache.cxx b/cache.cxx -index 3546b30..19c77ca 100644 ---- a/cache.cxx -+++ b/cache.cxx -@@ -294,7 +294,11 @@ clean_cache(systemtap_session& s) - { - //interval not passed, don't continue - if (s.verbose > 1) -+#if defined(__x86_64__) && defined (__ILP32__) -+ clog << _F("Cache cleaning skipped, interval not reached %lld s / %lu s.", -+#else - clog << _F("Cache cleaning skipped, interval not reached %lu s / %lu s.", -+#endif - (current_time.tv_sec-sb.st_mtime), cache_clean_interval) << endl; - return; - } -@@ -302,7 +306,11 @@ clean_cache(systemtap_session& s) - { - //interval reached, continue - if (s.verbose > 1) -+#if defined(__x86_64__) && defined (__ILP32__) -+ clog << _F("Cleaning cache, interval reached %lld s > %lu s.", -+#else - clog << _F("Cleaning cache, interval reached %lu s > %lu s.", -+#endif - (current_time.tv_sec-sb.st_mtime), cache_clean_interval) << endl; - } - diff --git a/meta/recipes-kernel/systemtap/systemtap_git.bb b/meta/recipes-kernel/systemtap/systemtap_git.bb index 475b2073f1..68f5c76428 100644 --- a/meta/recipes-kernel/systemtap/systemtap_git.bb +++ b/meta/recipes-kernel/systemtap/systemtap_git.bb @@ -1,11 +1,17 @@ SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux" +DESCRIPTION = "It provides free software infrastructure to simplify the \ +gathering of information about the running Linux system. This assists \ +diagnosis of a performance or functional problem." HOMEPAGE = "https://sourceware.org/systemtap/" require systemtap_git.inc -DEPENDS = "boost elfutils" +SRC_URI += " \ + file://0001-improve-reproducibility-for-c-compiling.patch \ + file://0001-staprun-address-ncurses-6.3-failures.patch \ + " -RDEPENDS_${PN} += "python3-core bash perl" +DEPENDS = "elfutils" EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \ --without-nss --without-avahi --without-dyninst \ @@ -18,12 +24,80 @@ STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs" EXTRA_OECONF += "${STAP_DOCS} " -PACKAGECONFIG ??= "sqlite monitor python3-probes" +PACKAGECONFIG ??= "translator sqlite monitor python3-probes ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}" +PACKAGECONFIG[translator] = "--enable-translator,--disable-translator,boost,bash" PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt" PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3" PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c" PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native" +PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod" -inherit autotools gettext pkgconfig distutils3-base +inherit autotools gettext pkgconfig systemd +inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'setuptools3-base', '', d)} + +# | ../git/elaborate.cxx:2601:21: error: storing the address of local variable 'sym' in '*s.systemtap_session::symbol_resolver' [-Werror=dangling-pointer=] +CXXFLAGS += "-Wno-dangling-pointer" + +# exporter comes with python3-probes +PACKAGES =+ "${PN}-exporter" +FILES:${PN}-exporter = "${sysconfdir}/stap-exporter/* \ + ${sysconfdir}/sysconfig/stap-exporter \ + ${systemd_system_unitdir}/stap-exporter.service \ + ${sbindir}/stap-exporter" +RDEPENDS:${PN}-exporter = "${PN} python3-core python3-netclient" +SYSTEMD_SERVICE:${PN}-exporter = "stap-exporter.service" + +PACKAGES =+ "${PN}-runtime" +FILES:${PN}-runtime = "\ + ${bindir}/staprun \ + ${bindir}/stap-merge \ + ${bindir}/stapsh \ + ${libexecdir}/${BPN}/stapio \ +" +RDEPENDS:${PN}:class-target += "${PN}-runtime" + +PACKAGES =+ "${PN}-examples" +FILES:${PN}-examples = "${datadir}/${BPN}/examples/" +RDEPENDS:${PN}-examples += "${PN}" + +# don't complain that some examples involve bash, perl, php... +INSANE_SKIP:${PN}-examples += "file-rdeps" + +PACKAGES =+ "${PN}-python" +FILES:${PN}-python += "\ + ${bindir}/dtrace \ + ${libdir}/python*/ \ + ${libexecdir}/${BPN}/python/ \ +" +# python material requires sdt headers +RDEPENDS:${PN}-python += "${PN}-dev python3-core" +INSANE_SKIP:${PN}-python += "dev-deps" + +do_configure:prepend () { + # Improve reproducibility for c++ object files + reltivepath="${@os.path.relpath(d.getVar('STAGING_INCDIR'), d.getVar('S'))}" + sed -i "s:@RELATIVE_STAGING_INCDIR@:$reltivepath:g" ${S}/stringtable.h +} + +do_install:append () { + if [ ! -f ${D}${bindir}/stap ]; then + # translator disabled case, need to leave only minimal runtime + rm -rf ${D}${datadir}/${PN} + rm ${D}${libexecdir}/${PN}/stap-env + fi + + if [ -d ${D}${prefix}/lib/systemd -a ${D}${prefix}/lib != `dirname ${D}${systemd_unitdir}` ]; then + # Fix makefile hardcoded path assumptions for systemd (assumes $prefix) + # without usrmerge distro feature enabled + install -d `dirname ${D}${systemd_unitdir}` + mv ${D}${prefix}/lib/systemd `dirname ${D}${systemd_unitdir}` + rmdir ${D}${prefix}/lib --ignore-fail-on-non-empty + fi + + # Ensure correct ownership for files copied in + if [ -d ${D}${sysconfdir}/stap-exporter ]; then + chown root:root ${D}${sysconfdir}/stap-exporter/* -R + fi +} BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc index 3dc688a18f..c574bcb2ba 100644 --- a/meta/recipes-kernel/systemtap/systemtap_git.inc +++ b/meta/recipes-kernel/systemtap/systemtap_git.inc @@ -1,22 +1,21 @@ -LICENSE = "GPLv2" +LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" -SRCREV = "45d0e7a09a15a21078d0ebf2db5175ed9e87014e" -PV = "3.1" +SRCREV = "e72dc118e563c645d93a1a2d771e8d90e8fec1ae" +PV = "5.0" -SRC_URI = "git://sourceware.org/git/systemtap.git \ - file://system_map_location.patch \ - file://configure-allow-to-disable-libvirt.patch \ - file://x32_abi_time.patch \ - file://monitor-option.patch \ - file://no-msgfmt-check.patch \ +SRC_URI = "git://sourceware.org/git/systemtap.git;branch=master;protocol=https \ file://0001-Do-not-let-configure-write-a-python-location-into-th.patch \ file://0001-Install-python-modules-to-correct-library-dir.patch \ - file://0001-buildrun-remove-quotes-around-I-include-line.patch \ file://0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch \ + file://0001-Makefile.am-remove-runtime-linux-uprobes-and-runtime.patch \ + file://0001-prerelease-datestamp-fixes.patch \ + file://0001-configure.ac-fix-broken-libdebuginfod-library-auto-d.patch \ + file://0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch \ + file://0001-staprun-fix-build-against-upcoming-gcc-14-Werror-cal.patch \ " -# systemtap doesn't support mips -COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64).*-linux' +COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips|riscv64).*-linux' +COMPATIBLE_HOST:libc-musl = 'null' S = "${WORKDIR}/git" |