This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][BUGFIX] backtracing test and runtime bugfixes


Hi,

I found that the backtrace testcase still failed, and I tried to fix that.

Here are 3 patches which fix bugs related to backtrace tests.

[1/3] runtime-fix-stack-ia64.patch
   This patch fixes a bug that print_backtrace() and print_stack() shows
   current ip twice on ia64.
   The __stp_show_stack_sym() have to skip the case of ip == REG_IP(regs)
   as same as __stp_show_stack_addr() does.

[2/3] testsuite-fix-backtrace.patch
   This patch fixes a regexp pattern in testsuite/systemtap.context/backtrace.tcl,
   because the backtrace format is changed recently from "kfunc+0x1/0x1 + []" to
   "kfunc+0x1/0x1".

[3/3] testsuite-ia64-fix-backtrace.patch
   This patch adds a regexp pattern for return probe on ia64 in
   testsuite/systemtap.context/backtrace.tcl.
   In return probe, print_stack() shows "kretprobe_trampoline_holder" generally,
   but on ia64, it shows "yyy_func3". So, we need special regexp. And this means
   that the outputs of print_stack() in function entry and function return become same.
   Thus, this patch also adds additional marks for differentiating between each cases to
   backtrace.stp.

Thanks,

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com

---
 runtime/stack-ia64.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: src/runtime/stack-ia64.c
===================================================================
--- src.orig/runtime/stack-ia64.c	2008-02-05 15:55:10.000000000 -0500
+++ src/runtime/stack-ia64.c	2008-02-05 15:57:18.000000000 -0500
@@ -23,8 +23,8 @@
                 if (skip){
 			if (ip == REG_IP(regs))
 				skip = 0;
-                        else continue;
-                }
+			continue;
+		}
 		_stp_print_char(' ');
 		_stp_symbol_print(ip);
 		_stp_print_char('\n');
---
 testsuite/systemtap.context/backtrace.tcl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: src/testsuite/systemtap.context/backtrace.tcl
===================================================================
--- src.orig/testsuite/systemtap.context/backtrace.tcl	2008-02-05 17:53:48.000000000 -0500
+++ src/testsuite/systemtap.context/backtrace.tcl	2008-02-05 17:58:42.000000000 -0500
@@ -76,7 +76,7 @@
 	incr m4
 	expect {
 	    -timeout 5
-	    -re {.*0x[a-f0-9]+ : kretprobe_trampoline_holder[^\[]+\[\]\r\n} {
+	    -re {.*0x[a-f0-9]+ : kretprobe_trampoline_holder[^\r\n]+\r\n} {
 		if {$m4 == 1} {incr m4}
 		exp_continue
 	    }
---
 testsuite/systemtap.context/backtrace.stp |    2 +-
 testsuite/systemtap.context/backtrace.tcl |   12 +++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

Index: src/testsuite/systemtap.context/backtrace.tcl
===================================================================
--- src.orig/testsuite/systemtap.context/backtrace.tcl	2008-02-05 17:55:06.000000000 -0500
+++ src/testsuite/systemtap.context/backtrace.tcl	2008-02-05 17:55:06.000000000 -0500
@@ -5,6 +5,12 @@
 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 @@
 	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 @@
 	incr m4
 	expect {
 	    -timeout 5
-	    -re {.*0x[a-f0-9]+ : kretprobe_trampoline_holder[^\r\n]+\r\n} {
+	    -re $retexp {
 		if {$m4 == 1} {incr m4}
 		exp_continue
 	    }
@@ -104,7 +110,7 @@
 	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}
 	    }
 	}
Index: src/testsuite/systemtap.context/backtrace.stp
===================================================================
--- src.orig/testsuite/systemtap.context/backtrace.stp	2008-02-05 17:53:45.000000000 -0500
+++ src/testsuite/systemtap.context/backtrace.stp	2008-02-05 17:55:06.000000000 -0500
@@ -4,7 +4,7 @@
         print("--------\n")
 	bt = backtrace()
 	printf("the %s stack is %s\n", point, bt)
-        print("--------\n")
+        printf("--<%s>--\n", point)
 	print_stack(bt);
         print("--------\n")
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]