summaryrefslogtreecommitdiffstats
path: root/dtrace
diff options
context:
space:
mode:
authorStan Cox <scox@redhat.com>2009-01-13 17:20:37 -0500
committerStan Cox <scox@redhat.com>2009-01-13 17:20:37 -0500
commitd294a64913b810cbe067655e06ea46a0184f99dc (patch)
treef60f3f832250ba3a21e48d029ffd7ea34324365d /dtrace
parentb899aa795f925edb7fad318d2e90bb9c3da90b24 (diff)
downloadsystemtap-steved-d294a64913b810cbe067655e06ea46a0184f99dc.tar.gz
systemtap-steved-d294a64913b810cbe067655e06ea46a0184f99dc.tar.xz
systemtap-steved-d294a64913b810cbe067655e06ea46a0184f99dc.zip
Add dtrace and sdt.h
Diffstat (limited to 'dtrace')
-rwxr-xr-xdtrace35
1 files changed, 35 insertions, 0 deletions
diff --git a/dtrace b/dtrace
new file mode 100755
index 00000000..b8a1237e
--- /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