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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
set test "process_by_cmd"
# Only run on make installcheck and uprobes present.
if {! [installtest_p]} { untested "$test"; return }
# Test for PR12427 [implied process("...") target for stap -c CMD
# invocation].
# We've got a problem in testing all the 'process.*' probe
# variants. Depending on the compiler, debuginfo generation,
# optimization level, etc., the probes can get hit in different
# orders. For instance, a 'process.function("main")' probe might get
# hit before or after the first
# 'process.statement("*@process_by_cmd.c")' probe (they sometimes get
# inserted at the same address, but might get installed in different
# orders).
#
# To ensure we're testing the right thing, this test has been split
# into two subtests, so we can hopefully depend on the order output.
set ::result_string {func end
mark end
func return end
func return end
func return end
mark end
func return end}
set test_flags "additional_flags=-g"
set test_flags "$test_flags [sdt_includes]"
set res [target_compile $srcdir/$subdir/$test.c $test executable "$test_flags"]
if {$res != ""} {
verbose -log "target_compile failed: $res" 2
fail "$test.c compile"
untested "$test"
return
} else {
pass "$test.c compile"
}
foreach runtime [get_runtime_list] {
if {$runtime != ""} {
stap_run3 "${test}.stp ($runtime)" \
$srcdir/$subdir/${test}.stp -c ./$test --runtime=$runtime
} elseif {[uretprobes_p]} {
stap_run3 ${test}.stp $srcdir/$subdir/${test}.stp -c ./$test
} else {
untested ${test}.stp
}
}
set ::result_string {state end
func label end
state end
state end
state end}
foreach runtime [get_runtime_list] {
if {$runtime != ""} {
stap_run3 "${test}2.stp ($runtime)" \
$srcdir/$subdir/${test}2.stp -c ./$test --runtime=$runtime
} elseif {[uprobes_p]} {
stap_run3 ${test}2.stp $srcdir/$subdir/${test}2.stp -c ./$test
} else {
untested ${test}2.stp
}
}
if { $verbose == 0 } { catch {exec rm -f $test} }
|