access pointer and global variables

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


Wenji Huang wrote:
>    c. char *
>        probe kernel.function("sys_open") {
>           //parameter list in source:   const char __user *filename, int 
> flags, int mode) 
>           $filename can be accessed, but how to get the string of 
> filename point ?
>        }

I'm not sure about your other questions, but I'll answer the easy one. 
To read a string from a pointer, use either kernel_string() or 
user_string().  Since $filename is a __user pointer, you should use the 
latter.

Alternately, you can use the tapset alias "syscall.open" which gives you 
variables that are already dereferenced.


Josh



More information about the Systemtap mailing list