diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-04-09 14:26:07 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-04-09 14:26:07 +0200 |
commit | 18ac9f367a2e63335dfbdc8f5e8a97de4e40dbe4 (patch) | |
tree | 923297dfb49aabf8e26f9840ba0d3bc4179c0cf8 | |
parent | 86872ea4cdc4ce7b4546975125fc7be7c7a6e0ec (diff) | |
download | systemtap-steved-18ac9f367a2e63335dfbdc8f5e8a97de4e40dbe4.tar.gz systemtap-steved-18ac9f367a2e63335dfbdc8f5e8a97de4e40dbe4.tar.xz systemtap-steved-18ac9f367a2e63335dfbdc8f5e8a97de4e40dbe4.zip |
Add tests for probefunc(), usymname(), uaddr() versus shared libraries.
* testsuite/systemtap.base/uprobes_uname.exp: New file.
* testsuite/systemtap.base/uprobes_uname.stp: Likewise.
-rw-r--r-- | testsuite/systemtap.base/uprobes_uname.exp | 46 | ||||
-rw-r--r-- | testsuite/systemtap.base/uprobes_uname.stp | 7 |
2 files changed, 53 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/uprobes_uname.exp b/testsuite/systemtap.base/uprobes_uname.exp new file mode 100644 index 00000000..65e1ff70 --- /dev/null +++ b/testsuite/systemtap.base/uprobes_uname.exp @@ -0,0 +1,46 @@ +set test "uprobes_uname" +set testpath "$srcdir/$subdir" +set testsrc "$testpath/uprobes_exe.c" +set testsrclib "$testpath/uprobes_lib.c" +set testexe "./uprobes_exe" +set testlibname "uprobes_lib" +set testlibdir "." +set testso "$testlibdir/lib${testlibname}.so" +set testflags "additional_flags=-g additional_flags=-O" +set testlibflags "$testflags additional_flags=-fPIC additional_flags=-shared" +set maintestflags "$testflags additional_flags=-L$testlibdir additional_flags=-l$testlibname additional_flags=-Wl,-rpath,$testlibdir" + +# Compile our test program and library. +set res [target_compile $testsrclib $testso executable $testlibflags] +if { $res != "" } { + verbose "target_compile for $testso failed: $res" 2 + fail "$test compile $testsrclib" + return +} else { + pass "$test compile $testsrclib" +} + +set res [target_compile $testsrc $testexe executable $maintestflags] +if { $res != "" } { + verbose "target_compile failed: $res" 2 + fail "$test compile $testsrc" + return +} else { + pass "$test compile $testsrc" +} + +set ::result_string {exe: main=main +exe: main_func=main_func +exe: main_func=main_func +exe: main_func=main_func +lib: lib_main=lib_main +lib: lib_func=lib_func +lib: lib_func=lib_func +lib: lib_func=lib_func} + +# Only run on make installcheck +if {! [installtest_p]} { untested "$test"; return } +if {! [utrace_p]} { untested $test; return } +stap_run2 $srcdir/$subdir/$test.stp -c $testexe + +#exec rm -f $testexe $testso diff --git a/testsuite/systemtap.base/uprobes_uname.stp b/testsuite/systemtap.base/uprobes_uname.stp new file mode 100644 index 00000000..a44d78d3 --- /dev/null +++ b/testsuite/systemtap.base/uprobes_uname.stp @@ -0,0 +1,7 @@ +probe process("uprobes_exe").function("*") { + printf("exe: %s=%s\n",probefunc(), usymname(uaddr())); +} + +probe process("libuprobes_lib.so").function("*") { + printf("lib: %s=%s\n",probefunc(), usymname(uaddr())); +} |