File: alias_tapset.exp

package info (click to toggle)
systemtap 5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 47,556 kB
  • sloc: cpp: 81,117; ansic: 54,933; xml: 49,795; exp: 43,595; sh: 11,526; python: 5,003; perl: 2,252; tcl: 1,312; makefile: 1,006; javascript: 149; lisp: 105; awk: 101; asm: 91; java: 70; sed: 16
file content (33 lines) | stat: -rw-r--r-- 1,067 bytes parent folder | download | duplicates (2)
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
# This testcase is based on pr10568.  It ensures that when an alias
# causes a tapset file to be included, the entire files gets included.

set test alias_tapset

set never_found 0
set kernel_function_found 0
set timer_found 0

set cmd "bash -c {stap -p2 -I $srcdir/$subdir/${test} $srcdir/$subdir/${test}.stp | grep -E '^kprobe|^kernel|^never|^timer'}"
verbose -log "running $cmd"
eval spawn $cmd
expect {
    -timeout 60
    -re {^never[^\r\n]+\r\n} { incr never_found; exp_continue }
    -re {^(kernel|kprobe)\.function[^\r\n]+\r\n} { incr kernel_function_found; exp_continue }
    -re {^timer\.s\(5\)[^\r\n]+\r\n} { incr timer_found; exp_continue }
    -re {^[^\r\n]+\r\n} {
	# ignore output we're not interested in
	exp_continue }
    timeout { verbose -log "TIMEOUT" }
}
catch { close }

# get the return code of the process
set rc [lindex [wait -i $spawn_id] 3]

if { $rc == 0 && $never_found == 1 && $kernel_function_found >= 1
     && $timer_found == 1 } {
    pass $test
} else {
    fail "$test ($rc, $never_found, $kernel_function_found, $timer_found)"
}