File: syscall.exp

package info (click to toggle)
systemtap 2.6-0.2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 21,220 kB
  • ctags: 10,944
  • sloc: cpp: 53,239; ansic: 50,615; exp: 33,694; sh: 9,906; xml: 7,665; perl: 2,089; python: 1,534; tcl: 1,236; makefile: 797; java: 148; lisp: 104; awk: 94; asm: 91; sed: 16
file content (53 lines) | stat: -rw-r--r-- 1,572 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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 test_script test_module test_module_name
    set flags ""
    if {$srcdir == ""} {
	set pattern "*.c"
    } else {
	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 {set i 0} {$i < [arch_compile_flags]} {incr i} {
	set flags [arch_compile_flag $i]
	set arch [arch_compile_flag_name $i]
	set arch_size [arch_compile_flag_bits $i]

	foreach filename [lsort [glob $pattern]] {
	    set testname [file tail [string range $filename 0 end-2]]
	    if {![installtest_p]} {
		untested "${arch_size}-bit $testname"; continue
	    }
	    send_log "Testing ${arch_size}-bit ${testname} syscall\n"
	    run_one_test $filename $flags ${arch_size} "syscall"
	}
    }

    # Cleeanup
    exec /bin/rm -f ${test_module}
}

test_procedure