diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-04-08 18:11:34 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-04-08 23:38:39 +0200 |
commit | 30450585dd7d50224abef863ed8bae0950740fdb (patch) | |
tree | 61afc342570f2d0636f90cc33b1f4ea15f5a88e4 | |
parent | e87251e16921a2d52a35212278e45f0c0af1cc5d (diff) | |
download | systemtap-steved-30450585dd7d50224abef863ed8bae0950740fdb.tar.gz systemtap-steved-30450585dd7d50224abef863ed8bae0950740fdb.tar.xz systemtap-steved-30450585dd7d50224abef863ed8bae0950740fdb.zip |
Add main executable symbol uprobe to uprobes_lib.exp test.
There was nothing wrong with the probe itself, but because the body
was empty the compiler optimised away the actual call...
* testsuite/systemtap.base/uprobes_lib.exp: Activate main exe probe, expect
more output.
* testsuite/systemtap.base/uprobes_lib.stp: Also probe main and main_lib.
* testsuite/systemtap.base/uprobes_exe.c: Put some code in main_func.
* testsuite/systemtap.base/uprobes_lib.c: Likewise for lib_func.
-rw-r--r-- | testsuite/systemtap.base/uprobes_exe.c | 8 | ||||
-rw-r--r-- | testsuite/systemtap.base/uprobes_lib.c | 3 | ||||
-rw-r--r-- | testsuite/systemtap.base/uprobes_lib.exp | 13 | ||||
-rw-r--r-- | testsuite/systemtap.base/uprobes_lib.stp | 10 |
4 files changed, 23 insertions, 11 deletions
diff --git a/testsuite/systemtap.base/uprobes_exe.c b/testsuite/systemtap.base/uprobes_exe.c index 447434c6..b4811335 100644 --- a/testsuite/systemtap.base/uprobes_exe.c +++ b/testsuite/systemtap.base/uprobes_exe.c @@ -15,13 +15,15 @@ int lib_main (void); void main_func (int foo) { - ; // nothing here... + if (foo > 1) + main_func (foo - 1); + else + lib_main(); } int main (int argc, char *argv[], char *envp[]) { - main_func(1); - lib_main(); + main_func (3); return 0; } diff --git a/testsuite/systemtap.base/uprobes_lib.c b/testsuite/systemtap.base/uprobes_lib.c index c9d70625..25297b6b 100644 --- a/testsuite/systemtap.base/uprobes_lib.c +++ b/testsuite/systemtap.base/uprobes_lib.c @@ -10,7 +10,8 @@ void lib_func (int bar) { - ; // nothing here... + if (bar > 1) + lib_func (bar - 1); } void diff --git a/testsuite/systemtap.base/uprobes_lib.exp b/testsuite/systemtap.base/uprobes_lib.exp index 63ef957a..313c01b6 100644 --- a/testsuite/systemtap.base/uprobes_lib.exp +++ b/testsuite/systemtap.base/uprobes_lib.exp @@ -29,11 +29,14 @@ if { $res != "" } { pass "$test compile $testsrc" } -# XXX main_func needs another/extra test. Disabled for now. -# Enable (and in uprobes_lib.stp) after PR9940 is fixed. -# set ::result_string {main_func -# lib_func} -set ::result_string {lib_func} +set ::result_string {main +main_func +main_func +main_func +lib_main +lib_func +lib_func +lib_func} # Only run on make installcheck if {! [installtest_p]} { untested "$test"; return } diff --git a/testsuite/systemtap.base/uprobes_lib.stp b/testsuite/systemtap.base/uprobes_lib.stp index bc6cc249..459351a4 100644 --- a/testsuite/systemtap.base/uprobes_lib.stp +++ b/testsuite/systemtap.base/uprobes_lib.stp @@ -1,8 +1,14 @@ -/* - Not activated probe... Seems always skipped? +probe process("uprobes_exe").function("main") { + printf("main\n"); +} + probe process("uprobes_exe").function("main_func") { printf("main_func\n"); } -*/ + +probe process("libuprobes_lib.so").function("lib_main") { + printf("lib_main\n"); +} probe process("libuprobes_lib.so").function("lib_func") { printf("lib_func\n"); |