import systemtap-4.6-4.el9

This commit is contained in:
CentOS Sources 2022-01-11 13:01:32 -05:00 committed by Stepan Oksanichenko
parent b63617a7a9
commit a1c4f9531e
11 changed files with 356 additions and 1445 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/systemtap-4.5.tar.gz
SOURCES/systemtap-4.6.tar.gz

View File

@ -1 +1 @@
c549d5fa7aaf6a8cef3371f5757d912d41eae934 SOURCES/systemtap-4.5.tar.gz
ecc45371b378fc3824a5547b02c030b4123d6769 SOURCES/systemtap-4.6.tar.gz

19
SOURCES/rhbz1972798.patch Normal file
View File

@ -0,0 +1,19 @@
commit 2c11a115bdbe41a7f064ccd32b41c76c5b7c516d
Author: Martin Cermak <mcermak@redhat.com>
Date: Wed Dec 1 14:04:57 2021 +0100
tapset/linux/nfs.stp: Fix rhbz1972798
diff --git a/tapset/linux/nfs.stp b/tapset/linux/nfs.stp
index 28f0b90ed..232289e3b 100644
--- a/tapset/linux/nfs.stp
+++ b/tapset/linux/nfs.stp
@@ -979,7 +979,7 @@ probe nfs.aop.readpages = kernel.function ("nfs_readpages") !,
ino = $mapping->host->i_ino
nr_pages = $nr_pages
- file = $filp
+ file = @choose_defined($filp, $file)
rpages = __nfs_rpages($mapping->host)
rsize = __nfs_server_rsize($mapping->host)

View File

@ -1,24 +0,0 @@
commit eaf63df6a429956bdc03f2ecd8fc2b6fa50321a8
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Wed Jun 23 20:16:52 2021 -0400
ppc64 runtime: FULL_REGS() gone
Adapt to kernel commit 8dc7f0229b78, which dropped the titular macro
from ppc64 ptrace.h header.
diff --git a/runtime/linux/regs.c b/runtime/linux/regs.c
index 26423164b..5c3a86c62 100644
--- a/runtime/linux/regs.c
+++ b/runtime/linux/regs.c
@@ -182,6 +182,10 @@ static void _stp_print_regs(struct pt_regs * regs)
}
_stp_printf("%016lX ", regs->gpr[i]);
+/* since kernel commit 8dc7f0229 */
+#ifndef FULL_REGS
+#define FULL_REGS(r) true
+#endif
if (i == 13 && !FULL_REGS(regs))
break;
}

View File

@ -1,52 +0,0 @@
commit 5409ddea1a007384b9c71a78e8dd2cbca1fc5424
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Thu Jul 1 14:41:06 2021 -0400
rhbz1972805: add basic syscall-in-ptregs support for s390x
Akin to commit 7be7af0fda36 for ARM, add basic syscalls via
tracepoints / CONTEXT->sregs support for s390x. The argno=6 case is
funny because for syscalls they travel in registers, whereas normally
they hop onto the stack.
diff --git a/tapset/s390/registers.stp b/tapset/s390/registers.stp
index b3986cdd9..cbe7e8483 100644
--- a/tapset/s390/registers.stp
+++ b/tapset/s390/registers.stp
@@ -136,7 +136,10 @@ function uarch_bytes:long() {
function _stp_get_register_by_offset:long (offset:long) %{ /* pure */
long value;
struct pt_regs *regs;
- regs = (CONTEXT->user_mode_p ? CONTEXT->uregs : CONTEXT->kregs);
+ if (CONTEXT->sregs)
+ regs = CONTEXT->sregs;
+ else
+ regs = (CONTEXT->user_mode_p ? CONTEXT->uregs : CONTEXT->kregs);
if (!regs) {
CONTEXT->last_error = "No registers available in this context";
return;
@@ -169,9 +172,10 @@ function _stp_sign_extend32:long (value:long) {
}
function _stp_register:long (name:string, sign_extend:long) {
- assert(registers_valid(), "cannot access CPU registers in this context")
+ # don't assert this: will get *regs state checked in _stp_get_register_by_offset, and better
+ # assert(registers_valid(), "cannot access CPU registers in this context")
offset = _reg_offsets[name]
- assert(offset != 0 || (name in _reg_offsets), "Unknown register: " . name)
+ assert(offset != 0 || (name in _reg_offsets), "Unknown register: " . name)
value = _stp_get_register_by_offset(offset)
if (probing_32bit_app()) {
if (sign_extend)
@@ -235,8 +239,10 @@ function _stp_arg2:long (argnum:long, sign_extend:long, truncate:long,
val = u_register("r5")
else if (argnum == 5)
val = u_register("r6")
+ else if (argnum == 6 && %{ CONTEXT->sregs != NULL %} ) // linux syscall arg6 goes into r7
+ val = u_register("r7")
else if (argnum >= 6)
- val = _stp_get_kernel_stack_param(argnum - 6)
+ val = _stp_get_kernel_stack_param(argnum - 6);
if ((truncate || @__compat_task) && !force64) {
/* High bits may be garbage. */

View File

@ -1,29 +0,0 @@
commit 515a6a2d63cdf16c5bc599f0d29283289219d9a4
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Thu Jun 24 13:30:38 2021 -0400
rhbz1972828: tapsets: iommu tracepoints
Disable detection of intel-iommu tracepoint family on non-x86
platforms, because the 5.13ish kernel headers for this tracepoint
include references to functions like clcache_flush_range which don't
exist on all non-x86.
diff --git a/tapsets.cxx b/tapsets.cxx
index a5e41129f..20e0cb68f 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -11930,6 +11930,13 @@ static vector<string> tracepoint_extra_decls (systemtap_session& s,
they_live.push_back ("#include <linux/phy.h>");
}
+ if (header.find("intel_iommu") != string::npos && s.architecture != "x86_64" && s.architecture != "i386")
+ {
+ // need asm/cacheflush.h for clflush_cache_range() used in that header,
+ // but this function does not exist on e.g. ppc
+ they_live.push_back ("#error nope");
+ }
+
if (header.find("wbt") != string::npos)
{
// blk-wbt.h gets included as "../../../block/blk-wbt.h", so we

View File

@ -1,222 +0,0 @@
commit 04b43f48f1091bdc4bfdbabae86745547e539f8c
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Mon Jul 26 15:49:15 2021 -0400
releng: ditch custom pie/ssp CFLAGS engine in configure.ac
Just inherit the desired c*flags from autoconf via environment
variables from the distro spec files. This lets us automatically
benefit from centralized hardening flags on some distros. OTOH
distros without that now will need to add such settings to the build
scripts that invoke this configure script.
diff --git a/configure b/configure
index 3830ca898..55ff87330 100755
--- a/configure
+++ b/configure
@@ -904,8 +904,6 @@ with_libiconv_prefix
with_libintl_prefix
enable_prologues
enable_sdt_probes
-enable_ssp
-enable_pie
with_debuginfod
enable_sqlite
enable_translator
@@ -1609,8 +1607,6 @@ Optional Features:
--disable-rpath do not hardcode runtime library paths
--enable-prologues make -P prologue-searching default
--disable-sdt-probes disable process.mark probes in stap, staprun, stapio
- --disable-ssp disable gcc stack-protector
- --enable-pie enable position-independent-executable
--enable-sqlite build with sqlite support
--disable-translator build only runtime utilities
--enable-crash[=DIRECTORY]
@@ -10269,82 +10265,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
-# Check whether --enable-ssp was given.
-if test "${enable_ssp+set}" = set; then :
- enableval=$enable_ssp;
-fi
-
-if test "x$enable_ssp" != xno; then :
-
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="-Werror -fstack-protector-all -D_FORTIFY_SOURCE=2 $CXXFLAGS"
- CFLAGS="-Werror -fstack-protector-all -D_FORTIFY_SOURCE=2 $CFLAGS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int something ();
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling with gcc -fstack-protector-all et al." >&5
-$as_echo "$as_me: Compiling with gcc -fstack-protector-all et al." >&6;}
- CFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2 $save_CFLAGS"
- CXXFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2 $save_CXXFLAGS"
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: Compiler does not support -fstack-protector-all et al." >&5
-$as_echo "$as_me: Compiler does not support -fstack-protector-all et al." >&6;}
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-
-
-# Compiling with fPIE by default (but see PR 9922)
-# Check whether --enable-pie was given.
-if test "${enable_pie+set}" = set; then :
- enableval=$enable_pie;
-fi
-
-if test "x$enable_pie" != xno; then :
-
- PIECFLAGS='-fPIE'
- PIECXXFLAGS='-fPIE'
- PIELDFLAGS='-pie -Wl,-z,relro -Wl,-z,now'
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- save_LDFLAGS="$LDFLAGS"
- CFLAGS="$CFLAGS $PIECFLAGS"
- CXXFLAGS="$CXXFLAGS $PIECXXFLAGS"
- LDFLAGS="$LDFLAGS $PIELDFLAGS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-void main () {}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling with gcc pie et al." >&5
-$as_echo "$as_me: Compiling with gcc pie et al." >&6;}
-
-else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: Compiler does not support -pie et al." >&5
-$as_echo "$as_me: Compiler does not support -pie et al." >&6;}
- PIECFLAGS=""
- PIECXXFLAGS=""
- PIELDFLAGS=""
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"
- LDFLAGS="$save_LDFLAGS"
-
-fi
diff --git a/configure.ac b/configure.ac
index d4fd9e1b0..a88c20bff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -190,60 +190,8 @@ AS_IF([test "x$HAVE_CXX11" != x1],[
AC_LANG_POP(C++)
])
-AC_ARG_ENABLE([ssp],
- [AS_HELP_STRING([--disable-ssp], [disable gcc stack-protector])])
-AS_IF([test "x$enable_ssp" != xno],[
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="-Werror -fstack-protector-all -D_FORTIFY_SOURCE=2 $CXXFLAGS"
- CFLAGS="-Werror -fstack-protector-all -D_FORTIFY_SOURCE=2 $CFLAGS"
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([int something ();])], [
- AC_MSG_NOTICE([Compiling with gcc -fstack-protector-all et al.])
- CFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2 $save_CFLAGS"
- CXXFLAGS="-fstack-protector-all -D_FORTIFY_SOURCE=2 $save_CXXFLAGS"],[
- AC_MSG_NOTICE([Compiler does not support -fstack-protector-all et al.])
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"])])
-
-
-dnl Link with gold if possible
-dnl but: https://bugzilla.redhat.com/show_bug.cgi?id=636603
-dnl
-dnl AC_PATH_PROG(GOLD, [ld.gold], [no])
-dnl if test "x$GOLD" != "xno"
-dnl then
-dnl mkdir -p Bdir
-dnl ln -sf $GOLD Bdir/ld
-dnl LDFLAGS="$LDFLAGS -B`pwd`/Bdir/"
-dnl AC_MSG_NOTICE([using ld.gold to link])
-dnl fi
-
-
-# Compiling with fPIE by default (but see PR 9922)
-AC_ARG_ENABLE([pie],
- [AS_HELP_STRING([--enable-pie], [enable position-independent-executable])])
-AS_IF([test "x$enable_pie" != xno],[
- PIECFLAGS='-fPIE'
- PIECXXFLAGS='-fPIE'
- PIELDFLAGS='-pie -Wl,-z,relro -Wl,-z,now'
- save_CFLAGS="$CFLAGS"
- save_CXXFLAGS="$CXXFLAGS"
- save_LDFLAGS="$LDFLAGS"
- CFLAGS="$CFLAGS $PIECFLAGS"
- CXXFLAGS="$CXXFLAGS $PIECXXFLAGS"
- LDFLAGS="$LDFLAGS $PIELDFLAGS"
- AC_LINK_IFELSE([AC_LANG_SOURCE([void main () {}])], [
- AC_MSG_NOTICE([Compiling with gcc pie et al.])
- ], [
- AC_MSG_NOTICE([Compiler does not support -pie et al.])
- PIECFLAGS=""
- PIECXXFLAGS=""
- PIELDFLAGS=""
- ])
- CFLAGS="$save_CFLAGS"
- CXXFLAGS="$save_CXXFLAGS"
- LDFLAGS="$save_LDFLAGS"
-])
+dnl Carry forward some empty PIE*FLAGS so we don't have to modify
+dnl all the Makefile.am's just now.
AC_SUBST(PIELDFLAGS)
AC_SUBST(PIECFLAGS)
AC_SUBST(PIECXXFLAGS)
diff --git a/systemtap.spec b/systemtap.spec
index e5224e902..a2458b4b5 100644
--- a/systemtap.spec
+++ b/systemtap.spec
@@ -11,7 +11,6 @@
%endif
%{!?with_rpm: %global with_rpm 1}
%{!?elfutils_version: %global elfutils_version 0.179}
-%{!?pie_supported: %global pie_supported 1}
%{!?with_boost: %global with_boost 0}
%ifarch %{ix86} x86_64 ppc ppc64 ppc64le aarch64
%{!?with_dyninst: %global with_dyninst 0%{?fedora} >= 18 || 0%{?rhel} >= 7}
@@ -589,14 +588,6 @@ systemtap-runtime-virthost machine to execute systemtap scripts.
%global docs_config --enable-docs=prebuilt
%endif
-# Enable pie as configure defaults to disabling it
-%if %{pie_supported}
-%global pie_config --enable-pie
-%else
-%global pie_config --disable-pie
-%endif
-
-
%if %{with_java}
%global java_config --with-java=%{_jvmdir}/java
%else
@@ -646,8 +637,8 @@ systemtap-runtime-virthost machine to execute systemtap scripts.
# We don't ship compileworthy python code, just oddball samples
%global py_auto_byte_compile 0
-%configure %{dyninst_config} %{sqlite_config} %{crash_config} %{docs_config} %{pie_config} %{rpm_config} %{java_config} %{virt_config} %{dracut_config} %{python3_config} %{python2_probes_config} %{python3_probes_config} %{httpd_config} %{bpf_config} %{debuginfod_config} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}"
-make %{?_smp_mflags}
+%configure %{dyninst_config} %{sqlite_config} %{crash_config} %{docs_config} %{rpm_config} %{java_config} %{virt_config} %{dracut_config} %{python3_config} %{python2_probes_config} %{python3_probes_config} %{httpd_config} %{bpf_config} %{debuginfod_config} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}"
+make %{?_smp_mflags} V=1
%install

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,95 @@
commit 241f53050f441808e673d19b42008779f555f484 (HEAD)
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Fri Nov 19 22:22:45 2021 -0500
configury: let python3 be python3
Our baroque heuristics for identifying python2/3 under their various
historical aliases is showing its age. On some modern distros,
/usr/bin/python is to be positively NOT used. Fixing configure.ac
$PYTHON3 search to only look for python3, and not even consider
$PYTHON_UNKNOWN. At some point we'll want to simplify further, and
get rid of python2 remnants.
diff --git a/configure b/configure
index 6d0d53992636..962323156181 100755
--- a/configure
+++ b/configure
@@ -9350,49 +9350,7 @@ fi
as_fn_append ac_configure_args " python='$PYTHON' pyexecdir='$pyexecdir'"
# Now let's try to find python version 3.
-if test "x$PYTHON_UNKNOWN" != "xno" -a "x$ac_cv_python_unknown_version" = "x3"; then
- # Extract the first word of "python", so it can be a program name with args.
-set dummy python; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PYTHON3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PYTHON3 in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PYTHON3="$PYTHON3" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_PYTHON3="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-PYTHON3=$ac_cv_path_PYTHON3
-if test -n "$PYTHON3"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3" >&5
-$as_echo "$PYTHON3" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-else
- for ac_prog in python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0
+for ac_prog in python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -9438,7 +9396,6 @@ fi
done
test -n "$PYTHON3" || PYTHON3=":"
-fi
python3_basename=$(basename "$PYTHON3")
cat >>confdefs.h <<_ACEOF
diff --git a/configure.ac b/configure.ac
index b0a823604ca3..d1b1247637bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,12 +88,8 @@ fi
AS_VAR_APPEND([ac_configure_args], [" python='$PYTHON' pyexecdir='$pyexecdir'"])
# Now let's try to find python version 3.
-if test "x$PYTHON_UNKNOWN" != "xno" -a "x$ac_cv_python_unknown_version" = "x3"; then
- AC_PATH_PROG([PYTHON3], [python])
-else
- AC_PATH_PROGS([PYTHON3],
- [python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0], [:])
-fi
+AC_PATH_PROGS([PYTHON3],
+ [python3 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0], [:])
python3_basename=$(basename "$PYTHON3")
AC_DEFINE_UNQUOTED([PYTHON3_BASENAME], "${python3_basename}",
[Base name of the python3 interpreter binary.])

146
SOURCES/sdt-asm-glibc.patch Normal file
View File

@ -0,0 +1,146 @@
commit ecab2afea46099b4e7dfd551462689224afdbe3a
Author: Stan Cox <scox@redhat.com>
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 28d236d91..24d5e01c3 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 1cff23c5f..9b357086c 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 5791cb2b9..0cd1cb517 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 4f2539c93..530a79175 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)
+}
commit 1d3653936 (HEAD -> master, origin/master, origin/HEAD)
Author: Frank Ch. Eigler <fche@redhat.com>
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 24d5e01c3..3e1f00b6c 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__

View File

@ -4,14 +4,13 @@
%{!?with_htmldocs: %global with_htmldocs 0}
%{!?with_monitor: %global with_monitor 1}
# crash is not available
%ifarch ppc ppc64 %{sparc} %{mips}
%ifarch ppc ppc64 %{sparc} %{mips} %{riscv}
%{!?with_crash: %global with_crash 0}
%else
%{!?with_crash: %global with_crash 1}
%endif
%{!?with_rpm: %global with_rpm 1}
%{!?elfutils_version: %global elfutils_version 0.179}
%{!?pie_supported: %global pie_supported 1}
%{!?with_boost: %global with_boost 0}
%ifarch %{ix86} x86_64 ppc ppc64 ppc64le aarch64
%{!?with_dyninst: %global with_dyninst 0%{?fedora} >= 18 || 0%{?rhel} >= 7}
@ -39,6 +38,7 @@
%{!?with_python3_probes: %global with_python3_probes (0%{?fedora} >= 23 || 0%{?rhel} > 7)}
%{!?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}
# Virt is supported on these arches, even on el7, but it's not in core EL7
%if 0%{?rhel} <= 7
@ -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.5
Release: 8%{?release_override}%{?dist}
Version: 4.6
Release: 4%{?release_override}%{?dist}
# for version, see also configure.ac
@ -126,11 +154,9 @@ License: GPLv2+
URL: http://sourceware.org/systemtap/
Source: ftp://sourceware.org/pub/systemtap/releases/systemtap-%{version}.tar.gz
Patch1: rhbz1972803.patch
Patch2: rhbz1972828.patch
Patch3: rhbz1972805.patch
Patch4: rhbz1982908.patch
Patch5: rhbz1985124.patch
Patch1: rhbz2025054python3.patch
Patch2: rhbz1972798.patch
Patch3: sdt-asm-glibc.patch
# Build*
BuildRequires: make
@ -180,6 +206,7 @@ BuildRequires: xmlto /usr/share/xmlto/format/fo/pdf
%endif
%endif
%if %{with_emacsvim}
# for _emacs_sitelispdir macros etc.
BuildRequires: emacs
%endif
%if %{with_java}
@ -202,6 +229,9 @@ BuildRequires: python2-setuptools
BuildRequires: python-setuptools
%endif
%endif
%if %{with_python3}
BuildRequires: python3
%endif
%if %{with_python3_probes}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
@ -214,6 +244,10 @@ BuildRequires: /usr/bin/pathfix.py
BuildRequires: libmicrohttpd-devel
BuildRequires: libuuid-devel
%endif
%if %{with_sysusers}
BuildRequires: systemd-rpm-macros
%endif
# Install requirements
Requires: systemtap-client = %{version}-%{release}
@ -490,7 +524,7 @@ This package includes support files needed to run systemtap scripts
that probe python 3 processes.
%endif
%if %{with_python3}
%if %{with_python3_probes}
%package exporter
Summary: Systemtap-prometheus interoperation mechanism
License: GPLv2+
@ -508,7 +542,8 @@ to remote requesters on demand.
Summary: Systemtap Cross-VM Instrumentation - host
License: GPLv2+
URL: http://sourceware.org/systemtap/
Requires: libvirt >= 1.0.2
# only require libvirt-libs really
#Requires: libvirt >= 1.0.2
Requires: libxml2
%description runtime-virthost
@ -542,11 +577,10 @@ systemtap-runtime-virthost machine to execute systemtap scripts.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
@ -595,14 +629,6 @@ systemtap-runtime-virthost machine to execute systemtap scripts.
%global docs_config --enable-docs=prebuilt
%endif
# Enable pie as configure defaults to disabling it
%if %{pie_supported}
%global pie_config --enable-pie
%else
%global pie_config --disable-pie
%endif
%if %{with_java}
%global java_config --with-java=%{_jvmdir}/java
%else
@ -652,8 +678,8 @@ systemtap-runtime-virthost machine to execute systemtap scripts.
# We don't ship compileworthy python code, just oddball samples
%global py_auto_byte_compile 0
%configure %{dyninst_config} %{sqlite_config} %{crash_config} %{docs_config} %{pie_config} %{rpm_config} %{java_config} %{virt_config} %{dracut_config} %{python3_config} %{python2_probes_config} %{python3_probes_config} %{httpd_config} %{bpf_config} %{debuginfod_config} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}"
make %{?_smp_mflags}
%configure %{dyninst_config} %{sqlite_config} %{crash_config} %{docs_config} %{rpm_config} %{java_config} %{virt_config} %{dracut_config} %{python3_config} %{python2_probes_config} %{python3_probes_config} %{httpd_config} %{bpf_config} %{debuginfod_config} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}"
make %{?_smp_mflags} V=1
%install
@ -665,6 +691,14 @@ for dir in $(ls -1d $RPM_BUILD_ROOT%{_mandir}/{??,??_??}) ; do
echo "%%lang($lang) $dir/man*/*" >> %{name}.lang
done
%if %{with_sysusers}
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
ln -s %{_datadir}/systemtap/examples
# Fix paths in the example scripts.
@ -788,24 +822,37 @@ pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{python3_sitearch
%endif
%pre runtime
%if %{with_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
getent group stapdev >/dev/null || groupadd -f -g 158 -r stapdev
%endif
exit 0
%pre server
%if %{with_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 || \
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
%pre testsuite
%if %{with_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
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
%post server
@ -962,7 +1009,7 @@ if [ "$1" -ge "1" ]; then
fi
exit 0
%if %{with_python3}
%if %{with_python3_probes}
%if %{with_systemd}
%preun exporter
if [ $1 = 0 ] ; then
@ -1027,6 +1074,9 @@ exit 0
%doc README README.unprivileged AUTHORS NEWS
%{!?_licensedir:%global license %%doc}
%license COPYING
%if %{with_sysusers}
%{_sysusersdir}/systemtap-server.conf
%endif
%files devel -f systemtap.lang
@ -1096,6 +1146,9 @@ exit 0
%doc README README.security AUTHORS NEWS
%{!?_licensedir:%global license %%doc}
%license COPYING
%if %{with_sysusers}
%{_sysusersdir}/systemtap-runtime.conf
%endif
%files client -f systemtap.lang
@ -1162,6 +1215,9 @@ exit 0
%files testsuite
%dir %{_datadir}/systemtap
%{_datadir}/systemtap/testsuite
%if %{with_sysusers}
%{_sysusersdir}/systemtap-testsuite.conf
%endif
%if %{with_java}
@ -1203,7 +1259,7 @@ exit 0
%endif
%endif
%if %{with_python3}
%if %{with_python3_probes}
%files exporter
%{_sysconfdir}/stap-exporter
%{_sysconfdir}/sysconfig/stap-exporter
@ -1221,6 +1277,19 @@ exit 0
# PRERELEASE
%changelog
* Mon Dec 06 2021 Stan Cox <scox@redhat.com> - 4.6.4
- sys/sdt.h remove float constraints that may cause gcc reload issues.
* Thu Dec 02 2021 Frank Ch. Eigler <fche@redhat.com> - 4.6.3
- rhbz2972798 - nfs tapset tweaks
- sys/sdt.h fixes for glibc ftbfs
* Thu Nov 25 2021 Martin Cermak <mcermak@redhat.com> - 4.6.2
- rhbz2012907: Fix use of sysuser.d/* for user/group management
* Fri Nov 19 2021 Frank Ch. Eigler <fche@redhat.com> - 4.6-1
- Upstream release.
* Thu Sep 09 2021 Frank Ch. Eigler <fche@redhat.com> - 4.5-8
- rhbz1985124: Kernel 5.14 compatibility omnibus cont'd.