public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: systemtap-ml <systemtap@sources.redhat.com>
Subject: [PATCH][BUGFIX] backtracing test and runtime bugfixes
Date: Wed, 06 Feb 2008 15:42:00 -0000	[thread overview]
Message-ID: <47A9D562.5070000@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1278 bytes --]

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


[-- Attachment #2: runtime-fix-stack-ia64.patch --]
[-- Type: text/x-patch, Size: 567 bytes --]

---
 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');

[-- Attachment #3: testsuite-fix-backtrace.patch --]
[-- Type: text/x-patch, Size: 652 bytes --]

---
 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
 	    }

[-- Attachment #4: testsuite-ia64-fix-backtrace.patch --]
[-- Type: text/x-patch, Size: 1983 bytes --]

---
 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")
 }

                 reply	other threads:[~2008-02-06 15:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47A9D562.5070000@redhat.com \
    --to=mhiramat@redhat.com \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).