% stap -L 'kernel.function("sys_open")' kernel.function("sys_open@fs/open.c:1050") $filename:char const* $flags:int $mode:int $ret:long int properly adds $ to the available $context variables being listed, but in error messages, we don't decorate the variables that way. % stap -p2 -e 'probe kernel.function("sys_open") {println($foo)}' semantic error: unable to find local 'foo' near pc 0xffffffff810e1df7 in sys_open(fs/open.c) (alternatives: filename flags mode ret): identifier '$foo' at <input>:1:44
Created attachment 4844 [details] patch With this patch, the following message will be displayed, $ ./stap -e 'probe kernel.function("sys_open"){print($foo)}'semantic error: unable to find local 'foo' near pc 0xc04cf156 in sys_open(fs/open.c) (alternatives: $filename $flags $mode $ret): identifier '$foo' at <input>:1:41 source: probe kernel.function("sys_open"){print($foo)} ^ Pass 2: analysis failed. Try again with another '--vp 01' option.
(In reply to comment #1) > Created an attachment (id=4844) Thanks. I suspect there are a few other analogous places in the code.
(In reply to comment #2) > (In reply to comment #1) > > Created an attachment (id=4844) > > Thanks. I suspect there are a few other analogous places in the code. > Seems the patch is enough, It's hard-coded like $arg, $value for other probe types.
commit 4ca5acc84095c947c2dfade905b8eab5a7433961 Author: Wenji Huang <wenji.huang@oracle.com> Date: Tue Jun 22 10:43:35 2010 +0800 PR11713: listing available variable with leading '$' * dwflpp.cxx(dwflpp::print_locals): Add '$' to name.
thanks