summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-03-11 22:11:09 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-03-11 22:11:09 -0400
commitec80b3969d33e4d54e97ead4286bdb018e2f1f97 (patch)
tree88c3403a2ec79e106c3d618d03b1b589990acd1d
parent3bd0d4df7ccfd9afe7771441b26d8baaaf180e29 (diff)
downloadsystemtap-steved-ec80b3969d33e4d54e97ead4286bdb018e2f1f97.tar.gz
systemtap-steved-ec80b3969d33e4d54e97ead4286bdb018e2f1f97.tar.xz
systemtap-steved-ec80b3969d33e4d54e97ead4286bdb018e2f1f97.zip
improve sdt.h compatibility and test suite
Replaced cpp VA_ARGS in sdt.h with explicit enumeration of arguments (since with -pedantic, cpp has no varargs), and added a few more cflags variants to the sdt.exp test case.
-rw-r--r--includes/sys/sdt.h40
-rw-r--r--testsuite/systemtap.base/sdt.c2
-rw-r--r--testsuite/systemtap.base/sdt.exp25
3 files changed, 36 insertions, 31 deletions
diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h
index dc2950f0..d6c90192 100644
--- a/includes/sys/sdt.h
+++ b/includes/sys/sdt.h
@@ -196,26 +196,26 @@ label: \
#define STAP_PROBE(provider,probe) \
STAP_PROBE_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER))
-#define STAP_PROBE1(provider,probe,...) \
- STAP_PROBE1_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),__VA_ARGS__)
-#define STAP_PROBE2(provider,probe,...) \
- STAP_PROBE2_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),__VA_ARGS__)
-#define STAP_PROBE3(provider,probe,...) \
- STAP_PROBE3_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),__VA_ARGS__)
-#define STAP_PROBE4(provider,probe,...) \
- STAP_PROBE4_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),__VA_ARGS__)
-#define STAP_PROBE5(provider,probe,...) \
- STAP_PROBE5_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),__VA_ARGS__)
-#define STAP_PROBE6(provider,probe,...) \
- STAP_PROBE6_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),__VA_ARGS__)
-#define STAP_PROBE7(provider,probe,...) \
- STAP_PROBE7_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),__VA_ARGS__)
-#define STAP_PROBE8(provider,probe,...) \
- STAP_PROBE8_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),__VA_ARGS__)
-#define STAP_PROBE9(provider,probe,...) \
- STAP_PROBE9_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),__VA_ARGS__)
-#define STAP_PROBE10(provider,probe,...) \
- STAP_PROBE10_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),__VA_ARGS__)
+#define STAP_PROBE1(provider,probe,parm1) \
+ STAP_PROBE1_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1))
+#define STAP_PROBE2(provider,probe,parm1,parm2) \
+ STAP_PROBE2_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2))
+#define STAP_PROBE3(provider,probe,parm1,parm2,parm3) \
+ STAP_PROBE3_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3))
+#define STAP_PROBE4(provider,probe,parm1,parm2,parm3,parm4) \
+ STAP_PROBE4_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4))
+#define STAP_PROBE5(provider,probe,parm1,parm2,parm3,parm4,parm5) \
+ STAP_PROBE5_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4),(parm5))
+#define STAP_PROBE6(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6) \
+ STAP_PROBE6_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4),(parm5),(parm6))
+#define STAP_PROBE7(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7) \
+ STAP_PROBE7_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7))
+#define STAP_PROBE8(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8) \
+ STAP_PROBE8_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7),(parm8))
+#define STAP_PROBE9(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9) \
+ STAP_PROBE9_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7),(parm8),(parm9))
+#define STAP_PROBE10(provider,probe,parm1,parm2,parm3,parm4,parm5,parm6,parm7,parm8,parm9,parm10) \
+ STAP_PROBE10_(probe,STAP_LABEL(STAP_LABEL_PREFIX(probe),STAP_COUNTER),(parm1),(parm2),(parm3),(parm4),(parm5),(parm6),(parm7),(parm8),(parm9),(parm10))
#define DTRACE_PROBE(provider,probe) \
STAP_PROBE(provider,probe)
diff --git a/testsuite/systemtap.base/sdt.c b/testsuite/systemtap.base/sdt.c
index 46f68664..7c7398e5 100644
--- a/testsuite/systemtap.base/sdt.c
+++ b/testsuite/systemtap.base/sdt.c
@@ -65,5 +65,7 @@ main (int argc, char **argv)
call8(a, b, c, d, e, f, g, h);
call9(a, b, c, d, e, f, g, h, i);
call10(a, b, c, d, e, f, g, h, i, j);
+ (void) argv;
+ (void) argc;
return 0;
}
diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp
index 09aaaf8d..74818beb 100644
--- a/testsuite/systemtap.base/sdt.exp
+++ b/testsuite/systemtap.base/sdt.exp
@@ -10,31 +10,33 @@ set ::result_string {1
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 10}
-set extra_flags {{""} {additional_flags=-ansi}}
+set extra_flags {{""} {additional_flags=-std=gnu89} {additional_flags=-ansi} {additional_flags=-pedantic}}
# Iterate extra_flags, trying each with C and C++
for {set i 0} {$i < [llength $extra_flags]} {incr i} {
+set extra_flag [lindex $extra_flags $i]
+
# C
set test_flags "additional_flags=-g"
set test_flags "$test_flags additional_flags=-I$srcdir/../includes/sys"
-set test_flags "$test_flags additional_flags=-std=gnu89"
set test_flags "$test_flags additional_flags=-Wall"
-set test_flags "$test_flags additional_flags=-Wdeclaration-after-statement"
+set test_flags "$test_flags additional_flags=-Wextra"
set test_flags "$test_flags additional_flags=-Werror"
-set res [target_compile $srcdir/$subdir/$test.c $test.prog executable [concat $test_flags " " [lindex $extra_flags $i]]]
+set res [target_compile $srcdir/$subdir/$test.c $test.prog executable "$test_flags $extra_flag"]
if { $res != "" } {
verbose "target_compile failed: $res" 2
- fail "compiling $test.c"
+ fail "compiling $test.c $extra_flag"
return
} else {
- pass "compiling $test.c"
+ pass "compiling $test.c $extra_flag"
}
if {[installtest_p]} {
+# XXX: we need distinct test names for these
stap_run2 $srcdir/$subdir/$test.stp -c ./$test.prog
} else {
- untested "$test"
+ untested "$test $extra_flag"
}
# C++
@@ -44,19 +46,20 @@ set test_flags "$test_flags additional_flags=-Wall"
set test_flags "$test_flags additional_flags=-Werror"
set test_flags "$test_flags additional_flags=-x additional_flags=c++"
-set res [target_compile $srcdir/$subdir/$test.c $test.prog executable [concat $test_flags [lindex $extra_flags $i]]]
+set res [target_compile $srcdir/$subdir/$test.c $test.prog executable "$test_flags $extra_flag"]
if { $res != "" } {
verbose "target_compile failed: $res" 2
- fail "compiling $test.c"
+ fail "compiling $test.c c++ $extra_flag"
return
} else {
- pass "compiling $test.c"
+ pass "compiling $test.c c++ $extra_flag"
}
if {[installtest_p]} {
+# XXX: we need distinct test names for these
stap_run2 $srcdir/$subdir/$test.stp -c ./$test.prog
} else {
- untested "$test"
+ untested "$test c++ $extra_flag"
}
}