summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfche <fche>2008-02-13 03:33:18 +0000
committerfche <fche>2008-02-13 03:33:18 +0000
commit4bab8964266929ec9356590db0d0fe51607c4b6b (patch)
tree991aac2cdd5f0508a5857fa72623524017475070
parent21beacc9a00ea48763048151c370e205c5f23379 (diff)
downloadsystemtap-steved-4bab8964266929ec9356590db0d0fe51607c4b6b.tar.gz
systemtap-steved-4bab8964266929ec9356590db0d0fe51607c4b6b.tar.xz
systemtap-steved-4bab8964266929ec9356590db0d0fe51607c4b6b.zip
2008-02-12 Frank Ch. Eigler <fche@elastic.org>
* systemtap.context/context.exp: Build temporary modules under build tree, to tolerate read-only source trees. * {args,backtrace,pid}.tcl: Corresponding changes. * systemtap_test_module2.c: Add a bunch of asm("")'s to prevent inlining even better than noinline does.
-rw-r--r--testsuite/ChangeLog8
-rw-r--r--testsuite/systemtap.context/args.tcl2
-rw-r--r--testsuite/systemtap.context/backtrace.tcl2
-rw-r--r--testsuite/systemtap.context/context.exp15
-rw-r--r--testsuite/systemtap.context/pid.tcl2
-rw-r--r--testsuite/systemtap.context/systemtap_test_module2.c10
6 files changed, 32 insertions, 7 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index da48742e..11af94f3 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,5 +1,13 @@
2008-02-12 Frank Ch. Eigler <fche@elastic.org>
+ * systemtap.context/context.exp: Build temporary modules under
+ build tree, to tolerate read-only source trees.
+ * {args,backtrace,pid}.tcl: Corresponding changes.
+ * systemtap_test_module2.c: Add a bunch of asm("")'s to prevent
+ inlining even better than noinline does.
+
+2008-02-12 Frank Ch. Eigler <fche@elastic.org>
+
* systemtap.pass1-4/buildok.exp: No longer kfail buildok/seventeen.
2008-02-07 Martin Hunt <hunt@redhat.com>
diff --git a/testsuite/systemtap.context/args.tcl b/testsuite/systemtap.context/args.tcl
index 6c14c4b7..37a43823 100644
--- a/testsuite/systemtap.context/args.tcl
+++ b/testsuite/systemtap.context/args.tcl
@@ -1,4 +1,4 @@
-spawn stap args.stp
+spawn stap $srcdir/$subdir/args.stp
expect {
-timeout 240
"READY" {
diff --git a/testsuite/systemtap.context/backtrace.tcl b/testsuite/systemtap.context/backtrace.tcl
index 409cf693..703f0ec2 100644
--- a/testsuite/systemtap.context/backtrace.tcl
+++ b/testsuite/systemtap.context/backtrace.tcl
@@ -11,7 +11,7 @@ if {[istarget ia64-*-*]} {
set retexp {.*return\>--\r\n 0x[a-f0-9]+ : kretprobe_trampoline_holder[^\r\n]+\r\n}
}
-spawn stap backtrace.stp
+spawn stap $srcdir/$subdir/backtrace.stp
#exp_internal 1
expect {
-timeout 240
diff --git a/testsuite/systemtap.context/context.exp b/testsuite/systemtap.context/context.exp
index 472609f7..11c0f2fc 100644
--- a/testsuite/systemtap.context/context.exp
+++ b/testsuite/systemtap.context/context.exp
@@ -21,20 +21,21 @@ proc cleanup {} {
proc build_modules {} {
global build_dir
+ global srcdir subdir
if {[catch {exec mktemp -d staptestXXXXX} build_dir]} {
puts stderr "Failed to create temporary directory: $build_dir"
return 0
}
- foreach f [glob systemtap_test_module*.c] {
+ foreach f [glob $srcdir/$subdir/systemtap_test_module*.c] {
exec cp $f $build_dir
}
set old_dir [pwd]
cd $build_dir
foreach n {2 1} {
- exec cp $old_dir/makefile$n Makefile
+ exec cp $srcdir/$subdir/makefile$n Makefile
if {[catch {exec make clean} res]} {
puts $res
cd $old_dir
@@ -61,7 +62,13 @@ proc build_modules {} {
}
# first build the modules
-cd $srcdir/$subdir
+
+# NB: We cannot "cd" on behalf the whole dejagnu process, especially
+# without going back to the build tree, and especially not to the
+# source tree expecting to be able to write there.
+#
+# cd $srcdir/$subdir
+
set uname [exec /bin/uname -r]
if {[build_modules] == 0} {
@@ -73,7 +80,7 @@ if {[build_modules] == 0} {
}
foreach test $testlist {
- source $test.tcl
+ source $srcdir/$subdir/$test.tcl
}
cleanup
diff --git a/testsuite/systemtap.context/pid.tcl b/testsuite/systemtap.context/pid.tcl
index c96d922f..a2c091f1 100644
--- a/testsuite/systemtap.context/pid.tcl
+++ b/testsuite/systemtap.context/pid.tcl
@@ -1,5 +1,5 @@
set tests [list execname pexecname pid ppid tid uid euid gid egid]
-spawn stap pid.stp
+spawn stap $srcdir/$subdir/pid.stp
#exp_internal 1
expect {
-timeout 240
diff --git a/testsuite/systemtap.context/systemtap_test_module2.c b/testsuite/systemtap.context/systemtap_test_module2.c
index 51cb58bb..b0d47428 100644
--- a/testsuite/systemtap.context/systemtap_test_module2.c
+++ b/testsuite/systemtap.context/systemtap_test_module2.c
@@ -22,19 +22,23 @@
/* some nested functions to test backtraces */
int noinline yyy_func4 (int foo) {
+ asm ("");
return foo + 1;
}
int noinline yyy_func3 (int foo) {
foo = yyy_func4(foo);
+ asm ("");
return foo + 1;
}
int noinline yyy_func2 (int foo) {
foo = yyy_func3(foo);
+ asm ("");
return foo + 1;
}
int noinline yyy_func1 (int foo) {
foo = yyy_func2(foo);
+ asm ("");
return foo + 1;
}
EXPORT_SYMBOL(yyy_func1);
@@ -42,31 +46,37 @@ EXPORT_SYMBOL(yyy_func1);
/* 1. int argument testing */
int noinline yyy_int(int a, int b, int c)
{
+ asm ("");
return a+b+c;
}
/* 2. uint argument testing */
unsigned noinline yyy_uint(unsigned a, unsigned b, unsigned c)
{
+ asm ("");
return a+b+c;
}
/* 3. long argument testing */
long noinline yyy_long(long a, long b, long c)
{
+ asm ("");
return a+b+c;
}
/* 4. int64_t argument testing */
int noinline yyy_int64(int64_t a, int64_t b, int64_t c)
{
+ asm ("");
return a+b+c;
}
/* 5. char argument testing */
char noinline yyy_char(char a, char b, char c)
{
+ asm ("");
return 'Q';
}
/* 5. string argument testing */
char * noinline yyy_str(char *a, char *b, char *c)
{
+ asm ("");
return "XYZZY";
}