This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Using kernel global variables
- From: David Wilder <dwilder at us dot ibm dot com>
- To: Mike Mason <mmlnx at us dot ibm dot com>
- Cc: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Mon, 06 Aug 2007 09:22:51 -0700
- Subject: Re: Using kernel global variables
- References: <46B35E2C.6000907@us.ibm.com> <46B60DC8.3060702@us.ibm.com>
Mike Mason wrote:
David Wilder wrote:
It is my understanding if we want to access a kernel global variable
in a tap script we must be in a context that is using the variable.
I believe the variable must be within the *scope* of the probed
function. The function doesn't necessarily have to use the variable
for it to be within scope. A global defined in the same file as the
function is automatically within scope.
I don't think exported symbols are within a function's scope from
SystemTap's perspective, though the function can see them. Perhaps
the dwarf info doesn't allow for that.
Mike
Thanks for the clarification Mike.
Based on question I have received about global variables I think there
is a need to access exported variables that are outside the scope of the
probepoint. For example accessing a global in a begin or exit probe.
What do you think of such a feature?
I suspect we would need a way to flag the stap compiler that we are
referencing a exported global something like using ^var.