resolves: rhbz2057567
This commit is contained in:
parent
d6aaf7cbe2
commit
cec1a1c1e3
1
.gitignore
vendored
1
.gitignore
vendored
@ -60,3 +60,4 @@
|
||||
/systemtap-4.5-0.202102101544git8d5e0abc542c.tar.gz
|
||||
/systemtap-4.5.tar.gz
|
||||
/systemtap-4.6.tar.gz
|
||||
/systemtap-4.7.tar.gz
|
||||
|
@ -1,19 +0,0 @@
|
||||
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)
|
@ -1,95 +0,0 @@
|
||||
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.])
|
@ -1,29 +0,0 @@
|
||||
commit 39b5233271b997811632871e1b6620a89b384fe8
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
Date: Thu Jan 20 18:18:00 2022 +0100
|
||||
|
||||
Fix python probing rhbz2027683
|
||||
|
||||
diff --git a/tapset/python.stp b/tapset/python.stp
|
||||
new file mode 100644
|
||||
index 000000000..b5d06fcd9
|
||||
--- /dev/null
|
||||
+++ b/tapset/python.stp
|
||||
@@ -0,0 +1,17 @@
|
||||
+/* Systemtap tapset to make it easier to trace Python */
|
||||
+
|
||||
+/*
|
||||
+ Define python.function.entry/return:
|
||||
+*/
|
||||
+probe python.function.entry = process("/usr/lib*/libpython*.so*").mark("function__entry")
|
||||
+{
|
||||
+ filename = user_string($arg1);
|
||||
+ funcname = user_string($arg2);
|
||||
+ lineno = $arg3;
|
||||
+}
|
||||
+probe python.function.return = process("/usr/lib*/libpython*.so*").mark("function__return")
|
||||
+{
|
||||
+ filename = user_string($arg1);
|
||||
+ funcname = user_string($arg2);
|
||||
+ lineno = $arg3;
|
||||
+}
|
@ -1,80 +0,0 @@
|
||||
commit 5abded54b
|
||||
Author: Stan Cox <scox@redhat.com>
|
||||
Date: Fri Jan 28 15:28:27 2022 -0500
|
||||
|
||||
Attempt to access string in userspace if kernel access fails
|
||||
|
||||
Add kernel_or_user_string_quoted(_utf16 _utf32) tapsets to handle
|
||||
situations where a kernelspace access was assumed but string is in
|
||||
userspace.
|
||||
|
||||
diff --git a/tapset/linux/conversions.stp b/tapset/linux/conversions.stp
|
||||
index 82f535f6c..d3d3a0b5a 100644
|
||||
--- a/tapset/linux/conversions.stp
|
||||
+++ b/tapset/linux/conversions.stp
|
||||
@@ -72,6 +72,17 @@ function kernel_string_quoted:string (addr:long)
|
||||
(unsigned long)(uintptr_t)STAP_ARG_addr);
|
||||
%}
|
||||
|
||||
+/**
|
||||
+ * sfunction kernel_or_user_string_quoted - Retrieves and quotes string from kernel or user memory
|
||||
+ *
|
||||
+ * @addr: the kernel or user memory address to retrieve the string from
|
||||
+ *
|
||||
+ * Similar to kernel_string_quoted except user memory is a fallback method
|
||||
+ */
|
||||
+function kernel_or_user_string_quoted:string (addr:long) {
|
||||
+ try { return string_quoted(kernel_string(addr)) } catch { return string_quoted(user_string(addr)) }
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* sfunction kernel_string_n - Retrieves string of given length from kernel memory
|
||||
* @addr: The kernel address to retrieve the string from
|
||||
@@ -160,6 +171,16 @@ function kernel_string_quoted_utf32:string (addr:long) {
|
||||
try { return string_quoted(kernel_string_utf32(addr)) } catch { return sprintf("0x%x", addr) }
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * sfunction kernel_or_user_string_quoted_utf32 - Retrieves and quotes UTF-32 string from kernel or user memory
|
||||
+ *
|
||||
+ * @addr: the kernel or user memory address to retrieve the string from
|
||||
+ *
|
||||
+ * Similar to kernel_string_quoted_utf32 except user memory is a fallback method
|
||||
+ */
|
||||
+function kernel_or_user_string_quoted_utf32:string (addr:long) {
|
||||
+ try { return string_quoted(kernel_string_utf32(addr)) } catch { return string_quoted(user_string_utf32(addr)) }
|
||||
+}
|
||||
|
||||
/**
|
||||
* sfunction kernel_string_utf16 - Retrieves UTF-16 string from kernel memory
|
||||
@@ -242,6 +263,17 @@ function kernel_string_quoted_utf16:string (addr:long) {
|
||||
try { return string_quoted(kernel_string_utf16(addr)) } catch { return sprintf("0x%x", addr) }
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * sfunction kernel_or_user_string_quoted_utf16 - Retrieves and quotes UTF-16 string from kernel or user memory
|
||||
+ *
|
||||
+ * @addr: the kernel or user memory address to retrieve the string from
|
||||
+ *
|
||||
+ * Similar to kernel_string_quoted_utf16 except uses user memory as a fallback method
|
||||
+ */
|
||||
+function kernel_or_user_string_quoted_utf16:string (addr:long) {
|
||||
+ try { return string_quoted(kernel_string_utf16(addr)) } catch { return string_quoted(user_string_utf16(addr)) }
|
||||
+}
|
||||
+
|
||||
|
||||
/**
|
||||
* sfunction kernel_long - Retrieves a long value stored in kernel memory
|
||||
diff --git a/tapsets.cxx b/tapsets.cxx
|
||||
index 8fc5146e2..8b8f1cad5 100644
|
||||
--- a/tapsets.cxx
|
||||
+++ b/tapsets.cxx
|
||||
@@ -3757,7 +3757,7 @@ dwarf_pretty_print::print_chars (Dwarf_Die* start_type, target_symbol* e,
|
||||
return false;
|
||||
}
|
||||
|
||||
- string function = userspace_p ? "user_string_quoted" : "kernel_string_quoted";
|
||||
+ string function = userspace_p ? "user_string_quoted" : "kernel_or_user_string_quoted";
|
||||
Dwarf_Word size = (Dwarf_Word) -1;
|
||||
dwarf_formudata (dwarf_attr_integrate (&type, DW_AT_byte_size, &attr), &size);
|
||||
switch (size)
|
@ -1,167 +0,0 @@
|
||||
diff --git a/tapset/linux/ioscheduler.stp b/tapset/linux/ioscheduler.stp
|
||||
index abb24dac9..3096a73ea 100644
|
||||
--- a/tapset/linux/ioscheduler.stp
|
||||
+++ b/tapset/linux/ioscheduler.stp
|
||||
@@ -11,7 +11,9 @@
|
||||
// </tapsetdescription>
|
||||
%{
|
||||
#include <linux/blkdev.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,14,0)
|
||||
#include <linux/elevator.h>
|
||||
+#endif
|
||||
%}
|
||||
|
||||
/**
|
||||
@@ -76,7 +78,8 @@ probe ioscheduler.elv_completed_request
|
||||
elevator_name = kernel_string(
|
||||
@choose_defined($q->elevator->type->elevator_name,
|
||||
@choose_defined($q->elevator->elevator_type->elevator_name,
|
||||
- $q->elevator->elevator_name)), "")
|
||||
+ @choose_defined($q->elevator->elevator_name,
|
||||
+ 0))), "")
|
||||
if($rq == 0) {
|
||||
disk_major = -1
|
||||
disk_minor = -1
|
||||
@@ -114,7 +117,8 @@ probe ioscheduler.elv_add_request.kp =
|
||||
elevator_name = kernel_string(
|
||||
@choose_defined($q->elevator->type->elevator_name,
|
||||
@choose_defined($q->elevator->elevator_type->elevator_name,
|
||||
- $q->elevator->elevator_name)), "")
|
||||
+ @choose_defined($q->elevator->elevator_name,
|
||||
+ 0))), "")
|
||||
q = $q
|
||||
if($rq == 0) {
|
||||
disk_major = -1
|
||||
@@ -152,7 +156,8 @@ probe ioscheduler.elv_add_request.tp = kernel.trace("block_rq_insert") ?
|
||||
elevator_name = kernel_string(
|
||||
@choose_defined($rq->q->elevator->type->elevator_name,
|
||||
@choose_defined($rq->q->elevator->elevator_type->elevator_name,
|
||||
- $rq->q->elevator->elevator_name)), "")
|
||||
+ @choose_defined($rq->q->elevator->elevator_name,
|
||||
+ 0))), "")
|
||||
rq = $rq
|
||||
|
||||
if ($rq == 0 || $rq->rq_disk ==0) {
|
||||
@@ -201,7 +206,8 @@ probe ioscheduler_trace.elv_completed_request
|
||||
elevator_name = kernel_string(
|
||||
@choose_defined($rq->q->elevator->type->elevator_name,
|
||||
@choose_defined($rq->q->elevator->elevator_type->elevator_name,
|
||||
- $rq->q->elevator->elevator_name)), "")
|
||||
+ @choose_defined($rq->q->elevator->elevator_name,
|
||||
+ 0))), "")
|
||||
|
||||
rq = $rq
|
||||
|
||||
@@ -237,7 +243,8 @@ probe ioscheduler_trace.elv_issue_request
|
||||
elevator_name = kernel_string(
|
||||
@choose_defined($rq->q->elevator->type->elevator_name,
|
||||
@choose_defined($rq->q->elevator->elevator_type->elevator_name,
|
||||
- $rq->q->elevator->elevator_name)), "")
|
||||
+ @choose_defined($rq->q->elevator->elevator_name,
|
||||
+ 0))), "")
|
||||
rq = $rq
|
||||
|
||||
if ($rq == 0 || $rq->rq_disk ==0) {
|
||||
@@ -272,7 +279,8 @@ probe ioscheduler_trace.elv_requeue_request
|
||||
elevator_name = kernel_string(
|
||||
@choose_defined($rq->q->elevator->type->elevator_name,
|
||||
@choose_defined($rq->q->elevator->elevator_type->elevator_name,
|
||||
- $rq->q->elevator->elevator_name)), "")
|
||||
+ @choose_defined($rq->q->elevator->elevator_name,
|
||||
+ 0))), "")
|
||||
rq = $rq
|
||||
|
||||
if ($rq == 0 || $rq->rq_disk ==0) {
|
||||
@@ -306,7 +314,8 @@ probe ioscheduler_trace.elv_abort_request
|
||||
elevator_name = kernel_string(
|
||||
@choose_defined($rq->q->elevator->type->elevator_name,
|
||||
@choose_defined($rq->q->elevator->elevator_type->elevator_name,
|
||||
- $rq->q->elevator->elevator_name)), "")
|
||||
+ @choose_defined($rq->q->elevator->elevator_name,
|
||||
+ 0))), "")
|
||||
rq = $rq
|
||||
|
||||
if ($rq == 0 || $rq->rq_disk ==0) {
|
||||
@@ -364,6 +373,9 @@ probe ioscheduler_trace.unplug_timer = kernel.trace("block_unplug_timer") ?
|
||||
|
||||
function disk_major_from_request:long(var_q:long)
|
||||
%{ /* pure */
|
||||
+#ifndef _ELEVATOR_H
|
||||
+ STAP_ERROR ("unsupported (PR28634)");
|
||||
+#else
|
||||
struct request_queue *q = (struct request_queue *)((uintptr_t)STAP_ARG_var_q);
|
||||
|
||||
/* We need to make sure there isn't a deref hazard here when
|
||||
@@ -382,10 +394,14 @@ function disk_major_from_request:long(var_q:long)
|
||||
STAP_RETVALUE = kread(&(rq_disk->major));
|
||||
}
|
||||
CATCH_DEREF_FAULT();
|
||||
+#endif
|
||||
%}
|
||||
|
||||
function disk_minor_from_request:long(var_q:long)
|
||||
%{ /* pure */
|
||||
+#ifndef _ELEVATOR_H
|
||||
+ STAP_ERROR ("unsupported (PR28634)");
|
||||
+#else
|
||||
struct request_queue *q = (struct request_queue *)((uintptr_t)STAP_ARG_var_q);
|
||||
|
||||
/* We need to make sure there isn't a deref hazard here when
|
||||
@@ -404,4 +420,6 @@ function disk_minor_from_request:long(var_q:long)
|
||||
STAP_RETVALUE = kread(&(rq_disk->first_minor));
|
||||
}
|
||||
CATCH_DEREF_FAULT();
|
||||
+#endif
|
||||
%}
|
||||
+
|
||||
diff --git a/testsuite/systemtap.examples/io/iostat-scsi.stp b/testsuite/systemtap.examples/io/iostat-scsi.stp
|
||||
index 6b1bf19ea..3faf32fe9 100755
|
||||
--- a/testsuite/systemtap.examples/io/iostat-scsi.stp
|
||||
+++ b/testsuite/systemtap.examples/io/iostat-scsi.stp
|
||||
@@ -26,6 +26,7 @@ probe module("sd_mod").function("sd_init_command") !,
|
||||
%(kernel_v >= "2.6.31" %?
|
||||
%{
|
||||
#include <linux/blkdev.h>
|
||||
+#include <linux/blk-mq.h>
|
||||
%}
|
||||
|
||||
function get_nr_sectors:long(rq:long)
|
||||
@@ -47,13 +48,24 @@ probe sd_prep_fn = module("sd_mod").function("sd_prep_fn") !,
|
||||
_cmd_flags = $rq->cmd_flags
|
||||
}
|
||||
|
||||
+function scsi_cmd_to_rq(scmd) {
|
||||
+ return scmd - @cast_module_sizeof("kernel", "request")
|
||||
+}
|
||||
+
|
||||
probe sd_init_command = module("sd_mod").function("sd_init_command") !,
|
||||
kernel.function("sd_init_command")
|
||||
{
|
||||
- device = kernel_string(@choose_defined($cmd, $SCpnt)->request->rq_disk->disk_name)
|
||||
- sector_size = @choose_defined($cmd, $SCpnt)->device->sector_size
|
||||
- nr_sectors = get_nr_sectors(@choose_defined($cmd, $SCpnt)->request)
|
||||
- _cmd_flags = @choose_defined($cmd, $SCpnt)->request->cmd_flags
|
||||
+ sector_size = @choose_defined($cmd, $SCpnt)->device->sector_size
|
||||
+ # Kernel commits aa8e25e5006aac52c943c84e9056ab488630ee19 2266a2def97ce11ec979b6c58a1b637a16eca7dd
|
||||
+ if (@defined(@choose_defined($cmd, $SCpnt)->request)) {
|
||||
+ device = kernel_string(@choose_defined($cmd, $SCpnt)->request->rq_disk->disk_name)
|
||||
+ nr_sectors = get_nr_sectors(@choose_defined($cmd, $SCpnt)->request)
|
||||
+ _cmd_flags = @choose_defined($cmd, $SCpnt)->request->cmd_flags
|
||||
+ } else {
|
||||
+ device = kernel_string(@cast(scsi_cmd_to_rq(@choose_defined($cmd, $SCpnt)), "request", "kernel")->rq_disk->disk_name)
|
||||
+ nr_sectors = get_nr_sectors(scsi_cmd_to_rq(@choose_defined($cmd, $SCpnt)))
|
||||
+ _cmd_flags = @cast(scsi_cmd_to_rq(@choose_defined($cmd, $SCpnt)), "request", "kernel")->cmd_flags
|
||||
+ }
|
||||
}
|
||||
|
||||
probe sd_prep_fn !, sd_init_command
|
||||
@@ -71,7 +83,8 @@ probe sd_prep_fn !, sd_init_command
|
||||
probe module("st").function("st_do_scsi").call !,
|
||||
kernel.function("st_do_scsi").call
|
||||
{
|
||||
- device = kernel_string($STp->disk->disk_name)
|
||||
+ # Kernel commit 45938335d0a9773d65a82a7ca722bb76e4b997a8
|
||||
+ device = kernel_string(@choose_defined($STp->disk->disk_name, $STp->name))
|
||||
devices[device] = 1
|
||||
if ($direction)
|
||||
writes[device] <<< $bytes
|
@ -1,179 +0,0 @@
|
||||
diff --git a/analysis.cxx b/analysis.cxx
|
||||
index a7a579e..d0d6a4f 100644
|
||||
--- a/analysis.cxx
|
||||
+++ b/analysis.cxx
|
||||
@@ -7,6 +7,7 @@
|
||||
// later version.
|
||||
|
||||
#include "config.h"
|
||||
+#include "session.h"
|
||||
|
||||
#ifdef HAVE_DYNINST
|
||||
|
||||
@@ -46,6 +47,8 @@ analysis::analysis(string name)
|
||||
char *name_str = strdup(name.c_str());
|
||||
sts = NULL;
|
||||
co = NULL;
|
||||
+ SymtabAPI::Symtab *symTab;
|
||||
+ bool isParsable;
|
||||
|
||||
// Use cached information if available
|
||||
if (cached_info.find(name) != cached_info.end()) {
|
||||
@@ -56,6 +59,9 @@ analysis::analysis(string name)
|
||||
|
||||
// Not not seen before
|
||||
// Create a new binary code object from the filename argument
|
||||
+ isParsable = SymtabAPI::Symtab::openFile(symTab, name_str);
|
||||
+ if(!isParsable) goto cleanup;
|
||||
+
|
||||
sts = new SymtabCodeSource(name_str);
|
||||
if(!sts) goto cleanup;
|
||||
|
||||
@@ -143,39 +149,40 @@ static const MachRegister dyninst_register_64[] = {
|
||||
static const MachRegister dyninst_register_32[1]; // No 32-bit support
|
||||
|
||||
#elif defined(__powerpc__)
|
||||
+/* For ppc64 still use the ppc32 register names */
|
||||
static const MachRegister dyninst_register_64[] = {
|
||||
- ppc64::r0,
|
||||
- ppc64::r1,
|
||||
- ppc64::r2,
|
||||
- ppc64::r3,
|
||||
- ppc64::r4,
|
||||
- ppc64::r5,
|
||||
- ppc64::r6,
|
||||
- ppc64::r7,
|
||||
- ppc64::r8,
|
||||
- ppc64::r9,
|
||||
- ppc64::r10,
|
||||
- ppc64::r11,
|
||||
- ppc64::r12,
|
||||
- ppc64::r13,
|
||||
- ppc64::r14,
|
||||
- ppc64::r15,
|
||||
- ppc64::r16,
|
||||
- ppc64::r17,
|
||||
- ppc64::r18,
|
||||
- ppc64::r19,
|
||||
- ppc64::r20,
|
||||
- ppc64::r21,
|
||||
- ppc64::r22,
|
||||
- ppc64::r23,
|
||||
- ppc64::r24,
|
||||
- ppc64::r25,
|
||||
- ppc64::r26,
|
||||
- ppc64::r27,
|
||||
- ppc64::r28,
|
||||
- ppc64::r29,
|
||||
- ppc64::r30,
|
||||
- ppc64::r31
|
||||
+ ppc32::r0,
|
||||
+ ppc32::r1,
|
||||
+ ppc32::r2,
|
||||
+ ppc32::r3,
|
||||
+ ppc32::r4,
|
||||
+ ppc32::r5,
|
||||
+ ppc32::r6,
|
||||
+ ppc32::r7,
|
||||
+ ppc32::r8,
|
||||
+ ppc32::r9,
|
||||
+ ppc32::r10,
|
||||
+ ppc32::r11,
|
||||
+ ppc32::r12,
|
||||
+ ppc32::r13,
|
||||
+ ppc32::r14,
|
||||
+ ppc32::r15,
|
||||
+ ppc32::r16,
|
||||
+ ppc32::r17,
|
||||
+ ppc32::r18,
|
||||
+ ppc32::r19,
|
||||
+ ppc32::r20,
|
||||
+ ppc32::r21,
|
||||
+ ppc32::r22,
|
||||
+ ppc32::r23,
|
||||
+ ppc32::r24,
|
||||
+ ppc32::r25,
|
||||
+ ppc32::r26,
|
||||
+ ppc32::r27,
|
||||
+ ppc32::r28,
|
||||
+ ppc32::r29,
|
||||
+ ppc32::r30,
|
||||
+ ppc32::r31
|
||||
};
|
||||
|
||||
static const MachRegister dyninst_register_32[] = {
|
||||
@@ -218,14 +225,26 @@ static const MachRegister dyninst_register_32[] = {
|
||||
typedef map<string, LivenessAnalyzer*> precomputed_liveness;
|
||||
static precomputed_liveness cached_liveness;
|
||||
|
||||
-int liveness(string executable,
|
||||
+int liveness(systemtap_session& s,
|
||||
+ target_symbol *e,
|
||||
+ string executable,
|
||||
Dwarf_Addr addr,
|
||||
location_context ctx)
|
||||
{
|
||||
+ try{
|
||||
+ // Doing this inside a try/catch because dyninst may require
|
||||
+ // too much memory to parse the binary.
|
||||
// should cache the executable names like the other things
|
||||
analysis func_to_analyze(executable);
|
||||
MachRegister r;
|
||||
|
||||
+ // Punt if unsuccessful in parsing binary
|
||||
+ if (!func_to_analyze.co){
|
||||
+ s.print_warning(_F("liveness analysis unable to parse binary %s",
|
||||
+ executable.c_str()), e->tok);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
// Determine whether 32-bit or 64-bit code as the register names are different in dyninst
|
||||
int reg_width = func_to_analyze.co->cs()->getAddressWidth();
|
||||
|
||||
@@ -282,6 +301,11 @@ int liveness(string executable,
|
||||
bool used;
|
||||
la->query(iloc, LivenessAnalyzer::Before, r, used);
|
||||
return (used ? 1 : -1);
|
||||
+ } catch (std::bad_alloc & ex){
|
||||
+ s.print_warning(_F("unable to allocate memory for liveness analysis of %s",
|
||||
+ executable.c_str()), e->tok);
|
||||
+ return 0;
|
||||
+ }
|
||||
}
|
||||
|
||||
#endif // HAVE_DYNINST
|
||||
diff --git a/analysis.h b/analysis.h
|
||||
index 9b6d115..6bea675 100644
|
||||
--- a/analysis.h
|
||||
+++ b/analysis.h
|
||||
@@ -17,13 +17,15 @@
|
||||
|
||||
#ifdef HAVE_DYNINST
|
||||
|
||||
-extern int liveness(std::string executable,
|
||||
+extern int liveness(systemtap_session& s,
|
||||
+ target_symbol *e,
|
||||
+ std::string executable,
|
||||
Dwarf_Addr location,
|
||||
location_context ctx);
|
||||
|
||||
#else
|
||||
|
||||
-#define liveness(executable, location, var) (0)
|
||||
+#define liveness(session, target, executable, location, var) (0)
|
||||
|
||||
#endif // HAVE_DYNINST
|
||||
#endif // ANALYSIS_H
|
||||
diff --git a/tapsets.cxx b/tapsets.cxx
|
||||
index 60794bb..8fc5146 100644
|
||||
--- a/tapsets.cxx
|
||||
+++ b/tapsets.cxx
|
||||
@@ -4732,7 +4732,7 @@ dwarf_var_expanding_visitor::visit_target_symbol (target_symbol *e)
|
||||
|
||||
// Now that have location information check if change to variable has any effect
|
||||
if (lvalue) {
|
||||
- if (liveness(q.dw.mod_info->elf_path, addr, ctx) < 0) {
|
||||
+ if (liveness(q.sess, e, q.dw.mod_info->elf_path, addr, ctx) < 0) {
|
||||
q.sess.print_warning(_F("write at %p will have no effect",
|
||||
(void *)addr), e->tok);
|
||||
}
|
@ -1,154 +0,0 @@
|
||||
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 209b5a19c (HEAD -> master, origin/master, origin/HEAD)
|
||||
Author: Stan Cox <scox@redhat.com>
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
--- a/includes/sys/sdt.h
|
||||
+++ b/includes/sys/sdt.h
|
||||
@@ -102,9 +102,5 @@
|
||||
# define STAP_SDT_ARG_CONSTRAINT nZr
|
||||
# elif defined __x86_64__
|
||||
-# define STAP_SDT_ARG_CONSTRAINT norfxy
|
||||
-# elif defined __aarch64__
|
||||
-# define STAP_SDT_ARG_CONSTRAINT norw
|
||||
-# elif defined __s390__ || defined __s390x__
|
||||
-# define STAP_SDT_ARG_CONSTRAINT norf
|
||||
+# define STAP_SDT_ARG_CONSTRAINT norx
|
||||
# else
|
||||
# define STAP_SDT_ARG_CONSTRAINT nor
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (systemtap-4.6.tar.gz) = 835b45597e9de0ea17857b47d542c87d155cb5c772f8595f41845a25ff06b862cb9c4b635292c3a6c66cb5255a07eee3af7cb7861110a4a05f545a4b35f11402
|
||||
SHA512 (systemtap-4.7.tar.gz) = 7d7c213dc4f7c5430f81763668da21403fbc351d1701b1096eb1ad233e3f0325e35f01dfd0a33e75f277b26fdde88c46d42dd32e32e4d4f27a45d53e2dd0f831
|
||||
|
@ -117,8 +117,8 @@ m stapdev stapdev
|
||||
|
||||
|
||||
Name: systemtap
|
||||
Version: 4.6
|
||||
Release: 11%{?release_override}%{?dist}
|
||||
Version: 4.7
|
||||
Release: 1%{?release_override}%{?dist}
|
||||
# for version, see also configure.ac
|
||||
|
||||
|
||||
@ -154,14 +154,6 @@ License: GPLv2+
|
||||
URL: http://sourceware.org/systemtap/
|
||||
Source: ftp://sourceware.org/pub/systemtap/releases/systemtap-%{version}.tar.gz
|
||||
|
||||
Patch1: rhbz2025054python3.patch
|
||||
Patch2: rhbz1972798.patch
|
||||
Patch3: sdt-asm-glibc.patch
|
||||
Patch4: rhbz2041526.patch
|
||||
Patch5: rhbz2027683.patch
|
||||
Patch6: rhbz2047256.patch
|
||||
Patch7: rhbz2039207.patch
|
||||
|
||||
# Build*
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc-c++
|
||||
@ -582,14 +574,6 @@ systemtap-runtime-virthost machine to execute systemtap scripts.
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
|
||||
%build
|
||||
|
||||
# Enable/disable the dyninst pure-userspace backend
|
||||
@ -756,6 +740,9 @@ install -m 644 initscript/logrotate.stap-server $RPM_BUILD_ROOT%{_sysconfdir}/lo
|
||||
%if %{with_systemd}
|
||||
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
|
||||
touch $RPM_BUILD_ROOT%{_unitdir}/systemtap.service
|
||||
# RHBZ2070857
|
||||
mkdir -p $RPM_BUILD_ROOT%{_presetdir}
|
||||
echo 'enable systemtap.service' > $RPM_BUILD_ROOT%{_presetdir}/42-systemtap.preset
|
||||
install -m 644 initscript/systemtap.service $RPM_BUILD_ROOT%{_unitdir}/systemtap.service
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
|
||||
install -m 755 initscript/systemtap $RPM_BUILD_ROOT%{_sbindir}/systemtap-service
|
||||
@ -937,7 +924,8 @@ exit 0
|
||||
|
||||
%post initscript
|
||||
%if %{with_systemd}
|
||||
/bin/systemctl enable systemtap.service >/dev/null 2>&1 || :
|
||||
# RHBZ2070857 - use systemd presets instead
|
||||
# /bin/systemctl enable systemtap.service >/dev/null 2>&1 || :
|
||||
%else
|
||||
/sbin/chkconfig --add systemtap
|
||||
%endif
|
||||
@ -1090,6 +1078,7 @@ exit 0
|
||||
%files devel -f systemtap.lang
|
||||
%{_bindir}/stap
|
||||
%{_bindir}/stap-prep
|
||||
%{_bindir}/stap-profile-annotate
|
||||
%{_bindir}/stap-report
|
||||
%dir %{_datadir}/systemtap
|
||||
%{_datadir}/systemtap/runtime
|
||||
@ -1190,6 +1179,7 @@ exit 0
|
||||
|
||||
%files initscript
|
||||
%if %{with_systemd}
|
||||
%{_presetdir}/42-systemtap.preset
|
||||
%{_unitdir}/systemtap.service
|
||||
%{_sbindir}/systemtap-service
|
||||
%else
|
||||
@ -1285,6 +1275,10 @@ exit 0
|
||||
|
||||
# PRERELEASE
|
||||
%changelog
|
||||
* Mon May 02 2022 Frank Ch. Eigler <fche@redhat.com> - 4.7-1
|
||||
- Upstream release, see wiki page below for detailed notes.
|
||||
https://sourceware.org/systemtap/wiki/SystemTapReleases
|
||||
|
||||
* Wed Feb 2 2022 Stan Cox <scox@redhat.com> - 4.6-11
|
||||
- rhbz2039207: Attempt userspace string access if kernel access fails
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user