This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH 2/2] marker probe: add $name testcases
Hi,
Masami Hiramatsu wrote:
> Here is a patch which add $name variable access from marker probe.
> I added _stp_mark_context structure which contains .name and .format
> strings for passing both of them to marker handler. Now you can get
> both of $format and $name from marker probes.
Here is a patch of the testcases for $name support.
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com
---
testsuite/systemtap.base/marker.exp | 45 ++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
Index: systemtap/testsuite/systemtap.base/marker.exp
===================================================================
--- systemtap.orig/testsuite/systemtap.base/marker.exp 2008-09-02 05:35:55.000000000 -0400
+++ systemtap/testsuite/systemtap.base/marker.exp 2008-09-03 17:46:51.000000000 -0400
@@ -230,3 +230,48 @@
[lindex $kernel_marker_names 0] "foo"]
stap_compile $TEST_NAME 0 $script
}
+
+set TEST_NAME "K_MARKER18"
+if {$kernel_markers_found == 0} {
+ untested "$TEST_NAME : no kernel markers present"
+} else {
+ # Try compiling a script that prints the name string of a
+ # marker.
+ set script [format $kernel_script_arg \
+ [lindex $kernel_marker_names 0] {\$name}]
+ stap_compile $TEST_NAME 1 $script
+}
+
+set TEST_NAME "K_MARKER19"
+if {$kernel_markers_found == 0} {
+ untested "$TEST_NAME : no kernel markers present"
+} else {
+ # Try compiling a script that writes to a marker name string
+ # (which isn't allowed).
+ set script [format $kernel_script_arg2 \
+ [lindex $kernel_marker_names 0] {\$name}]
+ stap_compile $TEST_NAME 0 $script
+}
+
+set TEST_NAME "K_MARKER20"
+if {$kernel_markers_found == 0} {
+ untested "$TEST_NAME : no kernel markers present"
+} else {
+ # Try compiling a script that treats the marker name string as a
+ # structure (which isn't allowed).
+ set script [format $kernel_script_arg \
+ [lindex $kernel_marker_names 0] {\$name->foo}]
+ stap_compile $TEST_NAME 0 $script
+}
+
+set TEST_NAME "K_MARKER21"
+if {$kernel_markers_found == 0} {
+ untested "$TEST_NAME : no kernel markers present"
+} else {
+ # Try compiling a script that treats the marker name string like
+ # an array (which isn't allowed).
+ set script [format $kernel_script_arg \
+ [lindex $kernel_marker_names 0] {\$name\[0\]}]
+ stap_compile $TEST_NAME 0 $script
+}
+