This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] systemtap.spec


This adds a subpackage 'static-user' that installs /usr/include/sdt.h
and /usr/bin/dtrace which enables postgres to build with stap support,
assuming that it is built with -g.   Subpackage name suggestions or
other comments?




* Makefile.am (oldincludedir): New.
  (oldinclude_HEADERS): New.
  (bin_SCRIPTS): Add dtrace
* dtrace: New file.
* systemtap.spec: Add package static-user.


RENAMED runtime/sduprobes.h TO runtime/sdt.h

diff --git a/Makefile.am b/Makefile.am
index 38a2eda..4ad842f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,6 +4,7 @@
 AUTOMAKE_OPTIONS = no-dist
 
 pkglibexecdir = ${libexecdir}/${PACKAGE}
+oldincludedir = ${includedir}/sys
 
 AM_CPPFLAGS = -DBINDIR='"$(bindir)"' -DPKGDATADIR='"${pkgdatadir}"' -DPKGLIBDIR='"$(pkglibexecdir)"'
 
@@ -15,6 +16,7 @@ man_MANS =  stap.1 stapprobes.5 stapfuncs.5 stapvars.5 stapex.5 staprun.8 man/st
 
 bin_PROGRAMS = stap staprun
 bin_SCRIPTS = stap-report
+oldinclude_HEADERS = runtime/sdt.h
 if BUILD_SERVER
 man_MANS += stap-server.8 
 bin_PROGRAMS += stap-client-connect stap-server-connect
@@ -22,6 +24,7 @@ bin_SCRIPTS += stap-client stap-serverd stap-server stap-find-servers \
 	       stap-start-server stap-find-or-start-server stap-stop-server \
 	       stap-gen-server-cert stap-add-server-cert
 endif
+bin_SCRIPTS += dtrace
 stap_SOURCES = main.cxx \
 	parse.cxx staptree.cxx elaborate.cxx translate.cxx \
 	tapsets.cxx buildrun.cxx loc2c.c hash.cxx mdfour.c \
diff --git a/dtrace b/dtrace
new file mode 100755
index 0000000..b8a1237
--- /dev/null
+++ b/dtrace
@@ -0,0 +1,35 @@
+# This is a stub to handle a Makefile which does:
+# $(DTRACE) $(DTRACEFLAGS) -G -s $^ -o $@
+# which is a step that builds DTrace provider and probe definitions
+
+usage() {
+echo "Usage $0 -s file.d {-o file} file1.o file2.o ..."
+}
+
+if [ -z "$1" ] ; then
+   usage
+   exit
+fi
+while test ! -z "$1" ; do
+   if [ $(expr "$1" : "-o") -gt 0 ] ; then 
+      shift
+      filename=$1
+   elif [ $(expr "$1" : "-s") -gt 0 ] ; then
+      shift
+      s_filename=$1      
+   fi
+   shift
+done
+
+if [ -z "$filename" ] ; then
+   if [ ! -z "$s_filename" ] ; then
+      filename=$(basename $s_filename .d).o
+   else
+      usage
+      exit
+   fi
+fi
+
+echo "_dtrace_ () {}" >| /tmp/$$.c 
+gcc -c /tmp/$$.c -o $filename
+rm /tmp/$$.c
diff --git a/systemtap.spec b/systemtap.spec
index b7dc6b6..26616f4 100644
--- a/systemtap.spec
+++ b/systemtap.spec
@@ -102,6 +102,16 @@ SystemTap server is the server component of an instrumentation
 system for systems running Linux 2.6.  Developers can write
 instrumentation to collect data on the operation of the system.
 
+%package static-user
+Summary: Static probe support tools
+Group: Development/System
+License: GPLv2+
+URL: http://sourceware.org/systemtap/
+Requires: systemtap
+
+%description static-user
+Support tools to allow applications to use static probes.
+
 %prep
 %setup -q %{?setup_elfutils}
 
@@ -257,6 +267,11 @@ exit 0
 %{_bindir}/stap-server-connect
 %{_mandir}/man8/stap-server.8*
 
+%files static-user
+%defattr(-,root,root)
+%{_bindir}/dtrace
+%{_includedir}/sys/sdt.h
+
 %changelog
 * Thu Nov 13 2008 Frank Ch. Eigler <fche@redhat.com> - 0.8-1
 - Upstream release.
diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp
index 354256d..34bd33a 100644
--- a/testsuite/systemtap.base/static_uprobes.exp
+++ b/testsuite/systemtap.base/static_uprobes.exp
@@ -9,7 +9,7 @@ set fp [open $sup_srcpath "w"]
 puts $fp "
 #include <stdlib.h>
 #define USE_STAP_PROBE 1
-#include \"sduprobes.h\"
+#include \"sdt.h\"
 
 foo ()
 {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]