summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.exelib/libmarkunamestack.stp
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-09-16 12:18:50 -0400
committerDave Brolley <brolley@redhat.com>2009-09-16 12:18:50 -0400
commit0f4a9cb5967714ace01e0941592040b8c1d83ee7 (patch)
treef97784dbd9392694931c1be99abf7920f6f0484b /testsuite/systemtap.exelib/libmarkunamestack.stp
parentd83d7b513d38791751e46a05e382b1e6876abefc (diff)
parentd833f810e4ffaf5c9c16eebc7f10b9d14e53e508 (diff)
downloadsystemtap-steved-0f4a9cb5967714ace01e0941592040b8c1d83ee7.tar.gz
systemtap-steved-0f4a9cb5967714ace01e0941592040b8c1d83ee7.tar.xz
systemtap-steved-0f4a9cb5967714ace01e0941592040b8c1d83ee7.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'testsuite/systemtap.exelib/libmarkunamestack.stp')
-rw-r--r--testsuite/systemtap.exelib/libmarkunamestack.stp72
1 files changed, 72 insertions, 0 deletions
diff --git a/testsuite/systemtap.exelib/libmarkunamestack.stp b/testsuite/systemtap.exelib/libmarkunamestack.stp
new file mode 100644
index 00000000..0efbae0e
--- /dev/null
+++ b/testsuite/systemtap.exelib/libmarkunamestack.stp
@@ -0,0 +1,72 @@
+// Jumbo stp script
+// Arguments: @1 uprobes_exe, @2 libuprobes_lib.so
+
+# lib
+probe process(@1).function("main") {
+ printf("main\n");
+}
+
+probe process(@1).function("main_func") {
+ printf("main_func\n");
+}
+
+probe process(@2).function("lib_main") {
+ printf("lib_main\n");
+}
+
+probe process(@2).function("lib_func") {
+ printf("lib_func\n");
+}
+
+#mark
+probe process(@1).mark("main_count") {
+ printf("main_count: %d\n", $arg1);
+}
+
+probe process(@2).mark("func_count") {
+ printf("func_count: %d\n", $arg1);
+}
+
+#uname
+probe process(@1).function("*") {
+ printf("exe: %s=%s\n",probefunc(), usymname(uaddr()));
+}
+
+probe process(@2).function("*") {
+ printf("lib: %s=%s\n",probefunc(), usymname(uaddr()));
+}
+
+# ustack
+global hits = 0;
+
+probe process(@1).function("main_func")
+{
+ if (hits == 0)
+ {
+ log("print_ubacktrace exe 0");
+ print_ubacktrace();
+ hits++;
+ }
+ else if (hits == 1)
+ {
+ log("print_ustack exe 1");
+ print_ustack(ubacktrace());
+ hits++;
+ }
+}
+
+probe process(@2).function("lib_func")
+{
+ if (hits == 2)
+ {
+ log("print_ubacktrace lib 2");
+ print_ubacktrace();
+ hits++;
+ }
+ else if (hits == 3)
+ {
+ log("print_ustack lib 3");
+ print_ustack(ubacktrace());
+ hits++;
+ }
+}