* including stap-prep in the rpm
@ 2010-03-10 22:37 William Cohen
[not found] ` <20100311143903.g62m66g54wswwwsg@imap.linux.ibm.com>
2010-03-12 12:05 ` Mark Wielaard
0 siblings, 2 replies; 3+ messages in thread
From: William Cohen @ 2010-03-10 22:37 UTC (permalink / raw)
To: systemtap
[-- Attachment #1: Type: text/plain, Size: 361 bytes --]
Rather than attempting to run a systemtap script and getting crypic messages about being unable to build the kernel module or find the debug information, the stap-prep script list outs the needed rpms.
The attached is a patch to include the stap-prep script in the systemtap rpm. Before checking it in I would like to get some comment about the patch.
-Will
[-- Attachment #2: stap-prep.patch --]
[-- Type: text/plain, Size: 3582 bytes --]
diff --git a/Makefile.am b/Makefile.am
index 7b655b7..7028662 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,7 +17,7 @@ dtrace.1 \
staprun.8
bin_PROGRAMS = staprun
-bin_SCRIPTS = stap-report
+bin_SCRIPTS = stap-report stap-prep
pkglibexec_PROGRAMS = stapio
pkglibexec_SCRIPTS = stap-env
oldinclude_HEADERS = includes/sys/sdt.h
diff --git a/Makefile.in b/Makefile.in
index eaa226e..47866b2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -380,7 +380,7 @@ AM_CXXFLAGS = -Wall -Werror
man_MANS = stapprobes.3stap stapfuncs.3stap stapvars.3stap \
stapex.3stap dtrace.1 staprun.8 $(am__append_2) \
$(am__append_4) $(am__append_8)
-bin_SCRIPTS = stap-report $(am__append_3) $(am__append_5) \
+bin_SCRIPTS = stap-report stap-prep $(am__append_3) $(am__append_5) \
$(am__append_10)
pkglibexec_SCRIPTS = stap-env $(am__append_7) $(am__append_11)
oldinclude_HEADERS = includes/sys/sdt.h
diff --git a/configure b/configure
index 1864214..76bf1cb 100755
--- a/configure
+++ b/configure
@@ -10894,7 +10894,7 @@ $as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
"run-stap":F) chmod +x run-stap ;;
"run-staprun":F) chmod +x run-staprun ;;
"dtrace":F) chmod +x dtrace ;;
- "doc/beginners":C) rm -f $ac_abs_top_builddir/doc/beginners/en-US $ac_abs_top_builddir/doc/beginners/build/en-US/testsuite && mkdir -p $ac_abs_top_builddir/doc/beginners/build/en-US && ln -s $ac_abs_top_srcdir/doc/SystemTap_Beginners_Guide/en-US $ac_abs_top_builddir/doc/beginners/en-US && ln -s $ac_abs_top_srcdir/testsuite $ac_abs_top_builddir/doc/beginners/build/en-US/testsuite ;;
+ "doc/beginners":C) rm -f $ac_abs_top_builddir/doc/beginners/en-US $ac_abs_top_builddir/doc/beginners/build/en-US/testsuite && mkdir -p $ac_abs_top_builddir/doc/beginners/build/en-US && ln -s $ac_abs_top_srcdir/doc/SystemTap_Beginners_Guide/en-US $ac_abs_top_builddir/doc/beginners/en-US && ln -s $ac_abs_top_srcdir/testsuite $ac_abs_top_builddir/doc/beginners/build/en-US/testsuite && ln -s $ac_abs_top_srcdir/stap-prep $ac_abs_top_builddir/doc/beginners/build/en-US/stap-prep ;;
esac
done # for ac_tag
diff --git a/configure.ac b/configure.ac
index 501e480..e6fc22f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -520,7 +520,7 @@ AC_CONFIG_FILES([dtrace], [chmod +x dtrace])
# the src is a directory and not a file.
AC_CONFIG_FILES([doc/beginners/publican.cfg:doc/SystemTap_Beginners_Guide/publican.cfg.in])
AC_CONFIG_COMMANDS([doc/beginners],
- [rm -f $ac_abs_top_builddir/doc/beginners/en-US $ac_abs_top_builddir/doc/beginners/build/en-US/testsuite && mkdir -p $ac_abs_top_builddir/doc/beginners/build/en-US && ln -s $ac_abs_top_srcdir/doc/SystemTap_Beginners_Guide/en-US $ac_abs_top_builddir/doc/beginners/en-US && ln -s $ac_abs_top_srcdir/testsuite $ac_abs_top_builddir/doc/beginners/build/en-US/testsuite])
+ [rm -f $ac_abs_top_builddir/doc/beginners/en-US $ac_abs_top_builddir/doc/beginners/build/en-US/testsuite && mkdir -p $ac_abs_top_builddir/doc/beginners/build/en-US && ln -s $ac_abs_top_srcdir/doc/SystemTap_Beginners_Guide/en-US $ac_abs_top_builddir/doc/beginners/en-US && ln -s $ac_abs_top_srcdir/testsuite $ac_abs_top_builddir/doc/beginners/build/en-US/testsuite && ln -s $ac_abs_top_srcdir/stap-prep $ac_abs_top_builddir/doc/beginners/build/en-US/stap-prep])
AC_OUTPUT
diff --git a/systemtap.spec b/systemtap.spec
index d29dac5..a65868a 100644
--- a/systemtap.spec
+++ b/systemtap.spec
@@ -410,6 +410,7 @@ exit 0
%{_bindir}/stap
%{_bindir}/stap-report
+%{_bindir}/stap-prep
%{_mandir}/man1/*
%{_mandir}/man3/*
^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <20100311143903.g62m66g54wswwwsg@imap.linux.ibm.com>]
* Re: including stap-prep in the rpm
[not found] ` <20100311143903.g62m66g54wswwwsg@imap.linux.ibm.com>
@ 2010-03-11 22:35 ` William Cohen
0 siblings, 0 replies; 3+ messages in thread
From: William Cohen @ 2010-03-11 22:35 UTC (permalink / raw)
To: Jim Keniston, SystemTAP
[-- Attachment #1: Type: text/plain, Size: 861 bytes --]
On 03/11/2010 02:39 PM, Jim Keniston wrote:
> Quoting William Cohen <wcohen@redhat.com>:
>
>> Rather than attempting to run a systemtap script and getting crypic
>> messages about being unable to build the kernel module or find the
>> debug information, the stap-prep script list outs the needed rpms.
>>
>> The attached is a patch to include the stap-prep script in the
>> systemtap rpm. Before checking it in I would like to get some comment
>> about the patch.
>>
>> -Will
>>
>
> Hi, Will.
>
> I don't see the stap-prep script itself in this patch or on gitweb.
>
> Jim
>
I used the "git-mv" to move
doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh to stap-prep. Apparently, the diff I used to generate the patch didn't show that. The attached is a "git diff" that shows the movement of stapprep.sh in the doc directory to stap-prep.
-will
[-- Attachment #2: stap-prep.patch --]
[-- Type: text/plain, Size: 4538 bytes --]
diff --git a/Makefile.am b/Makefile.am
index 7b655b7..7028662 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,7 +17,7 @@ dtrace.1 \
staprun.8
bin_PROGRAMS = staprun
-bin_SCRIPTS = stap-report
+bin_SCRIPTS = stap-report stap-prep
pkglibexec_PROGRAMS = stapio
pkglibexec_SCRIPTS = stap-env
oldinclude_HEADERS = includes/sys/sdt.h
diff --git a/Makefile.in b/Makefile.in
index eaa226e..47866b2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -380,7 +380,7 @@ AM_CXXFLAGS = -Wall -Werror
man_MANS = stapprobes.3stap stapfuncs.3stap stapvars.3stap \
stapex.3stap dtrace.1 staprun.8 $(am__append_2) \
$(am__append_4) $(am__append_8)
-bin_SCRIPTS = stap-report $(am__append_3) $(am__append_5) \
+bin_SCRIPTS = stap-report stap-prep $(am__append_3) $(am__append_5) \
$(am__append_10)
pkglibexec_SCRIPTS = stap-env $(am__append_7) $(am__append_11)
oldinclude_HEADERS = includes/sys/sdt.h
diff --git a/doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh b/doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh
deleted file mode 100755
index 3c6bf78..0000000
--- a/doc/SystemTap_Beginners_Guide/en-US/extras/stapprep.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/bash
-check_error() { if test $1 != 0; then echo $2; exit $1; fi }
-
-if [ "$#" -lt 1 ]; then
- UNAME=`uname -r` # determine the kernel running on the machine
-else
- UNAME=$1 #user passed in uname value
-fi
-UNAME=`echo $UNAME | sed "s/ //"` #strip out any whitespace
-KERNEL="kernel"
-for VARIANT in debug kdump PAE xen; do
- TMP=`echo $UNAME | sed s/$VARIANT//`
- if [ "$TMP" != "$UNAME" ]; then
- UNAME=$TMP; KERNEL="kernel-$VARIANT"
- fi
-done
-KERN_ARCH=`uname -m`
-KERN_REV=`echo $UNAME | sed s/.$KERN_ARCH//` # strip arch from uname
-CANDIDATES="$KERNEL-$KERN_REV.$KERN_ARCH \
- $KERNEL-devel-$KERN_REV.$KERN_ARCH \
- $KERNEL-debuginfo-$KERN_REV.$KERN_ARCH \
- kernel-debuginfo-common-$KERN_REV.$KERN_ARCH"
-NEEDED=`rpm --qf "%{name}-%{version}-%{release}.%{arch}\n" \
- -q $CANDIDATES | grep "is not installed" | awk '{print $2}'`
-if [ "$NEEDED" != "" ]; then
- echo -e "Need to install the following packages:\n$NEEDED"
- if [ `id -u` = "0" ]; then #attempt download and install
- DIR=`mktemp -d` || exit 1
- if [ ! -x /usr/bin/yumdownloader ]; then
- echo "Need to first install yum-utils for yumdownloader"
- yum install -y yum-utils
- fi
- yumdownloader --enablerepo="*debuginfo*" $NEEDED --destdir=$DIR
- check_error $? "problem downloading rpm(s) $NEEDED"
- rpm --force -ivh $DIR/*.rpm
- check_error $? "problem installing rpm(s) $NEEDED"
- rm -r $DIR #cleanup
- fi
-fi
diff --git a/stap-prep b/stap-prep
new file mode 100755
index 0000000..3c6bf78
--- /dev/null
+++ b/stap-prep
@@ -0,0 +1,39 @@
+#! /bin/bash
+check_error() { if test $1 != 0; then echo $2; exit $1; fi }
+
+if [ "$#" -lt 1 ]; then
+ UNAME=`uname -r` # determine the kernel running on the machine
+else
+ UNAME=$1 #user passed in uname value
+fi
+UNAME=`echo $UNAME | sed "s/ //"` #strip out any whitespace
+KERNEL="kernel"
+for VARIANT in debug kdump PAE xen; do
+ TMP=`echo $UNAME | sed s/$VARIANT//`
+ if [ "$TMP" != "$UNAME" ]; then
+ UNAME=$TMP; KERNEL="kernel-$VARIANT"
+ fi
+done
+KERN_ARCH=`uname -m`
+KERN_REV=`echo $UNAME | sed s/.$KERN_ARCH//` # strip arch from uname
+CANDIDATES="$KERNEL-$KERN_REV.$KERN_ARCH \
+ $KERNEL-devel-$KERN_REV.$KERN_ARCH \
+ $KERNEL-debuginfo-$KERN_REV.$KERN_ARCH \
+ kernel-debuginfo-common-$KERN_REV.$KERN_ARCH"
+NEEDED=`rpm --qf "%{name}-%{version}-%{release}.%{arch}\n" \
+ -q $CANDIDATES | grep "is not installed" | awk '{print $2}'`
+if [ "$NEEDED" != "" ]; then
+ echo -e "Need to install the following packages:\n$NEEDED"
+ if [ `id -u` = "0" ]; then #attempt download and install
+ DIR=`mktemp -d` || exit 1
+ if [ ! -x /usr/bin/yumdownloader ]; then
+ echo "Need to first install yum-utils for yumdownloader"
+ yum install -y yum-utils
+ fi
+ yumdownloader --enablerepo="*debuginfo*" $NEEDED --destdir=$DIR
+ check_error $? "problem downloading rpm(s) $NEEDED"
+ rpm --force -ivh $DIR/*.rpm
+ check_error $? "problem installing rpm(s) $NEEDED"
+ rm -r $DIR #cleanup
+ fi
+fi
diff --git a/systemtap.spec b/systemtap.spec
index d29dac5..a65868a 100644
--- a/systemtap.spec
+++ b/systemtap.spec
@@ -410,6 +410,7 @@ exit 0
%{_bindir}/stap
%{_bindir}/stap-report
+%{_bindir}/stap-prep
%{_mandir}/man1/*
%{_mandir}/man3/*
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: including stap-prep in the rpm
2010-03-10 22:37 including stap-prep in the rpm William Cohen
[not found] ` <20100311143903.g62m66g54wswwwsg@imap.linux.ibm.com>
@ 2010-03-12 12:05 ` Mark Wielaard
1 sibling, 0 replies; 3+ messages in thread
From: Mark Wielaard @ 2010-03-12 12:05 UTC (permalink / raw)
To: William Cohen; +Cc: systemtap
On Wed, 2010-03-10 at 17:36 -0500, William Cohen wrote:
> The attached is a patch to include the stap-prep script in the
> systemtap rpm. Before checking it in I would like to get some comment
> about the patch.
It seems a useful script. The only comment I have is that it might be a
bit rpm centric. Would it be an option to have this depend on
--with-rpm? I assume debian/dpkg based distros for example would have a
completely different approach.
Cheers,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-12 12:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-10 22:37 including stap-prep in the rpm William Cohen
[not found] ` <20100311143903.g62m66g54wswwwsg@imap.linux.ibm.com>
2010-03-11 22:35 ` William Cohen
2010-03-12 12:05 ` Mark Wielaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).