From 369b0894f052ee2183b15aa0f841ee141ba4c98c Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Fri, 10 Mar 2017 13:57:26 -0500 Subject: [PATCH 1/5] Rebuild for dyninst 9.3 --- systemtap.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/systemtap.spec b/systemtap.spec index 244fe64..e5a2afe 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -72,7 +72,7 @@ Name: systemtap Version: 3.1 -Release: 1%{?dist} +Release: 2%{?dist} # for version, see also configure.ac @@ -1139,6 +1139,9 @@ done # PRERELEASE %changelog +* Fri Mar 10 2017 Stan Cox - 3.1-2 +- Rebuild for dyninst 9.3 + * Fri Feb 17 2017 Frank Ch. Eigler - 3.1-1 - Upstream release. From 61c8529211735920e727ed23467edd2f276a2fcc Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Thu, 16 Mar 2017 16:48:33 -0400 Subject: [PATCH 2/5] rebuild for dyninst 9.3.1 --- systemtap.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/systemtap.spec b/systemtap.spec index 244fe64..bf9276c 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -72,7 +72,7 @@ Name: systemtap Version: 3.1 -Release: 1%{?dist} +Release: 2%{?dist} # for version, see also configure.ac @@ -1139,6 +1139,9 @@ done # PRERELEASE %changelog +* Thu Mar 16 2017 Stan Cox - 3.1-2 +- Rebuild for dyninst 9.3 + * Fri Feb 17 2017 Frank Ch. Eigler - 3.1-1 - Upstream release. From cdc8fbe05c370db1d552d35ed197296244a122a4 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 6 Apr 2017 17:06:04 -0400 Subject: [PATCH 3/5] rhbz1439914 --- bz1439914.patch | 36 ++++++++++++++++++++++++++++++++++++ systemtap.spec | 8 +++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 bz1439914.patch diff --git a/bz1439914.patch b/bz1439914.patch new file mode 100644 index 0000000..22d273a --- /dev/null +++ b/bz1439914.patch @@ -0,0 +1,36 @@ +commit 272146660f54786bb61d388f6d3a4eb20e7d9369 (origin/master2, master2) +Author: Jakub Jelinek +Date: Tue Mar 21 17:04:08 2017 -0400 + + gcc PR80115: sys/sdt.h: tweak i386 argument passing + + Use %w[arg] to request that widened forms of register names be passed + to the sys/sdt.h macro operand strings, so as to avoid nominating + sub-registers such as %sil within -m32 code, which gcc <= 6 sometimes + buggily did. + +diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h +index 3b7eda7976d1..eff315bcd885 100644 +--- a/includes/sys/sdt.h ++++ b/includes/sys/sdt.h +@@ -82,9 +82,11 @@ + # define _SDT_ASM_STRING_1(x) _SDT_ASM_1(.asciz #x) + + # define _SDT_ARGFMT(no) %n[_SDT_S##no]@_SDT_ARGTMPL(_SDT_A##no) ++ + # ifndef STAP_SDT_ARG_CONSTRAINT + # define STAP_SDT_ARG_CONSTRAINT nor + # endif ++ + # define _SDT_STRINGIFY(x) #x + # define _SDT_ARG_CONSTRAINT_STRING(x) _SDT_STRINGIFY(x) + # define _SDT_ARG(n, x) \ +@@ -173,6 +175,8 @@ __extension__ extern unsigned long long __sdt_unsp; + + #if defined __powerpc__ || defined __powerpc64__ + # define _SDT_ARGTMPL(id) %I[id]%[id] ++#elif defined __i386__ ++# define _SDT_ARGTMPL(id) %w[id] /* gcc.gnu.org/PR80115 */ + #else + # define _SDT_ARGTMPL(id) %[id] + #endif diff --git a/systemtap.spec b/systemtap.spec index bf9276c..406b28b 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -72,7 +72,7 @@ Name: systemtap Version: 3.1 -Release: 2%{?dist} +Release: 3%{?dist} # for version, see also configure.ac @@ -186,6 +186,8 @@ BuildRequires: python3-devel BuildRequires: python3-setuptools %endif +Patch10: bz1439914.patch + # Install requirements Requires: systemtap-client = %{version}-%{release} Requires: systemtap-devel = %{version}-%{release} @@ -461,6 +463,7 @@ systemtap-runtime-virthost machine to execute systemtap scripts. %prep %setup -q %{?setup_elfutils} +%patch10 -p1 %if %{with_bundled_elfutils} cd elfutils-%{elfutils_version} @@ -1139,6 +1142,9 @@ done # PRERELEASE %changelog +* Thu Apr 06 2017 Frank Ch. Eigler - 3.1-3 +- Backport bz1439914 (sys/sdt.h argument encoding) + * Thu Mar 16 2017 Stan Cox - 3.1-2 - Rebuild for dyninst 9.3 From 43d514b85622d4b7362e4f5e1b7937f924a65b3a Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Mon, 15 May 2017 15:38:09 -0400 Subject: [PATCH 4/5] kernel 4.11 support --- bz1448099.1.patch | 55 +++++++++++++++++ bz1448099.2.patch | 37 ++++++++++++ bz1448099.3.patch | 42 +++++++++++++ bz1448099.4.patch | 43 ++++++++++++++ bz1448099.5.patch | 72 ++++++++++++++++++++++ bz1448099.6.patch | 48 +++++++++++++++ bz1448099.7.1.patch | 36 +++++++++++ bz1448099.7.patch | 142 ++++++++++++++++++++++++++++++++++++++++++++ bz1448099.8.patch | 65 ++++++++++++++++++++ systemtap.spec | 26 +++++++- 10 files changed, 565 insertions(+), 1 deletion(-) create mode 100644 bz1448099.1.patch create mode 100644 bz1448099.2.patch create mode 100644 bz1448099.3.patch create mode 100644 bz1448099.4.patch create mode 100644 bz1448099.5.patch create mode 100644 bz1448099.6.patch create mode 100644 bz1448099.7.1.patch create mode 100644 bz1448099.7.patch create mode 100644 bz1448099.8.patch diff --git a/bz1448099.1.patch b/bz1448099.1.patch new file mode 100644 index 0000000..79c6f13 --- /dev/null +++ b/bz1448099.1.patch @@ -0,0 +1,55 @@ +commit 62640f2ed0deef9355970d216136ad4c49afa3d0 +Author: David Smith +Date: Fri Mar 17 09:36:42 2017 -0500 + + PR21255: Fix missing get_task_mm() declaration. + + * buildrun.cxx (compile_pass): Add autoconf test. This + was caused by the following kernel commit: + + commit 6e84f31522f931027bf695752087ece278c10d3f + Author: Ingo Molnar + Date: Wed Feb 8 18:51:29 2017 +0100 + + sched/headers: Prepare for new header dependencies before moving + code to + * runtime/linux/access_process_vm.h: Include and, if it + exists, . + * runtime/linux/autoconf-sched-mm.c: New file. + +diff --git a/buildrun.cxx b/buildrun.cxx +index aaea64c..644eea9 100644 +--- a/buildrun.cxx ++++ b/buildrun.cxx +@@ -402,6 +402,7 @@ compile_pass (systemtap_session& s) + output_autoconf(s, o, "autoconf-netfilter-4_4.c", "STAPCONF_NETFILTER_V44", NULL); + output_autoconf(s, o, "autoconf-smpcall-5args.c", "STAPCONF_SMPCALL_5ARGS", NULL); + output_autoconf(s, o, "autoconf-smpcall-4args.c", "STAPCONF_SMPCALL_4ARGS", NULL); ++ output_autoconf(s, o, "autoconf-sched-mm.c", "STAPCONF_SCHED_MM_H", NULL); + + // used by tapset/timestamp_monotonic.stp + output_exportconf(s, o, "cpu_clock", "STAPCONF_CPU_CLOCK"); +diff --git a/runtime/linux/access_process_vm.h b/runtime/linux/access_process_vm.h +index 22a1220..a46b86f 100644 +--- a/runtime/linux/access_process_vm.h ++++ b/runtime/linux/access_process_vm.h +@@ -3,6 +3,10 @@ + * some distros export it on some architectures. To workaround this inconsistency, + * we copied and pasted it here. Fortunately, everything it calls is exported. + */ ++#include ++#ifdef STAPCONF_SCHED_MM_H ++#include ++#endif + #include + #include + +diff --git a/runtime/linux/autoconf-sched-mm.c b/runtime/linux/autoconf-sched-mm.c +new file mode 100644 +index 0000000..6d3f1c2 +--- /dev/null ++++ b/runtime/linux/autoconf-sched-mm.c +@@ -0,0 +1,3 @@ ++#include ++#include ++ diff --git a/bz1448099.2.patch b/bz1448099.2.patch new file mode 100644 index 0000000..03f203f --- /dev/null +++ b/bz1448099.2.patch @@ -0,0 +1,37 @@ +commit a477a43122609691ce6ef24f71114cfaa9790392 +Author: David Smith +Date: Fri Mar 17 10:44:12 2017 -0500 + + PR21255: Fix missing __set_task_state() definition. + + * runtime/stp_utrace.c: Fix missing __set_task_state() definition. If we + can't find a __set_task_state() definition, define our own. + +diff --git a/runtime/stp_utrace.c b/runtime/stp_utrace.c +index bb2d663..5924016 100644 +--- a/runtime/stp_utrace.c ++++ b/runtime/stp_utrace.c +@@ -29,6 +29,14 @@ + + #include "stp_helper_lock.h" + ++#if defined(__set_task_state) ++#define __stp_set_task_state(tsk, state_value) \ ++ __set_task_state((tsk), (state_value)) ++#else ++#define __stp_set_task_state(tsk, state_value) \ ++ do { (tsk)->state = (state_value); } while (0) ++#endif ++ + /* + * Per-thread structure private to utrace implementation. + * If task_struct.utrace_flags is nonzero, task_struct.utrace +@@ -1105,7 +1113,7 @@ static bool utrace_do_stop(struct task_struct *target, struct utrace *utrace) + */ + spin_lock_irq(&target->sighand->siglock); + if (likely(task_is_stopped(target))) +- __set_task_state(target, TASK_TRACED); ++ __stp_set_task_state(target, TASK_TRACED); + spin_unlock_irq(&target->sighand->siglock); + } else if (utrace->resume > UTRACE_REPORT) { + utrace->resume = UTRACE_REPORT; diff --git a/bz1448099.3.patch b/bz1448099.3.patch new file mode 100644 index 0000000..acf2f3d --- /dev/null +++ b/bz1448099.3.patch @@ -0,0 +1,42 @@ +commit 030e9465eadf7d3b3a278951264dac83b2f4b4f7 +Author: David Smith +Date: Wed Feb 22 10:04:00 2017 -0600 + + Update the vfs.stp tapset for newer kernels. + + * tapset/linux/vfs.stp: Since the __block_write_begin() function can be + inlined on newer kernels, we'll also probe + __block_write_begin_int(). Also, check to see if '$file' is defined + before using it in _vfs.block_write_begin.return. + +diff --git a/tapset/linux/vfs.stp b/tapset/linux/vfs.stp +index 4572bd7..32db300 100644 +--- a/tapset/linux/vfs.stp ++++ b/tapset/linux/vfs.stp +@@ -1104,7 +1104,8 @@ probe _vfs.generic_commit_write = kernel.function("generic_commit_write") ? + argstr = sprintf("%p, %p, %d, %d", $file, $page, $from, $to) + } + +-probe _vfs.block_prepare_write = kernel.function("__block_write_begin") !, ++probe _vfs.block_prepare_write = kernel.function("__block_write_begin_int") !, ++ kernel.function("__block_write_begin") !, + kernel.function("__block_prepare_write") + { + page = $page +@@ -1134,6 +1135,7 @@ probe _vfs.block_prepare_write = kernel.function("__block_write_begin") !, + } + + probe _vfs.block_prepare_write.return = ++ kernel.function("__block_write_begin_int").return !, + kernel.function("__block_write_begin").return !, + kernel.function("__block_prepare_write").return + { +@@ -1188,7 +1190,7 @@ probe _vfs.block_write_begin.return = + name = "_vfs.block_write_begin" + retstr = sprintf("%d", $return) + +- file = @entry($file) ++ file = @choose_defined(@entry($file), "") + pathname = @defined(@entry($file)) ? fullpath_struct_file(task_current(), @entry($file)) : "" + pos = @entry($pos) + len = @entry($len) diff --git a/bz1448099.4.patch b/bz1448099.4.patch new file mode 100644 index 0000000..158f309 --- /dev/null +++ b/bz1448099.4.patch @@ -0,0 +1,43 @@ +commit 5ab0c875df5011725f9cd2f0804c00bf9e63d492 +Author: David Smith +Date: Thu Mar 2 15:23:28 2017 -0600 + + Fix s390x compile error in runtime/stack-s390.c. + + * runtime/stack-s390.c (__stp_stack_print): Update code to let it compile + on the 4.10 kernel. Kernel commit d5c352c moved 'thread_info' into + task_struct. + +diff --git a/runtime/stack-s390.c b/runtime/stack-s390.c +index 38eb73f..56043fc 100644 +--- a/runtime/stack-s390.c ++++ b/runtime/stack-s390.c +@@ -11,7 +11,6 @@ static unsigned long + __stp_show_stack (unsigned long sp, unsigned long low, + unsigned long high, int verbose) + { +- + struct stack_frame *sf; + struct pt_regs *regs; + unsigned long ip; +@@ -62,9 +61,18 @@ static void __stp_stack_print (struct pt_regs *regs, + + sp = __stp_show_stack(sp, + S390_lowcore.async_stack - ASYNC_SIZE, +- S390_lowcore.async_stack,verbose); ++ S390_lowcore.async_stack, verbose); + ++#ifdef CONFIG_THREAD_INFO_IN_TASK ++ /* FIXME: Note that this CONFIG_THREAD_INFO_IN_TASK ++ * code is untested, since the s390 uses the dwarf ++ * unwinder so this code doesn't get called. */ ++ __stp_show_stack(sp, ((unsigned long)current->stack), ++ (((unsigned long)current->stack) ++ + THREAD_SIZE), verbose); ++#else + __stp_show_stack(sp, + S390_lowcore.thread_info, +- S390_lowcore.thread_info + THREAD_SIZE,verbose); ++ S390_lowcore.thread_info + THREAD_SIZE, verbose); ++#endif + } diff --git a/bz1448099.5.patch b/bz1448099.5.patch new file mode 100644 index 0000000..72a57ed --- /dev/null +++ b/bz1448099.5.patch @@ -0,0 +1,72 @@ +commit 386b8596d721e93ad618e682ecddb323d2bee446 +Author: David Smith +Date: Thu Mar 2 15:25:17 2017 -0600 + + Fix s390x-specific syscall tests. + + * testsuite/buildok/syscalls-arch-detailed.stp: Made s390x probe tests + optional, since the underlying probes don't exist on the 4.10 kernel. + * testsuite/buildok/nd_syscalls-arch-detailed.stp: Ditto. + +diff --git a/testsuite/buildok/nd_syscalls-arch-detailed.stp b/testsuite/buildok/nd_syscalls-arch-detailed.stp +index 364b13e..b927d15 100755 +--- a/testsuite/buildok/nd_syscalls-arch-detailed.stp ++++ b/testsuite/buildok/nd_syscalls-arch-detailed.stp +@@ -429,22 +429,22 @@ probe nd_syscall.ppc64_newuname.return ? + # + + %( arch == "s390" %? +-probe nd_syscall.getresgid16 ++probe nd_syscall.getresgid16 ? + { + printf("%s, %s\n", name, argstr) + printf("%p, %p, %p\n", rgid_uaddr, egid_uaddr, sgid_uaddr) + } +-probe nd_syscall.getresgid16.return ++probe nd_syscall.getresgid16.return ? + { + printf("%s, %s\n", name, retstr) + } + +-probe nd_syscall.getresuid16 ++probe nd_syscall.getresuid16 ? + { + printf("%s, %s\n", name, argstr) + printf("%p, %p, %p\n", ruid_uaddr, euid_uaddr, suid_uaddr) + } +-probe nd_syscall.getresuid16.return ++probe nd_syscall.getresuid16.return ? + { + printf("%s, %s\n", name, retstr) + } +diff --git a/testsuite/buildok/syscalls-arch-detailed.stp b/testsuite/buildok/syscalls-arch-detailed.stp +index 8d7d21e..914da9e 100755 +--- a/testsuite/buildok/syscalls-arch-detailed.stp ++++ b/testsuite/buildok/syscalls-arch-detailed.stp +@@ -429,22 +429,22 @@ probe syscall.ppc64_newuname.return ? + # + + %( arch == "s390" %? +-probe syscall.getresgid16 ++probe syscall.getresgid16 ? + { + printf("%s, %s\n", name, argstr) + printf("%p, %p, %p\n", rgid_uaddr, egid_uaddr, sgid_uaddr) + } +-probe syscall.getresgid16.return ++probe syscall.getresgid16.return ? + { + printf("%s, %s\n", name, retstr) + } + +-probe syscall.getresuid16 ++probe syscall.getresuid16 ? + { + printf("%s, %s\n", name, argstr) + printf("%p, %p, %p\n", ruid_uaddr, euid_uaddr, suid_uaddr) + } +-probe syscall.getresuid16.return ++probe syscall.getresuid16.return ? + { + printf("%s, %s\n", name, retstr) + } diff --git a/bz1448099.6.patch b/bz1448099.6.patch new file mode 100644 index 0000000..a781eba --- /dev/null +++ b/bz1448099.6.patch @@ -0,0 +1,48 @@ +commit 9f1c7a872e7a13d1ee29b692d0f1f4dd18a07baa +Author: David Smith +Date: Tue May 9 16:20:41 2017 -0500 + + Avoid missing "task_stack()" definition on 4.11 kernels. + + * runtime/compatdefs.h: If exists, include + it. This avoids a missing task_stack() definition. + * buildrun.cxx (compile_pass): Add autoconf test for + . + * runtime/linux/autoconf-sched-task_stack.c: New file. + +diff --git a/buildrun.cxx b/buildrun.cxx +index 21ed3c5..6da308a 100644 +--- a/buildrun.cxx ++++ b/buildrun.cxx +@@ -403,6 +403,7 @@ compile_pass (systemtap_session& s) + output_autoconf(s, o, "autoconf-smpcall-5args.c", "STAPCONF_SMPCALL_5ARGS", NULL); + output_autoconf(s, o, "autoconf-smpcall-4args.c", "STAPCONF_SMPCALL_4ARGS", NULL); + output_autoconf(s, o, "autoconf-sched-mm.c", "STAPCONF_SCHED_MM_H", NULL); ++ output_autoconf(s, o, "autoconf-sched-task_stack.c", "STAPCONF_SCHED_TASK_STACK_H", NULL); + + // used by tapset/timestamp_monotonic.stp + output_exportconf(s, o, "cpu_clock", "STAPCONF_CPU_CLOCK"); +diff --git a/runtime/compatdefs.h b/runtime/compatdefs.h +index ba429b5..f261bfd 100644 +--- a/runtime/compatdefs.h ++++ b/runtime/compatdefs.h +@@ -57,6 +57,10 @@ static inline int _stp_is_compat_task(void) + */ + #include + #include ++#include ++#ifdef STAPCONF_SCHED_TASK_STACK_H ++#include ++#endif + + #if !defined(task_pt_regs) + #if defined(__powerpc__) +diff --git a/runtime/linux/autoconf-sched-task_stack.c b/runtime/linux/autoconf-sched-task_stack.c +new file mode 100644 +index 0000000..cdfcc60 +--- /dev/null ++++ b/runtime/linux/autoconf-sched-task_stack.c +@@ -0,0 +1,3 @@ ++#include ++#include ++ diff --git a/bz1448099.7.1.patch b/bz1448099.7.1.patch new file mode 100644 index 0000000..96d1db5 --- /dev/null +++ b/bz1448099.7.1.patch @@ -0,0 +1,36 @@ +diff --git a/tapset/linux/proc_mem.stp b/tapset/linux/proc_mem.stp +index 4b20686..890be69 100644 +--- a/tapset/linux/proc_mem.stp ++++ b/tapset/linux/proc_mem.stp +@@ -155,7 +155,7 @@ function proc_mem_size_pid:long (pid:long) + if (_stp_valid_task(task)) { + mm = task->mm + if (mm != 0) +- return mm->total_vm ++ return @mm(mm)->total_vm + } + return 0 + } +@@ -322,8 +322,8 @@ function proc_mem_txt_pid:long (pid:long) + if (_stp_valid_task(task)) { + mm = task->mm + if (mm != 0) { +- s = mm->start_code +- e = mm->end_code ++ s = @mm(mm)->start_code ++ e = @mm(mm)->end_code + return _stp_mem_txt_adjust (s, e) + } + } +@@ -381,8 +381,9 @@ function proc_mem_data_pid:long (pid:long) + if (_stp_valid_task(task)) { + mm = task->mm + if (mm != 0) { +- return (@defined(&@mm(0)->data_vm) ? (mm->data_vm + mm->stack_vm) +- : (mm->total_vm - mm->shared_vm)) ++ return (@defined(&@mm(0)->data_vm) ++ ? (@mm(mm)->data_vm + @mm(mm)->stack_vm) ++ : (@mm(mm)->total_vm - @mm(mm)->shared_vm)) + } + } + return 0 diff --git a/bz1448099.7.patch b/bz1448099.7.patch new file mode 100644 index 0000000..c2757a8 --- /dev/null +++ b/bz1448099.7.patch @@ -0,0 +1,142 @@ +commit c7029a89f5f1ff6d6a7008e8bccb797046f8af50 +Author: David Smith +Date: Tue May 9 16:32:25 2017 -0500 + + Add missing @cast() calls for 4.11 kernels. + + * tapset/linux/task.stp: Add a "signal_struct" cast to + _task_rlimit_cur(). + * tapset/linux/task.stpm: Fix @mm() macro for kernels >= 2.6.34, where the + mm_struct definition has moved to + * tapset/linux/proc_mem.stp (proc_mem_size): Use the @mm() macro to cast + values to a mm_struct. + (proc_mem_txt): Ditto. + (proc_mem_data): Ditto. + * tapset/linux/context.stp (cmdline_args): Ditto. + * tapset/linux/context-envvar.stp (env_var): Ditto. + +diff --git a/tapset/linux/context-envvar.stp b/tapset/linux/context-envvar.stp +index 4d4c648..2ceb6c8 100644 +--- a/tapset/linux/context-envvar.stp ++++ b/tapset/linux/context-envvar.stp +@@ -28,8 +28,8 @@ function env_var:string(name:string) + mm = task_current()->mm; + if (mm) + { +- env_start = mm->env_start; +- env_end = mm->env_end; ++ env_start = @mm(mm)->env_start; ++ env_end = @mm(mm)->env_end; + if (env_start != 0 && env_end != 0) + { + len = env_end - env_start; +diff --git a/tapset/linux/context.stp b/tapset/linux/context.stp +index e563983..8ab81b4 100644 +--- a/tapset/linux/context.stp ++++ b/tapset/linux/context.stp +@@ -559,8 +559,8 @@ function cmdline_args:string(n:long, m:long, delim:string) + if (__mm == 0) + return ""; + +- __arg_start = __mm->arg_start; +- __arg_end = __mm->arg_end; ++ __arg_start = @mm(__mm)->arg_start; ++ __arg_end = @mm(__mm)->arg_end; + if (__arg_start == 0 || __arg_end == 0) + return ""; + +diff --git a/tapset/linux/proc_mem.stp b/tapset/linux/proc_mem.stp +index de6f423..161033d 100644 +--- a/tapset/linux/proc_mem.stp ++++ b/tapset/linux/proc_mem.stp +@@ -124,7 +124,7 @@ function proc_mem_size:long () + if (_stp_valid_task(task)) { + mm = task->mm + if (mm != 0) +- return mm->total_vm ++ return @mm(mm)->total_vm + } + return 0 + } +@@ -144,7 +144,7 @@ function proc_mem_size:long (pid:long) + if (_stp_valid_task(task)) { + mm = task->mm + if (mm != 0) +- return mm->total_vm ++ return @mm(mm)->total_vm + } + return 0 + } +@@ -260,8 +260,8 @@ function proc_mem_txt:long () + if (_stp_valid_task(task)) { + mm = task->mm + if (mm != 0) { +- s = mm->start_code +- e = mm->end_code ++ s = @mm(mm)->start_code ++ e = @mm(mm)->end_code + return _stp_mem_txt_adjust(s, e) + } + } +@@ -283,8 +283,8 @@ function proc_mem_txt:long (pid:long) + if (_stp_valid_task(task)) { + mm = task->mm + if (mm != 0) { +- s = mm->start_code +- e = mm->end_code ++ s = @mm(mm)->start_code ++ e = @mm(mm)->end_code + return _stp_mem_txt_adjust (s, e) + } + } +@@ -308,8 +308,9 @@ function proc_mem_data:long () + if (_stp_valid_task(task)) { + mm = task->mm + if (mm != 0) { +- return (@defined(&@mm(0)->data_vm) ? (mm->data_vm + mm->stack_vm) +- : (mm->total_vm - mm->shared_vm)) ++ return (@defined(&@mm(0)->data_vm) ++ ? (@mm(mm)->data_vm + @mm(mm)->stack_vm) ++ : (@mm(mm)->total_vm - @mm(mm)->shared_vm)) + } + } + return 0 +@@ -330,8 +331,9 @@ function proc_mem_data:long (pid:long) + if (_stp_valid_task(task)) { + mm = task->mm + if (mm != 0) { +- return (@defined(&@mm(0)->data_vm) ? (mm->data_vm + mm->stack_vm) +- : (mm->total_vm - mm->shared_vm)) ++ return (@defined(&@mm(0)->data_vm) ++ ? (@mm(mm)->data_vm + @mm(mm)->stack_vm) ++ : (@mm(mm)->total_vm - @mm(mm)->shared_vm)) + } + } + return 0 +diff --git a/tapset/linux/task.stp b/tapset/linux/task.stp +index 5467e05..f7c852e 100644 +--- a/tapset/linux/task.stp ++++ b/tapset/linux/task.stp +@@ -40,7 +40,7 @@ function task_current:long () { + return -1; + } + sig = @task(task)->signal; +- return sig->rlim[nd_limit]->rlim_cur; ++ return @cast(sig, "signal_struct")->rlim[nd_limit]->rlim_cur; + } + + /* sfunction task_rlimit - The current resource limit of the task +diff --git a/tapset/linux/task.stpm b/tapset/linux/task.stpm +index 7df04e3..f1bfb8e 100644 +--- a/tapset/linux/task.stpm ++++ b/tapset/linux/task.stpm +@@ -3,5 +3,9 @@ + %) + + @define mm(ptr) %( ++ %( kernel_v >= "2.6.34" %? ++ @cast(@ptr, "mm_struct", "kernel") ++ %: + @cast(@ptr, "mm_struct", "kernel") ++ %) + %) diff --git a/bz1448099.8.patch b/bz1448099.8.patch new file mode 100644 index 0000000..45c8a72 --- /dev/null +++ b/bz1448099.8.patch @@ -0,0 +1,65 @@ +commit 35ea394c93d3c296c0c809d21bc397b531b7e965 +Author: David Smith +Date: Tue May 9 16:39:11 2017 -0500 + + Add small testsuite fixes for 4.11 kernels. + + * testsuite/buildok/twentyseven.stp: Avoid missing inlined function + arguments by probing 'kernel.function("do_execve").call'. + * testsuite/buildok/thirtyone.stp: On 4.11 kernels, handle the vfs_stat() + function being renamed to vfs_statx(). + * testsuite/systemtap.pass1-4/buildok.exp: Add kfails for + buildok/fortyfour.stp and buildok/map_probe_cond.stp if we don't have + uprobes. + * testsuite/systemtap.pass1-4/buildok-interactive.exp: Ditto. + +diff --git a/testsuite/buildok/thirtyone.stp b/testsuite/buildok/thirtyone.stp +index ccba660..e7e102d 100755 +--- a/testsuite/buildok/thirtyone.stp ++++ b/testsuite/buildok/thirtyone.stp +@@ -1,5 +1,5 @@ + #! stap -wp4 + +-probe kprobe.function("vfs_stat") {} ++probe kprobe.function("vfs_stat")!, kprobe.function("vfs_statx") ? {} + probe kprobe.function("do_sys_open") {} + probe kernel.function("filp_close") {} +diff --git a/testsuite/buildok/twentyseven.stp b/testsuite/buildok/twentyseven.stp +index 62900f3..a3cbfde 100755 +--- a/testsuite/buildok/twentyseven.stp ++++ b/testsuite/buildok/twentyseven.stp +@@ -1,6 +1,6 @@ + #! stap -p4 + +-probe kernel.function("do_execve") ++probe kernel.function("do_execve").call + { + print(@defined($__argv) ? $__argv[0] : $argv[0]) + } +diff --git a/testsuite/systemtap.pass1-4/buildok-interactive.exp b/testsuite/systemtap.pass1-4/buildok-interactive.exp +index fc4a019..d15640f 100644 +--- a/testsuite/systemtap.pass1-4/buildok-interactive.exp ++++ b/testsuite/systemtap.pass1-4/buildok-interactive.exp +@@ -188,6 +188,9 @@ foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { + # without utrace. + if {$rc == 1 && ![utrace_p]} { setup_kfail UTRACE *-*-*} } + ++ buildok/fortyfour.stp - ++ buildok/map_probe_cond.stp - ++ buildok/pretty-uprobes.stp - + buildok/pretty-uprobes.stp - + buildok/ucontext-symbols-embedded.stp - + buildok/ucontext-unwind-embedded.stp { +diff --git a/testsuite/systemtap.pass1-4/buildok.exp b/testsuite/systemtap.pass1-4/buildok.exp +index 3926b7f..79f2217 100644 +--- a/testsuite/systemtap.pass1-4/buildok.exp ++++ b/testsuite/systemtap.pass1-4/buildok.exp +@@ -40,6 +40,8 @@ foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { + # without utrace. + if {$rc != 0 && ![utrace_p]} { setup_kfail UTRACE *-*-*} } + ++ buildok/fortyfour.stp - ++ buildok/map_probe_cond.stp - + buildok/pretty-uprobes.stp - + buildok/ucontext-symbols-embedded.stp - + buildok/ucontext-unwind-embedded.stp { diff --git a/systemtap.spec b/systemtap.spec index 406b28b..fe2cbfd 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -72,7 +72,7 @@ Name: systemtap Version: 3.1 -Release: 3%{?dist} +Release: 5%{?dist} # for version, see also configure.ac @@ -187,6 +187,16 @@ BuildRequires: python3-setuptools %endif Patch10: bz1439914.patch +Patch21: bz1448099.1.patch +Patch22: bz1448099.2.patch +Patch23: bz1448099.3.patch +Patch24: bz1448099.4.patch +Patch25: bz1448099.5.patch +Patch26: bz1448099.6.patch +Patch27: bz1448099.7.patch +Patch28: bz1448099.7.1.patch +Patch29: bz1448099.8.patch + # Install requirements Requires: systemtap-client = %{version}-%{release} @@ -475,6 +485,17 @@ find . \( -name configure -o -name config.h.in \) -print | xargs touch cd .. %endif +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 +%patch27 -p1 +%patch28 -p1 +%patch29 -p1 + + %build %if %{with_bundled_elfutils} @@ -1142,6 +1163,9 @@ done # PRERELEASE %changelog +* Mon May 15 2017 Frank Ch. Eigler - 3.1-5 +- Build with dsmith's bz1448099 patches for support of kernel 4.11 + * Thu Apr 06 2017 Frank Ch. Eigler - 3.1-3 - Backport bz1439914 (sys/sdt.h argument encoding) From f6d32ace8fa19c1f583cd4186cd7e200dc50bd46 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 18 Oct 2017 14:20:46 -0400 Subject: [PATCH 5/5] upstream 3.2 release --- bz1439914.patch | 36 ----------- bz1448099.1.patch | 55 ----------------- bz1448099.2.patch | 37 ------------ bz1448099.3.patch | 42 ------------- bz1448099.4.patch | 43 -------------- bz1448099.5.patch | 72 ---------------------- bz1448099.6.patch | 48 --------------- bz1448099.7.1.patch | 36 ----------- bz1448099.7.patch | 142 -------------------------------------------- bz1448099.8.patch | 65 -------------------- sources | 2 +- systemtap.spec | 61 ++++++++----------- 12 files changed, 26 insertions(+), 613 deletions(-) delete mode 100644 bz1439914.patch delete mode 100644 bz1448099.1.patch delete mode 100644 bz1448099.2.patch delete mode 100644 bz1448099.3.patch delete mode 100644 bz1448099.4.patch delete mode 100644 bz1448099.5.patch delete mode 100644 bz1448099.6.patch delete mode 100644 bz1448099.7.1.patch delete mode 100644 bz1448099.7.patch delete mode 100644 bz1448099.8.patch diff --git a/bz1439914.patch b/bz1439914.patch deleted file mode 100644 index 22d273a..0000000 --- a/bz1439914.patch +++ /dev/null @@ -1,36 +0,0 @@ -commit 272146660f54786bb61d388f6d3a4eb20e7d9369 (origin/master2, master2) -Author: Jakub Jelinek -Date: Tue Mar 21 17:04:08 2017 -0400 - - gcc PR80115: sys/sdt.h: tweak i386 argument passing - - Use %w[arg] to request that widened forms of register names be passed - to the sys/sdt.h macro operand strings, so as to avoid nominating - sub-registers such as %sil within -m32 code, which gcc <= 6 sometimes - buggily did. - -diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h -index 3b7eda7976d1..eff315bcd885 100644 ---- a/includes/sys/sdt.h -+++ b/includes/sys/sdt.h -@@ -82,9 +82,11 @@ - # define _SDT_ASM_STRING_1(x) _SDT_ASM_1(.asciz #x) - - # define _SDT_ARGFMT(no) %n[_SDT_S##no]@_SDT_ARGTMPL(_SDT_A##no) -+ - # ifndef STAP_SDT_ARG_CONSTRAINT - # define STAP_SDT_ARG_CONSTRAINT nor - # endif -+ - # define _SDT_STRINGIFY(x) #x - # define _SDT_ARG_CONSTRAINT_STRING(x) _SDT_STRINGIFY(x) - # define _SDT_ARG(n, x) \ -@@ -173,6 +175,8 @@ __extension__ extern unsigned long long __sdt_unsp; - - #if defined __powerpc__ || defined __powerpc64__ - # define _SDT_ARGTMPL(id) %I[id]%[id] -+#elif defined __i386__ -+# define _SDT_ARGTMPL(id) %w[id] /* gcc.gnu.org/PR80115 */ - #else - # define _SDT_ARGTMPL(id) %[id] - #endif diff --git a/bz1448099.1.patch b/bz1448099.1.patch deleted file mode 100644 index 79c6f13..0000000 --- a/bz1448099.1.patch +++ /dev/null @@ -1,55 +0,0 @@ -commit 62640f2ed0deef9355970d216136ad4c49afa3d0 -Author: David Smith -Date: Fri Mar 17 09:36:42 2017 -0500 - - PR21255: Fix missing get_task_mm() declaration. - - * buildrun.cxx (compile_pass): Add autoconf test. This - was caused by the following kernel commit: - - commit 6e84f31522f931027bf695752087ece278c10d3f - Author: Ingo Molnar - Date: Wed Feb 8 18:51:29 2017 +0100 - - sched/headers: Prepare for new header dependencies before moving - code to - * runtime/linux/access_process_vm.h: Include and, if it - exists, . - * runtime/linux/autoconf-sched-mm.c: New file. - -diff --git a/buildrun.cxx b/buildrun.cxx -index aaea64c..644eea9 100644 ---- a/buildrun.cxx -+++ b/buildrun.cxx -@@ -402,6 +402,7 @@ compile_pass (systemtap_session& s) - output_autoconf(s, o, "autoconf-netfilter-4_4.c", "STAPCONF_NETFILTER_V44", NULL); - output_autoconf(s, o, "autoconf-smpcall-5args.c", "STAPCONF_SMPCALL_5ARGS", NULL); - output_autoconf(s, o, "autoconf-smpcall-4args.c", "STAPCONF_SMPCALL_4ARGS", NULL); -+ output_autoconf(s, o, "autoconf-sched-mm.c", "STAPCONF_SCHED_MM_H", NULL); - - // used by tapset/timestamp_monotonic.stp - output_exportconf(s, o, "cpu_clock", "STAPCONF_CPU_CLOCK"); -diff --git a/runtime/linux/access_process_vm.h b/runtime/linux/access_process_vm.h -index 22a1220..a46b86f 100644 ---- a/runtime/linux/access_process_vm.h -+++ b/runtime/linux/access_process_vm.h -@@ -3,6 +3,10 @@ - * some distros export it on some architectures. To workaround this inconsistency, - * we copied and pasted it here. Fortunately, everything it calls is exported. - */ -+#include -+#ifdef STAPCONF_SCHED_MM_H -+#include -+#endif - #include - #include - -diff --git a/runtime/linux/autoconf-sched-mm.c b/runtime/linux/autoconf-sched-mm.c -new file mode 100644 -index 0000000..6d3f1c2 ---- /dev/null -+++ b/runtime/linux/autoconf-sched-mm.c -@@ -0,0 +1,3 @@ -+#include -+#include -+ diff --git a/bz1448099.2.patch b/bz1448099.2.patch deleted file mode 100644 index 03f203f..0000000 --- a/bz1448099.2.patch +++ /dev/null @@ -1,37 +0,0 @@ -commit a477a43122609691ce6ef24f71114cfaa9790392 -Author: David Smith -Date: Fri Mar 17 10:44:12 2017 -0500 - - PR21255: Fix missing __set_task_state() definition. - - * runtime/stp_utrace.c: Fix missing __set_task_state() definition. If we - can't find a __set_task_state() definition, define our own. - -diff --git a/runtime/stp_utrace.c b/runtime/stp_utrace.c -index bb2d663..5924016 100644 ---- a/runtime/stp_utrace.c -+++ b/runtime/stp_utrace.c -@@ -29,6 +29,14 @@ - - #include "stp_helper_lock.h" - -+#if defined(__set_task_state) -+#define __stp_set_task_state(tsk, state_value) \ -+ __set_task_state((tsk), (state_value)) -+#else -+#define __stp_set_task_state(tsk, state_value) \ -+ do { (tsk)->state = (state_value); } while (0) -+#endif -+ - /* - * Per-thread structure private to utrace implementation. - * If task_struct.utrace_flags is nonzero, task_struct.utrace -@@ -1105,7 +1113,7 @@ static bool utrace_do_stop(struct task_struct *target, struct utrace *utrace) - */ - spin_lock_irq(&target->sighand->siglock); - if (likely(task_is_stopped(target))) -- __set_task_state(target, TASK_TRACED); -+ __stp_set_task_state(target, TASK_TRACED); - spin_unlock_irq(&target->sighand->siglock); - } else if (utrace->resume > UTRACE_REPORT) { - utrace->resume = UTRACE_REPORT; diff --git a/bz1448099.3.patch b/bz1448099.3.patch deleted file mode 100644 index acf2f3d..0000000 --- a/bz1448099.3.patch +++ /dev/null @@ -1,42 +0,0 @@ -commit 030e9465eadf7d3b3a278951264dac83b2f4b4f7 -Author: David Smith -Date: Wed Feb 22 10:04:00 2017 -0600 - - Update the vfs.stp tapset for newer kernels. - - * tapset/linux/vfs.stp: Since the __block_write_begin() function can be - inlined on newer kernels, we'll also probe - __block_write_begin_int(). Also, check to see if '$file' is defined - before using it in _vfs.block_write_begin.return. - -diff --git a/tapset/linux/vfs.stp b/tapset/linux/vfs.stp -index 4572bd7..32db300 100644 ---- a/tapset/linux/vfs.stp -+++ b/tapset/linux/vfs.stp -@@ -1104,7 +1104,8 @@ probe _vfs.generic_commit_write = kernel.function("generic_commit_write") ? - argstr = sprintf("%p, %p, %d, %d", $file, $page, $from, $to) - } - --probe _vfs.block_prepare_write = kernel.function("__block_write_begin") !, -+probe _vfs.block_prepare_write = kernel.function("__block_write_begin_int") !, -+ kernel.function("__block_write_begin") !, - kernel.function("__block_prepare_write") - { - page = $page -@@ -1134,6 +1135,7 @@ probe _vfs.block_prepare_write = kernel.function("__block_write_begin") !, - } - - probe _vfs.block_prepare_write.return = -+ kernel.function("__block_write_begin_int").return !, - kernel.function("__block_write_begin").return !, - kernel.function("__block_prepare_write").return - { -@@ -1188,7 +1190,7 @@ probe _vfs.block_write_begin.return = - name = "_vfs.block_write_begin" - retstr = sprintf("%d", $return) - -- file = @entry($file) -+ file = @choose_defined(@entry($file), "") - pathname = @defined(@entry($file)) ? fullpath_struct_file(task_current(), @entry($file)) : "" - pos = @entry($pos) - len = @entry($len) diff --git a/bz1448099.4.patch b/bz1448099.4.patch deleted file mode 100644 index 158f309..0000000 --- a/bz1448099.4.patch +++ /dev/null @@ -1,43 +0,0 @@ -commit 5ab0c875df5011725f9cd2f0804c00bf9e63d492 -Author: David Smith -Date: Thu Mar 2 15:23:28 2017 -0600 - - Fix s390x compile error in runtime/stack-s390.c. - - * runtime/stack-s390.c (__stp_stack_print): Update code to let it compile - on the 4.10 kernel. Kernel commit d5c352c moved 'thread_info' into - task_struct. - -diff --git a/runtime/stack-s390.c b/runtime/stack-s390.c -index 38eb73f..56043fc 100644 ---- a/runtime/stack-s390.c -+++ b/runtime/stack-s390.c -@@ -11,7 +11,6 @@ static unsigned long - __stp_show_stack (unsigned long sp, unsigned long low, - unsigned long high, int verbose) - { -- - struct stack_frame *sf; - struct pt_regs *regs; - unsigned long ip; -@@ -62,9 +61,18 @@ static void __stp_stack_print (struct pt_regs *regs, - - sp = __stp_show_stack(sp, - S390_lowcore.async_stack - ASYNC_SIZE, -- S390_lowcore.async_stack,verbose); -+ S390_lowcore.async_stack, verbose); - -+#ifdef CONFIG_THREAD_INFO_IN_TASK -+ /* FIXME: Note that this CONFIG_THREAD_INFO_IN_TASK -+ * code is untested, since the s390 uses the dwarf -+ * unwinder so this code doesn't get called. */ -+ __stp_show_stack(sp, ((unsigned long)current->stack), -+ (((unsigned long)current->stack) -+ + THREAD_SIZE), verbose); -+#else - __stp_show_stack(sp, - S390_lowcore.thread_info, -- S390_lowcore.thread_info + THREAD_SIZE,verbose); -+ S390_lowcore.thread_info + THREAD_SIZE, verbose); -+#endif - } diff --git a/bz1448099.5.patch b/bz1448099.5.patch deleted file mode 100644 index 72a57ed..0000000 --- a/bz1448099.5.patch +++ /dev/null @@ -1,72 +0,0 @@ -commit 386b8596d721e93ad618e682ecddb323d2bee446 -Author: David Smith -Date: Thu Mar 2 15:25:17 2017 -0600 - - Fix s390x-specific syscall tests. - - * testsuite/buildok/syscalls-arch-detailed.stp: Made s390x probe tests - optional, since the underlying probes don't exist on the 4.10 kernel. - * testsuite/buildok/nd_syscalls-arch-detailed.stp: Ditto. - -diff --git a/testsuite/buildok/nd_syscalls-arch-detailed.stp b/testsuite/buildok/nd_syscalls-arch-detailed.stp -index 364b13e..b927d15 100755 ---- a/testsuite/buildok/nd_syscalls-arch-detailed.stp -+++ b/testsuite/buildok/nd_syscalls-arch-detailed.stp -@@ -429,22 +429,22 @@ probe nd_syscall.ppc64_newuname.return ? - # - - %( arch == "s390" %? --probe nd_syscall.getresgid16 -+probe nd_syscall.getresgid16 ? - { - printf("%s, %s\n", name, argstr) - printf("%p, %p, %p\n", rgid_uaddr, egid_uaddr, sgid_uaddr) - } --probe nd_syscall.getresgid16.return -+probe nd_syscall.getresgid16.return ? - { - printf("%s, %s\n", name, retstr) - } - --probe nd_syscall.getresuid16 -+probe nd_syscall.getresuid16 ? - { - printf("%s, %s\n", name, argstr) - printf("%p, %p, %p\n", ruid_uaddr, euid_uaddr, suid_uaddr) - } --probe nd_syscall.getresuid16.return -+probe nd_syscall.getresuid16.return ? - { - printf("%s, %s\n", name, retstr) - } -diff --git a/testsuite/buildok/syscalls-arch-detailed.stp b/testsuite/buildok/syscalls-arch-detailed.stp -index 8d7d21e..914da9e 100755 ---- a/testsuite/buildok/syscalls-arch-detailed.stp -+++ b/testsuite/buildok/syscalls-arch-detailed.stp -@@ -429,22 +429,22 @@ probe syscall.ppc64_newuname.return ? - # - - %( arch == "s390" %? --probe syscall.getresgid16 -+probe syscall.getresgid16 ? - { - printf("%s, %s\n", name, argstr) - printf("%p, %p, %p\n", rgid_uaddr, egid_uaddr, sgid_uaddr) - } --probe syscall.getresgid16.return -+probe syscall.getresgid16.return ? - { - printf("%s, %s\n", name, retstr) - } - --probe syscall.getresuid16 -+probe syscall.getresuid16 ? - { - printf("%s, %s\n", name, argstr) - printf("%p, %p, %p\n", ruid_uaddr, euid_uaddr, suid_uaddr) - } --probe syscall.getresuid16.return -+probe syscall.getresuid16.return ? - { - printf("%s, %s\n", name, retstr) - } diff --git a/bz1448099.6.patch b/bz1448099.6.patch deleted file mode 100644 index a781eba..0000000 --- a/bz1448099.6.patch +++ /dev/null @@ -1,48 +0,0 @@ -commit 9f1c7a872e7a13d1ee29b692d0f1f4dd18a07baa -Author: David Smith -Date: Tue May 9 16:20:41 2017 -0500 - - Avoid missing "task_stack()" definition on 4.11 kernels. - - * runtime/compatdefs.h: If exists, include - it. This avoids a missing task_stack() definition. - * buildrun.cxx (compile_pass): Add autoconf test for - . - * runtime/linux/autoconf-sched-task_stack.c: New file. - -diff --git a/buildrun.cxx b/buildrun.cxx -index 21ed3c5..6da308a 100644 ---- a/buildrun.cxx -+++ b/buildrun.cxx -@@ -403,6 +403,7 @@ compile_pass (systemtap_session& s) - output_autoconf(s, o, "autoconf-smpcall-5args.c", "STAPCONF_SMPCALL_5ARGS", NULL); - output_autoconf(s, o, "autoconf-smpcall-4args.c", "STAPCONF_SMPCALL_4ARGS", NULL); - output_autoconf(s, o, "autoconf-sched-mm.c", "STAPCONF_SCHED_MM_H", NULL); -+ output_autoconf(s, o, "autoconf-sched-task_stack.c", "STAPCONF_SCHED_TASK_STACK_H", NULL); - - // used by tapset/timestamp_monotonic.stp - output_exportconf(s, o, "cpu_clock", "STAPCONF_CPU_CLOCK"); -diff --git a/runtime/compatdefs.h b/runtime/compatdefs.h -index ba429b5..f261bfd 100644 ---- a/runtime/compatdefs.h -+++ b/runtime/compatdefs.h -@@ -57,6 +57,10 @@ static inline int _stp_is_compat_task(void) - */ - #include - #include -+#include -+#ifdef STAPCONF_SCHED_TASK_STACK_H -+#include -+#endif - - #if !defined(task_pt_regs) - #if defined(__powerpc__) -diff --git a/runtime/linux/autoconf-sched-task_stack.c b/runtime/linux/autoconf-sched-task_stack.c -new file mode 100644 -index 0000000..cdfcc60 ---- /dev/null -+++ b/runtime/linux/autoconf-sched-task_stack.c -@@ -0,0 +1,3 @@ -+#include -+#include -+ diff --git a/bz1448099.7.1.patch b/bz1448099.7.1.patch deleted file mode 100644 index 96d1db5..0000000 --- a/bz1448099.7.1.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/tapset/linux/proc_mem.stp b/tapset/linux/proc_mem.stp -index 4b20686..890be69 100644 ---- a/tapset/linux/proc_mem.stp -+++ b/tapset/linux/proc_mem.stp -@@ -155,7 +155,7 @@ function proc_mem_size_pid:long (pid:long) - if (_stp_valid_task(task)) { - mm = task->mm - if (mm != 0) -- return mm->total_vm -+ return @mm(mm)->total_vm - } - return 0 - } -@@ -322,8 +322,8 @@ function proc_mem_txt_pid:long (pid:long) - if (_stp_valid_task(task)) { - mm = task->mm - if (mm != 0) { -- s = mm->start_code -- e = mm->end_code -+ s = @mm(mm)->start_code -+ e = @mm(mm)->end_code - return _stp_mem_txt_adjust (s, e) - } - } -@@ -381,8 +381,9 @@ function proc_mem_data_pid:long (pid:long) - if (_stp_valid_task(task)) { - mm = task->mm - if (mm != 0) { -- return (@defined(&@mm(0)->data_vm) ? (mm->data_vm + mm->stack_vm) -- : (mm->total_vm - mm->shared_vm)) -+ return (@defined(&@mm(0)->data_vm) -+ ? (@mm(mm)->data_vm + @mm(mm)->stack_vm) -+ : (@mm(mm)->total_vm - @mm(mm)->shared_vm)) - } - } - return 0 diff --git a/bz1448099.7.patch b/bz1448099.7.patch deleted file mode 100644 index c2757a8..0000000 --- a/bz1448099.7.patch +++ /dev/null @@ -1,142 +0,0 @@ -commit c7029a89f5f1ff6d6a7008e8bccb797046f8af50 -Author: David Smith -Date: Tue May 9 16:32:25 2017 -0500 - - Add missing @cast() calls for 4.11 kernels. - - * tapset/linux/task.stp: Add a "signal_struct" cast to - _task_rlimit_cur(). - * tapset/linux/task.stpm: Fix @mm() macro for kernels >= 2.6.34, where the - mm_struct definition has moved to - * tapset/linux/proc_mem.stp (proc_mem_size): Use the @mm() macro to cast - values to a mm_struct. - (proc_mem_txt): Ditto. - (proc_mem_data): Ditto. - * tapset/linux/context.stp (cmdline_args): Ditto. - * tapset/linux/context-envvar.stp (env_var): Ditto. - -diff --git a/tapset/linux/context-envvar.stp b/tapset/linux/context-envvar.stp -index 4d4c648..2ceb6c8 100644 ---- a/tapset/linux/context-envvar.stp -+++ b/tapset/linux/context-envvar.stp -@@ -28,8 +28,8 @@ function env_var:string(name:string) - mm = task_current()->mm; - if (mm) - { -- env_start = mm->env_start; -- env_end = mm->env_end; -+ env_start = @mm(mm)->env_start; -+ env_end = @mm(mm)->env_end; - if (env_start != 0 && env_end != 0) - { - len = env_end - env_start; -diff --git a/tapset/linux/context.stp b/tapset/linux/context.stp -index e563983..8ab81b4 100644 ---- a/tapset/linux/context.stp -+++ b/tapset/linux/context.stp -@@ -559,8 +559,8 @@ function cmdline_args:string(n:long, m:long, delim:string) - if (__mm == 0) - return ""; - -- __arg_start = __mm->arg_start; -- __arg_end = __mm->arg_end; -+ __arg_start = @mm(__mm)->arg_start; -+ __arg_end = @mm(__mm)->arg_end; - if (__arg_start == 0 || __arg_end == 0) - return ""; - -diff --git a/tapset/linux/proc_mem.stp b/tapset/linux/proc_mem.stp -index de6f423..161033d 100644 ---- a/tapset/linux/proc_mem.stp -+++ b/tapset/linux/proc_mem.stp -@@ -124,7 +124,7 @@ function proc_mem_size:long () - if (_stp_valid_task(task)) { - mm = task->mm - if (mm != 0) -- return mm->total_vm -+ return @mm(mm)->total_vm - } - return 0 - } -@@ -144,7 +144,7 @@ function proc_mem_size:long (pid:long) - if (_stp_valid_task(task)) { - mm = task->mm - if (mm != 0) -- return mm->total_vm -+ return @mm(mm)->total_vm - } - return 0 - } -@@ -260,8 +260,8 @@ function proc_mem_txt:long () - if (_stp_valid_task(task)) { - mm = task->mm - if (mm != 0) { -- s = mm->start_code -- e = mm->end_code -+ s = @mm(mm)->start_code -+ e = @mm(mm)->end_code - return _stp_mem_txt_adjust(s, e) - } - } -@@ -283,8 +283,8 @@ function proc_mem_txt:long (pid:long) - if (_stp_valid_task(task)) { - mm = task->mm - if (mm != 0) { -- s = mm->start_code -- e = mm->end_code -+ s = @mm(mm)->start_code -+ e = @mm(mm)->end_code - return _stp_mem_txt_adjust (s, e) - } - } -@@ -308,8 +308,9 @@ function proc_mem_data:long () - if (_stp_valid_task(task)) { - mm = task->mm - if (mm != 0) { -- return (@defined(&@mm(0)->data_vm) ? (mm->data_vm + mm->stack_vm) -- : (mm->total_vm - mm->shared_vm)) -+ return (@defined(&@mm(0)->data_vm) -+ ? (@mm(mm)->data_vm + @mm(mm)->stack_vm) -+ : (@mm(mm)->total_vm - @mm(mm)->shared_vm)) - } - } - return 0 -@@ -330,8 +331,9 @@ function proc_mem_data:long (pid:long) - if (_stp_valid_task(task)) { - mm = task->mm - if (mm != 0) { -- return (@defined(&@mm(0)->data_vm) ? (mm->data_vm + mm->stack_vm) -- : (mm->total_vm - mm->shared_vm)) -+ return (@defined(&@mm(0)->data_vm) -+ ? (@mm(mm)->data_vm + @mm(mm)->stack_vm) -+ : (@mm(mm)->total_vm - @mm(mm)->shared_vm)) - } - } - return 0 -diff --git a/tapset/linux/task.stp b/tapset/linux/task.stp -index 5467e05..f7c852e 100644 ---- a/tapset/linux/task.stp -+++ b/tapset/linux/task.stp -@@ -40,7 +40,7 @@ function task_current:long () { - return -1; - } - sig = @task(task)->signal; -- return sig->rlim[nd_limit]->rlim_cur; -+ return @cast(sig, "signal_struct")->rlim[nd_limit]->rlim_cur; - } - - /* sfunction task_rlimit - The current resource limit of the task -diff --git a/tapset/linux/task.stpm b/tapset/linux/task.stpm -index 7df04e3..f1bfb8e 100644 ---- a/tapset/linux/task.stpm -+++ b/tapset/linux/task.stpm -@@ -3,5 +3,9 @@ - %) - - @define mm(ptr) %( -+ %( kernel_v >= "2.6.34" %? -+ @cast(@ptr, "mm_struct", "kernel") -+ %: - @cast(@ptr, "mm_struct", "kernel") -+ %) - %) diff --git a/bz1448099.8.patch b/bz1448099.8.patch deleted file mode 100644 index 45c8a72..0000000 --- a/bz1448099.8.patch +++ /dev/null @@ -1,65 +0,0 @@ -commit 35ea394c93d3c296c0c809d21bc397b531b7e965 -Author: David Smith -Date: Tue May 9 16:39:11 2017 -0500 - - Add small testsuite fixes for 4.11 kernels. - - * testsuite/buildok/twentyseven.stp: Avoid missing inlined function - arguments by probing 'kernel.function("do_execve").call'. - * testsuite/buildok/thirtyone.stp: On 4.11 kernels, handle the vfs_stat() - function being renamed to vfs_statx(). - * testsuite/systemtap.pass1-4/buildok.exp: Add kfails for - buildok/fortyfour.stp and buildok/map_probe_cond.stp if we don't have - uprobes. - * testsuite/systemtap.pass1-4/buildok-interactive.exp: Ditto. - -diff --git a/testsuite/buildok/thirtyone.stp b/testsuite/buildok/thirtyone.stp -index ccba660..e7e102d 100755 ---- a/testsuite/buildok/thirtyone.stp -+++ b/testsuite/buildok/thirtyone.stp -@@ -1,5 +1,5 @@ - #! stap -wp4 - --probe kprobe.function("vfs_stat") {} -+probe kprobe.function("vfs_stat")!, kprobe.function("vfs_statx") ? {} - probe kprobe.function("do_sys_open") {} - probe kernel.function("filp_close") {} -diff --git a/testsuite/buildok/twentyseven.stp b/testsuite/buildok/twentyseven.stp -index 62900f3..a3cbfde 100755 ---- a/testsuite/buildok/twentyseven.stp -+++ b/testsuite/buildok/twentyseven.stp -@@ -1,6 +1,6 @@ - #! stap -p4 - --probe kernel.function("do_execve") -+probe kernel.function("do_execve").call - { - print(@defined($__argv) ? $__argv[0] : $argv[0]) - } -diff --git a/testsuite/systemtap.pass1-4/buildok-interactive.exp b/testsuite/systemtap.pass1-4/buildok-interactive.exp -index fc4a019..d15640f 100644 ---- a/testsuite/systemtap.pass1-4/buildok-interactive.exp -+++ b/testsuite/systemtap.pass1-4/buildok-interactive.exp -@@ -188,6 +188,9 @@ foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { - # without utrace. - if {$rc == 1 && ![utrace_p]} { setup_kfail UTRACE *-*-*} } - -+ buildok/fortyfour.stp - -+ buildok/map_probe_cond.stp - -+ buildok/pretty-uprobes.stp - - buildok/pretty-uprobes.stp - - buildok/ucontext-symbols-embedded.stp - - buildok/ucontext-unwind-embedded.stp { -diff --git a/testsuite/systemtap.pass1-4/buildok.exp b/testsuite/systemtap.pass1-4/buildok.exp -index 3926b7f..79f2217 100644 ---- a/testsuite/systemtap.pass1-4/buildok.exp -+++ b/testsuite/systemtap.pass1-4/buildok.exp -@@ -40,6 +40,8 @@ foreach file [lsort [glob -nocomplain $srcdir/$self/*.stp]] { - # without utrace. - if {$rc != 0 && ![utrace_p]} { setup_kfail UTRACE *-*-*} } - -+ buildok/fortyfour.stp - -+ buildok/map_probe_cond.stp - - buildok/pretty-uprobes.stp - - buildok/ucontext-symbols-embedded.stp - - buildok/ucontext-unwind-embedded.stp { diff --git a/sources b/sources index 9a80683..eabc5df 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (systemtap-3.1.tar.gz) = 07b322d5745f570296e287db80f1e370da87eb65073815cf24d532827900453c1cb9ee74b5496b4f3919d176b960caad4479edc2dadf27b5c58898fb7398264d +SHA512 (systemtap-3.2.tar.gz) = 6036ed1b5189fd3fcfdeeaa526a3539ac632d0b687a063b5e3424e8f613bfc2c8d079742b0262b547128e97e30e4beb61898b23761657aee519e61346ac92e94 diff --git a/systemtap.spec b/systemtap.spec index fe2cbfd..3f3d039 100644 --- a/systemtap.spec +++ b/systemtap.spec @@ -1,4 +1,4 @@ -%{!?with_sqlite: %global with_sqlite 1} +%{!?with_sqlite: %global with_sqlite 0%{?fedora} >= 17 || 0%{?rhel} >= 7} %{!?with_docs: %global with_docs 1} %{!?with_htmldocs: %global with_htmldocs 0} %{!?with_monitor: %global with_monitor 1} @@ -18,6 +18,7 @@ %else %{!?with_dyninst: %global with_dyninst 0} %endif +%{!?with_bpf: %global with_bpf 0%{?fedora} >= 22 || 0%{?rhel} >= 8} %{!?with_systemd: %global with_systemd 0%{?fedora} >= 19 || 0%{?rhel} >= 7} %{!?with_emacsvim: %global with_emacsvim 0%{?fedora} >= 19 || 0%{?rhel} >= 7} %{!?with_java: %global with_java 0%{?fedora} >= 19 || 0%{?rhel} >= 7} @@ -35,6 +36,7 @@ %{!?with_python3: %global with_python3 0%{?fedora} >= 23} %{!?with_python2_probes: %global with_python2_probes 1} %{!?with_python3_probes: %global with_python3_probes 0%{?fedora} >= 23} +%{!?with_httpd: %global with_httpd 0} %ifarch ppc64le aarch64 %global with_virthost 0 @@ -71,8 +73,8 @@ %endif Name: systemtap -Version: 3.1 -Release: 5%{?dist} +Version: 3.2 +Release: 1%{?dist} # for version, see also configure.ac @@ -120,7 +122,7 @@ BuildRequires: dyninst-devel >= 8.0 BuildRequires: pkgconfig(libselinux) %endif %if %{with_sqlite} -BuildRequires: sqlite-devel +BuildRequires: sqlite-devel > 3.7 %endif %if %{with_monitor} BuildRequires: pkgconfig(json-c) @@ -186,17 +188,10 @@ BuildRequires: python3-devel BuildRequires: python3-setuptools %endif -Patch10: bz1439914.patch -Patch21: bz1448099.1.patch -Patch22: bz1448099.2.patch -Patch23: bz1448099.3.patch -Patch24: bz1448099.4.patch -Patch25: bz1448099.5.patch -Patch26: bz1448099.6.patch -Patch27: bz1448099.7.patch -Patch28: bz1448099.7.1.patch -Patch29: bz1448099.8.patch - +%if %{with_httpd} +BuildRequires: libmicrohttpd-devel +BuildRequires: libuuid-devel +%endif # Install requirements Requires: systemtap-client = %{version}-%{release} @@ -473,7 +468,6 @@ systemtap-runtime-virthost machine to execute systemtap scripts. %prep %setup -q %{?setup_elfutils} -%patch10 -p1 %if %{with_bundled_elfutils} cd elfutils-%{elfutils_version} @@ -485,17 +479,6 @@ find . \( -name configure -o -name config.h.in \) -print | xargs touch cd .. %endif -%patch21 -p1 -%patch22 -p1 -%patch23 -p1 -%patch24 -p1 -%patch25 -p1 -%patch26 -p1 -%patch27 -p1 -%patch28 -p1 -%patch29 -p1 - - %build %if %{with_bundled_elfutils} @@ -593,10 +576,16 @@ cd .. %global dracut_config %{nil} %endif +%if %{with_httpd} +%global httpd_config --enable-httpd +%else +%global httpd_config --disable-httpd +%endif + # We don't ship compileworthy python code, just oddball samples %global py_auto_byte_compile 0 -%configure %{?elfutils_config} %{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} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}" +%configure %{?elfutils_config} %{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} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}" make %{?_smp_mflags} %if %{with_emacsvim} @@ -1031,6 +1020,9 @@ done %if %{with_dyninst} %{_bindir}/stapdyn %endif +%if %{with_bpf} +%{_bindir}/stapbpf +%endif %dir %{_libexecdir}/systemtap %{_libexecdir}/systemtap/stapio %{_libexecdir}/systemtap/stap-authorize-cert @@ -1047,6 +1039,9 @@ done %if %{with_dyninst} %{_mandir}/man8/stapdyn.8* %endif +%if %{with_bpf} +%{_mandir}/man8/stapbpf.8* +%endif %doc README README.security AUTHORS NEWS %{!?_licensedir:%global license %%doc} %license COPYING @@ -1163,14 +1158,8 @@ done # PRERELEASE %changelog -* Mon May 15 2017 Frank Ch. Eigler - 3.1-5 -- Build with dsmith's bz1448099 patches for support of kernel 4.11 - -* Thu Apr 06 2017 Frank Ch. Eigler - 3.1-3 -- Backport bz1439914 (sys/sdt.h argument encoding) - -* Thu Mar 16 2017 Stan Cox - 3.1-2 -- Rebuild for dyninst 9.3 +* Wed Oct 18 2017 Frank Ch. Eigler - 3.2-1 +- Upstream release. * Fri Feb 17 2017 Frank Ch. Eigler - 3.1-1 - Upstream release.