From c8abe8aada4698b9ba36411d5d77e9c3496b107f Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Wed, 24 Nov 2021 09:30:25 +0100 Subject: [PATCH 01/10] CI Gating: Exclude conflicting glibc-headers from dnf transaction --- plans/ci.fmf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plans/ci.fmf b/plans/ci.fmf index 1ad2c12..e1aad9b 100644 --- a/plans/ci.fmf +++ b/plans/ci.fmf @@ -2,5 +2,10 @@ summary: CI Gating Plan discover: how: fmf directory: tests +prepare: + how: install + exclude: + - glibc-headers-x86 + - glibc-headers-s390 execute: how: beakerlib From b086ce78c04a8d2d6be593f94e8dbf4c3da16ef7 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Wed, 24 Nov 2021 09:31:05 +0100 Subject: [PATCH 02/10] CI Gating: Exclude conflicting glibc-headers from dnf transaction --- plans/ci.fmf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plans/ci.fmf b/plans/ci.fmf index 1ad2c12..e1aad9b 100644 --- a/plans/ci.fmf +++ b/plans/ci.fmf @@ -2,5 +2,10 @@ summary: CI Gating Plan discover: how: fmf directory: tests +prepare: + how: install + exclude: + - glibc-headers-x86 + - glibc-headers-s390 execute: how: beakerlib From 220790f7f1e3c3f9a0fd23b8f36d1dcfd8a5599d Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Thu, 25 Nov 2021 14:45:25 +0100 Subject: [PATCH 03/10] Use sysuser.d/* for user/group management Related: #2012907 --- systemtap.spec | 46 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/systemtap.spec b/systemtap.spec index 281a594..471e808 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -88,9 +88,37 @@ # To avoid testsuite/*/*.stp has shebang which doesn't start with '/' %define __brp_mangle_shebangs_exclude_from .stp$ +%define _systemtap_runtime_preinstall \ +# See systemd-sysusers(8) sysusers.d(5)\ +\ +g stapusr 156\ +g stapsys 157\ +g stapdev 158 + +%define _systemtap_server_preinstall \ +# See systemd-sysusers(8) sysusers.d(5)\ +\ +g stap-server -\ +u stap-server - "systemtap compiler server" /var/lib/stap-server /sbin/nologin\ +m stap-server stap-server + + +%define _systemtap_testsuite_preinstall \ +# See systemd-sysusers(8) sysusers.d(5)\ +\ +u stapusr - "systemtap testsuite user" / /sbin/nologin\ +u stapsys - "systemtap testsuite user" / /sbin/nologin\ +u stapdev - "systemtap testsuite user" / /sbin/nologin\ +m stapusr stapusr\ +m stapsys stapusr\ +m stapsys stapsys\ +m stapdev stapusr\ +m stapdev stapdev + + Name: systemtap Version: 4.6 -Release: 1%{?release_override}%{?dist} +Release: 2%{?release_override}%{?dist} # for version, see also configure.ac @@ -656,9 +684,10 @@ for dir in $(ls -1d $RPM_BUILD_ROOT%{_mandir}/{??,??_??}) ; do done %if %{with_sysusers} -install -p -D -m 0644 systemtap-runtime.sysusers %{buildroot}%{_sysusersdir}/systemtap-runtime.conf -install -p -D -m 0644 systemtap-server.sysusers %{buildroot}%{_sysusersdir}/systemtap-server.conf -install -p -D -m 0644 systemtap-testsuite.sysusers %{buildroot}%{_sysusersdir}/systemtap-testsuite.conf +mkdir -p %{buildroot}%{_sysusersdir} +echo '%_systemtap_runtime_preinstall' > %{buildroot}%{_sysusersdir}/systemtap-runtime.conf +echo '%_systemtap_server_preinstall' > %{buildroot}%{_sysusersdir}/systemtap-server.conf +echo '%_systemtap_testsuite_preinstall' > %{buildroot}%{_sysusersdir}/systemtap-testsuite.conf %endif @@ -786,7 +815,7 @@ pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{python3_sitearch %pre runtime %if %{with_sysusers} -%sysusers_create_compat $RPM_BUILD_ROOT/systemtap-runtime.sysusers +echo '%_systemtap_runtime_preinstall' | systemd-sysusers --replace=%{_sysusersdir}/systemtap-runtime.conf - %else getent group stapusr >/dev/null || groupadd -f -g 156 -r stapusr getent group stapsys >/dev/null || groupadd -f -g 157 -r stapsys @@ -796,7 +825,7 @@ exit 0 %pre server %if %{with_sysusers} -%sysusers_create_compat $RPM_BUILD_ROOT/systemtap-server.sysusers +echo '%_systemtap_server_preinstall' | systemd-sysusers --replace=%{_sysusersdir}/systemtap-server.conf - %else getent group stap-server >/dev/null || groupadd -f -g 155 -r stap-server getent passwd stap-server >/dev/null || \ @@ -807,7 +836,7 @@ exit 0 %pre testsuite %if %{with_sysusers} -%sysusers_create_compat $RPM_BUILD_ROOT/systemtap-testsuite.sysusers +echo '%_systemtap_testsuite_preinstall' | systemd-sysusers --replace=%{_sysusersdir}/systemtap-testsuite.conf - %else getent passwd stapusr >/dev/null || \ useradd -c "Systemtap 'stapusr' User" -g stapusr -r -s /sbin/nologin stapusr @@ -1240,6 +1269,9 @@ exit 0 # PRERELEASE %changelog +* Thu Nov 25 2021 Martin Cermak - 4.6-2 +- rhbz2012907: Use sysuser.d/* for user/group management + * Mon Nov 15 2021 Serhei Makarov - 4.6-1 - Upstream release, see wiki page below for detailed notes. https://sourceware.org/systemtap/wiki/SystemTapReleases From 93fa3f55d19e7150f35f913a2390a4aecaef9fc7 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Wed, 1 Dec 2021 12:26:17 +0100 Subject: [PATCH 04/10] CI Gating: Set up mandatory rebuild tests Make sure components consuming systemtap-devel continue building after a systemtap update. Currently glibc and qemu rebuilds are attempted. --- gating.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gating.yaml b/gating.yaml index ce3cdc1..ff1fcc6 100644 --- a/gating.yaml +++ b/gating.yaml @@ -5,15 +5,18 @@ decision_context: bodhi_update_push_stable subject_type: koji_build rules: - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} + - !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation} --- !Policy product_versions: - rhel-8 decision_context: osci_compose_gate rules: - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} + - !PassingTestCaseRule {test_case_name: osci.brew-build.rebuild.validation} --- !Policy product_versions: - rhel-9 decision_context: osci_compose_gate rules: - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} + - !PassingTestCaseRule {test_case_name: osci.brew-build.rebuild.validation} From 5d4791f8aa8a35b4475e7df04e2a7c609c6939fb Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Wed, 1 Dec 2021 12:27:25 +0100 Subject: [PATCH 05/10] CI Gating: Set up mandatory rebuild tests Make sure components consuming systemtap-devel continue building after a systemtap update. Currently glibc and qemu rebuilds are attempted. --- gating.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gating.yaml b/gating.yaml index ce3cdc1..ff1fcc6 100644 --- a/gating.yaml +++ b/gating.yaml @@ -5,15 +5,18 @@ decision_context: bodhi_update_push_stable subject_type: koji_build rules: - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} + - !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation} --- !Policy product_versions: - rhel-8 decision_context: osci_compose_gate rules: - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} + - !PassingTestCaseRule {test_case_name: osci.brew-build.rebuild.validation} --- !Policy product_versions: - rhel-9 decision_context: osci_compose_gate rules: - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} + - !PassingTestCaseRule {test_case_name: osci.brew-build.rebuild.validation} From ead7448ade4aa7d0dcbb46bd6399fc6feda53d04 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Wed, 1 Dec 2021 12:33:16 +0100 Subject: [PATCH 06/10] Use sysuser.d/* for user/group management Related: #2012907 --- systemtap.spec | 46 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/systemtap.spec b/systemtap.spec index 281a594..83b3ef5 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -88,9 +88,37 @@ # To avoid testsuite/*/*.stp has shebang which doesn't start with '/' %define __brp_mangle_shebangs_exclude_from .stp$ +%define _systemtap_runtime_preinstall \ +# See systemd-sysusers(8) sysusers.d(5)\ +\ +g stapusr 156\ +g stapsys 157\ +g stapdev 158 + +%define _systemtap_server_preinstall \ +# See systemd-sysusers(8) sysusers.d(5)\ +\ +g stap-server -\ +u stap-server - "systemtap compiler server" /var/lib/stap-server /sbin/nologin\ +m stap-server stap-server + + +%define _systemtap_testsuite_preinstall \ +# See systemd-sysusers(8) sysusers.d(5)\ +\ +u stapusr - "systemtap testsuite user" / /sbin/nologin\ +u stapsys - "systemtap testsuite user" / /sbin/nologin\ +u stapdev - "systemtap testsuite user" / /sbin/nologin\ +m stapusr stapusr\ +m stapsys stapusr\ +m stapsys stapsys\ +m stapdev stapusr\ +m stapdev stapdev + + Name: systemtap Version: 4.6 -Release: 1%{?release_override}%{?dist} +Release: 2%{?release_override}%{?dist} # for version, see also configure.ac @@ -656,9 +684,10 @@ for dir in $(ls -1d $RPM_BUILD_ROOT%{_mandir}/{??,??_??}) ; do done %if %{with_sysusers} -install -p -D -m 0644 systemtap-runtime.sysusers %{buildroot}%{_sysusersdir}/systemtap-runtime.conf -install -p -D -m 0644 systemtap-server.sysusers %{buildroot}%{_sysusersdir}/systemtap-server.conf -install -p -D -m 0644 systemtap-testsuite.sysusers %{buildroot}%{_sysusersdir}/systemtap-testsuite.conf +mkdir -p %{buildroot}%{_sysusersdir} +echo '%_systemtap_runtime_preinstall' > %{buildroot}%{_sysusersdir}/systemtap-runtime.conf +echo '%_systemtap_server_preinstall' > %{buildroot}%{_sysusersdir}/systemtap-server.conf +echo '%_systemtap_testsuite_preinstall' > %{buildroot}%{_sysusersdir}/systemtap-testsuite.conf %endif @@ -786,7 +815,7 @@ pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{python3_sitearch %pre runtime %if %{with_sysusers} -%sysusers_create_compat $RPM_BUILD_ROOT/systemtap-runtime.sysusers +echo '%_systemtap_runtime_preinstall' | systemd-sysusers --replace=%{_sysusersdir}/systemtap-runtime.conf - %else getent group stapusr >/dev/null || groupadd -f -g 156 -r stapusr getent group stapsys >/dev/null || groupadd -f -g 157 -r stapsys @@ -796,7 +825,7 @@ exit 0 %pre server %if %{with_sysusers} -%sysusers_create_compat $RPM_BUILD_ROOT/systemtap-server.sysusers +echo '%_systemtap_server_preinstall' | systemd-sysusers --replace=%{_sysusersdir}/systemtap-server.conf - %else getent group stap-server >/dev/null || groupadd -f -g 155 -r stap-server getent passwd stap-server >/dev/null || \ @@ -807,7 +836,7 @@ exit 0 %pre testsuite %if %{with_sysusers} -%sysusers_create_compat $RPM_BUILD_ROOT/systemtap-testsuite.sysusers +echo '%_systemtap_testsuite_preinstall' | systemd-sysusers --replace=%{_sysusersdir}/systemtap-testsuite.conf - %else getent passwd stapusr >/dev/null || \ useradd -c "Systemtap 'stapusr' User" -g stapusr -r -s /sbin/nologin stapusr @@ -1240,6 +1269,9 @@ exit 0 # PRERELEASE %changelog +* Thu Dec 01 2021 Martin Cermak - 4.6-2 +- rhbz2012907: Use sysuser.d/* for user/group management + * Mon Nov 15 2021 Serhei Makarov - 4.6-1 - Upstream release, see wiki page below for detailed notes. https://sourceware.org/systemtap/wiki/SystemTapReleases From 2e141cfe0cfcaac9d5d372932db22faa12a82f67 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 2 Dec 2021 13:59:37 -0500 Subject: [PATCH 07/10] tweak sys/sdt.h for arm32 and s390 apps that ftbfs with stap 4.6 release version --- sdt-fixes.patch | 138 ++++++++++++++++++++++++++++++++++++++++++++++++ systemtap.spec | 9 +++- 2 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 sdt-fixes.patch diff --git a/sdt-fixes.patch b/sdt-fixes.patch new file mode 100644 index 0000000..ed76e48 --- /dev/null +++ b/sdt-fixes.patch @@ -0,0 +1,138 @@ +commit 34facf7ee6b43dae66cc109973a4eda42e439163 +Author: Frank Ch. Eigler +Date: Wed Dec 1 10:59:27 2021 -0500 + + RHBZ2026858: on __arm__ (arm32), use STAP_SDT_ARG_CONSTRAINT = g + +diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h +index 9ecb1cb6fed2..28d236d91cd8 100644 +--- a/includes/sys/sdt.h ++++ b/includes/sys/sdt.h +@@ -106,6 +106,8 @@ + # define STAP_SDT_ARG_CONSTRAINT norw + # elif defined __s390__ || defined __s390x__ + # define STAP_SDT_ARG_CONSTRAINT norf ++# elif defined __arm__ ++# define STAP_SDT_ARG_CONSTRAINT g + # else + # define STAP_SDT_ARG_CONSTRAINT nor + # endif + +commit ecab2afea46099b4e7dfd551462689224afdbe3a (upstream/master) +Author: Stan Cox +Date: Wed Dec 1 16:19:22 2021 -0500 + + Handle user supplied sdt probe argument template + + User supplied templates were erroneously removed by commit eaa15b047, + which complicated the template expansion. To do the above the + expansion of STAP_PROBE_ASM(provider, fooprobe, + STAP_PROBE_ASM_TEMPLATE(3)) adds an unused argument: + STAP_PROBE_ASM(provider, fooprobe, /*template expansion*/ "%[SDT..]..", + "use _SDT_ASM_TEMPLATE") A supplied template + STAP_PROBE_ASM(provider, fooprobe, "4@%rdx 8@%rax") is left alone. If + the varargs has 2 args (the fake "use ..") then macro expansion + inserts the expanded string, otherwise "4@.." becomes an ascii op. + +diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h +index 28d236d91cd8..24d5e01c3780 100644 +--- a/includes/sys/sdt.h ++++ b/includes/sys/sdt.h +@@ -290,7 +290,7 @@ __extension__ extern unsigned long long __sdt_unsp; + _SDT_ASM_1(.purgem _SDT_TYPE_) \ + _SDT_ASM_1(.purgem _SDT_TYPE) + +-#define _SDT_ASM_BODY(provider, name, pack_args, args) \ ++#define _SDT_ASM_BODY(provider, name, pack_args, args, ...) \ + _SDT_DEF_MACROS \ + _SDT_ASM_1(990: _SDT_NOP) \ + _SDT_ASM_3( .pushsection .note.stapsdt,_SDT_ASM_AUTOGROUP,"note") \ +@@ -417,9 +417,9 @@ __extension__ extern unsigned long long __sdt_unsp; + counted, so we don't have to worry about the behavior of macros + called without any arguments. */ + +-#ifdef SDT_USE_VARIADIC + #define _SDT_NARG(...) __SDT_NARG(__VA_ARGS__, 12,11,10,9,8,7,6,5,4,3,2,1,0) + #define __SDT_NARG(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, N, ...) N ++#ifdef SDT_USE_VARIADIC + #define _SDT_PROBE_N(provider, name, N, ...) \ + _SDT_PROBE(provider, name, N, (__VA_ARGS__)) + #define STAP_PROBEV(provider, name, ...) \ +@@ -468,9 +468,15 @@ __extension__ extern unsigned long long __sdt_unsp; + Note that these can use operand templates like %0 or %[name], + and likewise they must write %%reg for a literal operand of %reg. */ + ++#define _SDT_ASM_BODY_1(p,n,...) _SDT_ASM_BODY(p,n,_SDT_ASM_SUBSTR,(__VA_ARGS__)) ++#define _SDT_ASM_BODY_2(p,n,...) _SDT_ASM_BODY(p,n,/*_SDT_ASM_STRING */,__VA_ARGS__) ++#define _SDT_ASM_BODY_N2(p,n,no,...) _SDT_ASM_BODY_ ## no(p,n,__VA_ARGS__) ++#define _SDT_ASM_BODY_N1(p,n,no,...) _SDT_ASM_BODY_N2(p,n,no,__VA_ARGS__) ++#define _SDT_ASM_BODY_N(p,n,...) _SDT_ASM_BODY_N1(p,n,_SDT_NARG(0, __VA_ARGS__),__VA_ARGS__) ++ + #if __STDC_VERSION__ >= 199901L + # define STAP_PROBE_ASM(provider, name, ...) \ +- _SDT_ASM_BODY(provider, name, /*_SDT_ASM_STRING */, __VA_ARGS__) \ ++ _SDT_ASM_BODY_N(provider, name, __VA_ARGS__) \ + _SDT_ASM_BASE + # define STAP_PROBE_ASM_OPERANDS(n, ...) _SDT_ASM_OPERANDS_##n(__VA_ARGS__) + #else +@@ -478,7 +484,7 @@ __extension__ extern unsigned long long __sdt_unsp; + _SDT_ASM_BODY(provider, name, /* _SDT_ASM_STRING */, (args)) \ + _SDT_ASM_BASE + #endif +-#define STAP_PROBE_ASM_TEMPLATE(n) _SDT_ASM_TEMPLATE_##n ++#define STAP_PROBE_ASM_TEMPLATE(n) _SDT_ASM_TEMPLATE_##n,"use _SDT_ASM_TEMPLATE_" + + + /* DTrace compatible macro names. */ +diff --git a/testsuite/systemtap.base/sdt_casm.c b/testsuite/systemtap.base/sdt_casm.c +index 1cff23c5f7b9..9b357086c04f 100644 +--- a/testsuite/systemtap.base/sdt_casm.c ++++ b/testsuite/systemtap.base/sdt_casm.c +@@ -3,6 +3,7 @@ + int main() + { + int x = 42; ++ int y = 43; + __asm__ __volatile__ ( + STAP_PROBE_ASM(testsuite, probe0, STAP_PROBE_ASM_TEMPLATE(0)) + ); +@@ -10,5 +11,9 @@ int main() + STAP_PROBE_ASM(testsuite, probe1, STAP_PROBE_ASM_TEMPLATE(1)) + :: STAP_PROBE_ASM_OPERANDS(1, x) + ); ++ // Create a template to test explicit template support ++ __asm__ __volatile__ ( ++ STAP_PROBE_ASM(testsuite, probe2, -4@%[ARG1] -4@%[ARG2]) ++ :: [ARG1] "rm" (x), [ARG2] "rm" (y)); + return 0; + } +diff --git a/testsuite/systemtap.base/sdt_casm.exp b/testsuite/systemtap.base/sdt_casm.exp +index 5791cb2b9f9a..0cd1cb51730e 100644 +--- a/testsuite/systemtap.base/sdt_casm.exp ++++ b/testsuite/systemtap.base/sdt_casm.exp +@@ -18,7 +18,8 @@ proc cleanup_handler { verbose } { + + set script $srcdir/$subdir/$test.stp + set ::result_string {PASS: probe0 +-PASS: probe1} ++PASS: probe1 ++PASS: probe2} + + set asm_flags [sdt_includes] + set asm_flags "$asm_flags additional_flags=-std=c99" +diff --git a/testsuite/systemtap.base/sdt_casm.stp b/testsuite/systemtap.base/sdt_casm.stp +index 4f2539c93e52..530a791751e0 100644 +--- a/testsuite/systemtap.base/sdt_casm.stp ++++ b/testsuite/systemtap.base/sdt_casm.stp +@@ -10,3 +10,11 @@ probe process.mark("probe1") + else + printf("FAIL: %s (%d != 42)\n", $$name, $arg1) + } ++ ++probe process.mark("probe2") ++{ ++ if ($arg1 == 42 && $arg2 == 43) ++ printf("PASS: %s\n", $$name) ++ else ++ printf("FAIL: %s (%d/%d != 42/43)\n", $$name, $arg1, $arg2) ++} diff --git a/systemtap.spec b/systemtap.spec index 471e808..ca7bdde 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -118,7 +118,7 @@ m stapdev stapdev Name: systemtap Version: 4.6 -Release: 2%{?release_override}%{?dist} +Release: 3%{?release_override}%{?dist} # for version, see also configure.ac @@ -154,6 +154,8 @@ License: GPLv2+ URL: http://sourceware.org/systemtap/ Source: %{name}-%{version}.tar.gz +Patch1: sdt-fixes.patch + # Build* BuildRequires: make BuildRequires: gcc-c++ @@ -573,6 +575,7 @@ systemtap-runtime-virthost machine to execute systemtap scripts. %prep %setup -q +%patch1 -p1 %build @@ -1269,6 +1272,10 @@ exit 0 # PRERELEASE %changelog +* Thu Dec 02 2021 Frank Ch. Eigler - 4.6-3 +- rhbz2026858 - arm32 sdt fixes +- sdt.h fixes for glibc s390 ftbfs + * Thu Nov 25 2021 Martin Cermak - 4.6-2 - rhbz2012907: Use sysuser.d/* for user/group management From 44384cba96a2b742deee35789b4b5a4be353a1c6 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 2 Dec 2021 13:59:37 -0500 Subject: [PATCH 08/10] tweak sys/sdt.h for arm32 and s390 apps that ftbfs with stap 4.6 release version --- sdt-fixes.patch | 138 ++++++++++++++++++++++++++++++++++++++++++++++++ systemtap.spec | 11 +++- 2 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 sdt-fixes.patch diff --git a/sdt-fixes.patch b/sdt-fixes.patch new file mode 100644 index 0000000..ed76e48 --- /dev/null +++ b/sdt-fixes.patch @@ -0,0 +1,138 @@ +commit 34facf7ee6b43dae66cc109973a4eda42e439163 +Author: Frank Ch. Eigler +Date: Wed Dec 1 10:59:27 2021 -0500 + + RHBZ2026858: on __arm__ (arm32), use STAP_SDT_ARG_CONSTRAINT = g + +diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h +index 9ecb1cb6fed2..28d236d91cd8 100644 +--- a/includes/sys/sdt.h ++++ b/includes/sys/sdt.h +@@ -106,6 +106,8 @@ + # define STAP_SDT_ARG_CONSTRAINT norw + # elif defined __s390__ || defined __s390x__ + # define STAP_SDT_ARG_CONSTRAINT norf ++# elif defined __arm__ ++# define STAP_SDT_ARG_CONSTRAINT g + # else + # define STAP_SDT_ARG_CONSTRAINT nor + # endif + +commit ecab2afea46099b4e7dfd551462689224afdbe3a (upstream/master) +Author: Stan Cox +Date: Wed Dec 1 16:19:22 2021 -0500 + + Handle user supplied sdt probe argument template + + User supplied templates were erroneously removed by commit eaa15b047, + which complicated the template expansion. To do the above the + expansion of STAP_PROBE_ASM(provider, fooprobe, + STAP_PROBE_ASM_TEMPLATE(3)) adds an unused argument: + STAP_PROBE_ASM(provider, fooprobe, /*template expansion*/ "%[SDT..]..", + "use _SDT_ASM_TEMPLATE") A supplied template + STAP_PROBE_ASM(provider, fooprobe, "4@%rdx 8@%rax") is left alone. If + the varargs has 2 args (the fake "use ..") then macro expansion + inserts the expanded string, otherwise "4@.." becomes an ascii op. + +diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h +index 28d236d91cd8..24d5e01c3780 100644 +--- a/includes/sys/sdt.h ++++ b/includes/sys/sdt.h +@@ -290,7 +290,7 @@ __extension__ extern unsigned long long __sdt_unsp; + _SDT_ASM_1(.purgem _SDT_TYPE_) \ + _SDT_ASM_1(.purgem _SDT_TYPE) + +-#define _SDT_ASM_BODY(provider, name, pack_args, args) \ ++#define _SDT_ASM_BODY(provider, name, pack_args, args, ...) \ + _SDT_DEF_MACROS \ + _SDT_ASM_1(990: _SDT_NOP) \ + _SDT_ASM_3( .pushsection .note.stapsdt,_SDT_ASM_AUTOGROUP,"note") \ +@@ -417,9 +417,9 @@ __extension__ extern unsigned long long __sdt_unsp; + counted, so we don't have to worry about the behavior of macros + called without any arguments. */ + +-#ifdef SDT_USE_VARIADIC + #define _SDT_NARG(...) __SDT_NARG(__VA_ARGS__, 12,11,10,9,8,7,6,5,4,3,2,1,0) + #define __SDT_NARG(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12, N, ...) N ++#ifdef SDT_USE_VARIADIC + #define _SDT_PROBE_N(provider, name, N, ...) \ + _SDT_PROBE(provider, name, N, (__VA_ARGS__)) + #define STAP_PROBEV(provider, name, ...) \ +@@ -468,9 +468,15 @@ __extension__ extern unsigned long long __sdt_unsp; + Note that these can use operand templates like %0 or %[name], + and likewise they must write %%reg for a literal operand of %reg. */ + ++#define _SDT_ASM_BODY_1(p,n,...) _SDT_ASM_BODY(p,n,_SDT_ASM_SUBSTR,(__VA_ARGS__)) ++#define _SDT_ASM_BODY_2(p,n,...) _SDT_ASM_BODY(p,n,/*_SDT_ASM_STRING */,__VA_ARGS__) ++#define _SDT_ASM_BODY_N2(p,n,no,...) _SDT_ASM_BODY_ ## no(p,n,__VA_ARGS__) ++#define _SDT_ASM_BODY_N1(p,n,no,...) _SDT_ASM_BODY_N2(p,n,no,__VA_ARGS__) ++#define _SDT_ASM_BODY_N(p,n,...) _SDT_ASM_BODY_N1(p,n,_SDT_NARG(0, __VA_ARGS__),__VA_ARGS__) ++ + #if __STDC_VERSION__ >= 199901L + # define STAP_PROBE_ASM(provider, name, ...) \ +- _SDT_ASM_BODY(provider, name, /*_SDT_ASM_STRING */, __VA_ARGS__) \ ++ _SDT_ASM_BODY_N(provider, name, __VA_ARGS__) \ + _SDT_ASM_BASE + # define STAP_PROBE_ASM_OPERANDS(n, ...) _SDT_ASM_OPERANDS_##n(__VA_ARGS__) + #else +@@ -478,7 +484,7 @@ __extension__ extern unsigned long long __sdt_unsp; + _SDT_ASM_BODY(provider, name, /* _SDT_ASM_STRING */, (args)) \ + _SDT_ASM_BASE + #endif +-#define STAP_PROBE_ASM_TEMPLATE(n) _SDT_ASM_TEMPLATE_##n ++#define STAP_PROBE_ASM_TEMPLATE(n) _SDT_ASM_TEMPLATE_##n,"use _SDT_ASM_TEMPLATE_" + + + /* DTrace compatible macro names. */ +diff --git a/testsuite/systemtap.base/sdt_casm.c b/testsuite/systemtap.base/sdt_casm.c +index 1cff23c5f7b9..9b357086c04f 100644 +--- a/testsuite/systemtap.base/sdt_casm.c ++++ b/testsuite/systemtap.base/sdt_casm.c +@@ -3,6 +3,7 @@ + int main() + { + int x = 42; ++ int y = 43; + __asm__ __volatile__ ( + STAP_PROBE_ASM(testsuite, probe0, STAP_PROBE_ASM_TEMPLATE(0)) + ); +@@ -10,5 +11,9 @@ int main() + STAP_PROBE_ASM(testsuite, probe1, STAP_PROBE_ASM_TEMPLATE(1)) + :: STAP_PROBE_ASM_OPERANDS(1, x) + ); ++ // Create a template to test explicit template support ++ __asm__ __volatile__ ( ++ STAP_PROBE_ASM(testsuite, probe2, -4@%[ARG1] -4@%[ARG2]) ++ :: [ARG1] "rm" (x), [ARG2] "rm" (y)); + return 0; + } +diff --git a/testsuite/systemtap.base/sdt_casm.exp b/testsuite/systemtap.base/sdt_casm.exp +index 5791cb2b9f9a..0cd1cb51730e 100644 +--- a/testsuite/systemtap.base/sdt_casm.exp ++++ b/testsuite/systemtap.base/sdt_casm.exp +@@ -18,7 +18,8 @@ proc cleanup_handler { verbose } { + + set script $srcdir/$subdir/$test.stp + set ::result_string {PASS: probe0 +-PASS: probe1} ++PASS: probe1 ++PASS: probe2} + + set asm_flags [sdt_includes] + set asm_flags "$asm_flags additional_flags=-std=c99" +diff --git a/testsuite/systemtap.base/sdt_casm.stp b/testsuite/systemtap.base/sdt_casm.stp +index 4f2539c93e52..530a791751e0 100644 +--- a/testsuite/systemtap.base/sdt_casm.stp ++++ b/testsuite/systemtap.base/sdt_casm.stp +@@ -10,3 +10,11 @@ probe process.mark("probe1") + else + printf("FAIL: %s (%d != 42)\n", $$name, $arg1) + } ++ ++probe process.mark("probe2") ++{ ++ if ($arg1 == 42 && $arg2 == 43) ++ printf("PASS: %s\n", $$name) ++ else ++ printf("FAIL: %s (%d/%d != 42/43)\n", $$name, $arg1, $arg2) ++} diff --git a/systemtap.spec b/systemtap.spec index 83b3ef5..ca7bdde 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -118,7 +118,7 @@ m stapdev stapdev Name: systemtap Version: 4.6 -Release: 2%{?release_override}%{?dist} +Release: 3%{?release_override}%{?dist} # for version, see also configure.ac @@ -154,6 +154,8 @@ License: GPLv2+ URL: http://sourceware.org/systemtap/ Source: %{name}-%{version}.tar.gz +Patch1: sdt-fixes.patch + # Build* BuildRequires: make BuildRequires: gcc-c++ @@ -573,6 +575,7 @@ systemtap-runtime-virthost machine to execute systemtap scripts. %prep %setup -q +%patch1 -p1 %build @@ -1269,7 +1272,11 @@ exit 0 # PRERELEASE %changelog -* Thu Dec 01 2021 Martin Cermak - 4.6-2 +* Thu Dec 02 2021 Frank Ch. Eigler - 4.6-3 +- rhbz2026858 - arm32 sdt fixes +- sdt.h fixes for glibc s390 ftbfs + +* Thu Nov 25 2021 Martin Cermak - 4.6-2 - rhbz2012907: Use sysuser.d/* for user/group management * Mon Nov 15 2021 Serhei Makarov - 4.6-1 From e8221ef0cf72c0647be3753fa257daae412e1264 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Tue, 7 Dec 2021 11:31:56 -0500 Subject: [PATCH 09/10] rhbz2029929 --- sdt-fixes.patch | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ systemtap.spec | 5 ++++- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/sdt-fixes.patch b/sdt-fixes.patch index ed76e48..b64de78 100644 --- a/sdt-fixes.patch +++ b/sdt-fixes.patch @@ -136,3 +136,55 @@ index 4f2539c93e52..530a791751e0 100644 + else + printf("FAIL: %s (%d/%d != 42/43)\n", $$name, $arg1, $arg2) +} +commit 1d3653936fc1fd13135a723a27e6c7e959793ad0 +Author: Frank Ch. Eigler +Date: Mon Dec 6 12:06:06 2021 -0500 + + sys/sdt.h fp constraints cont'd, x86-64 edition + + It appears that various versions of gcc continue to show signs of + confusion at our newly offered asm-operand alternatives for floating + point sdt.h marker parameters. + + e.g., https://bugzilla.redhat.com/show_bug.cgi?id=2028798 + + We may need to restore previous constraints broadly, forcing the + compiler to plop floating point parameters into integer storage. + +diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h +index 24d5e01c3780..3e1f00b6c89c 100644 +--- a/includes/sys/sdt.h ++++ b/includes/sys/sdt.h +@@ -101,7 +101,7 @@ + # if defined __powerpc__ + # define STAP_SDT_ARG_CONSTRAINT nZr + # elif defined __x86_64__ +-# define STAP_SDT_ARG_CONSTRAINT norfxy ++# define STAP_SDT_ARG_CONSTRAINT norx + # elif defined __aarch64__ + # define STAP_SDT_ARG_CONSTRAINT norw + # elif defined __s390__ || defined __s390x__ + +commit 209b5a19c6ee30c2db3f6c849620544a851013e8 (upstream/master) +Author: Stan Cox +Date: Tue Dec 7 09:55:01 2021 -0500 + + sys/sdt.h fp constraints: aarch64, s390 + + Remove float constraints as per commit 1d3653936 but for aarch64 and s390. + +diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h +index 3e1f00b6c89c..48cb7263f325 100644 +--- a/includes/sys/sdt.h ++++ b/includes/sys/sdt.h +@@ -102,10 +102,6 @@ + # define STAP_SDT_ARG_CONSTRAINT nZr + # elif defined __x86_64__ + # define STAP_SDT_ARG_CONSTRAINT norx +-# elif defined __aarch64__ +-# define STAP_SDT_ARG_CONSTRAINT norw +-# elif defined __s390__ || defined __s390x__ +-# define STAP_SDT_ARG_CONSTRAINT norf + # elif defined __arm__ + # define STAP_SDT_ARG_CONSTRAINT g + # else diff --git a/systemtap.spec b/systemtap.spec index ca7bdde..f62eec7 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -118,7 +118,7 @@ m stapdev stapdev Name: systemtap Version: 4.6 -Release: 3%{?release_override}%{?dist} +Release: 4%{?release_override}%{?dist} # for version, see also configure.ac @@ -1272,6 +1272,9 @@ exit 0 # PRERELEASE %changelog +* Tue Dec 07 2021 Frank Ch. Eigler - 4.6-4 +- rhbz2029929 - reset sys/sdt.h asm operand constraints + * Thu Dec 02 2021 Frank Ch. Eigler - 4.6-3 - rhbz2026858 - arm32 sdt fixes - sdt.h fixes for glibc s390 ftbfs From 893623899e51fca44ebe8e5f1e9108646539a39a Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Tue, 7 Dec 2021 11:31:56 -0500 Subject: [PATCH 10/10] rhbz2029929 --- sdt-fixes.patch | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ systemtap.spec | 5 ++++- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/sdt-fixes.patch b/sdt-fixes.patch index ed76e48..b64de78 100644 --- a/sdt-fixes.patch +++ b/sdt-fixes.patch @@ -136,3 +136,55 @@ index 4f2539c93e52..530a791751e0 100644 + else + printf("FAIL: %s (%d/%d != 42/43)\n", $$name, $arg1, $arg2) +} +commit 1d3653936fc1fd13135a723a27e6c7e959793ad0 +Author: Frank Ch. Eigler +Date: Mon Dec 6 12:06:06 2021 -0500 + + sys/sdt.h fp constraints cont'd, x86-64 edition + + It appears that various versions of gcc continue to show signs of + confusion at our newly offered asm-operand alternatives for floating + point sdt.h marker parameters. + + e.g., https://bugzilla.redhat.com/show_bug.cgi?id=2028798 + + We may need to restore previous constraints broadly, forcing the + compiler to plop floating point parameters into integer storage. + +diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h +index 24d5e01c3780..3e1f00b6c89c 100644 +--- a/includes/sys/sdt.h ++++ b/includes/sys/sdt.h +@@ -101,7 +101,7 @@ + # if defined __powerpc__ + # define STAP_SDT_ARG_CONSTRAINT nZr + # elif defined __x86_64__ +-# define STAP_SDT_ARG_CONSTRAINT norfxy ++# define STAP_SDT_ARG_CONSTRAINT norx + # elif defined __aarch64__ + # define STAP_SDT_ARG_CONSTRAINT norw + # elif defined __s390__ || defined __s390x__ + +commit 209b5a19c6ee30c2db3f6c849620544a851013e8 (upstream/master) +Author: Stan Cox +Date: Tue Dec 7 09:55:01 2021 -0500 + + sys/sdt.h fp constraints: aarch64, s390 + + Remove float constraints as per commit 1d3653936 but for aarch64 and s390. + +diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h +index 3e1f00b6c89c..48cb7263f325 100644 +--- a/includes/sys/sdt.h ++++ b/includes/sys/sdt.h +@@ -102,10 +102,6 @@ + # define STAP_SDT_ARG_CONSTRAINT nZr + # elif defined __x86_64__ + # define STAP_SDT_ARG_CONSTRAINT norx +-# elif defined __aarch64__ +-# define STAP_SDT_ARG_CONSTRAINT norw +-# elif defined __s390__ || defined __s390x__ +-# define STAP_SDT_ARG_CONSTRAINT norf + # elif defined __arm__ + # define STAP_SDT_ARG_CONSTRAINT g + # else diff --git a/systemtap.spec b/systemtap.spec index ca7bdde..f62eec7 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -118,7 +118,7 @@ m stapdev stapdev Name: systemtap Version: 4.6 -Release: 3%{?release_override}%{?dist} +Release: 4%{?release_override}%{?dist} # for version, see also configure.ac @@ -1272,6 +1272,9 @@ exit 0 # PRERELEASE %changelog +* Tue Dec 07 2021 Frank Ch. Eigler - 4.6-4 +- rhbz2029929 - reset sys/sdt.h asm operand constraints + * Thu Dec 02 2021 Frank Ch. Eigler - 4.6-3 - rhbz2026858 - arm32 sdt fixes - sdt.h fixes for glibc s390 ftbfs