access pointer and global variables

Stone, Joshua I joshua.i.stone@intel.com
Thu Jun 7 19:03:00 GMT 2007


Stone, Joshua I wrote:
>     probe kernel.function("schedule") {
>         cache[...] = $prev
>     }
>     probe kernel.function("schedule").return {
>         printf("pid is %d\n", cache[...]->pid)
>         // The dereference happens using the same loc2c
>         // generated function that the entry would have used.
>     }

I just realized that this still looks a lot like what you were grumbling 
about.  The difference I was try to make is that I don't expect that we 
should ever support users writing this kind of code directly.  Trying to 
track the "original" type of arbitrary longs passed around is extremely 
hairy.  But in a controlled environment, where this is happening behind 
the scenes in the translator, I think it's more manageable.

> OR
> 
>     probe kernel.function("schedule") {
>         cache[...] = $prev->pid
>     }
>     probe kernel.function("schedule").return {
>         printf("pid is %d\n", cache[...])
>     }

But I would still be happy with this, which I don't think would require 
too much change.

Josh



More information about the Systemtap mailing list