Listing probe alias resolution failures

Mike Mason mmlnx@us.ibm.com
Thu May 17 00:09:00 GMT 2007


David Smith wrote:
> Frank Ch. Eigler wrote:
>> Hi -
>>
>> On Wed, May 16, 2007 at 03:17:55PM -0500, David Smith wrote:
>>> [...]
>>> Nope, I'm suggesting that:
>>>    probe kernel.function("something_that_does_not_exist") ? {
>>>       local1 = $arg1
>>>       local2 = $arg2
>>>       printf("%d %d\n", local1, local2)
>>>    }
>>> be accepted.
>>
>> But it is already.
>>
>>
>>> In other words, if we know a probe point doesn't exist, it shouldn't
>>> matter what arguments it references. [...]
>>
>> It doesn't.
> 
> Hmm, I see what you mean.  The following doesn't give an error for 
> accessing $arg (although it does rightly complain that "no probes found").
> 
> # stap -p2 -e 'probe kernel.function("fche") ? { $arg1++ }'
> 
> 
> Ah, I see something I missed before with the following:
> 
> # stap -p2 -e 'probe vm.mmap ? { printf("%p %d\n", address, length) }'
> 
> Here's the definition from tapset/memory.stp:
> 
> probe vm.mmap = kernel.function("do_mmap"), kernel.function("do_mmap2")? {
>     address = $addr
>     length = $len
> }
> 
> I missed the fact that the first one isn't optional.  But, shouldn't 
> making 'vm.mmap' optional basically make 'kernel.function("do_mmap")' 
> optional?
> 

That's how it's documented to work.  From stapprobes(5): "Optionalness  passes  down  through  all levels of alias/wildcard expansion."

As for certain variables being inaccessible, isn't this just the on-going problem that symbols are sometimes unpredictably optimized away.  As I've said before, I think the test suite should check for this (i.e., -u tests), but it currently doesn't.

Mike




More information about the Systemtap mailing list