|
|
f43afa |
From b2c99fdcc379ae65a83e25a6b6a8bc2b77a5b03c Mon Sep 17 00:00:00 2001
|
|
|
f43afa |
From: Jonathan Lebon <jlebon@redhat.com>
|
|
|
f43afa |
Date: Tue, 21 Jan 2014 16:21:31 -0500
|
|
|
f43afa |
Subject: [PATCH] testsuite: adjust tests for new probing powers
|
|
|
f43afa |
|
|
|
f43afa |
Since we can now probe more functions (such as _start,
|
|
|
f43afa |
register_tm_clones), a few tests need to be adjusted.
|
|
|
f43afa |
|
|
|
f43afa |
* rep_ret.exp
|
|
|
f43afa |
|
|
|
f43afa |
Get rid of 'bad' var and handle the case where main is not the first
|
|
|
f43afa |
line printed out (which is now _start).
|
|
|
f43afa |
|
|
|
f43afa |
* process_by_cmd.exp
|
|
|
f43afa |
|
|
|
f43afa |
Change wildcard probe (which now picks up too many functions) for
|
|
|
f43afa |
multiple probe points targetting only the functions we want.
|
|
|
f43afa |
|
|
|
f43afa |
* exelib.exp
|
|
|
f43afa |
|
|
|
f43afa |
Same as process_by_cmd.exp
|
|
|
f43afa |
---
|
|
|
f43afa |
testsuite/systemtap.base/process_by_cmd.stp | 5 ++++-
|
|
|
f43afa |
testsuite/systemtap.base/rep_ret.exp | 9 ++++++---
|
|
|
f43afa |
testsuite/systemtap.exelib/libmarkunamestack.stp | 6 ++++--
|
|
|
f43afa |
testsuite/systemtap.exelib/uname.stp | 6 ++++--
|
|
|
f43afa |
4 files changed, 18 insertions(+), 8 deletions(-)
|
|
|
f43afa |
|
|
|
f43afa |
diff --git a/testsuite/systemtap.base/process_by_cmd.stp b/testsuite/systemtap.base/process_by_cmd.stp
|
|
|
f43afa |
index 8f744e0..5fe1dec 100644
|
|
|
f43afa |
--- a/testsuite/systemtap.base/process_by_cmd.stp
|
|
|
f43afa |
+++ b/testsuite/systemtap.base/process_by_cmd.stp
|
|
|
f43afa |
@@ -1,3 +1,6 @@
|
|
|
f43afa |
probe process.function("main") { printf("func end\n") }
|
|
|
f43afa |
-probe process.function("*").return { printf("func return end\n") }
|
|
|
f43afa |
+probe process.function("main").return,
|
|
|
f43afa |
+ process.function("first").return,
|
|
|
f43afa |
+ process.function("second").return,
|
|
|
f43afa |
+ process.function("third") { printf("func return end\n") }
|
|
|
f43afa |
probe process.mark("*") { printf("mark end\n") }
|
|
|
f43afa |
diff --git a/testsuite/systemtap.base/rep_ret.exp b/testsuite/systemtap.base/rep_ret.exp
|
|
|
f43afa |
index 959050e..75b64df 100644
|
|
|
f43afa |
--- a/testsuite/systemtap.base/rep_ret.exp
|
|
|
f43afa |
+++ b/testsuite/systemtap.base/rep_ret.exp
|
|
|
f43afa |
@@ -32,11 +32,14 @@ foreach arch $arches {
|
|
|
f43afa |
|
|
|
f43afa |
if {[installtest_p] && [uprobes_p]} {
|
|
|
f43afa |
set ok 0
|
|
|
f43afa |
- set bad 0
|
|
|
f43afa |
set warn 0
|
|
|
f43afa |
|
|
|
f43afa |
spawn stap -e {probe process(@1).function("*") { println(probefunc()) }} ./$exe -c ./$exe
|
|
|
f43afa |
+ # We have two cases for main below to handle the possibility of main not being the first
|
|
|
f43afa |
+ # line being printed out (but only one of the two will ever fire, so the count is still 3)
|
|
|
f43afa |
+ # The test however does still ensure that main is followed by rep_ret then by repnz_ret.
|
|
|
f43afa |
expect {
|
|
|
f43afa |
+ -re {\r\nmain\r\n} { incr ok; exp_continue }
|
|
|
f43afa |
-re {^main\r\n} { incr ok; exp_continue }
|
|
|
f43afa |
-re {^rep_ret\r\n} { incr ok; exp_continue }
|
|
|
f43afa |
-re {^repnz_ret\r\n} { incr ok; exp_continue }
|
|
|
f43afa |
@@ -46,10 +49,10 @@ foreach arch $arches {
|
|
|
f43afa |
}
|
|
|
f43afa |
wait
|
|
|
f43afa |
|
|
|
f43afa |
- if {$ok == 3 && $bad == 0 && $warn == 0} {
|
|
|
f43afa |
+ if {$ok == 3 && $warn == 0} {
|
|
|
f43afa |
pass "$exe"
|
|
|
f43afa |
} else {
|
|
|
f43afa |
- fail "$exe ($ok, $bad, $warn)"
|
|
|
f43afa |
+ fail "$exe ($ok, $warn)"
|
|
|
f43afa |
}
|
|
|
f43afa |
} else {
|
|
|
f43afa |
untested "$exe"
|
|
|
f43afa |
diff --git a/testsuite/systemtap.exelib/libmarkunamestack.stp b/testsuite/systemtap.exelib/libmarkunamestack.stp
|
|
|
f43afa |
index 3ad1aa5..7894ef4 100644
|
|
|
f43afa |
--- a/testsuite/systemtap.exelib/libmarkunamestack.stp
|
|
|
f43afa |
+++ b/testsuite/systemtap.exelib/libmarkunamestack.stp
|
|
|
f43afa |
@@ -28,11 +28,13 @@ probe process(@2).mark("func_count") {
|
|
|
f43afa |
}
|
|
|
f43afa |
|
|
|
f43afa |
#uname
|
|
|
f43afa |
-probe process(@1).function("*") {
|
|
|
f43afa |
+probe process(@1).function("main"),
|
|
|
f43afa |
+ process(@1).function("main_func") {
|
|
|
f43afa |
printf("exe: %s=%s\n",probefunc(), usymname(uaddr()));
|
|
|
f43afa |
}
|
|
|
f43afa |
|
|
|
f43afa |
-probe process(@2).function("*") {
|
|
|
f43afa |
+probe process(@2).function("lib_main"),
|
|
|
f43afa |
+ process(@2).function("lib_func") {
|
|
|
f43afa |
printf("lib: %s=%s\n",probefunc(), usymname(uaddr()));
|
|
|
f43afa |
}
|
|
|
f43afa |
|
|
|
f43afa |
diff --git a/testsuite/systemtap.exelib/uname.stp b/testsuite/systemtap.exelib/uname.stp
|
|
|
f43afa |
index aaf7ef1..25e6f8d 100644
|
|
|
f43afa |
--- a/testsuite/systemtap.exelib/uname.stp
|
|
|
f43afa |
+++ b/testsuite/systemtap.exelib/uname.stp
|
|
|
f43afa |
@@ -1,10 +1,12 @@
|
|
|
f43afa |
// Prints probefunc() and usymname(uaddr()) to check they are similar.
|
|
|
f43afa |
// Arguments: @1 uprobes_exe, @2 libuprobes_lib.so
|
|
|
f43afa |
|
|
|
f43afa |
-probe process(@1).function("*") {
|
|
|
f43afa |
+probe process(@1).function("main"),
|
|
|
f43afa |
+ process(@1).function("main_func") {
|
|
|
f43afa |
printf("exe: %s=%s\n",probefunc(), usymname(uaddr()));
|
|
|
f43afa |
}
|
|
|
f43afa |
|
|
|
f43afa |
-probe process(@2).function("*") {
|
|
|
f43afa |
+probe process(@2).function("lib_main"),
|
|
|
f43afa |
+ process(@2).function("lib_func") {
|
|
|
f43afa |
printf("lib: %s=%s\n",probefunc(), usymname(uaddr()));
|
|
|
f43afa |
}
|
|
|
f43afa |
--
|
|
|
f43afa |
1.8.3.1
|
|
|
f43afa |
|