merge-f25

This commit is contained in:
Frank Ch. Eigler 2017-01-25 17:27:58 -05:00
parent 39f3f199b2
commit dbf80d39eb
3 changed files with 0 additions and 300 deletions

View File

@ -1,52 +0,0 @@
commit 10c48d46fa482b8cc762592aaee6c7cc178356e7 (HEAD -> master, origin/master, origin/HEAD)
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Mon Mar 28 08:54:11 2016 -0400
PR19874: reset 60s alarm for "stap -c CMD"
Brown paper bag bug. Test case included.
diff --git a/staprun/mainloop.c b/staprun/mainloop.c
index 82c0c74fcf0c..874fbd8f8a99 100644
--- a/staprun/mainloop.c
+++ b/staprun/mainloop.c
@@ -281,6 +281,7 @@ void start_cmd(void)
raise (SIGCONT); /* Harmless; just passes control to parent. */
#endif /* !WORKAROUND_BZ467568 */
+ alarm(0); /* clear alarms */
dbug(1, "execing target_cmd %s\n", target_cmd);
/* Note that execvp() is not a direct system call; it does a $PATH
diff --git a/testsuite/systemtap.base/staprunwait.exp b/testsuite/systemtap.base/staprunwait.exp
new file mode 100644
index 000000000000..fc719730bc4c
--- /dev/null
+++ b/testsuite/systemtap.base/staprunwait.exp
@@ -0,0 +1,17 @@
+set test staprunwait
+
+if {! [installtest_p]} { untested $test; return }
+
+foreach runtime [get_runtime_list] {
+ if {$runtime != ""} {
+ set ok [catch {exec stap $srcdir/$subdir/$test.stp --runtime=$runtime -c "sleep 120"} foo]
+ } else {
+ set ok [catch {exec stap $srcdir/$subdir/$test.stp -c "sleep 120"} foo]
+ }
+ verbose -log "$ok $foo"
+ if {$ok != 0} {
+ fail "$test $runtime"
+ } else {
+ pass "$test $runtime"
+ }
+}
diff --git a/testsuite/systemtap.base/staprunwait.stp b/testsuite/systemtap.base/staprunwait.stp
new file mode 100644
index 000000000000..91cbc92446c4
--- /dev/null
+++ b/testsuite/systemtap.base/staprunwait.stp
@@ -0,0 +1,3 @@
+#! /usr/bin/env stap
+
+probe timer.s(10) { println(ctime()) }

View File

@ -1,180 +0,0 @@
commit d9409a6b848e85dfd9e0cde62d7a2ff835df503c
Author: Josh Stone <jistone@redhat.com>
Date: Thu Jul 21 11:14:12 2016 -0700
Backport fixes for kernel 4.6 to systemtap 3.0
Fedora 23 and 24 were reported broken, rhbz1358863 and rhbz1358782.
commit 8acda2cea4688b8fca910ea8780fc29594ba6085
Author: David Smith <dsmith@redhat.com>
Date: Mon Apr 11 14:07:25 2016 -0500
Fixed PR19940 by updating runtime/linux/access_process_vm.h.
* runtime/linux/access_process_vm.h: Changed page_cache_release() to
put_page().
commit e7c42c3a9fa0c442ae59a15ccf256224c27ef745
Author: David Smith <dsmith@redhat.com>
Date: Mon Apr 25 10:02:36 2016 -0500
Fix PR19990 by updating runtime/linux/access_process_vm.h.
* runtime/linux/access_process_vm.h (__access_process_vm_): Use
get_user_pages_remote() when available.
* buildrun.cxx (compile_pass): Added export test for
'get_user_pages_remote()'.
commit 15de83a3b4b298ea8fa5f86083017d062393c0db
Author: David Smith <dsmith@redhat.com>
Date: Fri May 27 11:19:03 2016 -0500
Fix PR20158 by updating the runtime for the 4.6 kernel.
* buildrun.cxx (compile_pass): Added autoconf-stacktrace_ops-int-address.c
compile test.
* stack.c: (print_stack_address): If STAPCONF_STACKTRACE_OPS_INT_ADDRESS
is defined, the function returns a int instead of being a void
function.
* runtime/linux/autoconf-stacktrace_ops-int-address.c: New autoconf-style
test.
commit 59a9c75e68ba37bc891395da7e25cbef963d1ac7
Author: David Smith <dsmith@redhat.com>
Date: Fri May 27 13:08:36 2016 -0500
Fix PR20161 by handling VM_FAULT_MINOR being removed from rawhide kernels.
* tapset/linux/memory.stp (vm_fault_contains): Handle VM_FAULT_MINOR being
undefined by treating it the same way we did when it had the value of 0.
Plus a small bonus for rhbz1358863:
commit 91bfb360f9a2405edd6cd9f1cb3527aa085fa6ca
Author: Josh Stone <jistone@redhat.com>
Date: Thu Jul 21 10:11:31 2016 -0700
pfaults.stp: correct the fault_entry_time index
Commit 31131f187a73 removed most manual tid() memoization, but missed
this particular use, and stap complained about the never-assigned 'id'.
diff --git a/buildrun.cxx b/buildrun.cxx
index 76139b46b7eb..ca8a6dff3607 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -379,6 +379,8 @@ compile_pass (systemtap_session& s)
output_autoconf(s, o, "autoconf-walk-stack.c", "STAPCONF_WALK_STACK", NULL);
output_autoconf(s, o, "autoconf-stacktrace_ops-warning.c",
"STAPCONF_STACKTRACE_OPS_WARNING", NULL);
+ output_autoconf(s, o, "autoconf-stacktrace_ops-int-address.c",
+ "STAPCONF_STACKTRACE_OPS_INT_ADDRESS", NULL);
output_autoconf(s, o, "autoconf-mm-context-vdso.c", "STAPCONF_MM_CONTEXT_VDSO", NULL);
output_autoconf(s, o, "autoconf-mm-context-vdso-base.c", "STAPCONF_MM_CONTEXT_VDSO_BASE", NULL);
output_autoconf(s, o, "autoconf-blk-types.c", "STAPCONF_BLK_TYPES", NULL);
@@ -452,6 +454,7 @@ compile_pass (systemtap_session& s)
"STAPCONF_MODULE_LAYOUT", NULL);
output_autoconf(s, o, "autoconf-mod_kallsyms.c",
"STAPCONF_MOD_KALLSYMS", NULL);
+ output_exportconf(s, o, "get_user_pages_remote", "STAPCONF_GET_USER_PAGES_REMOTE");
o << module_cflags << " += -include $(STAPCONF_HEADER)" << endl;
diff --git a/runtime/linux/access_process_vm.h b/runtime/linux/access_process_vm.h
index fa11baf0276f..214d4e2546bf 100644
--- a/runtime/linux/access_process_vm.h
+++ b/runtime/linux/access_process_vm.h
@@ -32,7 +32,11 @@ __access_process_vm_ (struct task_struct *tsk, unsigned long addr, void *buf,
int bytes, ret, offset;
void *maddr;
+#ifdef STAPCONF_GET_USER_PAGES_REMOTE
+ ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
+#else
ret = get_user_pages (tsk, mm, addr, 1, write, 1, &page, &vma);
+#endif
if (ret <= 0)
break;
@@ -52,7 +56,7 @@ __access_process_vm_ (struct task_struct *tsk, unsigned long addr, void *buf,
reader (vma, page, addr, buf, maddr + offset, bytes);
}
kunmap (page);
- page_cache_release (page);
+ put_page (page);
len -= bytes;
buf += bytes;
addr += bytes;
diff --git a/runtime/linux/autoconf-stacktrace_ops-int-address.c b/runtime/linux/autoconf-stacktrace_ops-int-address.c
new file mode 100644
index 000000000000..8ca277a6e1c3
--- /dev/null
+++ b/runtime/linux/autoconf-stacktrace_ops-int-address.c
@@ -0,0 +1,14 @@
+#include <linux/sched.h>
+#include <asm/stacktrace.h>
+
+// check for 4.6 patch which changed the function signature of
+// stacktrace_ops 'address' member.
+
+int print_stack_address(void *data __attribute__ ((unused)),
+ unsigned long addr __attribute__ ((unused)),
+ int reliable __attribute__ ((unused)))
+{
+ return 0;
+}
+
+struct stacktrace_ops ops __attribute__ ((unused)) = {.address=print_stack_address};
diff --git a/runtime/stack.c b/runtime/stack.c
index a7d03db722d5..a99bad062382 100644
--- a/runtime/stack.c
+++ b/runtime/stack.c
@@ -111,7 +111,11 @@ static int print_stack_stack(void *data, char *name)
return -1;
}
+#ifdef STAPCONF_STACKTRACE_OPS_INT_ADDRESS
+static int print_stack_address(void *data, unsigned long addr, int reliable)
+#else
static void print_stack_address(void *data, unsigned long addr, int reliable)
+#endif
{
struct print_stack_data *sdata = data;
if (sdata->skip > 0)
@@ -122,6 +126,9 @@ static void print_stack_address(void *data, unsigned long addr, int reliable)
NULL);
sdata->levels--;
}
+#ifdef STAPCONF_STACKTRACE_OPS_INT_ADDRESS
+ return 0;
+#endif
}
static const struct stacktrace_ops print_stack_ops = {
diff --git a/tapset/linux/memory.stp b/tapset/linux/memory.stp
index e2c9b3cf32b8..4546ee97c763 100644
--- a/tapset/linux/memory.stp
+++ b/tapset/linux/memory.stp
@@ -30,7 +30,7 @@ function vm_fault_contains:long (value:long, test:long)
switch (STAP_ARG_test){
case 0: res = STAP_ARG_value & VM_FAULT_OOM; break;
case 1: res = STAP_ARG_value & VM_FAULT_SIGBUS; break;
-#if defined(VM_FAULT_MINOR) && VM_FAULT_MINOR == 0
+#if !defined(VM_FAULT_MINOR) || (defined(VM_FAULT_MINOR) && VM_FAULT_MINOR == 0)
case 2: /* VM_FAULT_MINOR infered by that flags off */
res = !((VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_MAJOR) &
STAP_ARG_value);
diff --git a/testsuite/systemtap.examples/memory/pfaults.stp b/testsuite/systemtap.examples/memory/pfaults.stp
index eaf6f4e6cdc9..fd70ba3e8d51 100755
--- a/testsuite/systemtap.examples/memory/pfaults.stp
+++ b/testsuite/systemtap.examples/memory/pfaults.stp
@@ -15,7 +15,7 @@ probe vm.pagefault {
probe vm.pagefault.return {
t=gettimeofday_us()
if (!(tid() in fault_entry_time)) next
- e = t - fault_entry_time[id]
+ e = t - fault_entry_time[tid()]
if (vm_fault_contains(fault_type,VM_FAULT_MINOR)) {
ftype="minor"
} else if (vm_fault_contains(fault_type,VM_FAULT_MAJOR)) {

View File

@ -1,68 +0,0 @@
commit 8f888904d8de9a798e4664caa373ea552366b304
Author: David Smith <dsmith@redhat.com>
Date: Mon May 23 13:56:29 2016 -0500
Fix PR20132 by updating the runtime to handle a 'struct inode' change.
* runtime/transport/transport.c (_stp_lock_inode): Use the new inode
lock/unlock routines.
(_stp_unlock_inode): Ditto.
* buildrun.cxx (compile_pass): Add autoconf-inode-rwsem test.
* runtime/linux/autoconf-inode-rwsem.c: New 'autoconf' test.
diff --git a/buildrun.cxx b/buildrun.cxx
index 8cf4b36b186e..27e2be6a2dc3 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -321,6 +321,7 @@ compile_pass (systemtap_session& s)
output_autoconf(s, o, "autoconf-generated-compile.c", "STAPCONF_GENERATED_COMPILE", NULL);
output_autoconf(s, o, "autoconf-hrtimer-getset-expires.c", "STAPCONF_HRTIMER_GETSET_EXPIRES", NULL);
output_autoconf(s, o, "autoconf-inode-private.c", "STAPCONF_INODE_PRIVATE", NULL);
+ output_autoconf(s, o, "autoconf-inode-rwsem.c", "STAPCONF_INODE_RWSEM", NULL);
output_autoconf(s, o, "autoconf-constant-tsc.c", "STAPCONF_CONSTANT_TSC", NULL);
output_autoconf(s, o, "autoconf-ktime-get-real.c", "STAPCONF_KTIME_GET_REAL", NULL);
output_autoconf(s, o, "autoconf-x86-uniregs.c", "STAPCONF_X86_UNIREGS", NULL);
diff --git a/runtime/linux/autoconf-inode-rwsem.c b/runtime/linux/autoconf-inode-rwsem.c
new file mode 100644
index 000000000000..8ca4a4accbd9
--- /dev/null
+++ b/runtime/linux/autoconf-inode-rwsem.c
@@ -0,0 +1,5 @@
+#include <linux/fs.h>
+
+// check for 4.6 inode patch which changed i_mutex to i_rwsem
+
+struct inode i __attribute__ ((unused)) = {.i_rwsem=__RWSEM_INITIALIZER(i.i_rwsem)};
diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c
index bbc61d25881d..d19eb1ee3831 100644
--- a/runtime/transport/transport.c
+++ b/runtime/transport/transport.c
@@ -490,20 +490,28 @@ static int _stp_transport_init(void)
static inline void _stp_lock_inode(struct inode *inode)
{
+#ifdef STAPCONF_INODE_RWSEM
+ inode_lock(inode);
+#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
mutex_lock(&inode->i_mutex);
#else
down(&inode->i_sem);
#endif
+#endif
}
static inline void _stp_unlock_inode(struct inode *inode)
{
+#ifdef STAPCONF_INODE_RWSEM
+ inode_unlock(inode);
+#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
mutex_unlock(&inode->i_mutex);
#else
up(&inode->i_sem);
#endif
+#endif
}
static struct dentry *_stp_lockfile = NULL;