summaryrefslogtreecommitdiffstats
path: root/dtrace.in
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-12-14 16:39:01 -0500
committerDave Brolley <brolley@redhat.com>2009-12-14 16:39:01 -0500
commitb8f1753c091d3f75ea4a71bfb709d8e50780d3fb (patch)
treeea5e83a0556d4df262a2b4f9b26065dc312a8a1e /dtrace.in
parent61b21980212779b5a35f6a196842bdca55a3ced6 (diff)
parent958c58e8231563e9349e4d8ea56c04c25e1501c0 (diff)
downloadsystemtap-steved-b8f1753c091d3f75ea4a71bfb709d8e50780d3fb.tar.gz
systemtap-steved-b8f1753c091d3f75ea4a71bfb709d8e50780d3fb.tar.xz
systemtap-steved-b8f1753c091d3f75ea4a71bfb709d8e50780d3fb.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'dtrace.in')
-rwxr-xr-xdtrace.in19
1 files changed, 13 insertions, 6 deletions
diff --git a/dtrace.in b/dtrace.in
index 74d70e77..3be05038 100755
--- a/dtrace.in
+++ b/dtrace.in
@@ -46,7 +46,7 @@ class provider:
self.f = open(provider)
self.h = open(header,mode='w')
self.h.write("/* Generated by the Systemtap dtrace wrapper */\n")
- # self.h.write("\n#define STAP_HAS_SEMAPHORES 1\n\n")
+ self.h.write("\n#define STAP_HAS_SEMAPHORES 1\n\n")
self.h.write("\n#include <sys/sdt.h>\n\n")
in_comment = False
typedefs = ""
@@ -107,7 +107,7 @@ class provider:
i += 1
self.h.write ('/* %s (%s) */\n' % (this_probe_canon,args_string))
# XXX Enable this when .so semaphores work properly
- self.h.write ('#define %s_ENABLED() 1 /*%s_semaphore*/\n' % (this_probe_canon,this_probe))
+ self.h.write ('#define %s_ENABLED() %s_semaphore\n' % (this_probe_canon,this_probe))
# NB: unsigned short is fixed in ABI
self.h.write ("__extension__ extern unsigned short %s_semaphore __attribute__ ((unused)) __attribute__ ((section (\".probes\")));\n" % (this_probe))
self.h.write (define_str + ") \\\n")
@@ -120,13 +120,15 @@ class provider:
def usage ():
- print "Usage " + sys.argv[0] + " [--help] [-h | -G] -s File.d [-o File]"
+ print "Usage " + sys.argv[0] + " [--help] [-h | -G] [-C [-I<Path>]] -s File.d [-o <File>]"
def help ():
usage()
print "Where -h builds a systemtap header file from the .d file"
+ print " -C when used with -h, also run cpp preprocessor"
print " -o specifies an explicit output file name,"
- print " The default for -G is file.o and -h is file.h"
+ print " the default for -G is file.o and -h is file.h"
+ print " -I when running cpp pass through this -I include Path"
print " -s specifies the name of the .d input file"
print " -G builds a stub file.o from file.d,"
print " which is required by some packages that use dtrace."
@@ -159,6 +161,8 @@ keep_temps = False
use_cpp = False
h_ext = '.h'
filename = ""
+s_filename = ""
+includes = []
while (i < len (sys.argv)):
if (sys.argv[i] == "-o"):
i += 1
@@ -170,6 +174,8 @@ while (i < len (sys.argv)):
use_cpp = True
elif (sys.argv[i] == "-h"):
build_header = True
+ elif (sys.argv[i].startswith("-I")):
+ includes.append(sys.argv[i])
elif (sys.argv[i] == "-G"):
build_source = True
elif (sys.argv[i] == "-k"):
@@ -185,9 +191,10 @@ if (build_header == False and build_source == False):
if (s_filename != "" and use_cpp):
(d,fn) = mkstemp(suffix=".d")
- retcode = call(["cpp", s_filename, fn])
+ args = ['cpp'] + includes + [s_filename, fn]
+ retcode = call(args)
if (retcode != 0):
- print "\"cpp s_filename\" failed"
+ print "\"cpp includes s_filename\" failed"
usage()
sys.exit(1)
s_filename = fn