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: access pointer and global variables


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



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