OBS User unknown 2008-12-15 14:08:38 +00:00 committed by Git OBS Bridge
parent 73a610e6a9
commit 2590d952ed
7 changed files with 267 additions and 21 deletions

View File

@ -5,13 +5,13 @@
Larger examples, demos and samples can be found in
-@prefix@/doc/systemtap*/examples, each example comes with either a .txt
+@_docdir@/systemtap*/examples, each example comes with either a .txt
+@prefix@/share/doc/packages/systemtap/examples, each example comes with either a .txt
or .meta file explaining what the example, sample or demo does and how
it is ordinarily run.
.SH SEE ALSO
-.BR @prefix@/doc/systemtap*/examples
+.BR @_docdir@/systemtap/examples
+.BR @prefix@/share/doc/packages/systemtap/examples
.IR stap (1)
.IR stapprobes (5)
.IR stapfuncs (5)
@ -22,7 +22,7 @@
i_cmd="$(INSTALL_PROGRAM)"; else \
i_cmd="$(INSTALL_DATA)"; fi; \
- $$i_cmd -D $$f $(DESTDIR)$(docdir)/examples/$$f; done)
+ $$i_cmd -D $$f $(DESTDIR)$(docdir)/systemtap/examples/$$f; done)
+ $$i_cmd -D $$f $(DESTDIR)$(datadir)/doc/packages/systemtap/examples/$$f; done)
TEST_COV_DIR = coverage
@ -33,7 +33,7 @@
PDF_FILES = tutorial.pdf langref.pdf
-DOC_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap
+DOC_INSTALL_DIR = $(DESTDIR)$(docdir)/systemtap
+DOC_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/packages/systemtap
if BUILD_DOCS
all-local: $(PDF_FILES)

View File

@ -0,0 +1,15 @@
--- tapsets.cxx-dist 2008-09-06 16:27:02.000000000 +0200
+++ tapsets.cxx 2008-12-12 16:31:18.000000000 +0100
@@ -1303,8 +1303,10 @@ struct dwflpp
// NB: fnmatch() is used without FNM_PATHNAME.
string prefixed_pattern = string("*/") + pattern;
- dwarf_assert ("dwarf_getsrcfiles",
- dwarf_getsrcfiles (cu, &srcfiles, &nfiles));
+ // just ignore the errors from dwarf_getsrcfiles; it's not fatal error
+ if (dwarf_getsrcfiles (cu, &srcfiles, &nfiles) < 0)
+ return;
+
{
for (size_t i = 0; i < nfiles; ++i)
{

166
systemtap-netcat-fix1.diff Normal file
View File

@ -0,0 +1,166 @@
From 309cc9ecf51b082d6de8f1c3b0028c398daa395f Mon Sep 17 00:00:00 2001
From: Dave Brolley <brolley@redhat.com>
Date: Tue, 9 Dec 2008 15:31:00 -0500
Subject: [PATCH] Use netcat or nc, whichever is available.
---
diff --git a/stap-client b/stap-client
index 0ac9bd6..255551b 100755
--- a/stap-client
+++ b/stap-client
@@ -29,6 +29,11 @@ function configuration {
tmpdir_prefix_client=stap.client
tmpdir_prefix_server=stap.server
avahi_service_tag=_stap._tcp
+
+ # We need either netcat or nc.
+ netcat=`which netcat 2>/dev/null`
+ test "X$netcat" = "X" && netcat=`which nc 2>/dev/null`
+ test "X$netcat" = "X" && fatal "ERROR: cannot find required program 'netcat' or 'nc' on PATH"
}
# function: initialization
@@ -386,7 +391,7 @@ function send_request {
# Send the request file.
for ((attempt=0; $attempt < 10; ++attempt))
do
- if nc -w10 $server $(($port+1)) < $tar_client > /dev/null 2>&1; then
+ if $netcat -w10 $server $(($port+1)) < $tar_client > /dev/null 2>&1; then
return;
fi
sleep 1
@@ -405,7 +410,7 @@ function receive_response {
# Retrieve the file. Wait for up to 5 minutes for a response.
for ((attempt=0; $attempt < 300; ++attempt))
do
- if nc -d $server $(($port+1)) > $tar_server 2>/dev/null; then
+ if $netcat -d $server $(($port+1)) > $tar_server 2>/dev/null; then
return;
fi
sleep 1
@@ -535,7 +540,7 @@ function choose_server {
function connect_to_server {
for ((attempt=0; $attempt < 10; ++attempt))
do
- if echo "request:" | nc -w10 $1 $2 >/dev/null 2>&1; then
+ if echo "request:" | $netcat -w10 $1 $2 >/dev/null 2>&1; then
return 0
fi
sleep 1
diff --git a/stap-server b/stap-server
index 67573de..a06adc9 100755
--- a/stap-server
+++ b/stap-server
@@ -26,6 +26,11 @@ function configuration {
tmpdir_prefix_server=stap.server
port=$1
test "X$port" = "X" && port=65001
+
+ # We need either netcat or nc.
+ netcat=`which netcat 2>/dev/null`
+ test "X$netcat" = "X" && netcat=`which nc 2>/dev/null`
+ test "X$netcat" = "X" && fatal "ERROR: cannot find required program 'netcat' or 'nc' on PATH"
}
# function: initialization
@@ -53,12 +58,12 @@ function receive_request {
fatal "ERROR: cannot create temporary tar file " $tar_client
# Receive the file.
- nc -ld $port > $tar_client 2>/dev/null &
+ $netcat -ld $port > $tar_client 2>/dev/null &
# Wait for 10 seconds before timing out
for ((t=0; $t < 10; ++t))
do
- if jobs '%nc -l' >/dev/null 2>&1; then
+ if jobs '%$netcat -l' >/dev/null 2>&1; then
sleep 1
else
return
@@ -384,12 +389,12 @@ function package_response {
# Wait for the client to take the response file.
function send_response {
# Now send it.
- nc -l $port < $tar_server > /dev/null 2>&1 &
+ $netcat -l $port < $tar_server > /dev/null 2>&1 &
# Wait for 10 seconds before timing out
for ((t=0; $t < 10; ++t))
do
- if jobs '%nc -l' >/dev/null 2>&1; then
+ if jobs '%$netcat -l' >/dev/null 2>&1; then
sleep 1
else
return
@@ -430,8 +435,8 @@ function cleanup {
rm -fr $tmpdir_stap
fi
- # Kill any nc job that may be running
- kill -s SIGTERM %nc 2> /dev/null
+ # Kill any $netcat job that may be running
+ kill -s SIGTERM '%$netcat' 2> /dev/null
}
# function: terminate
diff --git a/stap-serverd b/stap-serverd
index 45aacf6..b46a425 100755
--- a/stap-serverd
+++ b/stap-serverd
@@ -23,13 +23,21 @@ trap 'terminate' SIGTERM SIGINT
function initialization {
# Default settings.
avahi_type=_stap._tcp
+
+ # We need either netcat or nc.
+ netcat=`which netcat 2>/dev/null`
+ test "X$netcat" = "X" && netcat=`which nc 2>/dev/null`
+ test "X$netcat" = "X" && fatal "ERROR: cannot find required program 'netcat' or 'nc' on PATH"
+
+ # See if the given port, or the default port is busy. If so, select another.
port=$1
test "X$port" = "X" && port=65000
- export port2=$(($port + 1))
- if netstat -atn | awk '{print $4}' | cut -f2 -d: | egrep -q "^($port|$port2)\$"; then
+ port2=$(($port + 1))
+ while netstat -atn | awk '{print $4}' | cut -f2 -d: | egrep -q "^($port|$port2)\$"; do
# Whoops, the port is busy; try another one.
- initialization $((1024+($port + $RANDOM)%64000))
- fi
+ port=$((1024+($port + $RANDOM)%64000))
+ port2=$(($port + 1))
+ done
}
# function: advertise_presence
@@ -57,8 +65,8 @@ function listen {
do
for ((attempt=0; $attempt < 5; ++attempt))
do
- nc -ld $port 2>/dev/null | process_request &
- wait '%nc -l'
+ $netcat -ld $port 2>/dev/null | process_request &
+ wait '%$netcat -l'
rc=$?
if test $rc = 0 -o $rc = 127; then
break; # port was read ok
@@ -111,11 +119,11 @@ function terminate {
# Kill any running 'stap-server' job.
kill -s SIGTERM "%stap-server" 2> /dev/null
- wait "%stap-server" >/dev/null 2>&1
+ wait '%stap-server' >/dev/null 2>&1
- # Kill any running 'nc -l' job.
- kill -s SIGTERM "%?nc -l" 2> /dev/null
- wait "%?nc - l" >/dev/null 2>&1
+ # Kill any running '$netcat -l' job.
+ kill -s SIGTERM '%$netcat -l' 2>/dev/null
+ wait '%$netcat -l' >/dev/null 2>&1
exit
}
--
1.6.0.5

View File

@ -0,0 +1,48 @@
From 0b7f181e1096f8833e24a60a7c0f97ecc063b9f4 Mon Sep 17 00:00:00 2001
From: Dave Brolley <brolley@redhat.com>
Date: Thu, 11 Dec 2008 12:07:02 -0500
Subject: [PATCH] Don't use -d on $netcat. Redirect from /dev/null instead.
---
diff --git a/stap-client b/stap-client
index 255551b..3f530c7 100755
--- a/stap-client
+++ b/stap-client
@@ -410,7 +410,7 @@ function receive_response {
# Retrieve the file. Wait for up to 5 minutes for a response.
for ((attempt=0; $attempt < 300; ++attempt))
do
- if $netcat -d $server $(($port+1)) > $tar_server 2>/dev/null; then
+ if $netcat $server $(($port+1)) </dev/null > $tar_server 2>/dev/null; then
return;
fi
sleep 1
diff --git a/stap-server b/stap-server
index a06adc9..0a7d597 100755
--- a/stap-server
+++ b/stap-server
@@ -58,7 +58,7 @@ function receive_request {
fatal "ERROR: cannot create temporary tar file " $tar_client
# Receive the file.
- $netcat -ld $port > $tar_client 2>/dev/null &
+ $netcat -l $port < /dev/null > $tar_client 2>/dev/null &
# Wait for 10 seconds before timing out
for ((t=0; $t < 10; ++t))
diff --git a/stap-serverd b/stap-serverd
index b46a425..d4d6a77 100755
--- a/stap-serverd
+++ b/stap-serverd
@@ -65,7 +65,7 @@ function listen {
do
for ((attempt=0; $attempt < 5; ++attempt))
do
- $netcat -ld $port 2>/dev/null | process_request &
+ $netcat -l $port < /dev/null 2>/dev/null | process_request &
wait '%$netcat -l'
rc=$?
if test $rc = 0 -o $rc = 127; then
--
1.6.0.5

View File

@ -1,11 +0,0 @@
--- configure.ac-dist 2008-08-18 18:07:38.000000000 +0200
+++ configure.ac 2008-08-18 18:07:50.000000000 +0200
@@ -8,7 +8,7 @@
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
-AC_PROG_MKDIR_P
+dnl AC_PROG_MKDIR_P
AC_PROG_LN_S
AC_PROG_CC
AC_PROG_CXX

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Fri Dec 12 16:32:35 CET 2008 - tiwai@suse.de
- Don't assert of dwarf_getsrcfiles(). This hits recent SUSE
kernels (bnc#455992)
- Backport fix patches for stap-*-server scripts to run with
netcat (bnc#446686)
-------------------------------------------------------------------
Mon Dec 8 14:09:01 CET 2008 - tiwai@suse.de
- fixed unresolved path in man pages (bnc#457217)
- fixed build for old distros on OBS
-------------------------------------------------------------------
Thu Dec 4 18:08:23 CET 2008 - tiwai@suse.de

View File

@ -25,7 +25,7 @@ BuildRequires: latex2html
%define package_version 20080906
License: GPL v2 or later
Version: 0.7.1
Release: 26
Release: 27
Summary: Instrumentation System
Group: Development/Tools/Debuggers
Url: http://sourceware.org/systemtap/
@ -33,10 +33,12 @@ Url: http://sourceware.org/systemtap/
# Suggest: kernel-smp-debuginfo
Source: ftp://sources.redhat.com/pub/systemtap/snapshots/systemtap-%{package_version}.tar.bz2
Patch: systemtap-docdir-fix.diff
Patch1: systemtap-old-autoconf-fix.diff
Patch2: stap-fix-dump_unwindsyms.patch
Patch3: systemtap-parameter-bound-check.diff
Patch4: systemtap-ioblock-fix.diff
Patch5: systemtap-dwarf_getsrcfiles-no-assert.diff
Patch6: systemtap-netcat-fix1.diff
Patch7: systemtap-netcat-fix2.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -57,19 +59,23 @@ Authors:
# %setup -n %{name}-%{package_version} -q -a1
%setup -n src -q
%patch
%if %suse_version < 1020
%patch1
%endif
%patch2 -p1
%patch3
%patch4
%patch5
%patch6 -p1
%patch7 -p1
%build
autoreconf -fi
%configure --docdir=%{_docdir}
%configure
make %{?jobs:-j %jobs}
%install
%if %suse_version < 1030
# workaround for old autoconf
export MKDIR_P="mkdir -p"
%endif
%makeinstall
mkdir -p $RPM_BUILD_ROOT/var/cache/systemtap
cp README AUTHORS NEWS COPYING $RPM_BUILD_ROOT%{_docdir}/systemtap/
@ -87,6 +93,14 @@ rm -rf ${RPM_BUILD_ROOT}
%dir %attr(0755,root,root) /var/cache/systemtap
%changelog
* Fri Dec 12 2008 tiwai@suse.de
- Don't assert of dwarf_getsrcfiles(). This hits recent SUSE
kernels (bnc#455992)
- Backport fix patches for stap-*-server scripts to run with
netcat (bnc#446686)
* Mon Dec 08 2008 tiwai@suse.de
- fixed unresolved path in man pages (bnc#457217)
- fixed build for old distros on OBS
* Thu Dec 04 2008 tiwai@suse.de
- fix ioblock.stp for SUSE 2.6.27.x kernel (bnc#456175)
* Fri Nov 21 2008 tiwai@suse.de