From 3f545051d7334d4afcc95cca9f9de33a07462f44 Mon Sep 17 00:00:00 2001 From: hiramatu Date: Wed, 6 Feb 2008 17:30:41 +0000 Subject: 2008-02-06 Masami Hiramatsu * systemtap.base/procfs.exp: Added PROCFS.ko cleanup. * systemtap.context/context.exp: Added cleanup call. * systemtap.printf/end1b.exp: Passed evaluated command string to as_root. * systemtap.printf/mixed_outb.exp: Ditto. * systemtap.printf/out1b.exp: Ditto. * systemtap.printf/out2b.exp: Ditto. * systemtap.printf/out3b.exp: Ditto. --- testsuite/systemtap.context/context.exp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'testsuite/systemtap.context') diff --git a/testsuite/systemtap.context/context.exp b/testsuite/systemtap.context/context.exp index bc5f8ebe..472609f7 100644 --- a/testsuite/systemtap.context/context.exp +++ b/testsuite/systemtap.context/context.exp @@ -76,6 +76,5 @@ foreach test $testlist { source $test.tcl } - - +cleanup -- cgit From 47683be64546814f9bf7f48e62c916d7901e336e Mon Sep 17 00:00:00 2001 From: hiramatu Date: Wed, 6 Feb 2008 22:07:42 +0000 Subject: 2008-02-06 Masami Hiramatsu * stack-ia64.c (__stp_show_stack_sym): Skip printing symbol if (ip == REG_IP(regs)). 2008-02-06 Masami Hiramatsu * systemtap.context/backtrace.tcl: Fixed regular expressions and Added new expression for return probe on ia64. * systemtap.context/backtrace.stp(print_all_trace_info): Added trace point output before calling print_stack(). --- testsuite/systemtap.context/backtrace.stp | 2 +- testsuite/systemtap.context/backtrace.tcl | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'testsuite/systemtap.context') diff --git a/testsuite/systemtap.context/backtrace.stp b/testsuite/systemtap.context/backtrace.stp index 73781371..c14d071c 100644 --- a/testsuite/systemtap.context/backtrace.stp +++ b/testsuite/systemtap.context/backtrace.stp @@ -4,7 +4,7 @@ function print_all_trace_info(point:string) { print("--------\n") bt = backtrace() printf("the %s stack is %s\n", point, bt) - print("--------\n") + printf("--<%s>--\n", point) print_stack(bt); print("--------\n") } diff --git a/testsuite/systemtap.context/backtrace.tcl b/testsuite/systemtap.context/backtrace.tcl index e35832ee..409cf693 100644 --- a/testsuite/systemtap.context/backtrace.tcl +++ b/testsuite/systemtap.context/backtrace.tcl @@ -5,6 +5,12 @@ set m4 0 set m5 0 set m6 0 +if {[istarget ia64-*-*]} { + set retexp {.*return\>--\r\n 0x[a-f0-9]+ : yyy_func3[^\[]+\[systemtap_test_module2\]\r\n} +} else { + set retexp {.*return\>--\r\n 0x[a-f0-9]+ : kretprobe_trampoline_holder[^\r\n]+\r\n} +} + spawn stap backtrace.stp #exp_internal 1 expect { @@ -36,7 +42,7 @@ expect { incr m2 expect { -timeout 5 - -re {.*---\r\n 0x[a-f0-9]+ : yyy_func3[^\[]+\[systemtap_test_module2\]\r\n} { + -re {.*call\>--\r\n 0x[a-f0-9]+ : yyy_func3[^\[]+\[systemtap_test_module2\]\r\n} { if {$m2 == 1} {incr m2} exp_continue } @@ -76,7 +82,7 @@ expect { incr m4 expect { -timeout 5 - -re {.*0x[a-f0-9]+ : kretprobe_trampoline_holder[^\[]+\[\]\r\n} { + -re $retexp { if {$m4 == 1} {incr m4} exp_continue } @@ -104,7 +110,7 @@ expect { incr m6 expect { -timeout 5 - -re {.*---\r\n 0x[a-f0-9]+[^\r\n]+\r\n} { + -re {.*profile>--\r\n 0x[a-f0-9]+[^\r\n]+\r\n} { if {$m6 == 1} {incr m6} } } -- cgit From 4bab8964266929ec9356590db0d0fe51607c4b6b Mon Sep 17 00:00:00 2001 From: fche Date: Wed, 13 Feb 2008 03:33:18 +0000 Subject: 2008-02-12 Frank Ch. Eigler * 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. --- testsuite/systemtap.context/args.tcl | 2 +- testsuite/systemtap.context/backtrace.tcl | 2 +- testsuite/systemtap.context/context.exp | 15 +++++++++++---- testsuite/systemtap.context/pid.tcl | 2 +- testsuite/systemtap.context/systemtap_test_module2.c | 10 ++++++++++ 5 files changed, 24 insertions(+), 7 deletions(-) (limited to 'testsuite/systemtap.context') 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"; } -- cgit