This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: access pointer and global variables
- From: "Stone, Joshua I" <joshua dot i dot stone at intel dot com>
- To: Wenji Huang <wenji dot huang at oracle dot com>
- Cc: systemtap at sourceware dot org
- Date: Thu, 07 Jun 2007 08:38:24 -0700
- Subject: Re: access pointer and global variables
- References: <4667CD2A.9030405@oracle.com>
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