public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Stan Cox <scox@redhat.com>
To: systemtap@sourceware.org
Subject: [PATCH] systemtap.spec
Date: Mon, 12 Jan 2009 21:33:00 -0000	[thread overview]
Message-ID: <1231795981.2846.13.camel@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

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?





[-- Attachment #2: specfile.patch --]
[-- Type: text/x-patch, Size: 3367 bytes --]

* 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 ()
 {

WARNING: multiple messages have this Message-ID
From: Stan Cox <scox@redhat.com>
To: systemtap@sourceware.org
Subject: [PATCH] systemtap.spec
Date: Thu, 15 Jan 2009 07:40:00 -0000	[thread overview]
Message-ID: <1231795981.2846.13.camel@localhost.localdomain> (raw)
Message-ID: <20090115074000.RZ7Wl9j6-uu0PGhwcN2NpWmNQEvn_Z0e8-OqGle7A24@z> (raw)

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

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?





[-- Attachment #2: specfile.patch --]
[-- Type: text/x-patch, Size: 3367 bytes --]

* 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 ()
 {

             reply	other threads:[~2009-01-12 21:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-12 21:33 Stan Cox [this message]
2009-01-12 22:04 ` Masami Hiramatsu
2009-01-12 22:12   ` Roland McGrath
2009-01-12 22:40 ` William Cohen
2009-01-14  5:01 ` Probing user-space markers in RPM installed binaries William Cohen
2009-01-14  7:46   ` Roland McGrath
2009-01-14 19:16     ` William Cohen
2009-01-15  7:40 ` [PATCH] systemtap.spec Stan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1231795981.2846.13.camel@localhost.localdomain \
    --to=scox@redhat.com \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).