$foo in probe predicates

Roland McGrath roland@redhat.com
Wed Jan 7 22:09:00 GMT 2009


-bash-3.2$ ./run-stap -c 'cat < /dev/null' -e 'probe kernel.function("sys_read") { if ($fd == 0) printf("%d %d\n", $fd, $count) }'
0 4096
-bash-3.2$ ./run-stap -c 'cat < /dev/null' -e 'probe kernel.function("sys_read") if ($fd == 0) { printf("%d %d\n", $fd, $count) }'
semantic error: unresolved target-symbol expression: identifier '$fd' at <input>:1:39
        source: probe kernel.function("sys_read") if ($fd == 0) { printf("%d %d\n", $fd, $count) }
                                                      ^
Pass 2: analysis failed.  Try again with another '--vp 01' option.
-bash-3.2$ 


AFAICT this makes it impossible to do:

probe foo.bar = kernel.function("blah") if ($arg == 1) { argstr=... }
probe foo.baz = kernel.function("blah") if ($arg == 2) { argstr=... }

and I don't know how else I could get the same effect.  That is, so:

probe foo.bar { print... }

does not print on $arg!=1 cases, with the knowedlge about $arg and its
values being hidden in the tapset.


Thanks,
Roland



More information about the Systemtap mailing list