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: David Smith <dsmith at redhat dot com>
- Cc: Wenji Huang <wenji dot huang at oracle dot com>, systemtap at sourceware dot org
- Date: Thu, 07 Jun 2007 11:09:23 -0700
- Subject: Re: access pointer and global variables
- References: <4667CD2A.9030405@oracle.com> <466846DE.6010105@redhat.com>
David Smith wrote:
But, we've thrown away the type information at that point, so the value
in your case is just a long as far as systemtap is concerned. So, to
access $prev->pid you are going to have to write some code to access it.
See tapset/aux_syscalls.stp for examples of functions that take a
pointer value and dereference fields from it.
(Alternatively you could write an entry probe yourself to cache the
$prev->pid value if that is all you are interested in.)
Perhaps the SystemTap language is representing $prev as a plain long,
but the translator should know better. Whether we cache $prev->pid or
we cache $prev and remember how to dereference ->pid, that's just a
design decision. But I think it's possible for the translator to still
handle this automatically.
Josh