import systemtap-5.1-9.el10

i10c-beta changed/i10c-beta/systemtap-5.1-9.el10
MSVSphere Packaging Team 3 months ago
commit 3744d496f5
Signed by: sys_gitsync
GPG Key ID: B2B0B9F29E528FE8

1
.gitignore vendored

@ -0,0 +1 @@
SOURCES/systemtap-5.1.tar.gz

@ -0,0 +1 @@
5a2a16c61e815ead31e655665e6ee9cf7772f1de SOURCES/systemtap-5.1.tar.gz

@ -0,0 +1,29 @@
commit b87891f5aff91b8ebbda8d9218009495848f7747
Author: Martin Cermak <mcermak@redhat.com>
Date: Thu May 16 16:51:08 2024 +0200
PR31495: teach stap-prep to work with other RT kernels
diff --git a/stap-prep b/stap-prep
index 8b429f880..2bbb6bc2f 100755
--- a/stap-prep
+++ b/stap-prep
@@ -103,13 +103,16 @@ done
# 5.14.0-200.rt14.201.el9 ->
# "kernel-rt-debug-5.14.0-200.rt14.201.el9"
# OR?! "kernel-rt-5.14.0-200.rt14.201.el9"
-if expr "$UNAME" : ".*\.rt.*" >/dev/null;
+# OR??!"kernel-rt-5.14.0-447.el9.x86_64+rt"
+if expr "$UNAME" : ".*\.rt.*" || expr "$UNAME" : ".*\+rt.*" >/dev/null;
then
KERNEL=`echo $KERNEL | sed -e s,kernel,kernel-rt,`
fi
KERN_ARCH=`uname -m`
-KERN_REV=`echo $UNAME | sed s/.$KERN_ARCH//` # strip arch from uname
+# strip arch from uname, for kernels like 5.14.0-447.el9.x86_64+rt or
+# 6.9.0-0.rc2.1.el10.x86_64+rt strip the +rt suffix too
+KERN_REV=`echo $UNAME | sed s/.$KERN_ARCH// | sed s/\+rt$//`
if [ -x /usr/bin/dnf4 ]; then
DI="dnf4 debuginfo-install"
DI_DEPS=""

@ -0,0 +1,116 @@
commit b8d4274d1e7697801c12c512b6724dd3f59f2c72
Author: William Cohen <wcohen@redhat.com>
Date: Mon May 6 11:36:42 2024 -0400
Support kernels that backported kallsym functions from newer linux kernels
Some Linux distributions may have backported
module_kallsyms_on_each_symbol and kallsyms_on_each_symbol functions
from newer linux kernels. In these situations checking the kernel
version would not detect the proper arguments for these functions.
Systemtap now has a couple of autoconf tests to determine what
arguments should be used for these functions.
diff --git a/buildrun.cxx b/buildrun.cxx
index bb7bdcc9d..8ee8c391f 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -506,6 +506,8 @@ compile_pass (systemtap_session& s)
output_autoconf(s, o, cs, "autoconf-pagefault_disable.c", "STAPCONF_PAGEFAULT_DISABLE", NULL);
output_exportconf(s, o2, "kallsyms_lookup_name", "STAPCONF_KALLSYMS_LOOKUP_NAME_EXPORTED");
+ output_autoconf(s, o, cs, "autoconf-kallsyms_6_3.c", "STAPCONF_KALLSYMS_6_3", NULL);
+ output_autoconf(s, o, cs, "autoconf-kallsyms_6_4.c", "STAPCONF_KALLSYMS_6_4", NULL);
output_autoconf(s, o, cs, "autoconf-uidgid.c", "STAPCONF_LINUX_UIDGID_H", NULL);
output_exportconf(s, o2, "sigset_from_compat", "STAPCONF_SIGSET_FROM_COMPAT_EXPORTED");
output_exportconf(s, o2, "vzalloc", "STAPCONF_VZALLOC");
diff --git a/runtime/linux/autoconf-kallsyms_6_3.c b/runtime/linux/autoconf-kallsyms_6_3.c
new file mode 100644
index 000000000..0af1a5c35
--- /dev/null
+++ b/runtime/linux/autoconf-kallsyms_6_3.c
@@ -0,0 +1,6 @@
+#include <linux/module.h>
+
+int module_kallsyms_on_each_symbol(const char *modname,
+ int (*fn)(void *, const char *, struct module*,
+ unsigned long),
+ void *data);
diff --git a/runtime/linux/autoconf-kallsyms_6_4.c b/runtime/linux/autoconf-kallsyms_6_4.c
new file mode 100644
index 000000000..3b3680c53
--- /dev/null
+++ b/runtime/linux/autoconf-kallsyms_6_4.c
@@ -0,0 +1,3 @@
+#include <linux/kallsyms.h>
+int kallsyms_on_each_symbol(int (*fn)(void *, const char *, unsigned long),
+ void *data);
diff --git a/runtime/linux/kprobes.c b/runtime/linux/kprobes.c
index 6b30f2c52..2fba61cbb 100644
--- a/runtime/linux/kprobes.c
+++ b/runtime/linux/kprobes.c
@@ -737,7 +737,7 @@ __stapkp_symbol_callback(void *data, const char *name,
}
static int
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,0)
+#if defined(STAPCONF_KALLSYMS_6_4)
stapkp_symbol_callback(void *data, const char *name,
unsigned long addr)
{
@@ -780,7 +780,7 @@ stapkp_init(struct stap_kprobe_probe *probes,
mutex_lock(&module_mutex);
#endif
kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0)
+#if defined(STAPCONF_KALLSYMS_6_3) || defined(STAPCONF_KALLSYMS_6_4)
module_kallsyms_on_each_symbol(sd.modname, stapkp_symbol_callback, &sd);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,12,0)
module_kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
@@ -855,7 +855,7 @@ stapkp_refresh(const char *modname,
mutex_lock(&module_mutex);
#endif
kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0)
+#if defined(STAPCONF_KALLSYMS_6_3)
module_kallsyms_on_each_symbol(sd.modname, stapkp_symbol_callback, &sd);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,12,0)
module_kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
diff --git a/runtime/sym.c b/runtime/sym.c
index 3947d42f7..23dd3be30 100644
--- a/runtime/sym.c
+++ b/runtime/sym.c
@@ -1187,7 +1187,7 @@ unsigned long kallsyms_lookup_name (const char *name)
typedef typeof(&kallsyms_on_each_symbol) kallsyms_on_each_symbol_fn;
// XXX Will be linked in place of the kernel's kallsyms_on_each_symbol:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,0)
+#if defined(STAPCONF_KALLSYMS_6_4)
int kallsyms_on_each_symbol(int (*fn)(void *, const char *,
unsigned long),
void *data)
@@ -1214,13 +1214,13 @@ int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
typedef typeof(&module_kallsyms_on_each_symbol) module_kallsyms_on_each_symbol_fn;
// XXX Will be linked in place of the kernel's module_kallsyms_on_each_symbol:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,0)
+#if defined(STAPCONF_KALLSYMS_6_4)
int module_kallsyms_on_each_symbol(const char *modname,
int (*fn)(void *, const char *,
unsigned long),
void *data)
#else
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0)
+#if defined(STAPCONF_KALLSYMS_6_3)
int module_kallsyms_on_each_symbol(const char *modname,
int (*fn)(void *, const char *, struct module *,
unsigned long),
@@ -1235,7 +1235,7 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module
/* First, try to use a kallsyms_lookup_name address passed to us
through the relocation mechanism. */
if (_stp_module_kallsyms_on_each_symbol != NULL)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0)
+#if defined(STAPCONF_KALLSYMS_6_3) || defined(STAPCONF_KALLSYMS_6_4)
return ibt_wrapper(int,
(* (module_kallsyms_on_each_symbol_fn)_stp_module_kallsyms_on_each_symbol)(modname, fn, data));
#else

@ -0,0 +1,22 @@
commit ed5649f64a3f8c2e8269f9c4435e9174c4e8c775
Author: William Cohen <wcohen@redhat.com>
Date: Thu May 9 12:23:54 2024 -0400
Support kernels that backported kallsym functions (part 2)
Git commit b8d4274d1e769780 omitted a test for the Linux 6.4 version
of kallsyms function in runtime/linux/kprobes.c.
diff --git a/runtime/linux/kprobes.c b/runtime/linux/kprobes.c
index 2fba61cbb..9ae5565e3 100644
--- a/runtime/linux/kprobes.c
+++ b/runtime/linux/kprobes.c
@@ -855,7 +855,7 @@ stapkp_refresh(const char *modname,
mutex_lock(&module_mutex);
#endif
kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);
-#if defined(STAPCONF_KALLSYMS_6_3)
+#if defined(STAPCONF_KALLSYMS_6_3) || defined(STAPCONF_KALLSYMS_6_4)
module_kallsyms_on_each_symbol(sd.modname, stapkp_symbol_callback, &sd);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,12,0)
module_kallsyms_on_each_symbol(stapkp_symbol_callback, &sd);

@ -0,0 +1,248 @@
commit 0c437c7e2d02772615d73d1be1c3100d4c1de254
Author: William Cohen <wcohen@redhat.com>
Date: Tue Jun 4 09:46:41 2024 -0400
Address changes in Linux 6.10 /include/linux/vmalloc.h
Upstream linux kernel git commit 88ae5fb755b0d contains a number of
changes in /include/linux/vmalloc.h that affect vmalloc, vmalloc_node,
and vzalloc_node definitions. These are no longer functions but
macros and cannot be found in the list of symbols exported by the
kernel. Support for vzalloc, vmalloc_node, and vzalloc_node has been
in kernels since Linux 2.6.37. Given that systemtap requires Linux
3.10 or newer there is no longer a need to check for the existence of
these functions or provide local versions of them.
diff --git a/buildrun.cxx b/buildrun.cxx
index 8ee8c391f..a7fcd6297 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -510,9 +510,6 @@ compile_pass (systemtap_session& s)
output_autoconf(s, o, cs, "autoconf-kallsyms_6_4.c", "STAPCONF_KALLSYMS_6_4", NULL);
output_autoconf(s, o, cs, "autoconf-uidgid.c", "STAPCONF_LINUX_UIDGID_H", NULL);
output_exportconf(s, o2, "sigset_from_compat", "STAPCONF_SIGSET_FROM_COMPAT_EXPORTED");
- output_exportconf(s, o2, "vzalloc", "STAPCONF_VZALLOC");
- output_exportconf(s, o2, "vzalloc_node", "STAPCONF_VZALLOC_NODE");
- output_exportconf(s, o2, "vmalloc_node", "STAPCONF_VMALLOC_NODE");
// RHBZ1233912 - s390 temporary workaround for non-atomic udelay()
output_exportconf(s, o2, "udelay_simple", "STAPCONF_UDELAY_SIMPLE_EXPORTED");
diff --git a/runtime/linux/alloc.c b/runtime/linux/alloc.c
index ab16249e1..add36c30d 100644
--- a/runtime/linux/alloc.c
+++ b/runtime/linux/alloc.c
@@ -404,16 +404,6 @@ static void *_stp_kzalloc(size_t size)
return _stp_kzalloc_gfp(size, STP_ALLOC_FLAGS);
}
-#ifndef STAPCONF_VZALLOC
-static void *vzalloc(unsigned long size)
-{
- void *ret = vmalloc(size);
- if (ret)
- memset(ret, 0, size);
- return ret;
-}
-#endif
-
static void *_stp_vzalloc(size_t size)
{
void *ret;
@@ -438,24 +428,6 @@ static void *_stp_vzalloc(size_t size)
return ret;
}
-
-#ifndef STAPCONF_VMALLOC_NODE
-static void *vmalloc_node(unsigned long size, int node __attribute__((unused)))
-{
- return vmalloc(size);
-}
-#endif
-
-#ifndef STAPCONF_VZALLOC_NODE
-static void *vzalloc_node(unsigned long size, int node)
-{
- void *ret = vmalloc_node(size, node);
- if (ret)
- memset(ret, 0, size);
- return ret;
-}
-#endif
-
static void *_stp_vzalloc_node(size_t size, int node)
{
void *ret;
commit 1fd6fb4d7101e013e21006da3b77b9723be5b446
Author: William Cohen <wcohen@redhat.com>
Date: Mon Jun 3 15:46:49 2024 -0400
Avoid -Werror=empty-body errors from runtime/linux/uprobes-inode.c
Newer linux kernel compiles are being built with -Werror=empty-body.
For some modules generated runtime/linux/uprobes-inode.c is pulled in
and will get error messages like the following:
In file included from /tmp/stapGIM4O9/stap_ded21c54fce18c6570a8930d823aca3a_10928_src.c:2439:
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/uprobes-inode.c: In function 'stapiu_change_semaphore_plus':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/uprobes-inode.c:795:5: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
795 | ; // already unlocked
| ^
cc1: all warnings being treated as errors
Added "{}" in the appropriate location to indicate to the compiler
that this is intentional.
diff --git a/runtime/linux/uprobes-inode.c b/runtime/linux/uprobes-inode.c
index b07e7b666..103da09dd 100644
--- a/runtime/linux/uprobes-inode.c
+++ b/runtime/linux/uprobes-inode.c
@@ -792,7 +792,7 @@ stapiu_change_semaphore_plus(struct stapiu_consumer* c, struct task_struct *task
if (! any_found)
spin_unlock_irqrestore(&c->process_list_lock, flags);
else
- ; // already unlocked
+ {}; // already unlocked
return rc;
}
commit de8aba9a414b497d98c489173b878058c4031b39
Author: William Cohen <wcohen@redhat.com>
Date: Mon Jun 3 14:40:04 2024 -0400
Avoid -Werror=old-style-declaration for stap_probes array in generated kernel modules
With newer linux kernels additional compilers checks are being done
and will get error messages like the following for the generated
module:
/tmp/stapuundLy/stap_2755fca707746de04395c85872aae4b8_1753_src.c:111:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration]
111 | } static stap_probes[];
| ^
cc1: all warnings being treated as errors
Tweaked the code generation in translate.cxx to output the static
stap_probes array in a form that is agreeable to newer kernel builds.
diff --git a/translate.cxx b/translate.cxx
index 19c165a1d..8fb320e66 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -8748,7 +8748,8 @@ translate_pass (systemtap_session& s)
<< "STAP_PROBE_INIT_NAME(PN) "
<< "STAP_PROBE_INIT_TIMING(L, D) "
<< "}";
- s.op->newline(-1) << "} static stap_probes[];";
+ s.op->newline(-1) << "};";
+ s.op->newline() << "static struct stap_probe stap_probes[];";
s.op->assert_0_indent();
#undef CALCIT
commit da72d04303cfc3ba22b2bb58a26f8dc7868333eb
Author: William Cohen <wcohen@redhat.com>
Date: Mon Jun 3 14:23:08 2024 -0400
Avoid -Werror=empty-body errors from runtime/linux/debug.h macros
When attempting to run the testsuite the sanity.exp test fails
due to the following -Werror=empty-body errors:
/home/wcohen/systemtap_write/install/share/systemtap/runtime/transport/relay_v2.c: In function '__stp_relay_wakeup_timer':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/debug.h:47:36: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
47 | #define dbug_trans(level, args...) ;
| ^
/home/wcohen/systemtap_write/install/share/systemtap/runtime/transport/relay_v2.c:195:17: note: in expansion of macro 'dbug_trans'
195 | dbug_trans(0, "relay_v2 wakeup timer expiry\n");
| ^~~~~~~~~~
/home/wcohen/systemtap_write/install/share/systemtap/runtime/transport/symbols.c: In function '_stp_set_stext':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/debug.h:103:34: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
103 | #define dbug_sym(level, args...) ;
| ^
/home/wcohen/systemtap_write/install/share/systemtap/runtime/transport/symbols.c:44:17: note: in expansion of macro 'dbug_sym'
44 | dbug_sym(1, "found kernel _stext load address: 0x%lx\n",
| ^~~~~~~~
Changed the effectively empty macros in runtime/linux/debug.h to use
"do { } while (0)" to eliminate these errors.
diff --git a/runtime/linux/debug.h b/runtime/linux/debug.h
index d2ab9e8db..dfc834dbb 100644
--- a/runtime/linux/debug.h
+++ b/runtime/linux/debug.h
@@ -44,8 +44,8 @@
printk(args); \
} while (0)
#else
-#define dbug_trans(level, args...) ;
-#define dbug_trans2(args...) ;
+#define dbug_trans(level, args...) do { } while (0)
+#define dbug_trans2(args...) do { } while (0)
#endif
#ifdef DEBUG_STP_ON_THE_FLY
@@ -53,7 +53,7 @@
_stp_dbug(__FUNCTION__, __LINE__, args); \
} while (0)
#else
-#define dbug_otf(args...) ;
+#define dbug_otf(args...) do { } while (0)
#endif
#ifdef DEBUG_UPROBES
@@ -61,7 +61,7 @@
_stp_dbug(__FUNCTION__, __LINE__, args); \
} while (0)
#else
-#define dbug_uprobes(args...) ;
+#define dbug_uprobes(args...) do { } while (0)
#endif
#ifdef DEBUG_UNWIND /* stack unwinder */
@@ -70,7 +70,7 @@
_stp_dbug(__FUNCTION__, __LINE__, args); \
} while (0)
#else
-#define dbug_unwind(level, args...) ;
+#define dbug_unwind(level, args...) do { } while (0)
#endif
@@ -80,7 +80,7 @@
_stp_dbug(__FUNCTION__, __LINE__, args); \
} while (0)
#else
-#define dbug_task(level, args...) ;
+#define dbug_task(level, args...) do { } while (0)
#endif
@@ -90,7 +90,7 @@
_stp_dbug(__FUNCTION__, __LINE__, args); \
} while (0)
#else
-#define dbug_task_vma(level, args...) ;
+#define dbug_task_vma(level, args...) do { } while (0)
#endif
@@ -100,7 +100,7 @@
_stp_dbug(__FUNCTION__, __LINE__, args); \
} while (0)
#else
-#define dbug_sym(level, args...) ;
+#define dbug_sym(level, args...) do { } while (0)
#endif
@@ -110,7 +110,7 @@
_stp_dbug(__FUNCTION__, __LINE__, args); \
} while (0)
#else
-#define dbug_tp(level, args...) ;
+#define dbug_tp(level, args...) do { } while (0)
#endif
#endif /* _STP_LINUX_DEBUG_H_ */

@ -0,0 +1,70 @@
diff --git a/python/Makefile.am b/python/Makefile.am
index a254480f9..13618dc2f 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -29,12 +29,12 @@ pkglibexecpython_DATA += stap-resolve-module-function.py
all-local:
if HAVE_PYTHON2_PROBES
- (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON) setup.py build \
+ (cd $(srcdir); CFLAGS="$(CFLAGS) $(AM_CPPFLAGS)" $(PYTHON) setup.py build \
--build-base $(shell readlink -f $(builddir))/py2build \
--verbose)
endif
if HAVE_PYTHON3_PROBES
- (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON3) setup.py build \
+ (cd $(srcdir); CFLAGS="$(CFLAGS) $(AM_CPPFLAGS)" $(PYTHON3) setup.py build \
--build-base $(shell readlink -f $(builddir))/py3build \
--verbose)
endif
@@ -45,7 +45,7 @@ endif
# and we need to keep separate build directories for python 2 and 3.
install-exec-local:
if HAVE_PYTHON2_PROBES
- (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON) setup.py build \
+ (cd $(srcdir); CFLAGS="$(CFLAGS) $(AM_CPPFLAGS)" $(PYTHON) setup.py build \
--build-base $(shell readlink -f $(builddir))/py2build \
install --prefix $(DESTDIR)$(prefix) \
--single-version-externally-managed \
@@ -53,7 +53,7 @@ if HAVE_PYTHON2_PROBES
--verbose)
endif
if HAVE_PYTHON3_PROBES
- (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON3) setup.py build \
+ (cd $(srcdir); CFLAGS="$(CFLAGS) $(AM_CPPFLAGS)" $(PYTHON3) setup.py build \
--build-base $(shell readlink -f $(builddir))/py3build \
install --prefix $(DESTDIR)$(prefix) \
--single-version-externally-managed \
diff --git a/python/Makefile.in b/python/Makefile.in
index 1216eefff..62fe2129c 100644
--- a/python/Makefile.in
+++ b/python/Makefile.in
@@ -624,10 +624,10 @@ uninstall-am: uninstall-pkglibexecpythonDATA \
@HAVE_PYTHON_PROBES_TRUE@all-local:
-@HAVE_PYTHON2_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON) setup.py build \
+@HAVE_PYTHON2_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ (cd $(srcdir); CFLAGS="$(CFLAGS) $(AM_CPPFLAGS)" $(PYTHON) setup.py build \
@HAVE_PYTHON2_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ --build-base $(shell readlink -f $(builddir))/py2build \
@HAVE_PYTHON2_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ --verbose)
-@HAVE_PYTHON3_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON3) setup.py build \
+@HAVE_PYTHON3_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ (cd $(srcdir); CFLAGS="$(CFLAGS) $(AM_CPPFLAGS)" $(PYTHON3) setup.py build \
@HAVE_PYTHON3_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ --build-base $(shell readlink -f $(builddir))/py3build \
@HAVE_PYTHON3_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ --verbose)
@@ -635,13 +635,13 @@ uninstall-am: uninstall-pkglibexecpythonDATA \
# since only the build command has the '--build-base' directory option
# and we need to keep separate build directories for python 2 and 3.
@HAVE_PYTHON_PROBES_TRUE@install-exec-local:
-@HAVE_PYTHON2_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON) setup.py build \
+@HAVE_PYTHON2_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ (cd $(srcdir); CFLAGS="$(CFLAGS) $(AM_CPPFLAGS)" $(PYTHON) setup.py build \
@HAVE_PYTHON2_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ --build-base $(shell readlink -f $(builddir))/py2build \
@HAVE_PYTHON2_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ install --prefix $(DESTDIR)$(prefix) \
@HAVE_PYTHON2_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ --single-version-externally-managed \
@HAVE_PYTHON2_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ --record $(shell readlink -f $(builddir))/py2build/install_files.txt \
@HAVE_PYTHON2_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ --verbose)
-@HAVE_PYTHON3_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON3) setup.py build \
+@HAVE_PYTHON3_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ (cd $(srcdir); CFLAGS="$(CFLAGS) $(AM_CPPFLAGS)" $(PYTHON3) setup.py build \
@HAVE_PYTHON3_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ --build-base $(shell readlink -f $(builddir))/py3build \
@HAVE_PYTHON3_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ install --prefix $(DESTDIR)$(prefix) \
@HAVE_PYTHON3_PROBES_TRUE@@HAVE_PYTHON_PROBES_TRUE@ --single-version-externally-managed \

@ -0,0 +1,79 @@
diff --git a/buildrun.cxx b/buildrun.cxx
index a7fcd6297..e3f2f83d1 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -400,6 +400,7 @@ compile_pass (systemtap_session& s)
output_exportconf(s, o2, "__module_text_address", "STAPCONF_MODULE_TEXT_ADDRESS");
output_exportconf(s, o2, "add_timer_on", "STAPCONF_ADD_TIMER_ON");
output_autoconf(s, o, cs, "autoconf-514-panic.c", "STAPCONF_514_PANIC", NULL);
+ output_autoconf(s, o, cs, "autoconf-task_work_cancel_func.c", "STAPCONF_TASK_WORK_CANCEL_FUNC", NULL);
output_dual_exportconf(s, o2, "probe_kernel_read", "probe_kernel_write", "STAPCONF_PROBE_KERNEL");
output_autoconf(s, o, cs, "autoconf-hw_breakpoint_context.c",
diff --git a/runtime/linux/autoconf-task_work_cancel_func.c b/runtime/linux/autoconf-task_work_cancel_func.c
new file mode 100644
index 000000000..0d460de6c
--- /dev/null
+++ b/runtime/linux/autoconf-task_work_cancel_func.c
@@ -0,0 +1,3 @@
+#include <linux/task_work.h>
+
+void* c = & task_work_cancel_func;
diff --git a/runtime/linux/runtime.h b/runtime/linux/runtime.h
index 0e9fe3fea..bd9307385 100644
--- a/runtime/linux/runtime.h
+++ b/runtime/linux/runtime.h
@@ -265,7 +265,7 @@ static void *kallsyms_uprobe_get_swbp_addr;
static void *kallsyms_task_work_add;
#endif
#if !defined(STAPCONF_TASK_WORK_CANCEL_EXPORTED)
-static void *kallsyms_task_work_cancel;
+static void *kallsyms_task_work_cancel_fn;
#endif
#if !defined(STAPCONF_TRY_TO_WAKE_UP_EXPORTED) && !defined(STAPCONF_WAKE_UP_STATE_EXPORTED)
diff --git a/runtime/stp_task_work.c b/runtime/stp_task_work.c
index 0dd3095b6..4818fecbf 100644
--- a/runtime/stp_task_work.c
+++ b/runtime/stp_task_work.c
@@ -3,14 +3,25 @@
#include "linux/task_work_compatibility.h"
+// Handle kernel commit 68cbd415dd4b9c5b9df69f0f091879e56bf5907a
+// task_work: s/task_work_cancel()/task_work_cancel_func()/
+#if defined(STAPCONF_TASK_WORK_CANCEL_FUNC)
+#define TASK_WORK_CANCEL_FN task_work_cancel_func
+#else
+#define TASK_WORK_CANCEL_FN task_work_cancel
+#endif
+
+#define STRINGIFY(x) #x
+#define TOSTRING(x) STRINGIFY(x)
+
#if !defined(STAPCONF_TASK_WORK_ADD_EXPORTED)
// First typedef from the original decls, then #define as typecasted calls.
typedef typeof(&task_work_add) task_work_add_fn;
#define task_work_add(a,b,c) ibt_wrapper(int, (* (task_work_add_fn)kallsyms_task_work_add)((a), (b), (c)))
#endif
#if !defined(STAPCONF_TASK_WORK_CANCEL_EXPORTED)
-typedef typeof(&task_work_cancel) task_work_cancel_fn;
-#define task_work_cancel(a,b) ibt_wrapper(struct callback_head *, (* (task_work_cancel_fn)kallsyms_task_work_cancel)((a), (b)))
+typedef typeof(&TASK_WORK_CANCEL_FN) task_work_cancel_fn;
+#define task_work_cancel(a,b) ibt_wrapper(struct callback_head *, (* (task_work_cancel_fn)kallsyms_task_work_cancel_fn)((a), (b)))
#endif
/* To avoid a crash when a task_work callback gets called after the
@@ -35,9 +46,9 @@ stp_task_work_init(void)
}
#endif
#if !defined(STAPCONF_TASK_WORK_CANCEL_EXPORTED)
- kallsyms_task_work_cancel = (void *)kallsyms_lookup_name("task_work_cancel");
- if (kallsyms_task_work_cancel == NULL) {
- _stp_error("Can't resolve task_work_cancel!");
+ kallsyms_task_work_cancel_fn = (void *)kallsyms_lookup_name(TOSTRING(TASK_WORK_CANCEL_FN));
+ if (kallsyms_task_work_cancel_fn == NULL) {
+ _stp_error("Can't resolve %s!", TOSTRING(TASK_WORK_CANCEL_FN));
return -ENOENT;
}
#endif

@ -0,0 +1,22 @@
commit 470da664cc0afd4aac982806622dbb5d700a7904
Author: Martin Cermak <mcermak@redhat.com>
Date: Fri Aug 9 07:40:43 2024 +0200
RHEL-52491: NSS 3.101.0 compatibility
After NSS rebased to 3.101.0, systemtap stopped being able to grant
trust to stap-server: https://issues.redhat.com/browse/RHEL-52491 .
This patch fixes it.
diff --git a/client-nss.cxx b/client-nss.cxx
index 55266feb7..c09f99ca9 100644
--- a/client-nss.cxx
+++ b/client-nss.cxx
@@ -184,6 +184,7 @@ badCertHandler(void *arg, PRFileDesc *sslSocket)
break;
+ case SEC_ERROR_UNKNOWN_ISSUER:
case SEC_ERROR_CA_CERT_INVALID:
/* The server's certificate is not trusted. Should we trust it? */
secStatus = SECFailure; /* Do not trust by default. */

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save