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: Dereferencing simple pointers


On 11/24/2009 11:47 AM, Frank Ch. Eigler wrote:
> daniel-kay3@arcor.de writes:
> 
>> I am playing around with systemtap and am quite impressed. But there
>> is one thing that confuses me. Is there any way that I can
>> derefernce a single pointer from a function parameter inside a
>> probe?
> 
>> [...]
>> # My Probe Attempt without success:
>> probe kernel.function("urandom_read") {
>>         printf("%s\n", *($ppos));
>> }
>>
>> I can't believe that this isn't possible...
> 
> Right, we don't currently use "*" as a derferencing operator, but
> instead make a family of functions available:
> kernel_{char,...,long,string} and user_{char,...,long,string}:
> So if $ppos was a just a random old char* string,
> 
>          printf("%s\n", kernel_string($ppos))

Another option for pointers to integral types (since $ppos is loff_t*)
is to use an array access, e.g.

	printf("%d\n, $ppos[0])

Array subscripts on pointers are supported since 0.9.9.

Josh


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