From 6236aa6f9e4b144ef2934d2c72f2fd698135cc4e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 14 2022 16:05:19 +0000 Subject: import gcc-toolset-11-systemtap-4.5-6.el8 --- diff --git a/SOURCES/rhbz1973751.patch b/SOURCES/rhbz1973751.patch new file mode 100644 index 0000000..1c020c1 --- /dev/null +++ b/SOURCES/rhbz1973751.patch @@ -0,0 +1,312 @@ +commit b367613c3bb88549dbb9944d306fe561dea03f04 +Author: Frank Ch. Eigler +Date: Fri Sep 24 15:54:34 2021 -0400 + + PR28384: convert more nfs_proc.stp server_ip to string + + This tapset variable has been changed in stap version 4.3 + to a string. Finish covering all instances in various + probe aliases. + +diff --git a/tapset/linux/nfs_proc.stp b/tapset/linux/nfs_proc.stp +index 257907457..9b1f65f5f 100644 +--- a/tapset/linux/nfs_proc.stp ++++ b/tapset/linux/nfs_proc.stp +@@ -235,7 +235,11 @@ probe _nfs.proc2.lookup = kernel.function("nfs_proc_lookup") !, + probe _nfs.proc2.missing_lookup = never + { + client = 0 ++%( systemtap_v >= "4.3" %? ++ server_ip = "" ++%: + server_ip = 0 ++%) + prot = 0 + + name_len = 0 +@@ -361,7 +365,11 @@ probe _nfs.proc2.read = kernel.function("nfs_proc_read") !, + } + probe _nfs.proc2.missing_read = never + { ++%( systemtap_v >= "4.3" %? ++ server_ip = "" ++%: + server_ip = 0 ++%) + prot = 0 + + flags = 0 +@@ -496,7 +504,11 @@ probe _nfs.proc2.write = kernel.function("nfs_proc_write") !, + } + probe _nfs.proc2.missing_write = never + { ++%( systemtap_v >= "4.3" %? ++ server_ip = "" ++%: + server_ip = 0 ++%) + prot = 0 + + flags = 0 +@@ -759,7 +771,7 @@ probe _nfs.proc2.missing_read_setup = never + inode = 0 + client = 0 + %( systemtap_v >= "4.3" %? +- server_ip = "0" ++ server_ip = "" + %: + server_ip = 0 + %) +@@ -895,7 +907,11 @@ probe _nfs.proc2.read_done = kernel.function("nfs_read_done") !, + } + probe _nfs.proc2.missing_read_done = never + { ++%( systemtap_v >= "4.3" %? ++ server_ip = "" ++%: + server_ip = 0 ++%) + prot = 0 + count = 0 + status = 0 +@@ -1054,7 +1070,11 @@ probe _nfs.proc2.missing_write_setup = never + { + inode = 0 + client = 0 ++%( systemtap_v >= "4.3" %? ++ server_ip = "" ++%: + server_ip = 0 ++%) + prot = 0 + + count = 0 +@@ -1201,7 +1221,11 @@ probe _nfs.proc2.write_done = kernel.function("nfs_write_done") !, + } + probe _nfs.proc2.missing_write_done = never + { ++%( systemtap_v >= "4.3" %? ++ server_ip = "" ++%: + server_ip = 0 ++%) + prot = 0 + count = 0 + valid = 0 +@@ -1826,7 +1850,11 @@ probe _nfs.proc2.create = kernel.function("nfs_proc_create") !, + probe _nfs.proc2.missing_create = never + { + client = 0 ++%( systemtap_v >= "4.3" %? ++ server_ip = "" ++%: + server_ip = 0 ++%) + prot = 0 + + fh = 0 +@@ -1946,7 +1974,11 @@ probe _nfs.proc2.remove = kernel.function("nfs_proc_remove") !, + probe _nfs.proc2.missing_remove = never + { + client = 0 ++%( systemtap_v >= "4.3" %? ++ server_ip = "" ++%: + server_ip = 0 ++%) + prot = 0 + + fh = 0 +@@ -2067,7 +2099,11 @@ probe _nfs.proc2.rename = kernel.function("nfs_proc_rename") !, + probe _nfs.proc2.missing_rename = never + { + client = 0 ++%( systemtap_v >= "4.3" %? ++ server_ip = "" ++%: + server_ip = 0 ++%) + prot = 0 + + old_fh = 0 +@@ -2114,7 +2150,11 @@ probe _nfs.proc3.rename = kernel.function("nfs3_proc_rename") !, + probe _nfs.proc3.missing_rename = never + { + client = 0 ++%( systemtap_v >= "4.3" %? ++ server_ip = "" ++%: + server_ip = 0 ++%) + prot = 0 + + old_fh = 0 +@@ -2161,7 +2201,11 @@ probe _nfs.proc4.rename = kernel.function("nfs4_proc_rename") !, + probe _nfs.proc4.missing_rename = never + { + client = 0 ++%( systemtap_v >= "4.3" %? ++ server_ip = "" ++%: + server_ip = 0 ++%) + prot = 0 + + old_fh = 0 +diff --git a/testsuite/buildok/nfs_proc-detailed.stp b/testsuite/buildok/nfs_proc-detailed.stp +index 2a04ee2a7..e7c7f2d18 100755 +--- a/testsuite/buildok/nfs_proc-detailed.stp ++++ b/testsuite/buildok/nfs_proc-detailed.stp +@@ -3,7 +3,7 @@ + + probe nfs.proc.lookup { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d\n", server_ip, prot, version, name_len) ++ printf("%s %d %d %d\n", server_ip, prot, version, name_len) + printf("%d %d\n", bitmask0, bitmask1) + } + probe nfs.proc.lookup.return { +@@ -12,7 +12,7 @@ probe nfs.proc.lookup.return { + + probe nfs.proc.read ? { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d %d %s\n", server_ip, prot, version, flags, ++ printf("%s %d %d %d %d %s\n", server_ip, prot, version, flags, + size, units) + } + probe nfs.proc.read.return ? { +@@ -21,7 +21,7 @@ probe nfs.proc.read.return ? { + + probe nfs.proc.write ? { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d %d %s\n", server_ip, prot, version, flags, ++ printf("%s %d %d %d %d %s\n", server_ip, prot, version, flags, + size, units) + printf("%d %d\n", bitmask0, bitmask1) + } +@@ -32,7 +32,7 @@ probe nfs.proc.write.return ? { + + probe nfs.proc.commit ? { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d %s\n", server_ip, prot, version, size, units) ++ printf("%s %d %d %d %s\n", server_ip, prot, version, size, units) + printf("%d %d\n", bitmask0, bitmask1) + } + probe nfs.proc.commit.return ? { +@@ -43,7 +43,7 @@ probe nfs.proc.commit.return ? { + + probe nfs.proc.read_setup { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d %d %s\n", client, server_ip, prot, ++ printf("%d %s %d %d %d %s\n", client, server_ip, prot, + version, size, units) + } + probe nfs.proc.read_setup.return { +@@ -52,7 +52,7 @@ probe nfs.proc.read_setup.return { + + probe nfs.proc.read_done { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d\n", server_ip, prot, count, version) ++ printf("%s %d %d %d\n", server_ip, prot, count, version) + printf("%d\n", timestamp) + } + probe nfs.proc.read_done.return { +@@ -61,7 +61,7 @@ probe nfs.proc.read_done.return { + + probe nfs.proc.write_setup { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d %d %s\n", client, server_ip, prot, ++ printf("%d %s %d %d %d %s\n", client, server_ip, prot, + version, size, units) + printf("%d %d %d\n", how, bitmask0, bitmask1) + } +@@ -71,7 +71,7 @@ probe nfs.proc.write_setup.return { + + probe nfs.proc.write_done { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d %d\n", server_ip, prot, count, valid, version) ++ printf("%s %d %d %d %d\n", server_ip, prot, count, valid, version) + printf("%d\n", timestamp) + } + probe nfs.proc.write_done.return { +@@ -80,7 +80,7 @@ probe nfs.proc.write_done.return { + + probe nfs.proc.commit_setup { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d %d %s\n", client, server_ip, prot, ++ printf("%d %s %d %d %d %s\n", client, server_ip, prot, + version, size, units) + printf("%d %d\n", bitmask0, bitmask1) + } +@@ -90,7 +90,7 @@ probe nfs.proc.commit_setup.return { + + probe nfs.proc.commit_done { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d %d\n", server_ip, prot, count, valid, version) ++ printf("%s %d %d %d %d\n", server_ip, prot, count, valid, version) + printf("%d\n", timestamp) + } + probe nfs.proc.commit_done.return { +@@ -99,7 +99,7 @@ probe nfs.proc.commit_done.return { + + probe nfs.proc.rename_setup { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d\n", client, server_ip, prot, ++ printf("%d %s %d %d\n", client, server_ip, prot, + version) + printf("%d\n", fh) + } +@@ -109,7 +109,7 @@ probe nfs.proc.rename_setup.return { + + probe nfs.proc.rename_done { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d\n", server_ip, prot, version) ++ printf("%s %d %d\n", server_ip, prot, version) + printf("%d %d\n", timestamp, status) + printf("%d %d\n", old_fh, new_fh) + } +@@ -119,7 +119,7 @@ probe nfs.proc.rename_done.return { + + probe nfs.proc.open { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d\n", server_ip, prot, version) ++ printf("%s %d %d\n", server_ip, prot, version) + } + probe nfs.proc.open.return { + printf("%s(%s)\n", name, retstr) +@@ -127,7 +127,7 @@ probe nfs.proc.open.return { + + probe nfs.proc.release ? { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d\n", server_ip, prot, version) ++ printf("%s %d %d\n", server_ip, prot, version) + } + probe nfs.proc.release.return ? { + printf("%s(%s)\n", name, retstr) +@@ -143,7 +143,7 @@ probe nfs.proc.handle_exception.return { + + probe nfs.proc.create { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d %d %d\n", server_ip, prot, version, fh, ++ printf("%s %d %d %d %d %d\n", server_ip, prot, version, fh, + filelen, mode) + } + probe nfs.proc.create.return { +@@ -152,7 +152,7 @@ probe nfs.proc.create.return { + + probe nfs.proc.remove { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d %d %d\n", server_ip, prot, version, fh, ++ printf("%s %d %d %d %d\n", server_ip, prot, version, fh, + filelen) + } + probe nfs.proc.remove.return { +@@ -161,7 +161,7 @@ probe nfs.proc.remove.return { + + probe nfs.proc.rename { + printf("%s(%s)\n", name, argstr) +- printf("%d %d %d\n", server_ip, prot, version) ++ printf("%s %d %d\n", server_ip, prot, version) + printf("%d %d %s\n", old_fh, old_filelen, old_name) + printf("%d %d %s\n", new_fh, new_filelen, new_name) + } diff --git a/SOURCES/rhbz2022849.patch b/SOURCES/rhbz2022849.patch new file mode 100644 index 0000000..2cf5526 --- /dev/null +++ b/SOURCES/rhbz2022849.patch @@ -0,0 +1,144 @@ +commit 0bd97a8061c2ebbe792da8b662c5d19b2f1af02c +Author: William Cohen +Date: Mon Sep 13 21:32:38 2021 -0400 + + Use task_state tapset function to avoid task_struct changes + + The Linux 5.14 kernel's task_struct changed the state field to + __state. The task_state tapset function selects the appropriate + version. Make the scheduler.stp tapset and schedtimes.stp example use + the task_state function rather than directly trying to access the + task_struct state field (and get it wrong for newer kernels). + +diff --git a/tapset/linux/scheduler.stp b/tapset/linux/scheduler.stp +index 7338e9008..4667ab53a 100644 +--- a/tapset/linux/scheduler.stp ++++ b/tapset/linux/scheduler.stp +@@ -138,7 +138,7 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, + prev_tid = $prev_p->pid + prev_task = $prev_p + prev_task_name = task_execname($prev_p) +- prevtsk_state = $prev_p->state ++ prevtsk_state = task_state($prev_p) + } + else { + prev_priority = $prev->prio +@@ -146,7 +146,7 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, + prev_tid = $prev->pid + prev_task = $prev + prev_task_name = task_execname($prev) +- prevtsk_state = $prev->state ++ prevtsk_state = task_state($prev) + } + + if (@defined($next)) { +@@ -155,7 +155,7 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, + next_tid = $next->pid + next_task = $next + next_task_name = task_execname($next) +- nexttsk_state = $next->state ++ nexttsk_state = task_state($next) + } + else if (@defined($next_p)) { + next_priority = $next_p->prio +@@ -163,7 +163,7 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, + next_tid = $next_p->pid + next_task = $next_p + next_task_name = task_execname($next_p) +- nexttsk_state = $next_p->state ++ nexttsk_state = task_state($next_p) + } + else { + next_priority = $new->prio +@@ -171,7 +171,7 @@ probe scheduler.ctxswitch = kernel.trace("sched_switch") !, + next_tid = $new->pid + next_task = $new + next_task_name = task_execname($new) +- nexttsk_state = $new->state ++ nexttsk_state = task_state($new) + } + } + +diff --git a/testsuite/systemtap.examples/process/schedtimes.stp b/testsuite/systemtap.examples/process/schedtimes.stp +index 4e422c893..ee1053045 100755 +--- a/testsuite/systemtap.examples/process/schedtimes.stp ++++ b/testsuite/systemtap.examples/process/schedtimes.stp +@@ -99,7 +99,7 @@ probe kernel.trace("sched_switch") + // Task $prev is scheduled off this cpu + if (task_targeted($prev)) { + pid = $prev->pid +- state = $prev->state ++ state = task_state($prev) + update_times(pid, timestamp()) + + if (state > 0) { + +commit a29f65d5750f6379afeca99c5d641598ff638517 +Author: Stan Cox +Date: Sun Jul 18 21:32:51 2021 -0400 + + PR28079: Adapt to kernel 5.14 task_struct.__state change + + Use signal_wake_up_state for the 5.14 kernel which changed volatile long state to unsigned int __state. + +diff --git a/buildrun.cxx b/buildrun.cxx +index a1332a687..ae27ddea4 100644 +--- a/buildrun.cxx ++++ b/buildrun.cxx +@@ -523,3 +523,4 @@ compile_pass (systemtap_session& s) + output_autoconf(s, o, cs, "autoconf-lockdown-kernel.c", "STAPCONF_LOCKDOWN_KERNEL", NULL); ++ output_autoconf(s, o, cs, "autoconf-task-state.c", "STAPCONF_TASK_STATE", NULL); + + // used by runtime/linux/netfilter.c + output_exportconf(s, o2, "nf_register_hook", "STAPCONF_NF_REGISTER_HOOK"); +diff --git a/runtime/linux/autoconf-task-state.c b/runtime/linux/autoconf-task-state.c +new file mode 100644 +index 000000000..27a1d7c13 +--- /dev/null ++++ b/runtime/linux/autoconf-task-state.c +@@ -0,0 +1,18 @@ ++/* ++ * Is this a kernel prior to the following kernel commit: ++ * ++ * commit 2f064a59a11ff9bc22e52e9678bc601404c7cb34 ++ * Author: Peter Zijlstra ++ * Date: 2021-06-11 10:28:17 +0200 ++ * ++ * sched: Change task_struct::state ++ * Change the type and name of task_struct::state. Drop the volatile and ++ * shrink it to an 'unsigned int'. Rename it in order to find all uses ++ * such that we can use READ_ONCE/WRITE_ONCE as appropriate. ++ */ ++ ++#include ++ ++unsigned int bar (struct task_struct *foo) { ++ return (foo->state = 0); ++} +diff --git a/runtime/stp_utrace.c b/runtime/stp_utrace.c +index ff8c5549d..d63e6366c 100644 +--- a/runtime/stp_utrace.c ++++ b/runtime/stp_utrace.c +@@ -33,9 +33,12 @@ + #if defined(__set_task_state) + #define __stp_set_task_state(tsk, state_value) \ + __set_task_state((tsk), (state_value)) +-#else ++#elif defined(STAPCONF_TASK_STATE) + #define __stp_set_task_state(tsk, state_value) \ + do { (tsk)->state = (state_value); } while (0) ++#else ++#define __stp_set_task_state(tsk, state_value) \ ++ signal_wake_up_state((tsk), (state_value)) + #endif + + // For now, disable the task_work_queue on non-RT kernels. +@@ -1263,7 +1266,7 @@ static void utrace_wakeup(struct task_struct *target, struct utrace *utrace) + spin_lock_irq(&target->sighand->siglock); + if (target->signal->flags & SIGNAL_STOP_STOPPED || + target->signal->group_stop_count) +- target->state = TASK_STOPPED; ++ __stp_set_task_state(target, TASK_STOPPED); + else + stp_wake_up_state(target, __TASK_TRACED); + spin_unlock_irq(&target->sighand->siglock); diff --git a/SPECS/systemtap.spec b/SPECS/systemtap.spec index 4bb4658..e9d7e45 100644 --- a/SPECS/systemtap.spec +++ b/SPECS/systemtap.spec @@ -24,7 +24,8 @@ %{!?with_dyninst: %global with_dyninst 0} %endif %{!?with_bpf: %global with_bpf 0%{?fedora} >= 22 || 0%{?rhel} >= 8} -%{!?with_systemd: %global with_systemd 0%{?fedora} >= 19 || 0%{?rhel} >= 7} +# DTS/GTS need to use initscript, not systemd services +%{!?with_systemd: %global with_systemd 0} %{!?with_emacsvim: %global with_emacsvim 0%{?fedora} >= 19 || 0%{?rhel} >= 7} %{!?with_java: %global with_java 0} %{!?with_debuginfod: %global with_debuginfod 0%{?fedora} >= 25 || 0%{?rhel} >= 7} @@ -98,7 +99,7 @@ Name: %{?scl_prefix}systemtap Version: 4.5 -Release: 3%{?release_override}%{?dist} +Release: 6%{?release_override}%{?dist} # for version, see also configure.ac @@ -134,6 +135,9 @@ License: GPLv2+ URL: http://sourceware.org/systemtap/ Source: ftp://sourceware.org/pub/systemtap/releases/systemtap-%{version}.tar.gz +Patch1: rhbz1973751.patch +Patch2: rhbz2022849.patch + # Build* BuildRequires: make BuildRequires: gcc-c++ @@ -145,7 +149,7 @@ BuildRequires: pkgconfig(avahi-client) BuildRequires: elfutils-debuginfod-client-devel >= 0.179 %endif %if %{with_dyninst} -BuildRequires: dyninst-devel >= 10.0 +BuildRequires: dyninst-devel >= 11.0 BuildRequires: pkgconfig(libselinux) %endif %if %{with_sqlite} @@ -539,6 +543,9 @@ systemtap-runtime-virthost machine to execute systemtap scripts. %prep %setup -q -n systemtap-%{version} +%patch1 -p1 +%patch2 -p1 + %build # Enable/disable the dyninst pure-userspace backend @@ -1229,6 +1236,16 @@ exit 0 # PRERELEASE %changelog +* Fri Nov 05 2021 Frank Ch. Eigler - 4.5-6 +- rhbz2022849: kernel 4.18.0-348.6 compatibility backports + +* Fri Nov 05 2021 Frank Ch. Eigler - 4.5-5 +- rhbz1973751: inconsistent datatype of server_ip in nfs_proc tapset + +* Fri Jun 18 2021 Frank Ch. Eigler - 4.5-4 +- rhbz1970373: force initscript for stap-server etc +- rhbz1970356: require dyninst 11 + * Thu May 27 2021 Frank Ch. Eigler - 4.5-3 - rhbz1965277: disable virt subrpms.