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] Add insn.block testcase to itrace.exp in testsuite


Earlier today, I posted a runtime patch for the insn.block probe point.  Once that patch is committed, the insn.block probe can be safely tested on any architecture.  The attached patch adds such a testcase to the testsuite.

Regards,
-Maynard
diff -paur systemtap-0.9.5/testsuite/systemtap.base/itrace.exp systemtap-0.9.5-insn.block-testcase/testsuite/systemtap.base/itrace.exp
--- systemtap-0.9.5/testsuite/systemtap.base/itrace.exp	2009-03-27 13:02:57.000000000 -0400
+++ systemtap-0.9.5-insn.block-testcase/testsuite/systemtap.base/itrace.exp	2009-04-01 16:15:56.000000000 -0400
@@ -48,6 +48,27 @@ set itrace2_script {
 }
 set itrace2_script_output "itraced = 5\r\n"
 
+set itrace3_script {
+    global branches = 0
+    probe begin
+    {
+        printf("systemtap starting probe\n")
+        printf("ATTENTION: if arch_has_block_step is not defined for this arch, this testcase will fail\n")
+    }
+    probe process("%s").insn.block
+    {
+        branches += 1
+        if (branches == 5)
+                exit()
+    }
+
+
+    probe end { printf("systemtap ending probe\n")
+          printf("itraced block mode = %%d\n", branches)
+    }
+}
+set itrace3_script_output "itraced block mode = 5\r\n"
+
 
 # Set up our own copy of /bin/ls, to make testing for a particular
 # executable easy.  We can't use 'ln' here, since we might be creating
@@ -99,5 +120,15 @@ if {$utrace_support_found == 0} {
     stap_run $TEST_NAME run_ls_5_sec $itrace2_script_output -e $script
 }
 
+set TEST_NAME "itrace3"
+if {$utrace_support_found == 0} {
+    untested "$TEST_NAME : no kernel utrace support found"
+} elseif {![installtest_p]} {
+    untested $TEST_NAME
+} else {
+    set script [format $itrace3_script $exepath]
+    stap_run $TEST_NAME run_ls_5_sec $itrace3_script_output -e $script
+}
+
 # Cleanup
 exec rm -f $exepath

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