]> sourceware.org Git - systemtap.git/commitdiff
Fix PR16570 by speeding up the syscall.exp/nd_syscall.exp testcases.
authorDavid Smith <dsmith@redhat.com>
Wed, 12 Feb 2014 18:58:41 +0000 (12:58 -0600)
committerDavid Smith <dsmith@redhat.com>
Wed, 12 Feb 2014 18:58:41 +0000 (12:58 -0600)
* testsuite/systemtap.syscall/syscall.exp: Compile the module once.
* testsuite/systemtap.syscall/nd_syscall.exp: Ditto.
* testsuite/systemtap.syscall/test.tcl (run_one_test): Use staprun to load
  the previously compiled module.

testsuite/systemtap.syscall/nd_syscall.exp
testsuite/systemtap.syscall/syscall.exp
testsuite/systemtap.syscall/test.tcl

index 0cc221b92b60459ab887d47fa42e8f7c600568ff..5b8e0fccb45ff7f373ded47c5c20c29131cad7a1 100644 (file)
@@ -1,8 +1,12 @@
 set test_script "nd_sys.stp"
+set test_module_name "nd_syscall"
+set wd [pwd]
+set test_module "${wd}/${test_module_name}.ko"
+
 source $srcdir/$subdir/test.tcl
 
 proc test_procedure {} {
-    global srcdir subdir
+    global srcdir subdir test_script test_module test_module_name
     set wd [pwd]
     set flags ""
     if {$srcdir == ""} {
@@ -11,6 +15,23 @@ proc test_procedure {} {
        set pattern "$srcdir/$subdir/*.c"
     }
 
+    # To speed things up, go ahead and compile the test module once
+    # here, then just use it down in run_one_test(). The test script
+    # uses wildcards to cover every syscall and takes time to parse.
+    set script "$srcdir/$subdir/${test_script}"
+    set cmd "stap -p4 -m ${test_module_name} --skip-badvars ${script}"
+    exec /bin/rm -f ${test_module}
+    catch {eval exec $cmd} output
+    send_log $output
+    if {[file exists ${test_module}]} {
+       pass "${script} compilation"
+    } else {
+       # If compiling the test module failed, there isn't much point
+       # in trying to run any of the real tests.
+       fail "${script} compilation"
+       return
+    }
+
     # for first pass, force 64-bit compilation for 64-bit systems
     # Add any other 64-bit arcvhitecture you want tested below.
     # To find tcl's platform name for your machine, run the following:
@@ -58,6 +79,9 @@ proc test_procedure {} {
            run_one_test $filename $flags 32 "nd_syscall"
        }
     }
+
+    # Cleeanup
+    exec /bin/rm -f ${test_module}
 }
 
 test_procedure
index 7f67ff5072349ec0da957be48f9dcf961a9bd3fa..630917021b122b4f3f343d4a885b2634c8f8a65c 100644 (file)
@@ -1,9 +1,12 @@
 set test_script "sys.stp"
+set test_module_name "syscall"
+set wd [pwd]
+set test_module "${wd}/${test_module_name}.ko"
+
 source $srcdir/$subdir/test.tcl
 
 proc test_procedure {} {
-    global srcdir subdir
-    set wd [pwd]
+    global srcdir subdir test_script test_module test_module_name
     set flags ""
     if {$srcdir == ""} {
        set pattern "*.c"
@@ -11,6 +14,23 @@ proc test_procedure {} {
        set pattern "$srcdir/$subdir/*.c"
     }
 
+    # To speed things up, go ahead and compile the test module once
+    # here, then just use it down in run_one_test(). The test script
+    # uses wildcards to cover every syscall and takes time to parse.
+    set script "$srcdir/$subdir/${test_script}"
+    set cmd "stap -p4 -m ${test_module_name} --skip-badvars ${script}"
+    exec /bin/rm -f ${test_module}
+    catch {eval exec $cmd} output
+    send_log $output
+    if {[file exists ${test_module}]} {
+       pass "${script} compilation"
+    } else {
+       # If compiling the test module failed, there isn't much point
+       # in trying to run any of the real tests.
+       fail "${script} compilation"
+       return
+    }
+
     # for first pass, force 64-bit compilation for 64-bit systems
     # Add any other 64-bit arcvhitecture you want tested below.
     # To find tcl's platform name for your machine, run the following:
@@ -54,6 +74,9 @@ proc test_procedure {} {
            run_one_test $filename $flags 32 "syscall"
        }
     }
+
+    # Cleeanup
+    exec /bin/rm -f ${test_module}
 }
 
 test_procedure
index a443638995693209069c3e39c719d98ad36fd8be..6b74364237fb1b0fa1bd21b51c5123f41fa67078 100644 (file)
@@ -27,7 +27,7 @@ proc bgerror {error} {
 trap {syscall_cleanup_and_exit} SIGINT
 
 proc run_one_test {filename flags bits suite} {
-    global syscall_dir current_dir test_script
+    global syscall_dir current_dir test_module
 
     set testname [file tail [string range $filename 0 end-2]]
 
@@ -46,8 +46,7 @@ proc run_one_test {filename flags bits suite} {
        return
     }
 
-    set sys_prog "[file dirname [file normalize $filename]]/${test_script}"
-    set cmd "stap --skip-badvars -c $syscall_dir/${testname} ${sys_prog}"
+    set cmd "staprun ${test_module} -c $syscall_dir/${testname}"
     
     # Extract additional C flags needed to compile
     set add_flags ""
This page took 0.032807 seconds and 5 git commands to generate.