diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-09-19 19:14:33 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-09-19 19:14:33 +0200 |
commit | 2f41f39496d9f9f82947eeebd169a8aa9db8245a (patch) | |
tree | d99665811aca38fb1fa18b193478f5c5b6300275 | |
parent | 1d12a9b21c8cbfc995ec3a84e09e613375a1bc5c (diff) | |
download | systemtap-steved-2f41f39496d9f9f82947eeebd169a8aa9db8245a.tar.gz systemtap-steved-2f41f39496d9f9f82947eeebd169a8aa9db8245a.tar.xz systemtap-steved-2f41f39496d9f9f82947eeebd169a8aa9db8245a.zip |
Use less idle time in testsuite.
A lot of tests wait, sleep or use a timer for multiple seconds when that
is not necessary. Reduce the time waited so save test time.
* testsuite/systemtap.base/backtrace.stp: Exit after 100ms.
* testsuite/systemtap.base/badkprobe.exp: Likewise.
* testsuite/systemtap.base/global_end.stp: Likewise.
* testsuite/systemtap.base/itrace.exp: Wait 1 sec instead of 5 for each test.
* testsuite/systemtap.base/maxactive.exp: Likewise.
* testsuite/systemtap.base/onoffprobe.exp: Match and use modname, so
build script can be cached.
* testsuite/systemtap.base/onoffprobe.stp: Wait miliseconds instead of
seconds in each alias. Output module_name.
* testsuite/systemtap.base/poll_map.stp: Start after 100ms.
-rw-r--r-- | testsuite/systemtap.base/backtrace.stp | 2 | ||||
-rw-r--r-- | testsuite/systemtap.base/badkprobe.exp | 2 | ||||
-rw-r--r-- | testsuite/systemtap.base/global_end.stp | 2 | ||||
-rw-r--r-- | testsuite/systemtap.base/itrace.exp | 14 | ||||
-rw-r--r-- | testsuite/systemtap.base/maxactive.exp | 17 | ||||
-rw-r--r-- | testsuite/systemtap.base/onoffprobe.exp | 8 | ||||
-rw-r--r-- | testsuite/systemtap.base/onoffprobe.stp | 10 | ||||
-rwxr-xr-x | testsuite/systemtap.base/poll_map.stp | 2 |
8 files changed, 30 insertions, 27 deletions
diff --git a/testsuite/systemtap.base/backtrace.stp b/testsuite/systemtap.base/backtrace.stp index 07ea11de..cdc20610 100644 --- a/testsuite/systemtap.base/backtrace.stp +++ b/testsuite/systemtap.base/backtrace.stp @@ -1,2 +1,2 @@ probe begin, end, procfs("foo").read, procfs("foo").write { log(pp()) print_backtrace() } -probe timer.s(1) { log(pp()) print_backtrace() exit() } +probe timer.ms(100) { log(pp()) print_backtrace() exit() } diff --git a/testsuite/systemtap.base/badkprobe.exp b/testsuite/systemtap.base/badkprobe.exp index 96ad5a3b..b44dacdf 100644 --- a/testsuite/systemtap.base/badkprobe.exp +++ b/testsuite/systemtap.base/badkprobe.exp @@ -1,7 +1,7 @@ set test "bad kprobe registration" set script { probe $1 {} - probe timer.s(1) { exit() } + probe timer.ms(100) { exit() } probe end { println("cleanup ok") } } diff --git a/testsuite/systemtap.base/global_end.stp b/testsuite/systemtap.base/global_end.stp index 876eac8c..4a5baff7 100644 --- a/testsuite/systemtap.base/global_end.stp +++ b/testsuite/systemtap.base/global_end.stp @@ -31,7 +31,7 @@ probe begin { epsilon["two",2] <<< 40 } -probe timer.ms(2000) { +probe timer.ms(100) { exit () } diff --git a/testsuite/systemtap.base/itrace.exp b/testsuite/systemtap.base/itrace.exp index ddd1b07b..89d488e2 100644 --- a/testsuite/systemtap.base/itrace.exp +++ b/testsuite/systemtap.base/itrace.exp @@ -147,13 +147,13 @@ if {[catch {exec cp /bin/ls $exepath} res]} { } # "load" generation function for stap_run. It spawns our own copy of -# /bin/ls, waits 5 seconds, then kills it. -proc run_ls_5_sec {} { +# /bin/ls, waits 1 second, then kills it. +proc run_ls_1_sec {} { global exepath spawn $exepath set exe_id $spawn_id - after 5000; + after 1000; exec kill -INT -[exp_pid -i $exe_id] return 0; } @@ -194,7 +194,7 @@ if {![utrace_p]} { xfail "$TEST_NAME : no kernel single step support" } else { set script [format $itrace_single1_script $exepath] - stap_run $TEST_NAME run_ls_5_sec $itrace_single1_script_output -e $script + stap_run $TEST_NAME run_ls_1_sec $itrace_single1_script_output -e $script } set TEST_NAME "itrace_single2" @@ -206,7 +206,7 @@ if {![utrace_p]} { xfail "$TEST_NAME : no kernel single step support" } else { set script [format $itrace_single2_script $exepath] - stap_run $TEST_NAME run_ls_5_sec $itrace_single2_script_output -e $script + stap_run $TEST_NAME run_ls_1_sec $itrace_single2_script_output -e $script } # Run the block step tests @@ -219,7 +219,7 @@ if {![utrace_p]} { xfail "$TEST_NAME : no kernel block step support" } else { set script [format $itrace_block1_script $exepath] - stap_run $TEST_NAME run_ls_5_sec $itrace_block1_script_output -e $script + stap_run $TEST_NAME run_ls_1_sec $itrace_block1_script_output -e $script } set TEST_NAME "itrace_block2" @@ -231,7 +231,7 @@ if {![utrace_p]} { xfail "$TEST_NAME : no kernel block step support" } else { set script [format $itrace_block2_script $exepath] - stap_run $TEST_NAME run_ls_5_sec $itrace_block2_script_output -e $script + stap_run $TEST_NAME run_ls_1_sec $itrace_block2_script_output -e $script } # Cleanup diff --git a/testsuite/systemtap.base/maxactive.exp b/testsuite/systemtap.base/maxactive.exp index 79ede897..c31c6386 100644 --- a/testsuite/systemtap.base/maxactive.exp +++ b/testsuite/systemtap.base/maxactive.exp @@ -5,28 +5,28 @@ if {![installtest_p]} { untested "MAXACTIVE"; return } -proc sleep_five_sec {} { - after 5000; +proc sleep_one_sec {} { + after 1000; return 0; } -# Script1. For 5 seconds, probe the return of "vfs_read" and +# Script1. For 1 second, probe the return of "vfs_read" and # "do_select". See if we skip any probes. set script1 { global foo probe kernel.function("vfs_read").return, kernel.function("do_select").return { foo++ } - probe timer.ms(5000) { exit(); } + probe timer.ms(1000) { exit(); } probe begin { log("systemtap starting probe"); log("systemtap ending probe");} } # Run script1 and save the number of skipped probes (which will most # likely be 0). -stap_run "MAXACTIVE01" sleep_five_sec "" -e $script1 +stap_run "MAXACTIVE01" sleep_one_sec "" -e $script1 set skipped1 $skipped_probes -# Script2. For 5 seconds, probe the return of "vfs_read" and +# Script2. For 1 second, probe the return of "vfs_read" and # "do_select", with a limit of 1 probe active at a time. See if we # skip any probes. set script2 { @@ -34,13 +34,13 @@ set script2 { probe kernel.function("vfs_read").return.maxactive(1), kernel.function("do_select").return.maxactive(1) { foo++ } - probe timer.ms(5000) { exit(); } + probe timer.ms(1000) { exit(); } probe begin { log("systemtap starting probe"); log("systemtap ending probe");} } # Run script2 and save the number of skipped probes. set output_string "(WARNING: Number of errors: 0, skipped probes: \\d+\r\n)?" -stap_run "MAXACTIVE02" sleep_five_sec $output_string -e $script2 +stap_run "MAXACTIVE02" sleep_one_sec $output_string -e $script2 set skipped2 $skipped_probes # If the number of skipped probes for script 1 is less than the number @@ -50,6 +50,7 @@ set skipped2 $skipped_probes # Note that this isn't 100% accurate based on the system load at the # time of the scripts. set test "MAXACTIVE03" +verbose -log "skipped1: $skipped1, skipped2: $skipped2\n" if {$skipped1 <= $skipped2} { pass $test } else { diff --git a/testsuite/systemtap.base/onoffprobe.exp b/testsuite/systemtap.base/onoffprobe.exp index 24012cac..1b39dab5 100644 --- a/testsuite/systemtap.base/onoffprobe.exp +++ b/testsuite/systemtap.base/onoffprobe.exp @@ -1,7 +1,7 @@ set test "onoffprobe" if {![installtest_p]} { untested $test; return } -spawn stap $srcdir/$subdir/$test.stp -m $test +spawn stap $srcdir/$subdir/$test.stp set pid $spawn_id set ok 0 @@ -9,16 +9,18 @@ proc advance {} { global test global expect_out global ok + global modname pass "$test $expect_out(1,string)" incr ok - exec echo $ok > /proc/systemtap/$test/switch + exec echo $ok > /proc/systemtap/$modname/switch exec echo dummy > /dev/null exp_continue } expect { -timeout 240 - -re "(begin1 probed)\r\n" { advance } + -re {(begin1 probed): ([^\r\n]+)\r\n} + { set modname "$expect_out(2,string)"; advance } -re "^(function return probed)\r\n" { advance } -re "^(function entry probed)\r\n" { advance } -re "^(timer probed)\r\n" { advance } diff --git a/testsuite/systemtap.base/onoffprobe.stp b/testsuite/systemtap.base/onoffprobe.stp index 79c41a3c..862c4059 100644 --- a/testsuite/systemtap.base/onoffprobe.stp +++ b/testsuite/systemtap.base/onoffprobe.stp @@ -2,7 +2,7 @@ global switch=-1 #begin probe probe begin if (switch==-1) { - log("begin1 probed"); + printf("begin1 probed: %s\n", module_name()); } probe begin if (switch==0) { @@ -22,7 +22,7 @@ probe kernel.function("vfs_write").return if (switch == 2) { } #timer probe -probe timer.s(1) if (switch == 3) { +probe timer.ms(100) if (switch == 3) { log("timer probed") switch = 0 } @@ -34,10 +34,10 @@ probe timer.profile if (switch == 4) { } # aliasess -probe alias.one.a = timer.s(2) if (switch == 5) { print("alias.one.a and") } -probe alias.one.b = timer.s(3) if (switch == 6) { print("alias.one.b and") } +probe alias.one.a = timer.ms(150) if (switch == 5) { print("alias.one.a and") } +probe alias.one.b = timer.ms(200) if (switch == 6) { print("alias.one.b and") } probe alias.one = alias.one.* if (switch >= 5 && switch < 7) { print(" alias.one and") } -probe alias.two = timer.s(4) if (switch == 7) { print("alias.two and") } +probe alias.two = timer.ms(250) if (switch == 7) { print("alias.two and") } probe alias.* if (switch) { log(" alias.* probed") } probe procfs("switch").write { diff --git a/testsuite/systemtap.base/poll_map.stp b/testsuite/systemtap.base/poll_map.stp index e278fc91..3070f442 100755 --- a/testsuite/systemtap.base/poll_map.stp +++ b/testsuite/systemtap.base/poll_map.stp @@ -9,7 +9,7 @@ probe kernel.function( "vfs_*" ).call { called[execname(),probefunc()]++ } -probe timer.ms(1000) +probe timer.ms(100) { print("\n\n") num_to_do = 10 |