diff --git a/Make-stp_task_work-compatible-with-6.11-kernels.patch b/Make-stp_task_work-compatible-with-6.11-kernels.patch deleted file mode 100644 index e1b3a0cd05e546f60d96e5520c5c1825e50e17a4..0000000000000000000000000000000000000000 --- a/Make-stp_task_work-compatible-with-6.11-kernels.patch +++ /dev/null @@ -1,99 +0,0 @@ -From a64dc4e2e0195ca80c6509df511a42459b40e9af Mon Sep 17 00:00:00 2001 -From: Martin Cermak -Date: Wed, 24 Jul 2024 16:47:42 +0200 -Subject: [PATCH] Make stp_task_work compatible with 6.11 kernels - -Update systemtap runtime so that it works with kernel commit -68cbd415dd4b task_work: - -s/task_work_cancel()/task_work_cancel_func()/ ---- - buildrun.cxx | 1 + - .../linux/autoconf-task_work_cancel_func.c | 3 +++ - runtime/linux/runtime.h | 2 +- - runtime/stp_task_work.c | 21 ++++++++++++++----- - 4 files changed, 21 insertions(+), 6 deletions(-) - create mode 100644 runtime/linux/autoconf-task_work_cancel_func.c - -diff --git a/buildrun.cxx b/buildrun.cxx -index a7fcd6297..e3f2f83d1 100644 ---- a/buildrun.cxx -+++ b/buildrun.cxx -@@ -400,6 +400,7 @@ compile_pass (systemtap_session& s) - output_exportconf(s, o2, "__module_text_address", "STAPCONF_MODULE_TEXT_ADDRESS"); - output_exportconf(s, o2, "add_timer_on", "STAPCONF_ADD_TIMER_ON"); - output_autoconf(s, o, cs, "autoconf-514-panic.c", "STAPCONF_514_PANIC", NULL); -+ output_autoconf(s, o, cs, "autoconf-task_work_cancel_func.c", "STAPCONF_TASK_WORK_CANCEL_FUNC", NULL); - - output_dual_exportconf(s, o2, "probe_kernel_read", "probe_kernel_write", "STAPCONF_PROBE_KERNEL"); - output_autoconf(s, o, cs, "autoconf-hw_breakpoint_context.c", -diff --git a/runtime/linux/autoconf-task_work_cancel_func.c b/runtime/linux/autoconf-task_work_cancel_func.c -new file mode 100644 -index 000000000..0d460de6c ---- /dev/null -+++ b/runtime/linux/autoconf-task_work_cancel_func.c -@@ -0,0 +1,3 @@ -+#include -+ -+void* c = & task_work_cancel_func; -diff --git a/runtime/linux/runtime.h b/runtime/linux/runtime.h -index 0e9fe3fea..bd9307385 100644 ---- a/runtime/linux/runtime.h -+++ b/runtime/linux/runtime.h -@@ -265,7 +265,7 @@ static void *kallsyms_uprobe_get_swbp_addr; - static void *kallsyms_task_work_add; - #endif - #if !defined(STAPCONF_TASK_WORK_CANCEL_EXPORTED) --static void *kallsyms_task_work_cancel; -+static void *kallsyms_task_work_cancel_fn; - #endif - - #if !defined(STAPCONF_TRY_TO_WAKE_UP_EXPORTED) && !defined(STAPCONF_WAKE_UP_STATE_EXPORTED) -diff --git a/runtime/stp_task_work.c b/runtime/stp_task_work.c -index 0dd3095b6..4818fecbf 100644 ---- a/runtime/stp_task_work.c -+++ b/runtime/stp_task_work.c -@@ -3,14 +3,25 @@ - - #include "linux/task_work_compatibility.h" - -+// Handle kernel commit 68cbd415dd4b9c5b9df69f0f091879e56bf5907a -+// task_work: s/task_work_cancel()/task_work_cancel_func()/ -+#if defined(STAPCONF_TASK_WORK_CANCEL_FUNC) -+#define TASK_WORK_CANCEL_FN task_work_cancel_func -+#else -+#define TASK_WORK_CANCEL_FN task_work_cancel -+#endif -+ -+#define STRINGIFY(x) #x -+#define TOSTRING(x) STRINGIFY(x) -+ - #if !defined(STAPCONF_TASK_WORK_ADD_EXPORTED) - // First typedef from the original decls, then #define as typecasted calls. - typedef typeof(&task_work_add) task_work_add_fn; - #define task_work_add(a,b,c) ibt_wrapper(int, (* (task_work_add_fn)kallsyms_task_work_add)((a), (b), (c))) - #endif - #if !defined(STAPCONF_TASK_WORK_CANCEL_EXPORTED) --typedef typeof(&task_work_cancel) task_work_cancel_fn; --#define task_work_cancel(a,b) ibt_wrapper(struct callback_head *, (* (task_work_cancel_fn)kallsyms_task_work_cancel)((a), (b))) -+typedef typeof(&TASK_WORK_CANCEL_FN) task_work_cancel_fn; -+#define task_work_cancel(a,b) ibt_wrapper(struct callback_head *, (* (task_work_cancel_fn)kallsyms_task_work_cancel_fn)((a), (b))) - #endif - - /* To avoid a crash when a task_work callback gets called after the -@@ -35,9 +46,9 @@ stp_task_work_init(void) - } - #endif - #if !defined(STAPCONF_TASK_WORK_CANCEL_EXPORTED) -- kallsyms_task_work_cancel = (void *)kallsyms_lookup_name("task_work_cancel"); -- if (kallsyms_task_work_cancel == NULL) { -- _stp_error("Can't resolve task_work_cancel!"); -+ kallsyms_task_work_cancel_fn = (void *)kallsyms_lookup_name(TOSTRING(TASK_WORK_CANCEL_FN)); -+ if (kallsyms_task_work_cancel_fn == NULL) { -+ _stp_error("Can't resolve %s!", TOSTRING(TASK_WORK_CANCEL_FN)); - return -ENOENT; - } - #endif --- -2.33.0 - diff --git a/systemtap-5.0.tar.gz b/systemtap-5.2.tar.gz similarity index 46% rename from systemtap-5.0.tar.gz rename to systemtap-5.2.tar.gz index 5566045d87becb78da20fa3c1c9a6dfce5d5deef..a9a5a91c5d956d2a4b5e5fbdd4863ffece00c2ec 100644 Binary files a/systemtap-5.0.tar.gz and b/systemtap-5.2.tar.gz differ diff --git a/systemtap.spec b/systemtap.spec index 570fee4059e5febcd373ab192d7adcb8724247c3..af0c1a80dac65e3fc59f2782f52933247c6a36b2 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -21,17 +21,16 @@ %undefine __brp_mangle_shebangs Name: systemtap -Version: 5.0 -Release: 3 +Version: 5.2 +Release: 1 Summary: Linux trace and probe tool -License: GPLv2+ and Public Domain -URL: http://sourceware.org/systemtap +License: GPL-2.0-or-later and Public Domain +URL: https://sourceware.org/systemtap Source: https://sourceware.org/systemtap/ftp/releases/%{name}-%{version}.tar.gz Patch9000: huawei-fix-network-tcp-test-error.patch Patch9001: huawei-local-is-only-valid-in-functions-for-shellche-sc2168.patch Patch9002: Add-basic-LoongArch64-support.patch -Patch9003: Make-stp_task_work-compatible-with-6.11-kernels.patch BuildRequires: gcc-c++ emacs systemd python3-setuptools BuildRequires: gettext-devel rpm-devel readline-devel @@ -49,6 +48,7 @@ BuildRequires: crash-devel zlib-devel %endif Requires: systemtap-client = %{version}-%{release} +%{?systemd_requires} %description SystemTap is an instrumentation system for systems running Linux. @@ -58,8 +58,9 @@ the components needed to locally develop and execute systemtap scripts. %package devel Summary: Programmable system-wide instrumentation system - development headers, tools -License: GPLv2+ +License: GPL-2.0-or-later Requires: make kernel-devel systemd +Requires: systemtap-translations = %{version}-%{release} %description devel This package contains the components needed to compile a systemtap @@ -69,13 +70,26 @@ systemtap-client and systemtap-runtime packages), or on a dedicated remote server (alongside the systemtap-server package). It includes a copy of the standard tapset library and the runtime library C files. +%package translations +Summary: Translation files for %{name} +Buildarch: noarch +Conflicts: systemtap-server < 5.1 +Conflicts: systemtap-devel < 5.1 +Conflicts: systemtap-runtime < 5.1 +Conflicts: systemtap-client < 5.1 + +%description translations +This package contains tranlation files for %{name} + %package server Summary: Instrumentation System Server -License: GPLv2+ +License: GPL-2.0-or-later Requires: systemtap-devel = %{version}-%{release} +Requires: systemtap-translations = %{version}-%{release} Requires: coreutils nss zip unzip Requires(pre): shadow-utils BuildRequires: nss-devel avahi-devel +%{?systemd_requires} %if %{with_openssl} Requires: openssl %endif @@ -87,8 +101,9 @@ compiles systemtap scripts to kernel objects on their demand. %package runtime Summary: Programmable system-wide instrumentation system - runtime -License: GPLv2+ +License: GPL-2.0-or-later Requires(pre): shadow-utils +Requires: systemtap-translations = %{version}-%{release} %description runtime SystemTap runtime contains the components needed to execute @@ -97,9 +112,10 @@ using a local or remote systemtap-devel installation. %package client Summary: Programmable system-wide instrumentation system - client -License: GPLv2+ +License: GPL-2.0-or-later Requires: zip unzip Requires: systemtap-runtime = %{version}-%{release} +Requires: systemtap-translations = %{version}-%{release} Requires: coreutils grep sed unzip zip Requires: openssh-clients %if %{with_mokutil} @@ -115,7 +131,7 @@ documentation, and a copy of the tapset library for reference. %package sdt-devel Summary: Static probe support tools -License: GPLv2+ and Public Domain +License: GPL-2.0-or-later and Public Domain Requires: python3-pyparsing %description sdt-devel @@ -126,7 +142,7 @@ with the optional dtrace-compatibility preprocessor to process related %package testsuite Summary: Instrumentation System Testsuite -License: GPLv2+ +License: GPL-2.0-or-later Requires: systemtap = %{version}-%{release} Requires: systemtap-sdt-devel = %{version}-%{release} Requires: systemtap-server = %{version}-%{release} @@ -146,8 +162,7 @@ systemtap on the current system. %package runtime-python3 Summary: Systemtap Python 3 Runtime Support -License: GPLv2+ -URL: http://sourceware.org/systemtap +License: GPL-2.0-or-later Requires: systemtap-runtime = %{version}-%{release} %description runtime-python3 @@ -156,9 +171,10 @@ that probe python3 processes. %package stap-exporter Summary: Systemtap-prometheus interoperation mechanism -License: GPLv2+ -URL: http://sourceware.org/systemtap +License: GPL-2.0-or-later Requires: systemtap-runtime = %{version}-%{release} +Provides: %{name}-exporter = %{version}-%{release} +%{?systemd_requires} %description stap-exporter This package includes files for a systemd service that manages @@ -167,8 +183,7 @@ to remote requesters on demand. %package jupyter Summary: ISystemtap jupyter kernel and examples -License: GPLv2+ -URL: http://sourceware.org/systemtap/ +License: GPL-2.0-or-later Requires: systemtap = %{version}-%{release} %description jupyter @@ -176,13 +191,7 @@ This package includes files needed to build and run the interactive systemtap Jupyter kernel, either locally or within a container. -%package help -Summary: systemtap manual -License: GPLv2+ -URL: http://sourceware.org/systemtap - -%description help -This package include systemtap manual +%package_help %prep %autosetup -p1 @@ -207,14 +216,8 @@ This package include systemtap manual %{_emacs_bytecompile} emacs/systemtap-mode.el %install -rm -rf ${RPM_BUILD_ROOT} -make DESTDIR=$RPM_BUILD_ROOT install +%make_install %find_lang %{name} -for dir in $(ls -1d $RPM_BUILD_ROOT%{_mandir}/{??,??_??}) ; do - dir=$(echo $dir | sed -e "s|^$RPM_BUILD_ROOT||") - lang=$(basename $dir) - echo "%%lang($lang) $dir/man*/*" >> %{name}.lang -done ln -s %{_datadir}/systemtap/examples find $RPM_BUILD_ROOT%{_datadir}/systemtap/examples -type f -name '*.stp' -print0 | xargs -0 sed -i -r -e '1s@^#!.+stap@#!%{_bindir}/stap@' @@ -322,49 +325,30 @@ fi exit 0 %preun server -if [ $1 = 0 ] ; then - /bin/systemctl --no-reload disable stap-server.service >/dev/null 2>&1 || : - /bin/systemctl stop stap-server.service >/dev/null 2>&1 || : -fi -exit 0 +%systemd_preun stap-server.service %postun server -if [ "$1" -ge "1" ] ; then - /bin/systemctl condrestart stap-server.service >/dev/null 2>&1 || : -fi -exit 0 +%systemd_postun stap-server.service %postun -if [ "$1" -ge "1" ] ; then - /bin/systemctl condrestart systemtap.service >/dev/null 2>&1 || : -fi -exit 0 +%systemd_postun systemtap.service %preun stap-exporter -if [ "$1" -eq "0" ] ; then -/bin/systemctl stop stap-exporter.service >/dev/null 2>&1 || : -/bin/systemctl disable stap-exporter.service >/dev/null 2>&1 || : -fi -exit 0 +%systemd_preun stap-exporter.service %post -/bin/systemctl enable systemtap.service >/dev/null 2>&1 || : +%systemd_post systemtap.service (make -C %{_datadir}/systemtap/runtime/uprobes clean) >/dev/null 2>&1 || true (/sbin/rmmod uprobes) >/dev/null 2>&1 || true %preun -if [ $1 = 0 ] ; then - /bin/systemctl --no-reload disable systemtap.service >/dev/null 2>&1 || : - /bin/systemctl stop systemtap.service >/dev/null 2>&1 || : -fi -exit 0 +%systemd_preun systemtap.service (make -C %{_datadir}/systemtap/runtime/uprobes clean) >/dev/null 2>&1 || true (/sbin/rmmod uprobes) >/dev/null 2>&1 || true %files %license COPYING %doc README README.unprivileged AUTHORS NEWS -%defattr(-,root,root) %{_unitdir}/systemtap.service %{_sbindir}/systemtap-service %dir %{_sysconfdir}/systemtap @@ -376,8 +360,9 @@ exit 0 %dir %{dracutstap} %{dracutstap}/* -%files server -f systemtap.lang -%defattr(-,root,root) +%files translations -f systemtap.lang + +%files server %{_bindir}/stap-server %dir %{_libexecdir}/systemtap %{_libexecdir}/systemtap/stap-serverd @@ -396,9 +381,8 @@ exit 0 %dir %attr(0755,stap-server,stap-server) %{_localstatedir}/log/stap-server %ghost %config(noreplace) %attr(0644,stap-server,stap-server) %{_localstatedir}/log/stap-server/log %ghost %attr(0755,stap-server,stap-server) %{_localstatedir}/run/stap-server -%{!?_licensedir:%global license %%doc} -%files devel -f systemtap.lang +%files devel %{_bindir}/stap %{_bindir}/stap-prep %{_bindir}/stap-profile-annotate @@ -406,15 +390,13 @@ exit 0 %dir %{_datadir}/systemtap %{_datadir}/systemtap/runtime %{_datadir}/systemtap/tapset -%{!?_licensedir:%global license %%doc} %dir %{_libexecdir}/systemtap %{_emacs_sitelispdir}/*.el* %{_emacs_sitestartdir}/systemtap-init.el %{_datadir}/vim/vimfiles/*/*.vim %{_libexecdir}/systemtap/python/stap-resolve-module-function.py -%files runtime -f systemtap.lang -%defattr(-,root,root) +%files runtime %attr(4110,root,stapusr) %{_bindir}/staprun %{_bindir}/stapsh %{_bindir}/stap-merge @@ -423,7 +405,6 @@ exit 0 %dir %{_libexecdir}/systemtap %{_libexecdir}/systemtap/stapio %{_libexecdir}/systemtap/stap-authorize-cert -%{!?_licensedir:%global license %%doc} %if %{with_dyninst} %{_bindir}/stapdyn %endif @@ -432,10 +413,8 @@ exit 0 %{_libdir}/systemtap/staplog.so* %endif -%files client -f systemtap.lang -%defattr(-,root,root) +%files client %{_datadir}/systemtap/examples -%{!?_licensedir:%global license %%doc} %license COPYING %doc docs.installed/*.pdf %{_bindir}/stap @@ -445,15 +424,12 @@ exit 0 %{_datadir}/systemtap/tapset %files sdt-devel -%defattr(-,root,root) %{_bindir}/dtrace %{_includedir}/sys/sdt.h %{_includedir}/sys/sdt-config.h %{_rpmmacrodir}/macros.systemtap -%{!?_licensedir:%global license %%doc} %files testsuite -%defattr(-,root,root) %dir %{_datadir}/systemtap %{_datadir}/systemtap/testsuite @@ -464,9 +440,9 @@ exit 0 %files stap-exporter %{_unitdir}/stap-exporter.service %{_bindir}/stap-exporter -/etc/stap-exporter/* -/usr/sbin/stap-exporter -/etc/sysconfig/stap-exporter +%{_sysconfdir}/stap-exporter +%{_sbindir}/stap-exporter +%{_sysconfdir}/sysconfig/stap-exporter %files jupyter %{_bindir}/stap-jupyter-container @@ -476,9 +452,15 @@ exit 0 %{_datadir}/systemtap/interactive-notebook %files help -%{_mandir}/man[1378]/* +%{_mandir}/man?/* +%lang(cs) %{_mandir}/cs/man?/* %changelog +* Sat Nov 09 2024 Funda Wang - 5.2-1 +- update to 5.2 +- split out translations as they are common for multiple components +- use systemd related macros to deal with services + * Wed Sep 04 2024 wangxiao - 5.0-3 - Type:bugfix - CVE:NA diff --git a/systemtap.yaml b/systemtap.yaml index 3e06431d5d30041ae1773526f10e5e8f006bcefd..685deff3713c1482cae6826393afc1282d00b982 100644 --- a/systemtap.yaml +++ b/systemtap.yaml @@ -1,4 +1,4 @@ version_control: git src_repo: https://sourceware.org/git/systemtap.git tag_prefix: ^release- -seperator: . +separator: .