diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2010-02-25 13:33:28 -0500 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2010-02-25 13:38:50 -0500 |
commit | c69a87e094e5e66daee8399838c8475f023ddc04 (patch) | |
tree | 4136d58cbebed28ccd40d3d983aac8179ed6ce1f /testsuite/semok/thirtysix.stp | |
parent | e7227e90cd1414b2d02884617da0346134892526 (diff) | |
download | systemtap-steved-c69a87e094e5e66daee8399838c8475f023ddc04.tar.gz systemtap-steved-c69a87e094e5e66daee8399838c8475f023ddc04.tar.xz systemtap-steved-c69a87e094e5e66daee8399838c8475f023ddc04.zip |
PR11005: @defined part 2: clarify/standardize internal handling of unresolvable $variables
* staptree.cxx (target_symbol::chain): New function.
* staptree.h: Declare it.
* (*): Use it instead of hand-chaining to target_symbol->saved_conversion_error.
* tapset-mark.cxx (*::visit_target_symbol): Chain resolution error object,
do not throw.
* tapset-procfs.cxx (*::visit_target_symbol): Ditto.
* tapset-utrace.cxx (*::visit_target_symbol): Ditto.
* tapsets.cxx (*::visit_target_symbol): Ditto.
(*::visit_defined_op): Explain & enforce the above.
* testsuite/semok/thirtysix.stp: Expand.
* testsuite/systemtap.base/sdt_misc.exp: Bonus fix: make work with blddir != srcdir.
Diffstat (limited to 'testsuite/semok/thirtysix.stp')
-rwxr-xr-x | testsuite/semok/thirtysix.stp | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/testsuite/semok/thirtysix.stp b/testsuite/semok/thirtysix.stp index 4f27d9bf..ee19852c 100755 --- a/testsuite/semok/thirtysix.stp +++ b/testsuite/semok/thirtysix.stp @@ -1,19 +1,31 @@ #! stap -p4 -probe kernel.function("sys_open") { println(@defined($foobar)) } # invalid -probe kernel.function("sys_open") { println(@defined($mode)) } # valid -probe kernel.function("sys_open").return { println(@defined($foobar)) } # invalid -probe kernel.function("sys_open").return { println(@defined($mode)) } # valid -probe kernel.trace("*")? { println(@defined($rw)) } # valid and invalid in places -probe kernel.mark("*")? { println(@defined($foo)) } # invalid -probe kernel.mark("*")? { println(@defined($name)) } # valid -probe process("stap").mark("*")? { println(@defined($arg1)) } # valid -probe process("stap").mark("*")? { println(@defined($nosuchvar)) } # invalid -probe procfs("file").read { println(@defined($nosuchvar)) } # invalid -probe procfs("file").write { println(@defined($value)) } # valid +probe kernel.function("sys_open") { println(@defined($foobar)?$foobar:0) } # invalid +probe kernel.function("sys_open") { println(@defined($mode)?$mode:0) } # valid + +/* +There is a problem with saved $target vars for retprobes. The synthetic entry probe +to collect $foobar is generated before pass-2's constant-folding can eliminate the +$foobar in the middle operand of ? : +*/ +/* +probe kernel.function("sys_open").return { println(@defined($foobar)?$foobar:0) } # invalid +*/ +probe kernel.function("sys_open").return { println(@defined($foobar)?1:0) } # invalid + +probe kernel.function("sys_open").return { println(@defined($mode)?$mode:0) } # valid +probe kernel.trace("*")? { println(@defined($rw)?$rw:0) } # valid and invalid in places +probe kernel.mark("*")? { println(@defined($foo)?$foo:0) } # invalid +probe kernel.mark("*")? { println(@defined($name)?$name:0) } # valid +probe kernel.mark("*")? { println(@defined($argJJJ)?$argJJJ:0) } +probe process("stap").mark("*")? { println(@defined($arg1)?$arg1:0) } # valid +probe process("stap").mark("*")? { println(@defined($nosuchvar)?$nosuchvar:0) } # invalid +probe procfs("file").read { println(@defined($nosuchvar)?$nosuchvar:0) } # invalid +probe procfs("file").write { println(@defined($value)?$value:0) } # valid %( CONFIG_UTRACE == "y" %? -probe process("stap").syscall { println(@defined($arg1)) } # valid -probe process("stap").syscall { println(@defined($argZZ)) } # invalid -probe process("stap").syscall.return { println(@defined($nosuchvar)) } # invalid -probe process("stap").syscall.return { println(@defined($syscall)) } # valid +probe process("stap").syscall { println(@defined($arg1)?$arg1:0) } # valid +probe process("stap").begin { println(@defined($arg7)?$arg7:0) } # invalid +probe process("stap").syscall { println(@defined($argZZ)?$argZZ:0) } # invalid +probe process("stap").syscall.return { println(@defined($nosuchvar)?$nosuchvar:0) } # invalid +probe process("stap").syscall.return { println(@defined($syscall)?$syscall:0) } # valid %) |