Debian Codegraph @

testsuite/systemtap.exelib/ustack.tcl

raw
1 # Only run on make installcheck
2 if {! [installtest_p]} { untested "ustack-$testname"; return }
3 if {! [uprobes_p]} { untested "ustack-$testname"; return }
4
5 # Output is:
6 #print_ubacktrace exe 0
7 # 0x080484ba : main_func+0xa/0x29 [.../uprobes_exe]
8 # 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe]
9 #print_usyms exe 1
10 # 0x080484ba : main_func+0xa/0x29 [.../uprobes_exe]
11 # 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe]
12 # 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe]
13 #print_ubacktrace lib 2
14 # 0x00db2422 : lib_func+0x16/0x2b [.../libuprobes_lib.so]
15 # 0x00db2455 : lib_main+0x1e/0x29 [.../libuprobes_lib.so]
16 # 0x080484d0 : main_func+0x20/0x29 [.../uprobes_exe]
17 # 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe]
18 # 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe]
19 # 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe]
20 #print_usyms lib 3
21 # 0x00db2422 : lib_func+0x16/0x2b [.../libuprobes_lib.so]
22 # 0x00db2431 : lib_func+0x25/0x2b [.../libuprobes_lib.so]
23 # 0x00db2455 : lib_main+0x1e/0x29 [.../libuprobes_lib.so]
24 # 0x080484d0 : main_func+0x20/0x29 [.../uprobes_exe]
25 # 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe]
26 # 0x080484c9 : main_func+0x19/0x29 [.../uprobes_exe]
27 # 0x080484f6 : main+0x1d/0x37 [.../uprobes_exe]
28
29 set print 0
30 set main 0
31 set main_func 0
32 set lib_main 0
33 set lib_func 0
34 set start_func 0
35 send_log "Running: stap -w --ldd $srcdir/$subdir/ustack.stp $testexe $testlib -c $testexe\n"
36 spawn stap -w --ldd $srcdir/$subdir/ustack.stp $testexe $testlib -c $testexe
37
38 expect {
39 -timeout 60
40 -re {^print_[^\r\n]+\r\n} {incr print; exp_continue}
41 -re {^ 0x[a-f0-9]+ : main\+0x[^\r\n]+\r\n} {incr main; exp_continue}
42 -re {^ 0x[a-f0-9]+ : main_func\+0x[^\r\n]+\r\n} {incr main_func; exp_continue}
43 -re {^ 0x[a-f0-9]+ : lib_main\+0x[^\r\n]+\r\n} {incr lib_main; exp_continue}
44 -re {^ 0x[a-f0-9]+ : lib_func\+0x[^\r\n]+\r\n} {incr lib_func; exp_continue}
45 -re {^ 0x[a-f0-9]+ : _[^\r\n]+\r\n} {incr start_func; exp_continue}
46 -re {^ 0x[a-f0-9]+ : [^\r\n]+/libc-[^\r\n]+\r\n} {incr start_func; exp_continue}
47 timeout { fail "ustack-$testname (timeout)"; kill -INT -[exp_pid] }
48 eof { }
49 }
50 # kill again for good measure
51 kill -INT -[exp_pid] 2
52 catch {close}; catch {wait}
53
54 if {$print == 4} { pass "ustack-$testname print" } {
55 fail "ustack-$testname print ($print)"
56 }
57
58 if {$main == 4} { pass "ustack-$testname main" } {
59 fail "ustack-$testname main ($main)"
60 }
61
62 if {$main_func == 9} { pass "ustack-$testname main_func" } {
63 fail "ustack-$testname main_func ($main_func)"
64 }
65
66 if {$lib_main == 2} { pass "ustack-$testname lib_main" } {
67 fail "ustack-$testname lib_main ($lib_main)"
68 }
69
70 if {$lib_func == 3} { pass "ustack-$testname lib_func" } {
71 fail "ustack-$testname lib_func ($lib_func)"
72 }