This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can't access argument of process marker


On 06/24/2010 11:04 PM, Wenji Huang wrote:
> Hi,
> 
> I got the failure when running test semok/thirtysix.stp. The error
> is triggered by the following script,
> 
> $ stap -e 'probe process("stap").mark("*")? { 
> println(@defined($arg1)?$arg1:$nosuchvar) }'
> semantic error: invalid argument number: identifier '$nosuchvar' at 
> <input>:1:66
>          source: probe process("stap").mark("*")? { 
> println(@defined($arg1)?$arg1:$nosuchvar) }
>  
>            ^
> Pass 2: analysis failed.  Try again with another '--vp 01' option.
> 
> It seems arguments of marker aren't accessible.

I saw this too, and I think it's just a failed operation of @defined for
SDT.  There are two overrides:

sdt_kprobe_var_expanding_visitor::visit_defined_op - just calls the
parent class... harmless, but unnecessary.

sdt_uprobe_var_expanding_visitor::visit_defined_op - leaves the
defined_op untouched, without checking its argument.  This means later
it expands to "undefined" --> 0.

I believe that neither class really needs to customize visit_defined_op,
but I haven't had a chance to try removing them yet.  Stan, do you
recall why these were needed?

> Moreover, I think it's not very accurate to complain "invalid
> argument number". In fact, the variable doesn't follow the naming
> rule, it's better to make a little modification and give some hints
> like $argN.

I agree, and there's also a comment that it needs to check for the $arg
prefix in the first place.


Josh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]