upstream rebase

Resolves: RHEL-87000
This commit is contained in:
Frank Ch. Eigler 2025-05-05 12:27:50 -04:00
parent 8d04ca6806
commit 2025eb7668
2 changed files with 40 additions and 239 deletions

View File

@ -1,223 +0,0 @@
commit 8b87bd584dcadb3713eaf6d0c9b540b4f54124bf
gpg: Signature made Mon 11 Nov 2024 11:48:03 AM EST
gpg: using RSA key D8F2E95271BA794E222FBEE0DB83606EC7DAAB26
gpg: Can't check signature: No public key
Author: Martin Cermak <mcermak@redhat.com>
Date: Mon Nov 11 17:41:53 2024 +0100
PR32302: Emit forward decls within tracepoint_derived_probe_group() too
Forward decls added in commit 069def0ae9184 need to actually be
emitted in 2 locations, roughtly corresponding to where
tracepoint_extra_decls() is used.
It would be ideal to put them directly to tracepoint_extra_decls()
but that gives significantly less recognized tracepoints.
The plan is toreview this again though and try to merge the
tracepoint_forward_decls() body into tracepoint_extra_decls()
if possible.
diff --git a/tapsets.cxx b/tapsets.cxx
index b4ad7e14e..06540cafc 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -11729,6 +11729,89 @@ static bool header_exists(systemtap_session& s, const string& header)
return false;
}
+static vector<string> tracepoint_forward_decls ()
+{
+ vector<string> retval;
+ // Kernel 6.12
+ retval.push_back("enum cachefiles_content;");
+ retval.push_back("enum extent_type;");
+ retval.push_back("struct bch_fs;");
+ retval.push_back("struct bch_move_stats;");
+ retval.push_back("struct bpos;");
+ retval.push_back("struct btree_bkey_cached_common;");
+ retval.push_back("struct btree_insert_entry;");
+ retval.push_back("struct btree_path;");
+ retval.push_back("struct btree_trans;");
+ retval.push_back("struct cachefiles_msg;");
+ retval.push_back("struct cachefiles_open;");
+ retval.push_back("struct cachefiles_read;");
+ retval.push_back("struct cachefiles_volume;");
+ retval.push_back("struct clk_rate_request;");
+ retval.push_back("struct compact_control;");
+ retval.push_back("struct fsi_device;");
+ retval.push_back("struct fsi_msg;");
+ retval.push_back("struct fsi_slave;");
+ retval.push_back("struct fuse_req;");
+ retval.push_back("struct get_locks_fail;");
+ retval.push_back("struct gss_cred;");
+ retval.push_back("struct handshake_req;");
+ retval.push_back("struct i2c_client;");
+ retval.push_back("struct ib_mad_agent_private;");
+ retval.push_back("struct ib_mad_qp_info;");
+ retval.push_back("struct ib_mad_send_wr_private;");
+ retval.push_back("struct ib_smp;");
+ retval.push_back("struct iomap;");
+ retval.push_back("struct iomap_iter;");
+ retval.push_back("struct mctp_sk_key;");
+ retval.push_back("struct mptcp_ext;");
+ retval.push_back("struct mptcp_subflow_context;");
+ retval.push_back("struct nbd_request;");
+ retval.push_back("struct netfs_io_request;");
+ retval.push_back("struct netfs_io_stream;");
+ retval.push_back("struct netfs_io_subrequest;");
+ retval.push_back("struct nfs42_clone_args;");
+ retval.push_back("struct nfs42_copy_args;");
+ retval.push_back("struct nfs42_copy_notify_args;");
+ retval.push_back("struct nfs42_copy_notify_res;");
+ retval.push_back("struct nfs42_copy_res;");
+ retval.push_back("struct nfs42_falloc_args;");
+ retval.push_back("struct nfs42_offload_status_args;");
+ retval.push_back("struct nfs42_seek_args;");
+ retval.push_back("struct nfs42_seek_res;");
+ retval.push_back("struct nfs_direct_req;");
+ retval.push_back("struct nfs_page;");
+ retval.push_back("struct opa_smp;");
+ retval.push_back("struct p9_fid;");
+ retval.push_back("struct pwc_device;");
+ retval.push_back("struct request;");
+ retval.push_back("struct rpc_auth;");
+ retval.push_back("struct rpc_gss_wire_cred;");
+ retval.push_back("struct rpcrdma_ep;");
+ retval.push_back("struct rpcrdma_mr;");
+ retval.push_back("struct rpcrdma_notification;");
+ retval.push_back("struct rpcrdma_rep;");
+ retval.push_back("struct rpcrdma_req;");
+ retval.push_back("struct rpcrdma_xprt;");
+ retval.push_back("struct rpc_rqst;");
+ retval.push_back("struct rpc_task;");
+ retval.push_back("struct selinux_audit_data;");
+ retval.push_back("struct spi_device;");
+ retval.push_back("struct svc_rdma_chunk;");
+ retval.push_back("struct svc_rdma_recv_ctxt;");
+ retval.push_back("struct svc_rdma_segment;");
+ retval.push_back("struct svc_rdma_send_ctxt;");
+ retval.push_back("struct svc_rqst;");
+ retval.push_back("struct svcxprt_rdma;");
+ retval.push_back("struct tmigr_cpu;");
+ retval.push_back("struct tmigr_group;");
+ retval.push_back("struct virtio_gpu_ctrl_hdr;");
+ retval.push_back("struct virtqueue;");
+ retval.push_back("struct somenonexistentstruct_123;");
+ retval.push_back("union ifs_sbaf;");
+ retval.push_back("union ifs_sbaf_status;");
+ retval.push_back("union tmigr_state;");
+ return retval;
+}
static vector<string> tracepoint_extra_decls (systemtap_session& s,
const string& header,
@@ -12187,6 +12270,8 @@ tracepoint_derived_probe_group::emit_module_decls (systemtap_session& s)
s.op->newline();
+
+
// We create a MODULE_aux_N.c file for each tracepoint header, to allow them
// to be separately compiled. That's because kernel tracepoint headers sometimes
// conflict. PR13155.
@@ -12207,6 +12292,11 @@ tracepoint_derived_probe_group::emit_module_decls (systemtap_session& s)
tpop = s.op_create_auxiliary();
per_header_aux[header] = tpop;
+ // add needed forward decls/#includes
+ static vector<string> forward_decls = tracepoint_forward_decls();
+ for (unsigned z=0; z<forward_decls.size(); z++)
+ tpop->newline()<< forward_decls[z] << "\n";
+
// PR9993: Add extra headers to work around undeclared types in individual
// include/trace/foo.h files
const vector<string>& extra_decls = tracepoint_extra_decls (s, header,
@@ -12773,83 +12863,10 @@ tracepoint_builder::get_tracequery_modules(systemtap_session& s,
osrc << "#ifdef CONFIG_TRACEPOINTS" << endl;
osrc << "#include <linux/tracepoint.h>" << endl;
- osrc << "enum cachefiles_content;" << endl;
- osrc << "enum extent_type;" << endl;
- osrc << "struct bch_fs;" << endl;
- osrc << "struct bch_move_stats;" << endl;
- osrc << "struct bpos;" << endl;
- osrc << "struct btree_bkey_cached_common;" << endl;
- osrc << "struct btree_insert_entry;" << endl;
- osrc << "struct btree_path;" << endl;
- osrc << "struct btree_trans;" << endl;
- osrc << "struct cachefiles_msg;" << endl;
- osrc << "struct cachefiles_open;" << endl;
- osrc << "struct cachefiles_read;" << endl;
- osrc << "struct cachefiles_volume;" << endl;
- osrc << "struct clk_rate_request;" << endl;
- osrc << "struct compact_control;" << endl;
- osrc << "struct fsi_device;" << endl;
- osrc << "struct fsi_msg;" << endl;
- osrc << "struct fsi_slave;" << endl;
- osrc << "struct fuse_req;" << endl;
- osrc << "struct get_locks_fail;" << endl;
- osrc << "struct gss_cred;" << endl;
- osrc << "struct handshake_req;" << endl;
- osrc << "struct i2c_client;" << endl;
- osrc << "struct ib_mad_agent_private;" << endl;
- osrc << "struct ib_mad_qp_info;" << endl;
- osrc << "struct ib_mad_send_wr_private;" << endl;
- osrc << "struct ib_smp;" << endl;
- osrc << "struct iomap;" << endl;
- osrc << "struct iomap_iter;" << endl;
- osrc << "struct mctp_sk_key;" << endl;
- osrc << "struct mptcp_ext;" << endl;
- osrc << "struct mptcp_subflow_context;" << endl;
- osrc << "struct nbd_request;" << endl;
- osrc << "struct netfs_io_request;" << endl;
- osrc << "struct netfs_io_stream;" << endl;
- osrc << "struct netfs_io_subrequest;" << endl;
- osrc << "struct nfs42_clone_args;" << endl;
- osrc << "struct nfs42_copy_args;" << endl;
- osrc << "struct nfs42_copy_notify_args;" << endl;
- osrc << "struct nfs42_copy_notify_res;" << endl;
- osrc << "struct nfs42_copy_res;" << endl;
- osrc << "struct nfs42_falloc_args;" << endl;
- osrc << "struct nfs42_offload_status_args;" << endl;
- osrc << "struct nfs42_seek_args;" << endl;
- osrc << "struct nfs42_seek_res;" << endl;
- osrc << "struct nfs_direct_req;" << endl;
- osrc << "struct nfs_page;" << endl;
- osrc << "struct opa_smp;" << endl;
- osrc << "struct p9_fid;" << endl;
- osrc << "struct pwc_device;" << endl;
- osrc << "struct request;" << endl;
- osrc << "struct rpc_auth;" << endl;
- osrc << "struct rpc_gss_wire_cred;" << endl;
- osrc << "struct rpcrdma_ep;" << endl;
- osrc << "struct rpcrdma_mr;" << endl;
- osrc << "struct rpcrdma_notification;" << endl;
- osrc << "struct rpcrdma_rep;" << endl;
- osrc << "struct rpcrdma_req;" << endl;
- osrc << "struct rpcrdma_xprt;" << endl;
- osrc << "struct rpc_rqst;" << endl;
- osrc << "struct rpc_task;" << endl;
- osrc << "struct selinux_audit_data;" << endl;
- osrc << "struct spi_device;" << endl;
- osrc << "struct svc_rdma_chunk;" << endl;
- osrc << "struct svc_rdma_recv_ctxt;" << endl;
- osrc << "struct svc_rdma_segment;" << endl;
- osrc << "struct svc_rdma_send_ctxt;" << endl;
- osrc << "struct svc_rqst;" << endl;
- osrc << "struct svcxprt_rdma;" << endl;
- osrc << "struct tmigr_cpu;" << endl;
- osrc << "struct tmigr_group;" << endl;
- osrc << "struct virtio_gpu_ctrl_hdr;" << endl;
- osrc << "struct virtqueue;" << endl;
- osrc << "struct somenonexistentstruct_123;" << endl;
- osrc << "union ifs_sbaf;" << endl;
- osrc << "union ifs_sbaf_status;" << endl;
- osrc << "union tmigr_state;" << endl;
+ // add needed forward decls/#includes
+ static vector<string> forward_decls = tracepoint_forward_decls();
+ for (unsigned z=0; z<forward_decls.size(); z++)
+ osrc << forward_decls[z] << "\n";
// BPF raw tracepoint macros for creating the multiple fields
// of the data struct that describes the raw tracepoint.

View File

@ -13,8 +13,8 @@
%endif
%{!?with_rpm: %global with_rpm 1}
%{!?elfutils_version: %global elfutils_version 0.179}
%{!?with_boost: %global with_boost 0}
%ifarch %{ix86} x86_64 ppc ppc64 ppc64le aarch64
%{!?with_boost: %global with_boost 1}
%ifarch x86_64 ppc ppc64 ppc64le aarch64
%{!?with_dyninst: %global with_dyninst 0%{?fedora} >= 18 || 0%{?rhel} >= 7}
%else
%{!?with_dyninst: %global with_dyninst 0}
@ -45,6 +45,10 @@
%{!?with_httpd: %global with_httpd 0}
%{!?with_specific_python: %global with_specific_python 0%{?fedora} >= 31}
%{!?with_sysusers: %global with_sysusers 0%{?fedora} >= 32 || 0%{?rhel} >= 9}
# NB: can't turn this on by default on any distro version whose builder system
# may run kernels different than the distro version itself.
%{!?with_check: %global with_check 0}
# Virt is supported on these arches, even on el7, but it's not in core EL7
%if 0%{?rhel} && 0%{?rhel} <= 7
@ -120,8 +124,8 @@ m stapdev stapdev
Name: systemtap
# PRERELEASE
Version: 5.2
Release: 2%{?release_override}%{?dist}
Version: 5.3
Release: 1%{?release_override}%{?dist}
# for version, see also configure.ac
@ -133,7 +137,7 @@ Release: 2%{?release_override}%{?dist}
# systemtap-runtime /usr/bin/staprun, /usr/bin/stapsh, /usr/bin/stapdyn
# systemtap-client /usr/bin/stap, samples, docs, tapset(bonus), req:-runtime
# systemtap-initscript /etc/init.d/systemtap, dracut module, req:systemtap
# systemtap-sdt-devel /usr/include/sys/sdt.h AND /usr/bin/dtrace
# systemtap-sdt-devel /usr/include/sys/sdt.h
# systemtap-sdt-dtrace /usr/bin/dtrace
# systemtap-testsuite /usr/share/systemtap/testsuite*, req:systemtap, req:sdt-devel
# systemtap-runtime-java libHelperSDT.so, HelperSDT.jar, stapbm, req:-runtime
@ -158,7 +162,6 @@ Summary: Programmable system-wide instrumentation system
License: GPL-2.0-or-later
URL: https://sourceware.org/systemtap/
Source: ftp://sourceware.org/pub/systemtap/releases/systemtap-%{version}.tar.gz
Patch0: PR32302.patch
# Build*
BuildRequires: make
@ -186,9 +189,7 @@ BuildRequires: pkgconfig(ncurses)
BuildRequires: systemd
%endif
# Needed for libstd++ < 4.0, without <tr1/memory>
%if %{with_boost}
BuildRequires: boost-devel
%endif
%if %{with_crash}
BuildRequires: crash-devel zlib-devel
%endif
@ -242,8 +243,14 @@ BuildRequires: libmicrohttpd-devel
BuildRequires: libuuid-devel
%endif
%if %{with_sysusers}
BuildRequires: systemd-rpm-macros
BuildRequires: systemd-rpm-macros
%endif
%if %{with_check}
BuildRequires: kernel-devel
# and some of the same Requires: as below
BuildRequires: dejagnu gcc make
%endif
# Install requirements
@ -382,12 +389,13 @@ boot-time probing if supported.
Summary: Static probe support header files
License: GPL-2.0-or-later AND CC0-1.0
URL: https://sourceware.org/systemtap/
# for RHEL buildability compatibility, pull in sdt-dtrace at all times
Requires: systemtap-sdt-dtrace = %{version}-%{release}
%description sdt-devel
This package includes the <sys/sdt.h> header file used for static
instrumentation compiled into userspace programs.
%package sdt-dtrace
Summary: Static probe support dtrace tool
License: GPL-2.0-or-later AND CC0-1.0
@ -596,7 +604,6 @@ or within a container.
%prep
%setup -q
%patch -P0 -p1
%build
@ -849,9 +856,18 @@ done
%py3_shebang_fix %{buildroot}%{python3_sitearch} %{buildroot}%{_bindir}/*
%endif
%check
%if %{with_check}
make check RUNTESTFLAGS=environment_sanity.exp
%endif
%pre runtime
%if %{with_sysusers}
%if 0%{?fedora} && 0%{?fedora} < 42
echo '%_systemtap_runtime_preinstall' | systemd-sysusers --replace=%{_sysusersdir}/systemtap-runtime.conf -
exit 0
%endif
%else
getent group stapusr >/dev/null || groupadd -f -g 156 -r stapusr
getent group stapsys >/dev/null || groupadd -f -g 157 -r stapsys
@ -859,23 +875,29 @@ getent group stapdev >/dev/null || groupadd -f -g 158 -r stapdev
getent passwd stapunpriv >/dev/null || \
useradd -c "Systemtap Unprivileged User" -u 159 -g stapunpriv -d %{_localstatedir}/lib/stapunpriv -r -s /sbin/nologin stapunpriv 2>/dev/null || \
useradd -c "Systemtap Unprivileged User" -g stapunpriv -d %{_localstatedir}/lib/stapunpriv -r -s /sbin/nologin stapunpriv
%endif
exit 0
%endif
%pre server
%if %{with_sysusers}
%if 0%{?fedora} && 0%{?fedora} < 42
echo '%_systemtap_server_preinstall' | systemd-sysusers --replace=%{_sysusersdir}/systemtap-server.conf -
exit 0
%endif
%else
getent group stap-server >/dev/null || groupadd -f -g 155 -r stap-server
getent passwd stap-server >/dev/null || \
useradd -c "Systemtap Compile Server" -u 155 -g stap-server -d %{_localstatedir}/lib/stap-server -r -s /sbin/nologin stap-server 2>/dev/null || \
useradd -c "Systemtap Compile Server" -g stap-server -d %{_localstatedir}/lib/stap-server -r -s /sbin/nologin stap-server
%endif
exit 0
%endif
%pre testsuite
%if %{with_sysusers}
%if 0%{?fedora} && 0%{?fedora} < 42
echo '%_systemtap_testsuite_preinstall' | systemd-sysusers --replace=%{_sysusersdir}/systemtap-testsuite.conf -
exit 0
%endif
%else
getent passwd stapusr >/dev/null || \
useradd -c "Systemtap 'stapusr' User" -g stapusr -r -s /sbin/nologin stapusr
@ -883,8 +905,8 @@ getent passwd stapsys >/dev/null || \
useradd -c "Systemtap 'stapsys' User" -g stapsys -G stapusr -r -s /sbin/nologin stapsys
getent passwd stapdev >/dev/null || \
useradd -c "Systemtap 'stapdev' User" -g stapdev -G stapusr -r -s /sbin/nologin stapdev
%endif
exit 0
%endif
%post server
@ -1246,8 +1268,6 @@ exit 0
%doc README AUTHORS NEWS
%{!?_licensedir:%global license %%doc}
%license COPYING
%{_bindir}/dtrace
%{_mandir}/man1/dtrace.1*
%files sdt-dtrace
@ -1330,6 +1350,10 @@ exit 0
# PRERELEASE
%changelog
* Fri May 02 2025 Frank Ch. Eigler <fche@redhat.com> - 5.3-1
- Upstream release, see wiki page below for detailed notes.
https://sourceware.org/systemtap/wiki/SystemTapReleases
* Fri Nov 15 2024 Frank Ch. Eigler <fche@redhat.com> - 5.2-2
- RHEL-67586: supply /usr/bin/dtrace in sdt-devel subrpm too