summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples
diff options
context:
space:
mode:
authorWenji Huang <wenji.huang@oracle.com>2009-09-08 18:38:14 -0400
committerWenji Huang <wenji.huang@oracle.com>2009-09-08 18:38:14 -0400
commit2de206d6b209e5e3b518f38c9991e4434940f72e (patch)
tree0c1908efd5c766726940b8ac26b5e343bf573a1e /testsuite/systemtap.examples
parente13354499dbd1f854040bc120bdfd1d0fc9ff6b3 (diff)
downloadsystemtap-steved-2de206d6b209e5e3b518f38c9991e4434940f72e.tar.gz
systemtap-steved-2de206d6b209e5e3b518f38c9991e4434940f72e.tar.xz
systemtap-steved-2de206d6b209e5e3b518f38c9991e4434940f72e.zip
PR10604: check availability for example test cases
* testsuite/systemtap.examples/check.exp: Handle with test_support. * testsuite/systemtap.examples/io/iostat-scsi.meta: Add meta-tag test_support. * testsuite/systemtap.examples/memory/mmanonpage.meta: Ditto. * testsuite/systemtap.examples/memory/mmfilepage.meta: Ditto. * testsuite/systemtap.examples/memory/mmreclaim.meta: Ditto. * testsuite/systemtap.examples/memory/mmwriteback.meta: Ditto. * testsuite/systemtap.examples/network/autofs4.meta: Ditto. * testsuite/systemtap.examples/network/dropwatch.meta: Ditto. * testsuite/systemtap.examples/process/schedtimes.meta: Ditto.
Diffstat (limited to 'testsuite/systemtap.examples')
-rw-r--r--testsuite/systemtap.examples/check.exp40
-rw-r--r--testsuite/systemtap.examples/io/iostat-scsi.meta1
-rw-r--r--testsuite/systemtap.examples/memory/mmanonpage.meta1
-rw-r--r--testsuite/systemtap.examples/memory/mmfilepage.meta1
-rw-r--r--testsuite/systemtap.examples/memory/mmreclaim.meta1
-rw-r--r--testsuite/systemtap.examples/memory/mmwriteback.meta1
-rw-r--r--testsuite/systemtap.examples/network/autofs4.meta1
-rw-r--r--testsuite/systemtap.examples/network/dropwatch.meta1
-rw-r--r--testsuite/systemtap.examples/process/schedtimes.meta1
9 files changed, 38 insertions, 10 deletions
diff --git a/testsuite/systemtap.examples/check.exp b/testsuite/systemtap.examples/check.exp
index 482738cc..0fad597d 100644
--- a/testsuite/systemtap.examples/check.exp
+++ b/testsuite/systemtap.examples/check.exp
@@ -32,7 +32,7 @@ proc extract_tag { META_DATA TAG } {
return $value
}
-proc run_command { test command } {
+proc run_command { test action command } {
#FIXME tcl says that single quotes not dealt with
if { $command != "" } then {
verbose -log "attempting command $command"
@@ -42,13 +42,16 @@ proc run_command { test command } {
set res [catch {eval exec "$command |& cat"} value]
verbose -log "OUT $value"
verbose -log "RC $res"
- if {$res != 0 } {
- fail $test
+ if { $res != 0 } { # allow failure for support
+ if { $action != "support" } { fail "$test $action" }
+ return $res
} else {
- pass $test
+ pass "$test $action"
+ return $res
}
} else {
- untested $test
+ untested "$test $action"
+ return 0
}
}
@@ -64,16 +67,33 @@ foreach file $meta_files {
cd $dir
set meta_data [get_meta_data $file]
- set test_check [extract_tag "$meta_data" "test_check"]
- set command $test_check
- run_command "$test build" $command
+ set test_support [extract_tag "$meta_data" "test_support"]
+ set command $test_support
+ set supported_p 1
+ if { $command != "" } { # need to test support
+ set res [run_command "$test" "support" $command]
+ if { $res != 0 } { set supported_p 0 }
+ }
+
+ if { $supported_p == 1 } {
+ set test_check [extract_tag "$meta_data" "test_check"]
+ set command $test_check
+ run_command "$test" "build" $command
+ } else {
+ untested "$test build"
+ }
+
set test_installcheck [extract_tag "$meta_data" "test_installcheck"]
# The pass/fail logic too simple and fails for some examples
# FIXME would like to be able to run more complicated test code
if {[info procs installtest_p] != "" && [installtest_p]
&& $test_installcheck != "" } then {
- set command $test_installcheck
- run_command "$test run" $command
+ if { $supported_p == 1 } {
+ set command $test_installcheck
+ run_command "$test" "run" $command
+ } else {
+ untested "$test run"
+ }
}
}
diff --git a/testsuite/systemtap.examples/io/iostat-scsi.meta b/testsuite/systemtap.examples/io/iostat-scsi.meta
index 834466aa..242e740e 100644
--- a/testsuite/systemtap.examples/io/iostat-scsi.meta
+++ b/testsuite/systemtap.examples/io/iostat-scsi.meta
@@ -9,5 +9,6 @@ exit: user-controlled
output: timed
scope: system-wide
description: The iostat-scsi.stp script provides a breakdown of the number of blks read and written on the various machines's SCSI devices. The script takes one argument which is the number of seconds between reports.
+test_support: stap -l module("st").function("st_do_scsi")!,kernel.function("st_do_scsi")
test_check: stap -p4 iostat-scsi.stp 1
test_installcheck: stap iostat-scsi.stp 1 -c "sleep 1"
diff --git a/testsuite/systemtap.examples/memory/mmanonpage.meta b/testsuite/systemtap.examples/memory/mmanonpage.meta
index 496d10d8..25385d82 100644
--- a/testsuite/systemtap.examples/memory/mmanonpage.meta
+++ b/testsuite/systemtap.examples/memory/mmanonpage.meta
@@ -9,5 +9,6 @@ exit: user-controlled
output: sorted-list
scope: system-wide
description: The mmanonpage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, user space frees, page ins, copy on writes and unmaps for anonymous pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. This script displays the anonymous page statistics for each process that ran while the script is active. Its useful in debugging leaks in the anonymous regions of a process.
+test_support: stap -l kernel.trace("mm_page_allocation"),kernel.trace("mm_page_free"),kernel.trace("mm_anon_fault"),kernel.trace("mm_anon_pgin"),kernel.trace("mm_anon_cow"),kernel.trace("mm_anon_unmap"),kernel.trace("mm_anon_userfree")
test_check: stap -p4 mmanonpage.stp
test_installcheck: stap mmanonpage.stp -c "sleep 1"
diff --git a/testsuite/systemtap.examples/memory/mmfilepage.meta b/testsuite/systemtap.examples/memory/mmfilepage.meta
index 3fb6ba55..efa87209 100644
--- a/testsuite/systemtap.examples/memory/mmfilepage.meta
+++ b/testsuite/systemtap.examples/memory/mmfilepage.meta
@@ -9,5 +9,6 @@ exit: user-controlled
output: sorted-list
scope: system-wide
description: The mmfilepage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, copy on writes mapping, and unmapping operations for file backed pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. The mmfilepage.stp script is useful in debugging leaks in the mapped file regions of a process.
+test_support: stap -l kernel.trace("mm_page_allocation"),kernel.trace("mm_page_free"),kernel.trace("mm_filemap_fault"),kernel.trace("mm_filemap_cow"),kernel.trace("mm_filemap_unmap"),kernel.trace("mm_filemap_userunmap")
test_check: stap -p4 mmfilepage.stp
test_installcheck: stap mmfilepage.stp -c "sleep 1"
diff --git a/testsuite/systemtap.examples/memory/mmreclaim.meta b/testsuite/systemtap.examples/memory/mmreclaim.meta
index f9c9b523..f6824f69 100644
--- a/testsuite/systemtap.examples/memory/mmreclaim.meta
+++ b/testsuite/systemtap.examples/memory/mmreclaim.meta
@@ -9,5 +9,6 @@ exit: user-controlled
output: sorted-list
scope: system-wide
description: The mmreclaim.stp script uses the virtual memory tracepoints available in some kernels to track page reclaim activity that occured while the script was running. Its useful is debugging performance problems that occur due to page reclamation.
+test_support: stap -l kernel.trace("mm_directreclaim_reclaimall"),kernel.trace("mm_pagereclaim_shrinkinactive"),kernel.trace("mm_pagereclaim_free"),kernel.trace("mm_pagereclaim_pgout"),kernel.trace("mm_pagereclaim_shrinkactive_a2a"),kernel.trace("mm_pagereclaim_shrinkinactive_i2a"),kernel.trace("mm_pagereclaim_shrinkactive_a2i"),kernel.trace("mm_pagereclaim_shrinkinactive_i2i")
test_check: stap -p4 mmreclaim.stp
test_installcheck: stap mmreclaim.stp -c "sleep 1"
diff --git a/testsuite/systemtap.examples/memory/mmwriteback.meta b/testsuite/systemtap.examples/memory/mmwriteback.meta
index aab0f910..00a68827 100644
--- a/testsuite/systemtap.examples/memory/mmwriteback.meta
+++ b/testsuite/systemtap.examples/memory/mmwriteback.meta
@@ -9,5 +9,6 @@ exit: user-controlled
output: sorted-list
scope: system-wide
description: The mmwriteback.stp script uses the virtual memory tracepoints available in some kernels to report all of the file writebacks that occur form kupdate, pdflush and kjournald while the script is running. Its useful in determining where writes are coming from on a supposedly idle system that is experiencing upexpected IO.
+test_support: stap -l kernel.trace("mm_pdflush_bgwriteout"),kernel.trace("mm_pdflush_kupdate"),kernel.trace("mm_pagereclaim_pgout")
test_check: stap -p4 mmwriteback.stp
test_installcheck: stap mmwriteback.stp -c "sleep 1"
diff --git a/testsuite/systemtap.examples/network/autofs4.meta b/testsuite/systemtap.examples/network/autofs4.meta
index 16ae7297..c6886e1c 100644
--- a/testsuite/systemtap.examples/network/autofs4.meta
+++ b/testsuite/systemtap.examples/network/autofs4.meta
@@ -4,5 +4,6 @@ name: autofs4.stp
author: Jeff Moyer
keywords: network autofs nfs
subsystem: network
+test_support: stap -l module("autofs4").function("autofs4_lookup"),module("autofs4").function("autofs4_follow_link"),module("autofs4").function("autofs4_expire_indirect").return,module("autofs4").function("autofs4_wait").return
test_check: stap -p4 autofs4.stp
test_installcheck: stap autofs4.stp -c "sleep 10"
diff --git a/testsuite/systemtap.examples/network/dropwatch.meta b/testsuite/systemtap.examples/network/dropwatch.meta
index 176ba236..98b23e05 100644
--- a/testsuite/systemtap.examples/network/dropwatch.meta
+++ b/testsuite/systemtap.examples/network/dropwatch.meta
@@ -9,5 +9,6 @@ exit: user-controlled
output: timed
scope: system-wide
description: Every five seconds the dropwatch.stp script lists the number of socket buffers freed at locations in the kernel.
+test_support: stap -l kernel.trace("kfree_skb")
test_check: stap -p4 dropwatch.stp
test_installcheck: stap dropwatch.stp -c "sleep 1"
diff --git a/testsuite/systemtap.examples/process/schedtimes.meta b/testsuite/systemtap.examples/process/schedtimes.meta
index 0074731f..786d9cfb 100644
--- a/testsuite/systemtap.examples/process/schedtimes.meta
+++ b/testsuite/systemtap.examples/process/schedtimes.meta
@@ -9,5 +9,6 @@ exit: user-controlled
output: sorted-list
scope: system-wide
description: The schedtimes.stp script instruments the scheduler to track the amount of time that each process spends running, sleeping, queued, and waiting for io. On exit the script prints out the accumulated time for each state of processes observed. Optionally, this script can be used with the '-c' or '-x' options to focus on a specific PID.
+test_support: stap -l kernel.trace("sched_switch"),kernel.trace("sched_wakeup")
test_check: stap -p4 schedtimes.stp
test_installcheck: stap schedtimes.stp -c "sleep 1"