forked from pool/systemtap
43 lines
1.5 KiB
Diff
43 lines
1.5 KiB
Diff
---
|
|
testsuite/systemtap.base/debugpath.exp | 28 ++++++++++++++++++++++------
|
|
1 file changed, 22 insertions(+), 6 deletions(-)
|
|
|
|
Index: b/testsuite/systemtap.base/debugpath.exp
|
|
===================================================================
|
|
--- a/testsuite/systemtap.base/debugpath.exp
|
|
+++ b/testsuite/systemtap.base/debugpath.exp
|
|
@@ -11,11 +11,27 @@ wait
|
|
|
|
set test "debugpath-good"
|
|
set uname [exec /bin/uname -r]
|
|
-spawn env SYSTEMTAP_DEBUGINFO_PATH=/lib/modules/$uname/build stap -e "probe kernel.function(\"sys_open\") {}" -p2
|
|
-expect {
|
|
- -re {kernel.function.*pc=} { pass $test }
|
|
- timeout { fail "$test (timeout2)" }
|
|
- eof { fail "$test (eof)" }
|
|
+
|
|
+# Guess where debuginfo is installed
|
|
+if [file isdirectory /usr/lib/debug/boot/] {
|
|
+ set debuginfo_path "/usr/lib/debug/boot/"
|
|
+} elseif [file isdirectory /usr/lib/debug/lib/modules/$uname] {
|
|
+ set debuginfo_path "/usr/lib/debug/lib/modules/$uname"
|
|
+} elseif [file isdirectory /lib/modules/$uname/build] {
|
|
+ set debuginfo_path "/lib/modules/$uname/build"
|
|
+} else {
|
|
+ set debuginfo_path "/lib/modules/$uname"
|
|
}
|
|
|
|
-wait
|
|
+if { ![file isfile "$debuginfo_path/vmlinux"] && ![file isfile "$debuginfo_path/vmlinux.debug"] } {
|
|
+ untested "$test: kernel debuginfo does not exists\n"
|
|
+} else {
|
|
+ spawn env SYSTEMTAP_DEBUGINFO_PATH=$debuginfo_path stap -e "probe kernel.function(\"sys_open\") {}" -p2
|
|
+ expect {
|
|
+ -re {kernel.function.*pc=} { pass $test }
|
|
+ timeout { fail "$test (timeout2)" }
|
|
+ eof { fail "$test (eof)" }
|
|
+ }
|
|
+
|
|
+ wait
|
|
+}
|