diff --git a/.gitignore b/.gitignore index cd27605..f9912e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/systemtap-2.6.tar.gz +SOURCES/systemtap-2.8.tar.gz diff --git a/.systemtap.metadata b/.systemtap.metadata index 767f9d4..ffb86ad 100644 --- a/.systemtap.metadata +++ b/.systemtap.metadata @@ -1 +1 @@ -87df285cfee508a8653eb7e161918327eb60479e SOURCES/systemtap-2.6.tar.gz +95034e8243e1f9fd33b765afda06546083df1b7f SOURCES/systemtap-2.8.tar.gz diff --git a/SOURCES/june-robust.patch b/SOURCES/june-robust.patch new file mode 100644 index 0000000..8dead9f --- /dev/null +++ b/SOURCES/june-robust.patch @@ -0,0 +1,132 @@ +commit 81bde8f873216c116988a98a0804dd79009b3d40 +Author: Mark Wielaard +Date: Mon Jun 22 16:57:59 2015 +0200 + + runtime/unwind.c: Also sanity check DWARF regno for DW_CFA_restore[_extended]. + + When processCFI wanted to restore a register state to its initial value it + wasn't checking whether the register was actually interesting (or existing). + DWARF_REG_MAP might return a marker (9999) that we don't know or don't care + about this register. This was checked in all the set_*_rule functions, but + not in the case we reset the rule of the register. Add this check also for + DW_CFA_restore[_extended]. + +diff --git a/runtime/unwind.c b/runtime/unwind.c +index d38363b..4dbab33 100644 +--- a/runtime/unwind.c ++++ b/runtime/unwind.c +@@ -426,7 +426,8 @@ static int processCFI(const u8 *start, const u8 *end, unsigned long targetLoc, + value, DWARF_REG_MAP(value)); + value = DWARF_REG_MAP(value); + } +- memcpy(®_STATE.regs[value], &state->cie_regs[value], sizeof(struct unwind_item)); ++ if (value < ARRAY_SIZE(REG_STATE.regs)) ++ memcpy(®_STATE.regs[value], &state->cie_regs[value], sizeof(struct unwind_item)); + break; + case DW_CFA_undefined: + value = get_uleb128(&ptr.p8, end); +@@ -641,7 +642,8 @@ static int processCFI(const u8 *start, const u8 *end, unsigned long targetLoc, + value, DWARF_REG_MAP(value)); + value = DWARF_REG_MAP(value); + } +- memcpy(®_STATE.regs[value], &state->cie_regs[value], sizeof(struct unwind_item)); ++ if (value < ARRAY_SIZE(REG_STATE.regs)) ++ memcpy(®_STATE.regs[value], &state->cie_regs[value], sizeof(struct unwind_item)); + break; + } + dbug_unwind(1, "targetLoc=%lx state->loc=%lx\n", targetLoc, state->loc); + +commit db6670607f9ba837a7a7af8a0ea076595e9eca1d +Author: David Smith +Date: Tue Jun 30 15:24:54 2015 -0500 + + Two small stat code fixes found by source analysis. + + * runtime/stat-common.c (_stp_stat_print_histogram_buf): Fixed small + potential overflow problem by widening values. + * runtime/stat.c (_stp_stat_init): Fixed missing 'va_end' call in an error + situation. + +diff --git a/runtime/stat-common.c b/runtime/stat-common.c +index f8372ac..4491b27 100644 +--- a/runtime/stat-common.c ++++ b/runtime/stat-common.c +@@ -261,10 +261,10 @@ static void _stp_stat_print_histogram_buf(char *buf, size_t size, Hist st, + val_prefix = "<"; + } else if (i == st->buckets-1) { + /* overflow */ +- val = st->start + (i - 2) * st->interval; ++ val = st->start + (int64_t)(i - 2) * st->interval; + val_prefix = ">"; + } else +- val = st->start + (i - 1) * st->interval; ++ val = st->start + (int64_t)(i - 1) * st->interval; + } else + val = _stp_bucket_to_val(i); + +diff --git a/runtime/stat.c b/runtime/stat.c +index 63ffccc..fa5939b 100644 +--- a/runtime/stat.c ++++ b/runtime/stat.c +@@ -71,8 +71,10 @@ static Stat _stp_stat_init (int type, ...) + interval = va_arg(ap, int); + + buckets = _stp_stat_calc_buckets(stop, start, interval); +- if (!buckets) ++ if (!buckets) { ++ va_end (ap); + return NULL; ++ } + } + va_end (ap); + } + +commit 39c6af0c27dfd5cdd71ee60e1667d40d101ff8ac +Author: Mark Wielaard +Date: Tue Jun 30 21:54:28 2015 +0200 + + unwind.c (compute_expr): Don't fallthrough after div/mod/shr. + + When processing DW_OP_div, DW_OP_mod or DW_OP_shr compute_expr + would accidentially fallthrough to the next case statement causing + the DWARF value stack to contain wrong values. + +diff --git a/runtime/unwind.c b/runtime/unwind.c +index 4dbab33..b5c8f6f 100644 +--- a/runtime/unwind.c ++++ b/runtime/unwind.c +@@ -1036,6 +1036,7 @@ static int compute_expr(const u8 *expr, struct unwind_frame_info *frame, + if (b == 0) + goto divzero; + PUSH (a % b); ++ break; + } + + case DW_OP_div: { +@@ -1044,12 +1045,14 @@ static int compute_expr(const u8 *expr, struct unwind_frame_info *frame, + if (b == 0) + goto divzero; + PUSH (a / b); ++ break; + } + + case DW_OP_shr: { + unsigned long b = POP; + unsigned long a = POP; + PUSH (a >> b); ++ break; + } + + case DW_OP_not: +diff --git a/runtime/unwind/unwind.h b/runtime/unwind/unwind.h +index e81e741..d72f68d 100644 +--- a/runtime/unwind/unwind.h ++++ b/runtime/unwind/unwind.h +@@ -157,6 +157,7 @@ static unsigned long read_ptr_sect(const u8 **pLoc, const void *end, + #else + BUILD_BUG_ON(sizeof(u32) != sizeof(value)); + #endif ++ /* fallthrough, see above. */ + case DW_EH_PE_absptr: + if (compat_task) + { diff --git a/SOURCES/rhbz1119335.patch b/SOURCES/rhbz1119335.patch deleted file mode 100644 index 5b4f7c6..0000000 --- a/SOURCES/rhbz1119335.patch +++ /dev/null @@ -1,35 +0,0 @@ -commit 284416e904b3f405cb3ae4220aa79dc61c94236a -Author: Frank Ch. Eigler -Date: Wed Nov 12 11:04:39 2014 -0500 - - RHBZ1119336: document STAP_FIPS_OVERRIDE in man staprun.8 - -diff --git a/staprun/staprun.8 b/staprun/staprun.8 -index b6f014e..82e2e22 100644 ---- a/staprun/staprun.8 -+++ b/staprun/staprun.8 -@@ -279,6 +279,16 @@ Part of the privilege enforcement mechanism may require using a - stap-server and administrative trust in its cryptographic signer; see the - .IR stap\-server (8) - manual page for a for more information. -+ -+.PP -+On a kernel with FIPS mode enabled, staprun normally refuses to attempt to -+load systemtap-generated kernel modules. This is because on some kernels, -+this results in a panic. If your kernel includes corrections such as -+linux commit #002c77a48b47, then you can force staprun to attempt module -+loads anyway, by setting the -+.BR STAP\_FIPS\_OVERRIDE -+environment variable to any value. -+ - .SH FILES - .TP - /lib/modules/VERSION/systemtap -@@ -288,6 +298,7 @@ Users who are only in the - group can install modules - located in this directory. This directory must be owned by the root - user and not be world writable. -+ - .SH SEE ALSO - .IR stap (1), - .IR stapprobes (3stap), diff --git a/SOURCES/rhbz1127591.patch b/SOURCES/rhbz1127591.patch deleted file mode 100644 index 78e7400..0000000 --- a/SOURCES/rhbz1127591.patch +++ /dev/null @@ -1,34 +0,0 @@ -commit c4a048331603a3fe19c886498e957f5f2a577ed9 -Author: Frank Ch. Eigler -Date: Thu Nov 20 16:30:20 2014 -0500 - - PR17126: put hcall_* kernel tracepoints into blacklist for powerpc - - * tapsets.cxx (tracepoint_query::handle_query_func): Implement - baby blacklist. - -diff --git a/tapsets.cxx b/tapsets.cxx -index 6e2bae5..0b4e0d8 100644 ---- a/tapsets.cxx -+++ b/tapsets.cxx -@@ -10900,6 +10900,20 @@ tracepoint_query::handle_query_func(Dwarf_Die * func) - if (!probed_names.insert(tracepoint_instance).second) - return DWARF_CB_OK; - -+ // PR17126: blacklist -+ if (!sess.guru_mode) -+ { -+ if ((sess.architecture.substr(0,3) == "ppc" || -+ sess.architecture.substr(0,7) == "powerpc") && -+ (tracepoint_instance == "hcall_entry" || -+ tracepoint_instance == "hcall_exit")) -+ { -+ sess.print_warning(_F("tracepoint %s is blacklisted on architecture %s", -+ tracepoint_instance.c_str(), sess.architecture.c_str())); -+ return DWARF_CB_OK; -+ } -+ } -+ - derived_probe *dp = new tracepoint_derived_probe (dw.sess, dw, *func, - tracepoint_instance, - base_probe, base_loc); diff --git a/SOURCES/rhbz1139844.patch b/SOURCES/rhbz1139844.patch deleted file mode 100644 index db919ee..0000000 --- a/SOURCES/rhbz1139844.patch +++ /dev/null @@ -1,58 +0,0 @@ -From c486eff3f809b5ce544d5a032198e7680f2b7f2b Mon Sep 17 00:00:00 2001 -From: Stan Cox -Date: Tue, 9 Sep 2014 15:07:44 -0400 -Subject: [PATCH] Add -fpic -fPIC to the list of accepted but ignored dtrace - options. - -* dtrace.in (main): Add ignore_options. ---- - dtrace.in | 4 +++- - testsuite/systemtap.base/dtrace.exp | 8 ++++---- - 2 files changed, 7 insertions(+), 5 deletions(-) - -diff --git a/dtrace.in b/dtrace.in -index d5f189d4fc9e..2f9fb6307e28 100644 ---- a/dtrace.in -+++ b/dtrace.in -@@ -305,6 +305,8 @@ def main(): - s_filename = "" - includes = [] - defines = [] -+ ignore_options = ["-64", "-32", "-fpic", "-fPIC"] -+ - while i < len(sys.argv): - if sys.argv[i] == "-o": - i += 1 -@@ -330,7 +332,7 @@ def main(): - HAVE_PYP = False - elif sys.argv[i] == "--types": - print sys.argv[0] + ": note: obsolete option --types used" -- elif sys.argv[i] == "-64" or sys.argv[i] == "-32": -+ elif sys.argv[i] in ignore_options: - pass # dtrace users sometimes pass these flags - elif sys.argv[i] == "--help": - dtrace_help() -diff --git a/testsuite/systemtap.base/dtrace.exp b/testsuite/systemtap.base/dtrace.exp -index 252dad90ede5..e029748100d6 100644 ---- a/testsuite/systemtap.base/dtrace.exp -+++ b/testsuite/systemtap.base/dtrace.exp -@@ -53,12 +53,12 @@ set incpath "/tmp/dtrace_inc" - # ----------------------------------------------------------------- - # test command line option and file handling - --verbose -log "$dtrace -G -s $dpath -o XXX.o" --catch {exec $dtrace -G -s $dpath -o XXX.o} -+verbose -log "$dtrace -G -64 -fPIC -s $dpath -o XXX.o" -+catch {exec $dtrace -G -64 -fPIC -s $dpath -o XXX.o} - if {[file exists XXX.o]} then { -- pass "dtrace -G -o XXX.o" -+ pass "dtrace -G -64 -fPIC -o XXX.o" - } else { -- fail "dtrace -G -o XXX.o" -+ fail "dtrace -G -64 -fPIC -o XXX.o" - } - exec rm -f XXX.o - --- -1.9.3 - diff --git a/SOURCES/rhbz1141919.patch b/SOURCES/rhbz1141919.patch deleted file mode 100644 index a1db25a..0000000 --- a/SOURCES/rhbz1141919.patch +++ /dev/null @@ -1,41 +0,0 @@ -commit f48e4f1c41b8d5e6fbee05500f59a5367b964193 (HEAD, master) -Author: Frank Ch. Eigler -Date: Fri Sep 19 15:58:00 2014 -0400 - - staplog.c: add some more per-arch macros w/ protection - - Some platforms define PPC etc. before staplog.c, so we must - not conflict. Some new platforms need to be listed. - -diff --git a/staplog.c b/staplog.c -index 809405305e63..18217b633e61 100644 ---- a/staplog.c -+++ b/staplog.c -@@ -22,6 +22,10 @@ - - /* crash/defs.h defines NR_CPUS based upon architecture macros - X86, X86_64, etc. See crash/configure.c (!). */ -+#if !defined(X86) && !defined(X86_64) && !defined(ALPHA) && !defined(PPC) && \ -+ !defined(IA64) && !defined(PPC64) && !defined(S390) && !defined(S390X) && \ -+ !defined(ARM) && !defined(ARM64) -+ - #if defined(__alpha__) - #define ALPHA - #elif defined(__x86_64__) -@@ -38,12 +42,16 @@ - #define S390X - #elif defined(__s390__) - #define S390 -+#elif defined(__aarch64__) -+#define ARM64 - #elif defined(__arm__) - #define ARM - #else - #warn "unknown architecture for crash/staplog support" - #endif - -+#endif -+ - #include - - struct rchan_offsets { diff --git a/SOURCES/rhbz1153673.patch b/SOURCES/rhbz1153673.patch deleted file mode 100644 index 662381a..0000000 --- a/SOURCES/rhbz1153673.patch +++ /dev/null @@ -1,28 +0,0 @@ -commit a1a230af2ea557ed7a9fcd9485ac16278dbdf778 -Author: Frank Ch. Eigler -Date: Thu Oct 16 16:25:55 2014 -0400 - - RHBZ1153673: speculatively correct segv in dead_control_remover - - It was reported that ::visit_block was occasionally called with - a 0-size input vs[]. That leads to an array overflow, as the - for condition becomes apprx. (i < UINT_MAX). - - for (size_t i = 0; i < vs.size() - 1; ++i) - do_something_with (vs[i]); - - Let's reject 0-size vectors right away. - -diff --git a/elaborate.cxx b/elaborate.cxx -index fa90fe7..35109ab 100644 ---- a/elaborate.cxx -+++ b/elaborate.cxx -@@ -4041,6 +4041,8 @@ struct dead_control_remover: public traversing_visitor - void dead_control_remover::visit_block (block* b) - { - vector& vs = b->statements; -+ if (vs.size() == 0) /* else (size_t) size()-1 => very big */ -+ return; - for (size_t i = 0; i < vs.size() - 1; ++i) - { - vs[i]->visit (this); diff --git a/SOURCES/rhbz1164373.patch b/SOURCES/rhbz1164373.patch deleted file mode 100644 index a46c244..0000000 --- a/SOURCES/rhbz1164373.patch +++ /dev/null @@ -1,21 +0,0 @@ -commit 69f0706dd69bd83dfa649246e695c682a6018790 -Author: Frank Ch. Eigler -Date: Fri Nov 14 15:04:53 2014 -0500 - - runtime: fix kernel relocation basis symbol on ppc64le - - It's _stext, not .__start (as on normal ppc64). - -diff --git a/runtime/k_syms.h b/runtime/k_syms.h -index 5e3db1d..ef80fbd 100644 ---- a/runtime/k_syms.h -+++ b/runtime/k_syms.h -@@ -1,7 +1,7 @@ - #ifndef _K_SYMS_H_ - #define _K_SYMS_H_ - --#ifdef __powerpc64__ -+#if defined(__powerpc64__) && !_LITTLE_ENDIAN - #define KERNEL_RELOC_SYMBOL ".__start" - #else - #define KERNEL_RELOC_SYMBOL "_stext" diff --git a/SOURCES/rhbz1167652.patch b/SOURCES/rhbz1167652.patch deleted file mode 100644 index a9843df..0000000 --- a/SOURCES/rhbz1167652.patch +++ /dev/null @@ -1,29 +0,0 @@ -commit dab22a155b78731803058c6a746396de03220362 -Author: Martin Cermak -Date: Tue Nov 25 15:58:29 2014 +0100 - - RHBZ1167652: Boot time probing feature fix - - * initscript/systemtap.in: Fix regenerating initramfs image - without the stap module - -diff --git a/initscript/systemtap.in b/initscript/systemtap.in -index 9443384..cd65b3f 100755 ---- a/initscript/systemtap.in -+++ b/initscript/systemtap.in -@@ -906,8 +906,13 @@ onboot () { - do_failure "Failed to make temporary file in $dir" - return 1 - fi -- # Create the initramfs image with stap module enabled. -- out=$($DRACUT --add stap --force $TMPINITRAMFS $KRELEASE 2>&1) -+ if [ ! "$ss" ]; then -+ # Create the initramfs image without stap module enabled. -+ out=$($DRACUT --force $TMPINITRAMFS $KRELEASE 2>&1) -+ else -+ # Create the initramfs image with stap module enabled. -+ out=$($DRACUT --add stap --force $TMPINITRAMFS $KRELEASE 2>&1) -+ fi - # dracut will report success even if some modules (e.g. stap) failed - # to install some files, so we need to be a bit more involved in - # checking for errors diff --git a/SOURCES/rhbz1171823.patch b/SOURCES/rhbz1171823.patch deleted file mode 100644 index 6a48f82..0000000 --- a/SOURCES/rhbz1171823.patch +++ /dev/null @@ -1,96 +0,0 @@ -commit f73985072571f93684e7742733d8d06b477b02bf -Author: David Smith -Date: Mon Dec 8 14:04:19 2014 -0600 - - Fix BZ1171823 by updating the __svc_fh() nfsd tapset function. - - * tapset/linux/nfsd.stp: Rewrite __svc_fh() in systemtap script language - instead of embedded-C to get around the disappearance of struct svc_fh's - declaration from a public kernel header file. - -diff --git a/tapset/linux/nfsd.stp b/tapset/linux/nfsd.stp -index 701a81d..7ec2856 100644 ---- a/tapset/linux/nfsd.stp -+++ b/tapset/linux/nfsd.stp -@@ -38,22 +38,23 @@ - *15 :nfsd.proc3.rename.tfh - */ - --/*Get file handler from struct svc_fh */ --function __svc_fh:string(fh :long) %{ /* pure */ -- struct svc_fh * fhp = (struct svc_fh *) (unsigned long)(STAP_ARG_fh); -- struct knfsd_fh *fh = &fhp->fh_handle; -- -- snprintf(STAP_RETVALUE, MAXSTRINGLEN, -- "%d: %08x %08x %08x %08x %08x %08x", -- kread(&(fh->fh_size)), -- kread(&(fh->fh_base.fh_pad[0])), -- kread(&(fh->fh_base.fh_pad[1])), -- kread(&(fh->fh_base.fh_pad[2])), -- kread(&(fh->fh_base.fh_pad[3])), -- kread(&(fh->fh_base.fh_pad[4])), -- kread(&(fh->fh_base.fh_pad[5]))); -- CATCH_DEREF_FAULT(); --%} -+@define __svc_fh_cast(fhp) -+%( -+ @cast(@fhp, "svc_fh", "kernel:nfsd")->fh_handle -+%) -+ -+/* Get file handler data from struct svc_fh */ -+function __svc_fh:string(fhp:long) -+{ -+ return sprintf("%d: %08x %08x %08x %08x %08x %08x", -+ @__svc_fh_cast(fhp)->fh_size, -+ @__svc_fh_cast(fhp)->fh_base->fh_pad[0], -+ @__svc_fh_cast(fhp)->fh_base->fh_pad[1], -+ @__svc_fh_cast(fhp)->fh_base->fh_pad[2], -+ @__svc_fh_cast(fhp)->fh_base->fh_pad[3], -+ @__svc_fh_cast(fhp)->fh_base->fh_pad[4], -+ @__svc_fh_cast(fhp)->fh_base->fh_pad[5]) -+} - - function nfs3_cmode:string(cmode:long) %{ /* pure */ - int cmode = (int)(long)STAP_ARG_cmode; - -commit 957812abcb03ad5eb2b544c7fff111b967deb211 -Author: David Smith -Date: Mon Dec 8 16:17:06 2014 -0600 - - BZ117823: Simplify fix using typed-integers. - - * tapset/linux/nfsd.stp: Simplify __svc_fh() fix which removes macro. - -diff --git a/tapset/linux/nfsd.stp b/tapset/linux/nfsd.stp -index 7ec2856..7aebb9c 100644 ---- a/tapset/linux/nfsd.stp -+++ b/tapset/linux/nfsd.stp -@@ -38,22 +38,14 @@ - *15 :nfsd.proc3.rename.tfh - */ - --@define __svc_fh_cast(fhp) --%( -- @cast(@fhp, "svc_fh", "kernel:nfsd")->fh_handle --%) -- --/* Get file handler data from struct svc_fh */ -+/* Get file handle data from struct svc_fh. */ - function __svc_fh:string(fhp:long) - { -- return sprintf("%d: %08x %08x %08x %08x %08x %08x", -- @__svc_fh_cast(fhp)->fh_size, -- @__svc_fh_cast(fhp)->fh_base->fh_pad[0], -- @__svc_fh_cast(fhp)->fh_base->fh_pad[1], -- @__svc_fh_cast(fhp)->fh_base->fh_pad[2], -- @__svc_fh_cast(fhp)->fh_base->fh_pad[3], -- @__svc_fh_cast(fhp)->fh_base->fh_pad[4], -- @__svc_fh_cast(fhp)->fh_base->fh_pad[5]) -+ svc_fh = &@cast(fhp, "svc_fh", "kernel:nfsd")->fh_handle -+ return sprintf("%d: %08x %08x %08x %08x %08x %08x", svc_fh->fh_size, -+ svc_fh->fh_base->fh_pad[0], svc_fh->fh_base->fh_pad[1], -+ svc_fh->fh_base->fh_pad[2], svc_fh->fh_base->fh_pad[3], -+ svc_fh->fh_base->fh_pad[4], svc_fh->fh_base->fh_pad[5]) - } - - function nfs3_cmode:string(cmode:long) %{ /* pure */ diff --git a/SOURCES/rhbz1212658.patch b/SOURCES/rhbz1212658.patch deleted file mode 100644 index 0a72fc8..0000000 --- a/SOURCES/rhbz1212658.patch +++ /dev/null @@ -1,120 +0,0 @@ -commit 985408d2120252fc68bd8afd0e5425ccf1d75dda -Author: Qiao Nuohan -Date: Tue Apr 7 10:06:33 2015 -0500 - - Fix failure of signing modules on XFS. - - * stap-serverd.cxx (mok_dir_valid_p): Call stat() if readdir() returns - 'DT_UNKNOWN'. Certain filesystems like XFS don't implement returning the - file type. - -diff --git a/stap-serverd.cxx b/stap-serverd.cxx -index 40b3c39..de71f10 100644 ---- a/stap-serverd.cxx -+++ b/stap-serverd.cxx -@@ -370,13 +370,28 @@ mok_dir_valid_p (string mok_fingerprint, bool verbose) - struct dirent *direntp; - while ((direntp = readdir (dirp)) != NULL) - { -- if (! priv_found && direntp->d_type == DT_REG -+ bool reg_file = false; -+ -+ if (direntp->d_type == DT_REG) -+ reg_file = true; -+ else if (direntp->d_type == DT_UNKNOWN) -+ { -+ struct stat tmpstat; -+ -+ // If the filesystem doesn't support d_type, we'll have to -+ // call stat(). -+ stat((mok_dir + "/" + direntp->d_name).c_str (), &tmpstat); -+ if (S_ISREG(tmpstat.st_mode)) -+ reg_file = true; -+ } -+ -+ if (! priv_found && reg_file - && strcmp (direntp->d_name, MOK_PRIVATE_CERT_NAME) == 0) - { - priv_found = true; - continue; - } -- if (! cert_found && direntp->d_type == DT_REG -+ if (! cert_found && reg_file - && strcmp (direntp->d_name, MOK_PUBLIC_CERT_NAME) == 0) - { - cert_found = true; - -commit 112095a21f6c18424f7d1f9540d395778e8f79dd -Author: Qiao Nuohan -Date: Tue Apr 7 10:33:09 2015 -0500 - - Fix another d_type problem on XFS. - - * stap-serverd.cxx (get_server_mok_fingerprints): Call stat() if readdir() - returns 'DT_UNKNOWN'. Certain filesystems like XFS don't implement - returning the file type. - -diff --git a/stap-serverd.cxx b/stap-serverd.cxx -index de71f10..eeb32cf 100644 ---- a/stap-serverd.cxx -+++ b/stap-serverd.cxx -@@ -473,7 +473,19 @@ get_server_mok_fingerprints(vector &mok_fingerprints, bool verbose, - { - // We're only interested in directories (of key files). - if (direntp->d_type != DT_DIR) -- continue; -+ { -+ if (direntp->d_type == DT_UNKNOWN) -+ { -+ // If the filesystem doesn't support d_type, we'll have to -+ // call stat(). -+ struct stat tmpstat; -+ stat((mok_path + "/" + direntp->d_name).c_str (), &tmpstat); -+ if (!S_ISDIR(tmpstat.st_mode)) -+ continue; -+ } -+ else -+ continue; -+ } - - // We've got a directory. If the directory name isn't in the right - // format for a MOK fingerprint, skip it. -commit ed64d10fb7def700729cf553c8463f0882f1134a -Author: David Smith -Date: Thu Apr 30 12:56:12 2015 -0500 - - Fix PR18361 by supporting RHEL7's 'securelevel' feature. - - * session.cxx (modules_must_be_signed): Check the - '/sys/kernel/security/securelevel' file for the value '1'. If so, - modules must be signed. - -diff --git a/session.cxx b/session.cxx -index 3753445..0475d29 100644 ---- a/session.cxx -+++ b/session.cxx -@@ -2441,16 +2441,24 @@ systemtap_session::parse_stap_color(const std::string& type) - * This routine parses /sys/module/module/parameters/sig_enforce to - * figure out if signatures are enforced on modules. Note that if the - * file doesn't exist, we don't really care and return false. -+ * -+ * On certain kernels (RHEL7), we also have to check -+ * /sys/kernel/security/securelevel. - */ - bool - systemtap_session::modules_must_be_signed() - { - ifstream statm("/sys/module/module/parameters/sig_enforce"); -+ ifstream securelevel("/sys/kernel/security/securelevel"); - char status = 'N'; - - statm >> status; - if (status == 'Y') - return true; -+ -+ securelevel >> status; -+ if (status == '1') -+ return true; - return false; - } - diff --git a/SOURCES/rhbz1237098.patch b/SOURCES/rhbz1237098.patch new file mode 100644 index 0000000..eea1698 --- /dev/null +++ b/SOURCES/rhbz1237098.patch @@ -0,0 +1,157 @@ +commit 6121861509bf5862b2869c71c7d1bbf618f45d46 +Author: Josh Stone +Date: Mon Jul 6 11:35:51 2015 -0700 + + PR18555: prefer linkage_name to match the symtab + + DW_AT_name is usually only the same as the symbol table for C. C++ + names are mangled, which may be given by DW_AT_linkage_name. So if we + want to compare a DWARF subprogram to the symbol table by name, we + should prefer the linkage name when it's available. + + This mattered especially for ppc64le, where query_dwarf_func was trying + to apply the global/local symbol offset. When we took a DWARF C++ + function and tried to find that name in the symbol table for its offset, + there was no match, so the function wouldn't be resolved at all. + + Now that lookup uses the linkage name. If there's still no match, like + with a stripped symbol table, then it falls through to just use DWARF's + entrypc as usual. + + This patch also maintains the raw "addr" and offset "entrypc" separately + for symbol table functions, so for instance update_symtab can still + compare the original address. + +diff --git a/tapsets.cxx b/tapsets.cxx +index fed4166..54f9d3d 100644 +--- a/tapsets.cxx ++++ b/tapsets.cxx +@@ -415,7 +415,7 @@ symbol_table + // Set to SHN_UNDEF if there is no such section. + GElf_Word opd_section; + void add_symbol(const char *name, bool weak, bool descriptor, +- Dwarf_Addr addr, Dwarf_Addr *high_addr); ++ Dwarf_Addr addr, Dwarf_Addr entrypc); + enum info_status get_from_elf(); + void prepare_section_rejection(Dwfl_Module *mod); + bool reject_section(GElf_Word section); +@@ -1068,19 +1068,19 @@ query_symtab_func_info (func_info & fi, dwarf_query * q) + { + assert(null_die(&fi.die)); + +- Dwarf_Addr addr = fi.addr; ++ Dwarf_Addr entrypc = fi.entrypc; + + // Now compensate for the dw bias because the addresses come +- // from dwfl_module_symtab, so fi->addr is NOT a normal dw address. ++ // from dwfl_module_symtab, so fi->entrypc is NOT a normal dw address. + q->dw.get_module_dwarf(false, false); +- addr -= q->dw.module_bias; ++ entrypc -= q->dw.module_bias; + + // If there are already probes in this module, lets not duplicate. + // This can come from other weak symbols/aliases or existing +- // matches from Dwarf DIE functions. Try to add this addr to the ++ // matches from Dwarf DIE functions. Try to add this entrypc to the + // collection, and only continue if it was new. +- if (q->alias_dupes.insert(addr).second) +- query_func_info(addr, fi, q); ++ if (q->alias_dupes.insert(entrypc).second) ++ query_func_info(entrypc, fi, q); + } + + void +@@ -2059,7 +2059,7 @@ query_dwarf_inline_instance (Dwarf_Die * die, dwarf_query * q) + } + + static bool +-is_filtered_func_exists (func_info_map_t filtered, func_info *fi) ++is_filtered_func_exists (func_info_map_t const& filtered, func_info *fi) + { + for (unsigned i = 0; i < filtered.size(); i++) + { +@@ -2135,16 +2135,22 @@ query_dwarf_func (Dwarf_Die * func, dwarf_query * q) + if ((em->e_machine == EM_PPC64) && ((em->e_flags & EF_PPC64_ABI) == 2) + && (q->dw.mod_info->sym_table)) + { +- set fis = q->dw.mod_info->sym_table->lookup_symbol(func.name); ++ /* The linkage name is the best match for the symbol table. */ ++ const string& linkage_name = dwarf_linkage_name(&func.die) ++ ?: dwarf_diename(&func.die) ?: func.name; ++ ++ set fis = q->dw.mod_info->sym_table->lookup_symbol(linkage_name); + for (set::iterator it=fis.begin(); it!=fis.end() ; ++it) + { +- func.entrypc = (*it)->addr; ++ func.entrypc = (*it)->entrypc; + if (is_filtered_func_exists(q->filtered_functions, &func)) + continue; + q->filtered_functions.push_back(func); + } + } +- else if (!func.entrypc && q->dw.function_entrypc (&entrypc)) ++ ++ /* If not ppc64 or not found in sym_table, try it directly. */ ++ if (!func.entrypc && q->dw.function_entrypc (&entrypc)) + { + func.entrypc = entrypc; + q->filtered_functions.push_back (func); +@@ -8201,7 +8207,7 @@ symbol_table::~symbol_table() + + void + symbol_table::add_symbol(const char *name, bool weak, bool descriptor, +- Dwarf_Addr addr, Dwarf_Addr* /*high_addr*/) ++ Dwarf_Addr addr, Dwarf_Addr entrypc) + { + /* Does the target architecture have function descriptors? + Then we want to filter them out. When seeing a symbol with a name +@@ -8224,6 +8230,7 @@ symbol_table::add_symbol(const char *name, bool weak, bool descriptor, + } + + func_info *fi = new func_info(); ++ fi->entrypc = entrypc; + fi->addr = addr; + fi->name = name; + fi->weak = weak; +@@ -8288,7 +8295,6 @@ symbol_table::reject_section(GElf_Word section) + enum info_status + symbol_table::get_from_elf() + { +- Dwarf_Addr high_addr = 0; + Dwfl_Module *mod = mod_info->mod; + int syments = dwfl_module_getsymtab(mod); + assert(syments); +@@ -8336,13 +8342,14 @@ symbol_table::get_from_elf() + * + * st_other field is currently only used with ABIv2 on ppc64 + */ ++ Dwarf_Addr entrypc = addr; + if ((em->e_machine == EM_PPC64) && ((em->e_flags & EF_PPC64_ABI) == 2) + && (GELF_ST_TYPE(sym.st_info) == STT_FUNC) && sym.st_other) +- addr += PPC64_LOCAL_ENTRY_OFFSET(sym.st_other); ++ entrypc += PPC64_LOCAL_ENTRY_OFFSET(sym.st_other); + + if (name && GELF_ST_TYPE(sym.st_info) == STT_FUNC) + add_symbol(name, (GELF_ST_BIND(sym.st_info) == STB_WEAK), +- reject, addr, &high_addr); ++ reject, addr, entrypc); + if (name && GELF_ST_TYPE(sym.st_info) == STT_OBJECT + && GELF_ST_BIND(sym.st_info) == STB_GLOBAL) + globals[name] = addr; +@@ -8486,12 +8493,13 @@ module_info::update_symtab(cu_function_cache_t *funcs) + continue; + } + +- // XXX We may want to make additional efforts to match mangled elf names +- // to dwarf too. MIPS_linkage_name can help, but that's sometimes ++ // We need to make additional efforts to match mangled elf names to dwarf ++ // too. DW_AT_linkage_name (or w/ MIPS) can help, but that's sometimes + // missing, so we may also need to try matching by address. See also the + // notes about _Z in dwflpp::iterate_over_functions(). ++ const string& name = dwarf_linkage_name(&func->second) ?: func->first; + +- set fis = sym_table->lookup_symbol(func->first); ++ set fis = sym_table->lookup_symbol(name); + if (fis.empty()) + continue; + diff --git a/SOURCES/rhbz1242992.patch b/SOURCES/rhbz1242992.patch new file mode 100644 index 0000000..d01e26b --- /dev/null +++ b/SOURCES/rhbz1242992.patch @@ -0,0 +1,91 @@ +commit 00ddbc6920530ed042260719e4faf690c2d38541 +Author: Lukas Berk +Date: Wed Jul 15 10:46:27 2015 -0400 + + Add ppc64le to java/Makefile.* + + java/Makefile.am - add JAVA_ARCH override for ppc64le + java/Makefile.in - add JAVA_ARCH override for ppc64le + +diff --git a/java/Makefile.am b/java/Makefile.am +index bd1efe8..2d5bba0 100644 +--- a/java/Makefile.am ++++ b/java/Makefile.am +@@ -10,6 +10,7 @@ override JAVA_ARCH:=$(JAVA_ARCH:i%86=i386) + override JAVA_ARCH:=$(JAVA_ARCH:sparcv9=sparc) + override JAVA_ARCH:=$(JAVA_ARCH:sparc64=sparcv9) + override JAVA_ARCH:=$(JAVA_ARCH:arm%=arm) ++override JAVA_ARCH:=$(JAVA_ARCH:powerpc64le%=ppc64le) + override JAVA_ARCH:=$(JAVA_ARCH:powerpc64%=ppc64) + + # XXX: perhaps autoconfigure the following? +diff --git a/java/Makefile.in b/java/Makefile.in +index 5e9f5a7..f98c79b 100644 +--- a/java/Makefile.in ++++ b/java/Makefile.in +@@ -725,6 +725,7 @@ override JAVA_ARCH:=$(JAVA_ARCH:i%86=i386) + override JAVA_ARCH:=$(JAVA_ARCH:sparcv9=sparc) + override JAVA_ARCH:=$(JAVA_ARCH:sparc64=sparcv9) + override JAVA_ARCH:=$(JAVA_ARCH:arm%=arm) ++override JAVA_ARCH:=$(JAVA_ARCH:powerpc64le%=ppc64le) + override JAVA_ARCH:=$(JAVA_ARCH:powerpc64%=ppc64) + @HAVE_JAVA_TRUE@$(HELPERSDT).class: $(srcdir)/$(HELPERSDT).java + @HAVE_JAVA_TRUE@ $(JAVAC) -d . $(srcdir)/$(HELPERSDT).java + +commit 5e5ec35cf1470bd52aca1bb73e76d205dcce01fc +Author: Lukas Berk +Date: Wed Jul 15 11:22:17 2015 -0400 + + systemtap.spec changes for ppc64{be,le} java helper library symlinking + + systemtap.spec - remove special clauses ppc64{be,le} linking + +diff --git a/systemtap.spec b/systemtap.spec +index 39f2130..23d1173 100644 +--- a/systemtap.spec ++++ b/systemtap.spec +@@ -775,12 +775,8 @@ exit 0 + + %triggerin runtime-java -- java-1.7.0-openjdk, java-1.6.0-openjdk + for f in %{_libexecdir}/systemtap/libHelperSDT_*.so; do +- %ifarch %{ix86} ppc64 ppc64le +- %ifarch ppc64 ppc64le +- arch=ppc64 +- %else +- arch=i386 +- %endif ++ %ifarch %{ix86} ++ arch=i386 + %else + arch=`basename $f | cut -f2 -d_ | cut -f1 -d.` + %endif +@@ -794,12 +790,8 @@ done + + %triggerun runtime-java -- java-1.7.0-openjdk, java-1.6.0-openjdk + for f in %{_libexecdir}/systemtap/libHelperSDT_*.so; do +- %ifarch %{ix86} ppc64 ppc64le +- %ifarch ppc64 ppc64le +- arch=ppc64 +- %else +- arch=i386 +- %endif ++ %ifarch %{ix86} ++ arch=i386 + %else + arch=`basename $f | cut -f2 -d_ | cut -f1 -d.` + %endif +@@ -812,12 +804,8 @@ done + %triggerpostun runtime-java -- java-1.7.0-openjdk, java-1.6.0-openjdk + # Restore links for any JDKs remaining after a package removal: + for f in %{_libexecdir}/systemtap/libHelperSDT_*.so; do +- %ifarch %{ix86} ppc64 ppc64le +- %ifarch ppc64 ppc64le +- arch=ppc64 +- %else +- arch=i386 +- %endif ++ %ifarch %{ix86} ++ arch=i386 + %else + arch=`basename $f | cut -f2 -d_ | cut -f1 -d.` + %endif diff --git a/SOURCES/rhbz1248159.patch b/SOURCES/rhbz1248159.patch new file mode 100644 index 0000000..57a3b0e --- /dev/null +++ b/SOURCES/rhbz1248159.patch @@ -0,0 +1,76 @@ +commit 7cfb10eca050964b22bc8f25dd4682b409434078 +Author: Martin Cermak +Date: Fri Jul 31 17:40:18 2015 +0200 + + Fix PR18711 by updating the netfilter code for new rhel-7.2 kernels. + + * buildrun.cxx (compile_pass): Add new netfilter autoconf test. + * runtime/linux/autoconf-netfilter-313b.c: New autoconf test. + * tapset-netfilter.cxx: (emit_module_decls): Add support for new + netfilter code backported to kernel-3.10.0-284.el7. + +diff --git a/buildrun.cxx b/buildrun.cxx +index e4b2697..d7a431d 100644 +--- a/buildrun.cxx ++++ b/buildrun.cxx +@@ -385,6 +385,7 @@ compile_pass (systemtap_session& s) + output_autoconf(s, o, "autoconf-fs_supers-hlist.c", "STAPCONF_FS_SUPERS_HLIST", NULL); + output_autoconf(s, o, "autoconf-compat_sigaction.c", "STAPCONF_COMPAT_SIGACTION", NULL); + output_autoconf(s, o, "autoconf-netfilter.c", "STAPCONF_NETFILTER_V313", NULL); ++ output_autoconf(s, o, "autoconf-netfilter-313b.c", "STAPCONF_NETFILTER_V313B", NULL); + output_autoconf(s, o, "autoconf-netfilter-4_1.c", "STAPCONF_NETFILTER_V41", 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); +diff --git a/runtime/linux/autoconf-netfilter-313b.c b/runtime/linux/autoconf-netfilter-313b.c +new file mode 100644 +index 0000000..3b18830 +--- /dev/null ++++ b/runtime/linux/autoconf-netfilter-313b.c +@@ -0,0 +1,22 @@ ++#include ++ ++// Similarly to autoconf-netfilter-4_1.c, this autoconf test covers ++// backport of kernel patch 238e54c9cb9385a1ba99e92801f3615a2fb398b6 ++// to kernel-3.10.0-284.el7 per rhbz1230935#c4 as patch no 119478. ++// This fixes PR18711. ++ ++unsigned int ++new_style_hook(const struct nf_hook_ops *ops, ++ struct sk_buff *skb, ++ const struct net_device *nf_in, ++ const struct net_device *nf_out, ++ const struct nf_hook_state *state) ++{ ++ (void) ops; (void) skb; (void) nf_in; (void) nf_out; (void) state; ++ return 0; ++} ++ ++struct nf_hook_ops netfilter_ops = { ++ .hook = new_style_hook ++}; ++ +diff --git a/tapset-netfilter.cxx b/tapset-netfilter.cxx +index 12df8d7..a820b8d 100644 +--- a/tapset-netfilter.cxx ++++ b/tapset-netfilter.cxx +@@ -277,6 +277,11 @@ netfilter_derived_probe_group::emit_module_decls (systemtap_session& s) + s.op->newline() << "(const struct nf_hook_ops *nf_ops, struct sk_buff *nf_skb, const struct net_device *nf_in, const struct net_device *nf_out, int (*nf_okfn)(struct sk_buff *))"; + s.op->newline() << "{"; + ++ s.op->newline() << "#elif defined(STAPCONF_NETFILTER_V313B)"; ++ ++ s.op->newline() << "(const struct nf_hook_ops *nf_ops, struct sk_buff *nf_skb, const struct net_device *nf_in, const struct net_device *nf_out, const struct nf_hook_state *nf_state)"; ++ s.op->newline() << "{"; ++ + s.op->newline() << "#elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22)"; + + s.op->newline() << "(unsigned int nf_hooknum, struct sk_buff *nf_skb, const struct net_device *nf_in, const struct net_device *nf_out, int (*nf_okfn)(struct sk_buff *))"; +@@ -291,7 +296,7 @@ netfilter_derived_probe_group::emit_module_decls (systemtap_session& s) + s.op->newline(-1) << "#endif"; + s.op->newline(1) << "const struct stap_probe * const stp = & stap_probes[" << np->session_index << "];"; + s.op->newline() << "int nf_verdict = NF_ACCEPT;"; // default NF_ACCEPT, to be used by $verdict context var +- s.op->newline() << "#if defined(STAPCONF_NETFILTER_V313) || defined(STAPCONF_NETFILTER_V41)"; ++ s.op->newline() << "#if defined(STAPCONF_NETFILTER_V313) || defined(STAPCONF_NETFILTER_V313B) || defined(STAPCONF_NETFILTER_V41)"; + s.op->newline() << "unsigned int nf_hooknum = nf_ops->hooknum;"; + s.op->newline() << "#endif"; + s.op->newline() << "#ifdef STAPCONF_NETFILTER_V41"; diff --git a/SOURCES/rhbz1252436.patch b/SOURCES/rhbz1252436.patch new file mode 100644 index 0000000..4c6a4bb --- /dev/null +++ b/SOURCES/rhbz1252436.patch @@ -0,0 +1,68 @@ +commit 86f726b7785a035a2d6bc9ec2642c46621587d23 +Author: David Smith +Date: Tue Jul 7 14:01:27 2015 -0500 + + Fixed PR18634 by getting timer probes to compile on rawhide. + + * runtime/linux/timer.c (_stp_hrtimer_init): If STAPCONF_HRTIMER_GET_RES + isn't defined, meaning hrtimer_get_res() doesn't exist, just use the + 'hrtimer_resolution' variable. + * buildrun.cxx (compile_pass): Add an export test for hrtimer_get_res(). + * translate.cxx (emit_common_header): Remove generated inclusion of + linux/hrtimer.h. + * runtime/linux/timer.h: Add inclusion of linux/hrtimer.h. + +diff --git a/buildrun.cxx b/buildrun.cxx +index 37b989f..e4b2697 100644 +--- a/buildrun.cxx ++++ b/buildrun.cxx +@@ -310,6 +310,7 @@ compile_pass (systemtap_session& s) + o << "$(STAPCONF_HEADER):" << endl; + o << "\t@echo -n > $@" << endl; + output_autoconf(s, o, "autoconf-hrtimer-rel.c", "STAPCONF_HRTIMER_REL", NULL); ++ output_exportconf(s, o, "hrtimer_get_res", "STAPCONF_HRTIMER_GET_RES"); + 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); +diff --git a/runtime/linux/timer.c b/runtime/linux/timer.c +index 03d8f3f..f24a5ee 100644 +--- a/runtime/linux/timer.c ++++ b/runtime/linux/timer.c +@@ -15,9 +15,13 @@ + + static void _stp_hrtimer_init(void) + { ++#if defined(STAPCONF_HRTIMER_GET_RES) + struct timespec res; + hrtimer_get_res (CLOCK_MONOTONIC, &res); + stap_hrtimer_resolution = timespec_to_ns(&res); ++#else ++ stap_hrtimer_resolution = hrtimer_resolution; ++#endif + } + + +diff --git a/runtime/linux/timer.h b/runtime/linux/timer.h +index e9a5271..e7e0bb6 100644 +--- a/runtime/linux/timer.h ++++ b/runtime/linux/timer.h +@@ -15,6 +15,7 @@ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) + #error "hrtimers not implemented" + #else /* kernel version >= 2.6.17 */ ++#include + + static unsigned long stap_hrtimer_resolution = 0; + +diff --git a/translate.cxx b/translate.cxx +index 390a73e..6e335b2 100644 +--- a/translate.cxx ++++ b/translate.cxx +@@ -1177,7 +1177,6 @@ c_unparser::emit_common_header () + o->newline(-1) << "}"; + + o->newline( 0) << "#ifdef STP_ON_THE_FLY_TIMER_ENABLE"; +- o->newline( 0) << "#include "; + o->newline( 0) << "#include \"timer.h\""; + o->newline( 0) << "static struct hrtimer module_refresh_timer;"; + diff --git a/SOURCES/rhbz1254856.patch b/SOURCES/rhbz1254856.patch new file mode 100644 index 0000000..2e38e1f --- /dev/null +++ b/SOURCES/rhbz1254856.patch @@ -0,0 +1,71 @@ +commit 3fc11ed07bad37dfefc866e24d92682d7ef1d819 +Author: David Smith +Date: Thu Aug 20 11:27:53 2015 -0500 + + Fix PR18856 by making nfsd.close optional. + + * tapset/linux/nfsd.stp: Make nfsd.close optional in nfsd.entries (and add + it optionally to nfsd.return), since the underlying probe point no + longer exists in kernels 4.2+. Also add nfsd.proc.commit.return to + nfsd.proc.return (to match nfsd.proc). + * testsuite/buildok/nfsd-detailed.stp: Make nfsd.close tests optional. + +diff --git a/tapset/linux/nfsd.stp b/tapset/linux/nfsd.stp +index 7aebb9c..71956a1 100644 +--- a/tapset/linux/nfsd.stp ++++ b/tapset/linux/nfsd.stp +@@ -211,6 +211,7 @@ probe nfsd.proc.entries = nfsd.proc.lookup, + probe nfsd.proc.return = nfsd.proc.lookup.return, + nfsd.proc.read.return, + nfsd.proc.write.return, ++ nfsd.proc.commit.return, + nfsd.proc.remove.return, + nfsd.proc.rename.return, + nfsd.proc.create.return +@@ -1064,7 +1065,7 @@ probe nfsd.entries = nfsd.open, + nfsd.createv3, + nfsd.unlink, + nfsd.rename, +- nfsd.close ++ nfsd.close ? + {} + + probe nfsd.return = nfsd.open.return, +@@ -1075,7 +1076,8 @@ probe nfsd.return = nfsd.open.return, + nfsd.create.return, + nfsd.createv3.return, + nfsd.unlink.return, +- nfsd.rename.return ++ nfsd.rename.return, ++ nfsd.close.return ? + {} + + /** +@@ -1113,6 +1115,8 @@ probe nfsd.open.return = kernel.function("nfsd_open").return !, + * probe nfsd.close - NFS server closing a file for client + * + * @filename: file name ++ * ++ * This probe point does not exist in kernels starting with 4.2. + */ + probe nfsd.close = __nfsd.call_close ?, __nfsd.inlined_close ? + { +diff --git a/testsuite/buildok/nfsd-detailed.stp b/testsuite/buildok/nfsd-detailed.stp +index 627f3a2..f862079 100755 +--- a/testsuite/buildok/nfsd-detailed.stp ++++ b/testsuite/buildok/nfsd-detailed.stp +@@ -229,12 +229,12 @@ probe nfsd.open.return + # nfsd.close tests + # + +-probe nfsd.close ++probe nfsd.close ? + { + printf("%s(%s)\n", name, argstr) + printf("%s\n", client_ip) + } +-probe nfsd.close.return ++probe nfsd.close.return ? + { + printf("%s(%s)\n", name, retstr) + } diff --git a/SOURCES/rhbz1257399.patch b/SOURCES/rhbz1257399.patch new file mode 100644 index 0000000..7d8d815 --- /dev/null +++ b/SOURCES/rhbz1257399.patch @@ -0,0 +1,530 @@ +commit 0caa975190e4d2b19e7b65a0b23a7700522aa5d7 +Author: Frank Ch. Eigler +Date: Mon Aug 31 11:17:33 2015 -0400 + + PR18889 part: improve module-notification related debug tracing + + -DDEBUG_KPROBES -DDEBUG_SYMBOLS -DDEBUG_STP_ON_THE_FLY recommended. + +diff --git a/runtime/linux/kprobes.c b/runtime/linux/kprobes.c +index 47eb29a..54c224e 100644 +--- a/runtime/linux/kprobes.c ++++ b/runtime/linux/kprobes.c +@@ -567,6 +567,8 @@ stapkp_refresh(const char *modname, + { + size_t i; + ++ dbug_stapkp("refresh %lu probes with module %s\n", nprobes, modname ?: "?"); ++ + for (i = 0; i < nprobes; i++) { + + struct stap_dwarf_probe *sdp = &probes[i]; +diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c +index fe576c1..9ea2b5b 100644 +--- a/runtime/transport/symbols.c ++++ b/runtime/transport/symbols.c +@@ -1,7 +1,7 @@ +-/* -*- linux-c -*- ++/* -*- linux-c -*- + * symbols.c - stp symbol and module functions + * +- * Copyright (C) Red Hat Inc, 2006-2012 ++ * Copyright (C) Red Hat Inc, 2006-2015 + * + * This file is part of systemtap, and is free software. You can + * redistribute it and/or modify it under the terms of the GNU General +@@ -121,10 +121,26 @@ static unsigned _stp_module_nsections (struct module_sect_attrs *attrs) + static int _stp_module_notifier (struct notifier_block * nb, + unsigned long val, void *data) + { ++ struct module *mod = data; ++ struct module_sect_attrs *attrs; ++ unsigned i, nsections; ++ ++ (void) attrs; ++ (void) i; ++ (void) nsections; ++ ++ if (!mod) { // so as to avoid null pointer checks later ++ WARN_ON (!mod); ++ return NOTIFY_DONE; ++ } ++ ++ dbug_sym(1, "module notify %lu %s attrs %p\n", ++ val, mod->name, mod->sect_attrs); ++ + /* Prior to 2.6.11, struct module contained a module_sections + attribute vector rather than module_sect_attrs. Prior to + 2.6.19, module_sect_attrs lacked a number-of-sections +- field. Past 3.8, MODULE_STATE_COMING is sent too early to ++ field. Past 3.8, MODULE_STATE_COMING is sent too early to + let us probe module init functions. + + Without CONFIG_KALLSYMS, we don't get any of the +@@ -132,11 +148,6 @@ static int _stp_module_notifier (struct notifier_block * nb, + that directly? */ + + #if defined(CONFIG_KALLSYMS) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) +- struct module *mod = data; +- struct module_sect_attrs *attrs; +- unsigned i, nsections; +- WARN_ON (!mod); +- + if (val == MODULE_STATE_COMING || + val == MODULE_STATE_LIVE) { + /* A module is arriving or has arrived. Register all +@@ -145,6 +156,7 @@ static int _stp_module_notifier (struct notifier_block * nb, + did the fishie go? */ + + attrs = mod->sect_attrs; ++ dbug_sym(1, "module_sect_attrs: %p\n", attrs); + if (attrs == NULL) // until add_sect_attrs(), may be zero + return NOTIFY_DONE; // remain ignorant + +@@ -153,7 +165,7 @@ static int _stp_module_notifier (struct notifier_block * nb, + int init_p = (strstr(attrs->attrs[i].name, "init.") != NULL); + int init_gone_p = (val == MODULE_STATE_LIVE); // likely already unloaded + +- _stp_kmodule_update_address(mod->name, ++ _stp_kmodule_update_address(mod->name, + attrs->attrs[i].name, + ((init_p && init_gone_p) ? 0 : attrs->attrs[i].address)); + } +@@ -161,7 +173,7 @@ static int _stp_module_notifier (struct notifier_block * nb, + /* Verify build-id. */ + if (_stp_kmodule_check (mod->name)) + _stp_kmodule_update_address(mod->name, NULL, 0); /* Pretend it was never here. */ +- } ++ } + else if (val == MODULE_STATE_GOING) { + /* Unregister all sections. */ + _stp_kmodule_update_address(mod->name, NULL, 0); + +commit 2278079efc01124dd509241f6c6eadbd6e19cb2a +Author: Frank Ch. Eigler +Date: Mon Aug 31 17:46:43 2015 -0400 + + PR18889 part: module-init notification via module_{load,free} tracepoints + + Investigating RHBZ1257399 et al., we found that module_notifier is + being called too early after kernel commit #4982223e51. This + precludes normal module section-address computation and thus kprobe + emplacement. This patch adds hooking into the module_{load,free} + tracepoints in parallel, because on some kernels (RHEL7.1.Z+) they + occur at just the right time. + + On the downside, on recent LKML kernels, attaching to those + tracepoints requires EXPORT_TRACEPOINT_SYMBOL_GPL's, so until that is + done (or another workaround made), LKML kernels will still miss out on + module-init probing. + +diff --git a/buildrun.cxx b/buildrun.cxx +index d7a431d..6d66b5a 100644 +--- a/buildrun.cxx ++++ b/buildrun.cxx +@@ -1,5 +1,5 @@ + // build/run probes +-// Copyright (C) 2005-2014 Red Hat Inc. ++// Copyright (C) 2005-2015 Red Hat Inc. + // + // This file is part of systemtap, and is free software. You can + // redistribute it and/or modify it under the terms of the GNU General +@@ -377,8 +377,10 @@ compile_pass (systemtap_session& s) + output_exportconf(s, o, "proc_create_data", "STAPCONF_PROC_CREATE_DATA"); + output_exportconf(s, o, "PDE_DATA", "STAPCONF_PDE_DATA"); + output_autoconf(s, o, "autoconf-module-sect-attrs.c", "STAPCONF_MODULE_SECT_ATTRS", NULL); +- + output_autoconf(s, o, "autoconf-utrace-via-tracepoints.c", "STAPCONF_UTRACE_VIA_TRACEPOINTS", NULL); ++ output_autoconf(s, o, "autoconf-module-tracepoints.c", "STAPCONF_MODULE_TRACEPOINT", NULL); ++ output_exportconf(s, o, "__tracepoint_module_load", "STAPCONF_MODULE_TRACEPOINT_EXPORT_LOAD"); ++ output_exportconf(s, o, "__tracepoint_module_free", "STAPCONF_MODULE_TRACEPOINT_EXPORT_FREE"); + output_autoconf(s, o, "autoconf-task_work-struct.c", "STAPCONF_TASK_WORK_STRUCT", NULL); + output_autoconf(s, o, "autoconf-vm-area-pte.c", "STAPCONF_VM_AREA_PTE", NULL); + output_autoconf(s, o, "autoconf-relay-umode_t.c", "STAPCONF_RELAY_UMODE_T", NULL); +diff --git a/runtime/linux/autoconf-module-tracepoints.c b/runtime/linux/autoconf-module-tracepoints.c +new file mode 100644 +index 0000000..77b938e +--- /dev/null ++++ b/runtime/linux/autoconf-module-tracepoints.c +@@ -0,0 +1,31 @@ ++#include ++#include ++ ++// NB: in kernels which do have the requisite pieces, just unconfigured, then ++// everything below will compile just fine, only returning ENOSYS at runtime. ++// To get the compile-time error that autoconf needs, check it directly: ++#ifndef CONFIG_TRACEPOINTS ++#error "CONFIG_TRACEPOINTS is not enabled" ++#endif ++ ++// presuming void *data-parametrized tracepoint callback api ++ ++void __module_load(void *cb_data, struct module* mod) ++{ ++ (void) cb_data; ++ (void) mod; ++ return; ++} ++ ++void __module_free(void *cb_data, struct module* mod) ++{ ++ (void) cb_data; ++ (void) mod; ++ return; ++} ++ ++void __autoconf_func(void) ++{ ++ (void) register_trace_module_load(__module_load, NULL); ++ (void) register_trace_module_free(__module_free, NULL); ++} +diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c +index 9ea2b5b..4266e5d 100644 +--- a/runtime/transport/symbols.c ++++ b/runtime/transport/symbols.c +@@ -125,6 +125,7 @@ static int _stp_module_notifier (struct notifier_block * nb, + struct module_sect_attrs *attrs; + unsigned i, nsections; + ++ (void) nb; + (void) attrs; + (void) i; + (void) nsections; +@@ -191,6 +192,21 @@ static int _stp_module_notifier (struct notifier_block * nb, + return NOTIFY_DONE; + } + ++ ++#ifdef STAPCONF_MODULE_TRACEPOINT ++/* We just delegate to the canonical notifier function */ ++static void _stp_module_load_tp(void *data, struct module* mod) ++{ ++ (void) _stp_module_notifier (NULL, MODULE_STATE_COMING, mod); ++ ++} ++static void _stp_module_free_tp(void *data, struct module* mod) ++{ ++ (void) _stp_module_notifier (NULL, MODULE_STATE_GOING, mod); ++} ++#endif ++ ++ + static int _stp_module_update_self (void) + { + /* Only bother if we need unwinding and have module_sect_attrs. */ +diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c +index 54e9b41..e069a3d 100644 +--- a/runtime/transport/transport.c ++++ b/runtime/transport/transport.c +@@ -21,6 +21,23 @@ + #include + #include + #include "../uidgid_compatibility.h" ++#ifdef STAPCONF_MODULE_TRACEPOINT ++#include ++#endif ++ ++/* PR18889: After 3.17, commit #de7b2973903c6, tracepoints are ++ attached by symbol-address rather than by name string. That means ++ they must be EXPORT_TRACEPOINT_SYMBOL_GPL'd for a tracepoint ++ [un]register operation. On RHEL7 kernels with out that commit ++ backported, we can do a tracepoint attach even without the exports. */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) ++#if defined(STAPCONF_MODULE_TRACEPOINT) && defined(STAPCONF_MODULE_TRACEPOINT_EXPORT_LOAD) && defined(STAPCONF_MODULE_TRACEPOINT_EXPORT_FREE) ++#define STAP_USE_MODULE_TRACEPOINTS ++#endif ++#elif defined(STAPCONF_MODULE_TRACEPOINT) ++#define STAP_USE_MODULE_TRACEPOINTS ++#endif ++ + + static int _stp_exit_flag = 0; + +@@ -83,6 +100,11 @@ static void systemtap_module_exit(void); + static int systemtap_module_init(void); + + static int _stp_module_notifier_active = 0; ++#ifdef STAPCONF_MODULE_TRACEPOINT ++/* callbacks in runtime/transport/symbols.c */ ++static void _stp_module_load_tp(void *data, struct module* mod); ++static void _stp_module_free_tp(void *data, struct module* mod); ++#endif + static int _stp_module_notifier (struct notifier_block * nb, + unsigned long val, void *data); + static struct notifier_block _stp_module_notifier_nb = { +@@ -158,11 +180,30 @@ static void _stp_handle_start(struct _stp_msg_start *st) + failed: something nasty has happened, and + we want no further probing started. PR16766 */ + if (!_stp_module_notifier_active) { +- int rc = register_module_notifier(& _stp_module_notifier_nb); +- if (rc == 0) +- _stp_module_notifier_active = 1; +- else +- _stp_warn ("Cannot register module notifier (%d)\n", rc); ++#ifdef STAP_USE_MODULE_TRACEPOINTS ++ int rc0 = register_trace_module_load (& _stp_module_load_tp, NULL); ++ if (rc0) ++ _stp_warn ("Cannot register module load tracepoint (%d)\n", rc0); ++ else { ++ int rc1 = register_trace_module_free (& _stp_module_free_tp, NULL); ++ if (rc1) { ++ _stp_warn ("Cannot register module free tracepoint (%d)\n", rc1); ++ unregister_trace_module_load(& _stp_module_load_tp, NULL); ++ } else { ++#endif ++ int rc = register_module_notifier(& _stp_module_notifier_nb); ++ if (rc == 0) ++ _stp_module_notifier_active = 1; ++ else { ++ _stp_warn ("Cannot register module notifier (%d)\n", rc); ++#ifdef STAP_USE_MODULE_TRACEPOINTS ++ unregister_trace_module_load(& _stp_module_load_tp, NULL); ++ unregister_trace_module_free(& _stp_module_free_tp, NULL); ++ ++ } ++ } ++#endif ++ } + } + } + +@@ -198,7 +239,12 @@ static void _stp_cleanup_and_exit(int send_exit) + + /* Unregister the module notifier. */ + if (_stp_module_notifier_active) { +- int rc = unregister_module_notifier(& _stp_module_notifier_nb); ++ int rc; ++#ifdef STAP_USE_MODULE_TRACEPOINTS ++ unregister_trace_module_load(& _stp_module_load_tp, NULL); ++ unregister_trace_module_free(& _stp_module_free_tp, NULL); ++#endif ++ rc = unregister_module_notifier(& _stp_module_notifier_nb); + if (rc) + _stp_warn("module_notifier unregister error %d", rc); + _stp_module_notifier_active = 0; + +commit 2e67c14dad1c661d2ce0b0ed218b371c1af218ba +Author: Frank Ch. Eigler +Date: Wed Sep 2 11:16:46 2015 -0400 + + PR18889: switch to STP_TRACEPOINT* frontend for kernel tracepoint registration + + jistone kindly reminded that the runtime/stp_tracepoint.[ch] machinery + allows us to attach to kernel tracepoints, whether on string- or + tp*-based kernel APIs, and whether or not the tp* objects are + EXPORT_TRACEPOINT_SYMBOL_GPL'd. Let's use those; presto we get + module-init probing back on kernels oldish and newish. + +diff --git a/buildrun.cxx b/buildrun.cxx +index 6d66b5a..2ca5933 100644 +--- a/buildrun.cxx ++++ b/buildrun.cxx +@@ -379,8 +379,6 @@ compile_pass (systemtap_session& s) + output_autoconf(s, o, "autoconf-module-sect-attrs.c", "STAPCONF_MODULE_SECT_ATTRS", NULL); + output_autoconf(s, o, "autoconf-utrace-via-tracepoints.c", "STAPCONF_UTRACE_VIA_TRACEPOINTS", NULL); + output_autoconf(s, o, "autoconf-module-tracepoints.c", "STAPCONF_MODULE_TRACEPOINT", NULL); +- output_exportconf(s, o, "__tracepoint_module_load", "STAPCONF_MODULE_TRACEPOINT_EXPORT_LOAD"); +- output_exportconf(s, o, "__tracepoint_module_free", "STAPCONF_MODULE_TRACEPOINT_EXPORT_FREE"); + output_autoconf(s, o, "autoconf-task_work-struct.c", "STAPCONF_TASK_WORK_STRUCT", NULL); + output_autoconf(s, o, "autoconf-vm-area-pte.c", "STAPCONF_VM_AREA_PTE", NULL); + output_autoconf(s, o, "autoconf-relay-umode_t.c", "STAPCONF_RELAY_UMODE_T", NULL); +diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c +index e069a3d..db7de46 100644 +--- a/runtime/transport/transport.c ++++ b/runtime/transport/transport.c +@@ -1,8 +1,8 @@ +-/* -*- linux-c -*- ++/* -*- linux-c -*- + * transport.c - stp transport functions + * + * Copyright (C) IBM Corporation, 2005 +- * Copyright (C) Red Hat Inc, 2005-2014 ++ * Copyright (C) Red Hat Inc, 2005-2015 + * Copyright (C) Intel Corporation, 2006 + * + * This file is part of systemtap, and is free software. You can +@@ -23,19 +23,7 @@ + #include "../uidgid_compatibility.h" + #ifdef STAPCONF_MODULE_TRACEPOINT + #include +-#endif +- +-/* PR18889: After 3.17, commit #de7b2973903c6, tracepoints are +- attached by symbol-address rather than by name string. That means +- they must be EXPORT_TRACEPOINT_SYMBOL_GPL'd for a tracepoint +- [un]register operation. On RHEL7 kernels with out that commit +- backported, we can do a tracepoint attach even without the exports. */ +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) +-#if defined(STAPCONF_MODULE_TRACEPOINT) && defined(STAPCONF_MODULE_TRACEPOINT_EXPORT_LOAD) && defined(STAPCONF_MODULE_TRACEPOINT_EXPORT_FREE) +-#define STAP_USE_MODULE_TRACEPOINTS +-#endif +-#elif defined(STAPCONF_MODULE_TRACEPOINT) +-#define STAP_USE_MODULE_TRACEPOINTS ++#include "../linux/stp_tracepoint.h" + #endif + + +@@ -149,7 +137,7 @@ static void _stp_handle_start(struct _stp_msg_start *st) + // protect against excessive or premature startup + handle_startup = (! _stp_start_called && ! _stp_exit_called); + _stp_start_called = 1; +- ++ + if (handle_startup) { + dbug_trans(1, "stp_handle_start\n"); + +@@ -180,15 +168,15 @@ static void _stp_handle_start(struct _stp_msg_start *st) + failed: something nasty has happened, and + we want no further probing started. PR16766 */ + if (!_stp_module_notifier_active) { +-#ifdef STAP_USE_MODULE_TRACEPOINTS +- int rc0 = register_trace_module_load (& _stp_module_load_tp, NULL); ++#ifdef STAPCONF_MODULE_TRACEPOINT ++ int rc0 = STP_TRACE_REGISTER(module_load, & _stp_module_load_tp); + if (rc0) + _stp_warn ("Cannot register module load tracepoint (%d)\n", rc0); + else { +- int rc1 = register_trace_module_free (& _stp_module_free_tp, NULL); ++ int rc1 = STP_TRACE_REGISTER(module_free, & _stp_module_free_tp); + if (rc1) { + _stp_warn ("Cannot register module free tracepoint (%d)\n", rc1); +- unregister_trace_module_load(& _stp_module_load_tp, NULL); ++ STP_TRACE_UNREGISTER(module_load, & _stp_module_load_tp); + } else { + #endif + int rc = register_module_notifier(& _stp_module_notifier_nb); +@@ -196,10 +184,9 @@ static void _stp_handle_start(struct _stp_msg_start *st) + _stp_module_notifier_active = 1; + else { + _stp_warn ("Cannot register module notifier (%d)\n", rc); +-#ifdef STAP_USE_MODULE_TRACEPOINTS +- unregister_trace_module_load(& _stp_module_load_tp, NULL); +- unregister_trace_module_free(& _stp_module_free_tp, NULL); +- ++#ifdef STAPCONF_MODULE_TRACEPOINT ++ STP_TRACE_UNREGISTER(module_load, & _stp_module_load_tp); ++ STP_TRACE_UNREGISTER(module_free, & _stp_module_free_tp); + } + } + #endif +@@ -240,9 +227,9 @@ static void _stp_cleanup_and_exit(int send_exit) + /* Unregister the module notifier. */ + if (_stp_module_notifier_active) { + int rc; +-#ifdef STAP_USE_MODULE_TRACEPOINTS +- unregister_trace_module_load(& _stp_module_load_tp, NULL); +- unregister_trace_module_free(& _stp_module_free_tp, NULL); ++#ifdef STAPCONF_MODULE_TRACEPOINT ++ STP_TRACE_UNREGISTER(module_load, & _stp_module_load_tp); ++ STP_TRACE_UNREGISTER(module_free, & _stp_module_free_tp); + #endif + rc = unregister_module_notifier(& _stp_module_notifier_nb); + if (rc) +@@ -380,7 +367,7 @@ static void _stp_ctl_work_callback(unsigned long val) + * _stp_transport_close - close ctl and relayfs channels + * + * This is called automatically when the module is unloaded. +- * ++ * + */ + static void _stp_transport_close(void) + { +@@ -397,7 +384,7 @@ static void _stp_transport_close(void) + + /** + * _stp_transport_init() is called from the module initialization. +- * It does the bare minimum to exchange commands with staprun ++ * It does the bare minimum to exchange commands with staprun + */ + static int _stp_transport_init(void) + { +@@ -657,7 +644,7 @@ static struct dentry *_stp_get_module_dir(void) + static int _stp_transport_fs_init(const char *module_name) + { + struct dentry *root_dir; +- ++ + dbug_trans(1, "entry\n"); + if (module_name == NULL) + return -1; + +commit 578f5f6f6792fc92d74539a927cd85de5bcbb4dd +Author: Frank Ch. Eigler +Date: Wed Sep 2 11:52:31 2015 -0400 + + PR18889 testing: already done by modules_out_of_tree.exp + + Ditch bz6503, given that it wasn't reliable. + +diff --git a/testsuite/systemtap.base/bz6503.exp b/testsuite/systemtap.base/bz6503.exp +deleted file mode 100644 +index 5d4d2d0..0000000 +--- a/testsuite/systemtap.base/bz6503.exp ++++ /dev/null +@@ -1,55 +0,0 @@ +-# Note that this test is *really* testing the bug fix for pr6503: +-# permit probes on module .init and __exit functions +-# +-# +-# Not BZ6503: +-# ypserve does not work +-# +-# +-# Unfortunately, PR17249 indicates that module-init probes +-# have subsequently broken (due to kernel notification timing +-# changes). +-# +- +-set test bz6503 +- +-if {! [installtest_p]} { +- untested "$test" +- return +-} +- +-# If we aren't root, make sure the test still succeeds. +-set effective_pid [exec /usr/bin/id -u] +-if {$effective_pid != 0} { +- set root_cmd "sudo " +-} else { +- set root_cmd "" +-} +- +- +-# jffs2/ext2/fat/vfat should cover a span of kernels. +-# +-# Note that this test might fail if there is a filesystem of one of +-# these types already mounted. The filesystem mount will be +-# unaffected (since the module can't be removed). +-spawn stap -t $srcdir/$subdir/bz6503.stp -c "( ($root_cmd /sbin/modprobe jffs2; $root_cmd /sbin/modprobe ext2; $root_cmd /sbin/modprobe fat; $root_cmd /sbin/modprobe vfat); wait; ($root_cmd /sbin/rmmod jffs2; $root_cmd /sbin/rmmod ext2; $root_cmd /sbin/rmmod vfat; $root_cmd /sbin/rmmod fat); wait) 2>/dev/null" +- +-set ok 0 +-set ko 0 +-expect { +- -timeout 60 +- timeout { fail "$test (timeout)" } +- -re {^-----[^\r\n]*\r\n} { exp_continue } +- -re {^module[^\r\n]*hits:[^\r\n]*\r\n} { incr ok; exp_continue } +- -re {^WARNING:[\r\n]*\r\n} { incr ko; exp_continue } +- -re {^ERROR:[\r\n]*\r\n} { incr ko; exp_continue } +- eof { } +-} +-catch { close} ; catch { wait } +- +-# Mark kernels without module refresh support as xfail +-if {![module_refresh_p]} { setup_xfail *-*-* } +- +-if {$ok > 0 && $ko == 0} then { pass "$test $ok" } else { fail "$test $ok $ko"} +- +- +diff --git a/testsuite/systemtap.base/bz6503.stp b/testsuite/systemtap.base/bz6503.stp +deleted file mode 100644 +index 409149f..0000000 +--- a/testsuite/systemtap.base/bz6503.stp ++++ /dev/null +@@ -1,5 +0,0 @@ +-probe module("jffs2").function("*").call ?, +- module("ext2").function("*").call ?, +- module("fat").function("*").call ?, +- module("vfat").function("*").call ?, +- never { } diff --git a/SPECS/systemtap.spec b/SPECS/systemtap.spec index b789d05..034da44 100644 --- a/SPECS/systemtap.spec +++ b/SPECS/systemtap.spec @@ -1,7 +1,11 @@ %{!?with_sqlite: %global with_sqlite 1} +%ifarch ppc64le +%{!?with_docs: %global with_docs 0} +%else %{!?with_docs: %global with_docs 1} +%endif # crash is not available -%ifarch %{sparc} +%ifarch ppc ppc64 %{sparc} aarch64 ppc64le %{!?with_crash: %global with_crash 0} %else %{!?with_crash: %global with_crash 1} @@ -11,16 +15,6 @@ %{!?elfutils_version: %global elfutils_version 0.142} %{!?pie_supported: %global pie_supported 1} %{!?with_boost: %global with_boost 0} -%ifarch ppc %{sparc} -%{!?with_publican: %global with_publican 0} -%else -%{!?with_publican: %global with_publican 1} -%endif -%if 0%{?rhel} -%{!?publican_brand: %global publican_brand RedHat} -%else -%{!?publican_brand: %global publican_brand fedora} -%endif %ifarch %{ix86} x86_64 ppc ppc64 %{!?with_dyninst: %global with_dyninst 0%{?fedora} >= 18 || 0%{?rhel} >= 7} %else @@ -41,6 +35,10 @@ %endif %{!?with_pyparsing: %global with_pyparsing 0%{?fedora} >= 18 || 0%{?rhel} >= 7} +%ifarch ppc64le aarch64 +%global with_virthost 0 +%endif + %if 0%{?fedora} >= 18 || 0%{?rhel} >= 6 %define initdir %{_initddir} %else # RHEL5 doesn't know _initddir @@ -59,25 +57,13 @@ %endif %endif -%define dracutlibdir %{_prefix}/lib/dracut -%define dracutstap %{dracutlibdir}/modules.d/99stap +%define dracutstap %{_prefix}/lib/dracut/modules.d/99stap Name: systemtap -Version: 2.6 +Version: 2.8 Release: 10%{?dist} # for version, see also configure.ac -#Patch1: reserved for elfutils (see below) -Patch2: rhbz1139844.patch -Patch3: rhbz1141919.patch -Patch4: rhbz1153673.patch -Patch5: rhbz1164373.patch -Patch6: rhbz1119335.patch -Patch7: rhbz1127591.patch -Patch8: rhbz1167652.patch -Patch9: rhbz1171823.patch -Patch10: rhbz1212658.patch - # Packaging abstract: # @@ -149,14 +135,6 @@ BuildRequires: tex(fullpage.sty) tex(fancybox.sty) tex(bchr7t.tfm) # called 'xmlto-tex'. To avoid a specific F10 BuildReq, we'll do a # file-based buildreq on '/usr/share/xmlto/format/fo/pdf'. BuildRequires: xmlto /usr/share/xmlto/format/fo/pdf -%if %{with_publican} -BuildRequires: publican -BuildRequires: /usr/share/publican/Common_Content/%{publican_brand}/defaults.cfg - -# A workaround for BZ920216 which requires an X server to build docs -# with publican. -BuildRequires: /usr/bin/xvfb-run -%endif %endif %if %{with_emacsvim} BuildRequires: emacs @@ -169,6 +147,14 @@ BuildRequires: libvirt-devel >= 1.0.2 BuildRequires: libxml2-devel %endif +Patch1: rhbz1237098.patch +Patch2: june-robust.patch +Patch3: rhbz1242992.patch +Patch4: rhbz1248159.patch +Patch5: rhbz1252436.patch +Patch6: rhbz1254856.patch +Patch7: rhbz1257399.patch + # Install requirements Requires: systemtap-client = %{version}-%{release} Requires: systemtap-devel = %{version}-%{release} @@ -396,6 +382,13 @@ systemtap-runtime-virthost machine to execute systemtap scripts. %prep %setup -q %{?setup_elfutils} +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 %if %{with_bundled_elfutils} cd elfutils-%{elfutils_version} @@ -407,16 +400,6 @@ find . \( -name configure -o -name config.h.in \) -print | xargs touch cd .. %endif -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 - %build %if %{with_bundled_elfutils} @@ -475,11 +458,6 @@ cd .. %global pie_config --disable-pie %endif -%if %{with_publican} -%global publican_config --enable-publican --with-publican-brand=%{publican_brand} -%else -%global publican_config --disable-publican -%endif %if %{with_java} %global java_config --with-java=%{_jvmdir}/java @@ -487,7 +465,19 @@ cd .. %global java_config --without-java %endif -%configure %{?elfutils_config} %{dyninst_config} %{sqlite_config} %{crash_config} %{docs_config} %{pie_config} %{publican_config} %{rpm_config} %{java_config} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}" +%if %{with_virthost} +%global virt_config --enable-virt +%else +%global virt_config --disable-virt +%endif + +%if %{with_dracut} +%global dracut_config --with-dracutstap=%{dracutstap} +%else +%global dracut_config +%endif + +%configure %{?elfutils_config} %{dyninst_config} %{sqlite_config} %{crash_config} %{docs_config} %{pie_config} %{rpm_config} %{java_config} %{virt_config} %{dracut_config} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}" make %{?_smp_mflags} %if %{with_emacsvim} @@ -531,10 +521,8 @@ cp -rp testsuite $RPM_BUILD_ROOT%{_datadir}/systemtap mkdir docs.installed mv $RPM_BUILD_ROOT%{_datadir}/doc/systemtap/*.pdf docs.installed/ mv $RPM_BUILD_ROOT%{_datadir}/doc/systemtap/tapsets docs.installed/ -%if %{with_publican} mv $RPM_BUILD_ROOT%{_datadir}/doc/systemtap/SystemTap_Beginners_Guide docs.installed/ %endif -%endif mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/stap-server mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/stap-server @@ -789,14 +777,10 @@ exit 0 %if %{with_java} -%triggerin runtime-java -- java-1.7.0-openjdk, java-1.6.0-openjdk +%triggerin runtime-java -- java-1.8.0-openjdk, java-1.7.0-openjdk, java-1.6.0-openjdk for f in %{_libexecdir}/systemtap/libHelperSDT_*.so; do - %ifarch %{ix86} %{power64} - %ifarch %{power64} - arch=ppc64 - %else - arch=i386 - %endif + %ifarch %{ix86} + arch=i386 %else arch=`basename $f | cut -f2 -d_ | cut -f1 -d.` %endif @@ -808,14 +792,10 @@ for f in %{_libexecdir}/systemtap/libHelperSDT_*.so; do done done -%triggerun runtime-java -- java-1.7.0-openjdk, java-1.6.0-openjdk +%triggerun runtime-java -- java-1.8.0-openjdk, java-1.7.0-openjdk, java-1.6.0-openjdk for f in %{_libexecdir}/systemtap/libHelperSDT_*.so; do - %ifarch %{ix86} %{power64} - %ifarch %{power64} - arch=ppc64 - %else - arch=i386 - %endif + %ifarch %{ix86} + arch=i386 %else arch=`basename $f | cut -f2 -d_ | cut -f1 -d.` %endif @@ -825,15 +805,11 @@ for f in %{_libexecdir}/systemtap/libHelperSDT_*.so; do done done -%triggerpostun runtime-java -- java-1.7.0-openjdk, java-1.6.0-openjdk +%triggerpostun runtime-java -- java-1.8.0-openjdk, java-1.7.0-openjdk, java-1.6.0-openjdk # Restore links for any JDKs remaining after a package removal: for f in %{_libexecdir}/systemtap/libHelperSDT_*.so; do - %ifarch %{ix86} %{power64} - %ifarch %{power64} - arch=ppc64 - %else - arch=i386 - %endif + %ifarch %{ix86} + arch=i386 %else arch=`basename $f | cut -f2 -d_ | cut -f1 -d.` %endif @@ -958,10 +934,8 @@ done %if %{with_docs} %doc docs.installed/*.pdf %doc docs.installed/tapsets/*.html -%if %{with_publican} %doc docs.installed/SystemTap_Beginners_Guide %endif -%endif %{_bindir}/stap %{_bindir}/stap-prep %{_bindir}/stap-report @@ -969,6 +943,7 @@ done %{_mandir}/man1/stap-prep.1* %{_mandir}/man1/stap-merge.1* %{_mandir}/man1/stap-report.1* +%{_mandir}/man1/stapref.1* %{_mandir}/man3/* %{_mandir}/man7/error* %{_mandir}/man7/stappaths.7* @@ -1047,11 +1022,38 @@ done # http://sourceware.org/systemtap/wiki/SystemTapReleases %changelog -* Thu Apr 30 2015 Frank Ch. Eigler - 2.6-10 -- append upstream PR18361 to xfs & signing patch, to catch up with kernel change +* Wed Sep 02 2015 Frank Ch. Eigler - 2.8-10 +- rhbz1257399: module-init probes + +* Tue Aug 11 2015 Frank Ch. Eigler - 2.8-9 +- rhbz1254856: nfsd tapset fix for kernel functions that went away + +* Tue Aug 11 2015 Frank Ch. Eigler - 2.8-8 +- rhbz1252436: timer probes build fix + +* Mon Aug 10 2015 Frank Ch. Eigler - 2.8-7 +- rhbz1248159: netfilter probes build fix +- disabling docs on ppc64le for bz1252103 + +* Wed Jul 22 2015 Frank Ch. Eigler - 2.8-6 +- rhbz1242992: cont'd: applying .spec hunk here + +* Tue Jul 21 2015 Frank Ch. Eigler - 2.8-5 +- rhbz1242992: java / ppc64 + +* Mon Jul 6 2015 Frank Ch. Eigler - 2.8-3 +- rhbz1237098: handle symbol-table vs. linkage-name mismatches better +- some runtime robustification fixes backported from upstream + +* Wed Jun 17 2015 Frank Ch. Eigler - 2.8-1 +- Upstream release + +* Mon May 11 2015 Frank Ch. Eigler - 2.7-2 +- Upstream release, incl. rhel6.7 post-release xmltohtml patch +- pre-rebase-rebase for aarch64 mass-rebuild -* Tue Apr 28 2015 Frank Ch. Eigler - 2.6-9 -- rhbz1216230=rhbz1212658 (xfs & signing) +* Wed Dec 10 2014 Frank Ch. Eigler - 2.6-9 +- rhbz1212658 (xfs & signing) * Wed Dec 10 2014 Frank Ch. Eigler - 2.6-8 - rhbz1171823 (nfsd svc_fh access)