summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/ChangeLog11
-rw-r--r--testsuite/buildok/vfs_testcase.stp461
-rw-r--r--testsuite/systemtap.base/utrace_p4.exp68
-rw-r--r--testsuite/systemtap.stress/conversions.exp4
4 files changed, 536 insertions, 8 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index 4fda9c5f..eda51529 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,3 +1,14 @@
+2008-06-27 David Smith <dsmith@redhat.com>
+
+ * systemtap.base/utrace_p4.exp: Added tests for 'process(PID)'
+ variants.
+
+2008-06-24 Frank Ch. Eigler <fche@elastic.org>
+
+ rhbz 451707
+ * systemtap.stress/conversions.exp: Reorder value overrides
+ so $test name conveys correct tested value.
+
2008-06-23 Stan Cox <scox@redhat.com>
* systemtap.base/stmt_rel.stp: Added test for
diff --git a/testsuite/buildok/vfs_testcase.stp b/testsuite/buildok/vfs_testcase.stp
new file mode 100644
index 00000000..dc78399c
--- /dev/null
+++ b/testsuite/buildok/vfs_testcase.stp
@@ -0,0 +1,461 @@
+#! stap -up4
+probe generic.fop.llseek
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("file = %p\n", file);
+ print("offset = %ll\n", offset);
+ print("origin = %d\n", origin);
+ print("maxbyte = %l\n", maxbyte);
+}
+
+probe generic.fop.llseek.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe generic.fop.aio_read
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("file = %p\n", file);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("pos = %ll\n", pos);
+ print("size = %l\n", size);
+ print("buf = %p\n", buf);
+}
+
+probe generic.fop.aio_read.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe generic.fop.aio_write
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("file = %p\n", file);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("pos = %ll\n", pos);
+ print("size = %l\n", size);
+ print("buf = %p\n", buf);
+}
+
+probe generic.fop.aio_write.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+%( kernel_v < "2.6.19" %?
+probe generic.fop.readv
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("size = %lu\n", size);
+ print("pos = %ll\n", pos);
+}
+
+probe generic.fop.readv.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe generic.fop.writev
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("size = %lu\n", size);
+ print("pos = %ll\n", pos);
+}
+
+probe generic.fop.writev.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+%:
+%)
+
+probe generic.fop.mmap
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("file = %p\n", file);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("vm_start = %lu\n", vm_start);
+ print("vm_end = %lu\n", vm_end);
+ print("vm_flags = %lu\n", vm_flags);
+}
+
+probe generic.fop.mmap.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe generic.fop.open
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("size = %lu\n", size);
+ print("filename: %s\n", filename);
+ print("flag = %u\n", flag);
+}
+
+probe generic.fop.open.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+%( kernel_v < "2.6.23" %?
+probe generic.fop.sendfile
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("file = %p\n", file);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("pos = %ll\n", pos);
+ print("size = %l\n", size);
+}
+
+probe generic.fop.sendfile.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+%)
+
+
+probe generic.fop.splice_read
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("file = %p\n", file);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("size = %l\n", size);
+ print("flags = %u\n", flags);
+}
+
+probe generic.fop.splice_read.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe generic.fop.splice_write
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("file = %p\n", file);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("size = %l\n", size);
+ print("flags = %u\n", flags);
+}
+
+probe generic.fop.splice_write.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+%( kernel_v < "2.6.19" %?
+probe generic.fop.read
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("file = %p\n", file);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("size = %l\n", size);
+}
+
+probe generic.fop.read.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe generic.fop.write
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("size = %l\n", size);
+}
+
+probe generic.fop.write.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+%)
+
+probe generic.aop.writepages
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("size = %l\n", size);
+}
+
+probe generic.aop.writepages.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe vfs.do_sync_read
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("ino = %l\n", ino);
+ print("size = %l\n", size);
+ print("pos = %ll\n", pos);
+ print("buf = %u\n", buf);
+}
+
+probe vfs.do_sync_read.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe vfs.do_sync_write
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("size = %l\n", size);
+ print("pos = %ll\n", pos);
+ print("buf = %u\n", buf);
+}
+
+probe vfs.do_sync_write.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe vfs.block_sync_page
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("size = %l\n", size);
+ print("page_index = %l\n", page_index);
+}
+
+probe vfs.block_sync_page.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+
+probe vfs.__set_page_dirty_buffers
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("size = %l\n", size);
+ print("index = %l\n", index);
+}
+
+probe vfs.__set_page_dirty_buffers.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe vfs.do_mpage_readpage
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("size = %l\n", size);
+ print("index = %l\n", index);
+}
+
+probe vfs.do_mpage_readpage.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe vfs.add_to_page_cache
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("index = %ll\n", index);
+ print("nrpages = %lu\n", nrpages);
+}
+
+probe vfs.add_to_page_cache.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe vfs.remove_from_page_cache
+{
+ print("Probe hit the function: %s\n", name);
+ print("Probe function argstr: %s\n", argstr);
+ print("dev = %l\n", dev);
+ print("devname = %s\n", devname);
+ print("ino = %l\n", ino);
+ print("index = %ll\n", index);
+}
+
+probe vfs.remove_from_page_cache.return
+{
+ print("Probe return from function: %s with return value = %s\n", name, retstr);
+}
+
+probe vfs.read
+{
+ print("Probe hit the function: %s\n", probefunc());
+ print("file = %p\n", file);
+ print("pos = %p\n", pos);
+ print("buf = %p\n", buf);
+}
+
+probe vfs.read.return
+{
+ print("Probe return from function: %s with return value = %s\n", probefunc(), ret);
+}
+
+probe vfs.readv
+{
+ print("Probe hit the function: %s\n", probefunc());
+ print("file = %p\n", file);
+ print("pos = %p\n", pos);
+ print("vec = %p\n", vec);
+ print("vlen = %lu\n", vlen);
+}
+
+probe vfs.readv.return
+{
+ print("Probe return from function: %s with return value = %s\n", probefunc(), ret);
+}
+
+probe vfs.write
+{
+ print("Probe hit the function: %s\n", probefunc());
+ print("file = %p\n", file);
+ print("pos = %p\n", pos);
+ print("buf = %p\n", buf);
+}
+
+probe vfs.write.return
+{
+ print("Probe return from function: %s with return value = %s\n", probefunc(), ret);
+}
+
+probe vfs.writev
+{
+ print("Probe hit the function: %s\n", probefunc());
+ print("file = %p\n", file);
+ print("pos = %p\n", pos);
+ print("vec = %p\n", vec);
+ print("vlen = %lu\n", vlen);
+}
+
+probe vfs.writev.return
+{
+ print("Probe return from function: %s with return value = %s\n", probefunc(), ret);
+}
+
+probe _vfs.generic_file_readonly_mmap
+{
+ print("Probe hit the function: %s\n", probefunc());
+ print("file = %p\n", file);
+ print("vma = %p\n", vma);
+}
+
+probe _vfs.generic_file_readonly_mmap.return
+{
+ print("Probe return from function: %s with return value = %s\n", probefunc(), ret);
+}
+
+probe _vfs.generic_block_bmap
+{
+ print("Probe hit the function: %s\n", probefunc());
+ print("mapping = %p\n", mapping);
+ print("block = %llu\n", block);
+ print("get_block = %p\n", get_block);
+}
+
+probe _vfs.generic_commit_write
+{
+ print("Probe hit the function: %s\n", probefunc());
+ print("file = %p\n", file);
+ print("page = %p\n", page);
+ print("from = %u to=%u\n", from, to);
+}
+
+probe _vfs.block_prepare_write
+{
+ print("Probe hit the function: %s\n", probefunc());
+ print("_inode = %p\n", _inode);
+ print("page = %p\n", page);
+ print("write_from = %u write_upto=%u\n", write_from, write_upto);
+}
+probe _vfs.block_prepare_write.return
+{
+ print("Probe return from function: %s with return value = %s\n", probefunc(), ret);
+}
+
+probe _vfs.block_write_begin
+{
+ print("Probe hit the function: %s\n", probefunc());
+ print("file = %p\n", file);
+ print("pos = %llu\n", pos);
+ print("len = %u\n", len);
+ print("flags = %u\n", flags);
+ print("_inode = %l\n", _inode);
+}
+probe _vfs.block_write_begin.return
+{
+ print("Probe return from function: %s with return value = %s\n", probefunc(), ret);
+}
+
+probe _vfs.block_write_end
+{
+ print("Probe hit the function: %s\n", probefunc());
+ print("file = %p\n", file);
+ print("pos = %llu\n", pos);
+ print("len = %u\n", len);
+ print("page = %p\n", page);
+ print("_inode = %l\n", _inode);
+}
+
+probe _vfs.block_write_end.return
+{
+ print("Probe return from function: %s with return value = %s\n", probefunc(), ret);
+}
+
diff --git a/testsuite/systemtap.base/utrace_p4.exp b/testsuite/systemtap.base/utrace_p4.exp
index 5544ee55..333cff21 100644
--- a/testsuite/systemtap.base/utrace_p4.exp
+++ b/testsuite/systemtap.base/utrace_p4.exp
@@ -25,6 +25,7 @@ proc stap_compile { TEST_NAME compile script args } {
-re "parse error" { incr compile_errors 1; exp_continue}
-re "compilation failed" {incr compile_errors 1; exp_continue}
-re "semantic error:" {incr compile_errors 1; exp_continue}
+ -re "terminate called" {incr compile_errors 1; exp_continue}
}
catch close
wait
@@ -56,6 +57,13 @@ set syscall_return_script {"probe process(\"/bin/ls\").syscall.return { printf(\
set thread_begin_script {"probe process(\"/bin/ls\").thread.begin { print(\"ls thread.begin\") }"}
set thread_end_script {"probe process(\"/bin/ls\").thread.end { print(\"ls thread.end\") }"}
+set pid_begin_script {"probe process(123).begin { print(\"123 begin\") }"}
+set pid_end_script {"probe process(123).end { print(\"123 end\") }"}
+set pid_syscall_script {"probe process(123).syscall { printf(\"|%d\", \$syscall) }"}
+set pid_syscall_return_script {"probe process(123).syscall.return { printf(\"|%d\", \$syscall) }"}
+set pid_thread_begin_script {"probe process(123).thread.begin { print(\"123 thread.begin\") }"}
+set pid_thread_end_script {"probe process(123).thread.end { print(\"123 thread.end\") }"}
+
# Try to find utrace_attach symbol in /proc/kallsyms
set path "/proc/kallsyms"
if {! [catch {exec grep -q utrace_attach $path} dummy]} {
@@ -70,46 +78,94 @@ set TEST_NAME "UTRACE_P4_01"
if {$utrace_support_found == 0} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
- # Try compiling a begin script
+ # Try compiling a begin script using a path
stap_compile $TEST_NAME 1 $begin_script
}
+set TEST_NAME "UTRACE_P4_01_pid"
+if {$utrace_support_found == 0} {
+ untested "$TEST_NAME : no kernel utrace support found"
+} else {
+ # Try compiling a begin script using a pid
+ stap_compile $TEST_NAME 1 $pid_begin_script
+}
+
set TEST_NAME "UTRACE_P4_02"
if {$utrace_support_found == 0} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
- # Try compiling a end script
+ # Try compiling a end script using a path
stap_compile $TEST_NAME 1 $end_script
}
+set TEST_NAME "UTRACE_P4_02_pid"
+if {$utrace_support_found == 0} {
+ untested "$TEST_NAME : no kernel utrace support found"
+} else {
+ # Try compiling a end script using a pid
+ stap_compile $TEST_NAME 1 $pid_end_script
+}
+
set TEST_NAME "UTRACE_P4_03"
if {$utrace_support_found == 0} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
- # Try compiling a syscall script
+ # Try compiling a syscall script using a path
stap_compile $TEST_NAME 1 $syscall_script
}
+set TEST_NAME "UTRACE_P4_03_pid"
+if {$utrace_support_found == 0} {
+ untested "$TEST_NAME : no kernel utrace support found"
+} else {
+ # Try compiling a syscall script using a pid
+ stap_compile $TEST_NAME 1 $pid_syscall_script
+}
+
set TEST_NAME "UTRACE_P4_04"
if {$utrace_support_found == 0} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
- # Try compiling a syscall return script
+ # Try compiling a syscall return script using a path
stap_compile $TEST_NAME 1 $syscall_return_script
}
+set TEST_NAME "UTRACE_P4_04_pid"
+if {$utrace_support_found == 0} {
+ untested "$TEST_NAME : no kernel utrace support found"
+} else {
+ # Try compiling a syscall return script using a pid
+ stap_compile $TEST_NAME 1 $pid_syscall_return_script
+}
+
set TEST_NAME "UTRACE_P4_05"
if {$utrace_support_found == 0} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
- # Try compiling an thread.begin script
+ # Try compiling an thread.begin script using a path
stap_compile $TEST_NAME 1 $thread_begin_script
}
+set TEST_NAME "UTRACE_P4_05_pid"
+if {$utrace_support_found == 0} {
+ untested "$TEST_NAME : no kernel utrace support found"
+} else {
+ # Try compiling an thread.begin script using a pid
+ stap_compile $TEST_NAME 1 $pid_thread_begin_script
+}
+
set TEST_NAME "UTRACE_P4_06"
if {$utrace_support_found == 0} {
untested "$TEST_NAME : no kernel utrace support found"
} else {
- # Try compiling an thread.end script
+ # Try compiling an thread.end script using a path
stap_compile $TEST_NAME 1 $thread_end_script
}
+
+set TEST_NAME "UTRACE_P4_06_pid"
+if {$utrace_support_found == 0} {
+ untested "$TEST_NAME : no kernel utrace support found"
+} else {
+ # Try compiling an thread.end script using a pid
+ stap_compile $TEST_NAME 1 $pid_thread_end_script
+}
diff --git a/testsuite/systemtap.stress/conversions.exp b/testsuite/systemtap.stress/conversions.exp
index 9c2c2fa9..27de10c2 100644
--- a/testsuite/systemtap.stress/conversions.exp
+++ b/testsuite/systemtap.stress/conversions.exp
@@ -1,12 +1,12 @@
set file $srcdir/$subdir/conversions.stp
foreach value {0 0xffffffff 0xffffffffffffffff} {
- set test "conversions.stp $value"
- if {![installtest_p]} { untested $test; continue }
# PR 4121: address 0 is valid on s390x
if {[istarget s390x-*-*] && $value == 0} { set value 0x7777777777 }
# PR 4540: ia64 thinks 0xffffffffffffffff okay for character accesses
if {[istarget ia64-*-*] && $value == 0xffffffffffffffff } { set value 0xafffffffffffffff }
+ set test "conversions.stp $value"
+ if {![installtest_p]} { untested $test; continue }
spawn stap -DMAXERRORS=40 $file $value
set errs 0
verbose -log "exp $test $errs"