SHA256
1
0
forked from pool/systemtap

Accepting request 148159 from home:jones_tony:branches:devel:tools

Update to 2.0.   Verified against current Factory using systemtap-testsuite.

OBS-URL: https://build.opensuse.org/request/show/148159
OBS-URL: https://build.opensuse.org/package/show/devel:tools/systemtap?expand=0&rev=57
This commit is contained in:
Tony Jones 2013-01-12 05:43:52 +00:00 committed by Git OBS Bridge
parent f90f448826
commit d23249ff0b
11 changed files with 246 additions and 126 deletions

View File

@ -1,35 +0,0 @@
Otherwise we get this link error:
CXXLD stap-serverd
.../ld: stap_serverd-stap-serverd.o: undefined reference to symbol 'sem_getvalue@@GLIBC_2.2.5'
.../ld: note: 'sem_getvalue@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
Makefile.am | 2 +-
Makefile.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- a/Makefile.am
+++ b/Makefile.am
@@ -184,7 +184,7 @@ stap_serverd_SOURCES = stap-serverd.cxx
stap_serverd_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS)
stap_serverd_CFLAGS = $(AM_CFLAGS) @PIECFLAGS@ $(nss_CFLAGS)
stap_serverd_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@
-stap_serverd_LDADD = $(nss_LIBS)
+stap_serverd_LDADD = $(nss_LIBS) -lpthread
if HAVE_AVAHI
stap_serverd_CFLAGS += $(avahi_CFLAGS)
stap_serverd_CXXFLAGS += $(avahi_CFLAGS)
--- a/Makefile.in
+++ b/Makefile.in
@@ -504,7 +504,7 @@ PHONIES = $(am__append_17) $(am__append_
@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ $(nss_CFLAGS) \
@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ $(am__append_24)
@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@stap_serverd_LDFLAGS = $(AM_LDFLAGS) @PIELDFLAGS@
-@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@stap_serverd_LDADD = $(nss_LIBS) \
+@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@stap_serverd_LDADD = $(nss_LIBS) -lpthread \
@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@ $(am__append_26)
@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@stap_gen_cert_SOURCES = stap-gen-cert.cxx util.cxx nsscommon.cxx
@BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@stap_gen_cert_CXXFLAGS = $(AM_CXXFLAGS) @PIECXXFLAGS@ $(nss_CFLAGS)

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9061962818ff27a2557487195984a72f45bb90f0076d088b71e055cd8434b3b0
size 2414738

3
systemtap-2.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7b5e4740c697506768be42cbbcc238f1b0184747dd43938a46ab0393682eee63
size 2461359

View File

@ -9,12 +9,11 @@ SuSE %{_docdir} is /usr/share/doc/packages. Change install locations to match.
Makefile.am | 2 +- Makefile.am | 2 +-
doc/Makefile.am | 2 +- doc/Makefile.am | 2 +-
doc/SystemTap_Tapset_Reference/Makefile.am | 4 ++-- doc/SystemTap_Tapset_Reference/Makefile.am | 4 ++--
stapex.3stap.in | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
4 files changed, 6 insertions(+), 6 deletions(-)
--- a/Makefile.am --- a/Makefile.am
+++ b/Makefile.am +++ b/Makefile.am
@@ -257,7 +257,7 @@ install-data-local: @@ -259,7 +259,7 @@ endif
| while read f; do if test -x $$f; then \ | while read f; do if test -x $$f; then \
i_cmd="$(INSTALL_PROGRAM)"; else \ i_cmd="$(INSTALL_PROGRAM)"; else \
i_cmd="$(INSTALL_DATA)"; fi; \ i_cmd="$(INSTALL_DATA)"; fi; \

View File

@ -4,16 +4,18 @@ References: none
Upstream: no Upstream: no
Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: Tony Jones <tonyj@suse.de>
diff --git a/configure.ac b/configure.ac ---
index ce3121e..c8b90de 100644 configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -29,7 +29,7 @@ AC_PROG_MAKE_SET @@ -30,7 +30,7 @@ AC_SUBST(CFLAGS)
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS) AC_SUBST(CXXFLAGS)
AC_SYS_LARGEFILE
AM_GNU_GETTEXT(external) AM_GNU_GETTEXT(external)
-AM_GNU_GETTEXT_VERSION(0.17) -AM_GNU_GETTEXT_VERSION(0.17)
+AM_GNU_GETTEXT_VERSION(0.15) +AM_GNU_GETTEXT_VERSION(0.18)
AC_CHECK_FUNCS(ppoll) AC_CHECK_FUNCS(ppoll)
dnl Handle the prologues option. dnl Handle the prologues option.

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sat Jan 12 05:10:48 UTC 2013 - tonyj@suse.com
- Update to version 2.0. See systemtap.spec for changelog
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jul 27 10:29:23 UTC 2012 - aj@suse.de Fri Jul 27 10:29:23 UTC 2012 - aj@suse.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package systemtap-docs # spec file for package systemtap-docs
# #
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -26,7 +26,7 @@ BuildRequires: pkg-config
BuildRequires: fop BuildRequires: fop
BuildRequires: latex2html BuildRequires: latex2html
BuildRequires: xmlto BuildRequires: xmlto
Version: 1.8 Version: 2.0
Release: 0 Release: 0
Summary: Documents and examples for systemtap Summary: Documents and examples for systemtap
License: GPL-2.0+ License: GPL-2.0+
@ -37,7 +37,6 @@ Source2: README-BEFORE-ADDING-PATCHES
Patch1: systemtap-docdir-fix.diff Patch1: systemtap-docdir-fix.diff
Patch2: systemtap-xmlto-fop.diff Patch2: systemtap-xmlto-fop.diff
Patch3: systemtap-docs-autoconf-version.diff Patch3: systemtap-docs-autoconf-version.diff
Patch4: systemtap-linux-types.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch BuildArch: noarch
@ -50,7 +49,6 @@ This package contains the documents and examples for systemtap.
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%patch4 -p1
%build %build
# fix interpreter # fix interpreter

View File

@ -0,0 +1,212 @@
From: Josh Stone <jistone@redhat.com>
Date: Fri Oct 12 14:45:55 2012 -0700
Subject: PR14172: Fix for kernels without VM_EXECUTABLE
Git-commit: 529c7eaed7360776b596af31c86d4e4712a1a3db
We were using VM_EXECUTABLE in two ways:
1) In task_finder for locating the process executable among all the
vmas. Since around 2.6.26 there is also mm->exe_file, which will serve
this purpose just fine.
2) In uprobes to avoid relocation offset for semaphores in ET_EXEC
files. This is actually incorrect, but harmless, because the callback
path for ET_EXEC targets already sets relocation=offset=0 anyway. So we
can just remove the special case for VM_EXECUTABLE altogether.
* runtime/task_finder_vma.c (stap_find_exe_file): New, locate the
process executable either by VM_EXECUTABLE or mm->exe_file.
* runtime/linux/task_finder.c (__stp_get_mm_path): Use stap_find_exe_file.
* runtime/linux/task_finder2.c (__stp_get_mm_path): Ditto.
* runtime/linux/uprobes-common.c (stap_uprobe_change_plus): Don't
special case for VM_EXECUTABLE (and add a comment why).
* runtime/linux/uprobes-inode.c (stapiu_change_plus): Ditto.
(stapiu_get_task_inode): Use stap_find_exe_file.
diff --git a/runtime/linux/runtime.h b/runtime/linux/runtime.h
index e167be6..783f199 100644
--- a/runtime/linux/runtime.h
+++ b/runtime/linux/runtime.h
@@ -163,13 +163,13 @@ void *kallsyms_task_work_cancel;
#include "copy.c"
#include "regs.c"
#include "regs-ia64.c"
+#include "sym.c"
#if (defined(CONFIG_UTRACE) || defined(STAPCONF_UTRACE_VIA_TRACEPOINTS))
#define HAVE_TASK_FINDER
#include "task_finder.c"
#endif
-#include "sym.c"
#ifdef STP_PERFMON
#include "perf.c"
#endif
diff --git a/runtime/linux/task_finder.c b/runtime/linux/task_finder.c
index 2b1e22f..d718e80 100644
--- a/runtime/linux/task_finder.c
+++ b/runtime/linux/task_finder.c
@@ -440,7 +440,7 @@ __stp_task_finder_cleanup(void)
static char *
__stp_get_mm_path(struct mm_struct *mm, char *buf, int buflen)
{
- struct vm_area_struct *vma;
+ struct file *vm_file;
char *rc = NULL;
// The down_read() function can sleep, so we'll call
@@ -451,17 +451,12 @@ __stp_get_mm_path(struct mm_struct *mm, char *buf, int buflen)
return ERR_PTR(-ENOENT);
}
- vma = mm->mmap;
- while (vma) {
- if ((vma->vm_flags & VM_EXECUTABLE) && vma->vm_file)
- break;
- vma = vma->vm_next;
- }
- if (vma) {
+ vm_file = stap_find_exe_file(mm);
+ if (vm_file) {
#ifdef STAPCONF_DPATH_PATH
- rc = d_path(&(vma->vm_file->f_path), buf, buflen);
+ rc = d_path(&(vm_file->f_path), buf, buflen);
#else
- rc = d_path(vma->vm_file->f_dentry, vma->vm_file->f_vfsmnt,
+ rc = d_path(vm_file->f_dentry, vm_file->f_vfsmnt,
buf, buflen);
#endif
}
diff --git a/runtime/linux/task_finder2.c b/runtime/linux/task_finder2.c
index 680b428..5cee195 100644
--- a/runtime/linux/task_finder2.c
+++ b/runtime/linux/task_finder2.c
@@ -425,7 +425,7 @@ __stp_task_finder_cleanup(void)
static char *
__stp_get_mm_path(struct mm_struct *mm, char *buf, int buflen)
{
- struct vm_area_struct *vma;
+ struct file *vm_file;
char *rc = NULL;
// The down_read() function can sleep, so we'll call
@@ -436,17 +436,12 @@ __stp_get_mm_path(struct mm_struct *mm, char *buf, int buflen)
return ERR_PTR(-ENOENT);
}
- vma = mm->mmap;
- while (vma) {
- if ((vma->vm_flags & VM_EXECUTABLE) && vma->vm_file)
- break;
- vma = vma->vm_next;
- }
- if (vma) {
+ vm_file = stap_find_exe_file(mm);
+ if (vm_file) {
#ifdef STAPCONF_DPATH_PATH
- rc = d_path(&(vma->vm_file->f_path), buf, buflen);
+ rc = d_path(&(vm_file->f_path), buf, buflen);
#else
- rc = d_path(vma->vm_file->f_dentry, vma->vm_file->f_vfsmnt,
+ rc = d_path(vm_file->f_dentry, vm_file->f_vfsmnt,
buf, buflen);
#endif
}
diff --git a/runtime/linux/uprobes-common.c b/runtime/linux/uprobes-common.c
index 64b62cc..cdfb5a6 100644
--- a/runtime/linux/uprobes-common.c
+++ b/runtime/linux/uprobes-common.c
@@ -77,13 +77,10 @@ static int stap_uprobe_change_plus (struct task_struct *tsk, unsigned long reloc
sdt_sem_pid = (sups->return_p ? sup->urp.u.pid : sup->up.pid);
if (sups->sdt_sem_offset && (sdt_sem_pid != tsk->tgid || sup->sdt_sem_address == 0)) {
- /* If the probe is in the executable itself, the offset *is* the address. */
- if (vm_flags & VM_EXECUTABLE) {
- sup->sdt_sem_address = relocation + sups->sdt_sem_offset;
- }
- else {
- sup->sdt_sem_address = (relocation - offset) + sups->sdt_sem_offset;
- }
+ /* If the probe is in an ET_EXEC binary, then the sdt_sem_offset already
+ * is a real address. But stap_uprobe_process_found calls us in this
+ * case with relocation=offset=0, so we don't have to worry about it. */
+ sup->sdt_sem_address = (relocation - offset) + sups->sdt_sem_offset;
} /* sdt_sem_offset */
if (slotted_p) {
struct stap_uprobe *sup = & stap_uprobes[i];
diff --git a/runtime/linux/uprobes-inode.c b/runtime/linux/uprobes-inode.c
index 578123c..9d4d867 100644
--- a/runtime/linux/uprobes-inode.c
+++ b/runtime/linux/uprobes-inode.c
@@ -406,9 +406,14 @@ stapiu_change_plus(struct stapiu_target* target, struct task_struct *task,
if (!p->tgid) {
p->tgid = task->tgid;
p->relocation = relocation;
- p->base = relocation;
- if (!(vm_flags & VM_EXECUTABLE))
- p->base -= offset;
+
+ /* The base is used for relocating semaphores. If the
+ * probe is in an ET_EXEC binary, then that offset
+ * already is a real address. But stapiu_process_found
+ * calls us in this case with relocation=offset=0, so
+ * we don't have to worry about it. */
+ p->base = relocation - offset;
+
list_add(&p->target_process, &target->processes);
break;
}
@@ -491,7 +496,7 @@ static struct inode *
stapiu_get_task_inode(struct task_struct *task)
{
struct mm_struct *mm;
- struct vm_area_struct *vma;
+ struct file* vm_file;
struct inode *inode = NULL;
// Grab the inode associated with the task.
@@ -507,15 +512,9 @@ stapiu_get_task_inode(struct task_struct *task)
}
down_read(&mm->mmap_sem);
- vma = mm->mmap;
- while (vma) {
- if ((vma->vm_flags & VM_EXECUTABLE) && vma->vm_file
- && vma->vm_file->f_path.dentry != NULL) {
- inode = vma->vm_file->f_path.dentry->d_inode;
- break;
- }
- vma = vma->vm_next;
- }
+ vm_file = stap_find_exe_file(mm);
+ if (vm_file && vm_file->f_path.dentry)
+ inode = vm_file->f_path.dentry->d_inode;
up_read(&mm->mmap_sem);
return inode;
diff --git a/runtime/task_finder_vma.c b/runtime/task_finder_vma.c
index 7c872ba..1c1bfbc 100644
--- a/runtime/task_finder_vma.c
+++ b/runtime/task_finder_vma.c
@@ -371,3 +371,21 @@ stap_drop_vma_maps(struct task_struct *tsk)
write_unlock_irqrestore(&__stp_tf_vma_lock, flags);
return 0;
}
+
+/* Find the main executable for this mm.
+ * NB: mmap_sem should be held already. */
+static struct file*
+stap_find_exe_file(struct mm_struct* mm)
+{
+ /* VM_EXECUTABLE was killed in kernel commit e9714acf, but in kernels
+ * that new we can just use mm->exe_file anyway. (PR14172) */
+#ifdef VM_EXECUTABLE
+ struct vm_area_struct *vma;
+ for (vma = mm->mmap; vma; vma = vma->vm_next)
+ if ((vma->vm_flags & VM_EXECUTABLE) && vma->vm_file)
+ return vma->vm_file;
+ return NULL;
+#else
+ return mm->exe_file;
+#endif
+}

View File

@ -1,70 +0,0 @@
From: Josh Stone <jistone@redhat.com>
Subject: Fix build with glibc 2.16
Date: 2012-07-27
Upstream: yes
Signed-Off-by: aj@suse.de
From Fedora:
Squashed cherry-picks from upstream:
commit 037853b4644bb6ebd68e2f1fac11c3636f551d8e
Author: Josh Stone <jistone@redhat.com>
Date: Mon Jul 9 12:07:48 2012 -0700
Fix the build with glibc 2.16
With our elevated compiler warnings as errors, we got:
mainloop.c: In function 'stp_main_loop':
mainloop.c:581:3: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
mainloop.c:581:3: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
mainloop.c:583:35: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
mainloop.c:583:35: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
mainloop.c:631:2: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
mainloop.c:631:2: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
cc1: all warnings being treated as errors
This turns out to be a macro fight between glibc-2.16 and
kernel-headers, via including linux/types.h. We apparently don't
even need that header, so removing it lets us proceed normally.
Those curious can watch this bug to see how the conflict is resolved:
https://bugzilla.redhat.com/show_bug.cgi?id=837641
commit d9b0c1c8712ff255d4b6171fdb0e1ec39f444501
Author: Josh Stone <jistone@redhat.com>
Date: Wed Jul 18 18:33:12 2012 -0700
Further tweak to glibc/kernel-headers workaround
... following commit 037853b4644bb6ebd68e2f1fac11c3636f551d8e, for
https://bugzilla.redhat.com/show_bug.cgi?id=840902
Seems it's not always possible to avoid linux/types.h for the conflict
it presents with sys/select.h. Now include linux/types.h very early, so
glibc can stomp over it with #undef and #define, rather than vice versa.
diff --git a/runtime/staprun/staprun.h b/runtime/staprun/staprun.h
index d01a291..e9ce117 100644
--- a/runtime/staprun/staprun.h
+++ b/runtime/staprun/staprun.h
@@ -10,6 +10,11 @@
* Copyright (C) 2005-2008 Red Hat Inc.
*/
#define _FILE_OFFSET_BITS 64
+
+/* kernel-headers and glibc like to stomp on each other. We include this early
+ * so we can ensure glibc's own definitions will win. rhbz 837641 & 840902 */
+#include <linux/types.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@@ -28,7 +33,6 @@
#include <sys/poll.h>
#include <pthread.h>
#include <sys/socket.h>
-#include <linux/types.h>
#include <linux/limits.h>
#include <sys/wait.h>
#include <sys/statfs.h>

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Fri Dec 14 23:42:06 UTC 2012 - tonyj@suse.com
- Update to version 2.0
Changelog: http://sourceware.org/ml/systemtap/2012-q4/msg00047.html
- Delete previous patches (present in version 2.0):
link-with-pthread.patch
systemtap-linux-types.patch
- Add patches:
systemtap-fix-for-kernels-without-vm_executable.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Oct 17 12:20:17 UTC 2012 - fcrozat@suse.com Wed Oct 17 12:20:17 UTC 2012 - fcrozat@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package systemtap # spec file for package systemtap
# #
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -27,7 +27,7 @@ BuildRequires: mozilla-nss-tools
BuildRequires: pkg-config BuildRequires: pkg-config
BuildRequires: sqlite-devel BuildRequires: sqlite-devel
BuildRequires: systemd BuildRequires: systemd
Version: 1.8 Version: 2.0
Release: 0 Release: 0
Summary: Instrumentation System Summary: Instrumentation System
License: GPL-2.0+ License: GPL-2.0+
@ -36,8 +36,7 @@ Url: http://sourceware.org/systemtap/
Source: http://sourceware.org/systemtap/ftp/releases/systemtap-%{version}.tar.gz Source: http://sourceware.org/systemtap/ftp/releases/systemtap-%{version}.tar.gz
Source2: README-BEFORE-ADDING-PATCHES Source2: README-BEFORE-ADDING-PATCHES
Source3: stap-server.conf Source3: stap-server.conf
Patch0: link-with-pthread.patch Patch1: systemtap-fix-for-kernels-without-vm_executable.patch
Patch4: systemtap-linux-types.patch
Obsoletes: systemtap-client < 1.5 Obsoletes: systemtap-client < 1.5
Requires: %{name}-runtime = %{version}-%{release} Requires: %{name}-runtime = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -85,8 +84,7 @@ This package contains the support tools for static probes.
%prep %prep
%setup -q %setup -q
%patch0 -p1 %patch1 -p1
%patch4 -p1
%build %build
%configure --disable-docs --docdir=%{_docdir}/systemtap %configure --disable-docs --docdir=%{_docdir}/systemtap