public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/11096] New: Getting global module vars in functions
@ 2009-12-16 11:39 mjw at redhat dot com
  2009-12-16 19:49 ` [Bug translator/11096] " jistone at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mjw at redhat dot com @ 2009-12-16 11:39 UTC (permalink / raw)
  To: systemtap

It is often convenient to grab a global variable value in a function. But
currently you cannot do that, so you have to grab it in a probe handler and
store it globally or pass it to the function invocation (then you can use the
address of this variable and @cast(var "struct", "module") to extract the
information in the function).

Possible syntax: @global($var, "module")

-- 
           Summary: Getting global module vars in functions
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: mjw at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11096

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug translator/11096] Getting global module vars in functions
  2009-12-16 11:39 [Bug translator/11096] New: Getting global module vars in functions mjw at redhat dot com
@ 2009-12-16 19:49 ` jistone at redhat dot com
  2009-12-16 20:55 ` mjw at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jistone at redhat dot com @ 2009-12-16 19:49 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From jistone at redhat dot com  2009-12-16 19:48 -------
Global vars that are in scope should be usable already.  Are you talking about
globals that are only present in other CUs?

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11096

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug translator/11096] Getting global module vars in functions
  2009-12-16 11:39 [Bug translator/11096] New: Getting global module vars in functions mjw at redhat dot com
  2009-12-16 19:49 ` [Bug translator/11096] " jistone at redhat dot com
@ 2009-12-16 20:55 ` mjw at redhat dot com
  2009-12-16 22:55 ` jistone at redhat dot com
  2010-05-21 21:39 ` fche at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: mjw at redhat dot com @ 2009-12-16 20:55 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From mjw at redhat dot com  2009-12-16 20:55 -------
(In reply to comment #1)
> Global vars that are in scope should be usable already.

But in a function there is no scope, so no variable is accessible.

The use case for me is the jstack() function, that would benefit from having
access to some of the globals in libjvm.so. Currently we have a probe on vm_init
to collect those globals and store them for later use in the function. But that
is somewhat limiting the use of the jstack() function (it can only be used after
some probe in the libjvm.so context has been fired first).

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11096

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug translator/11096] Getting global module vars in functions
  2009-12-16 11:39 [Bug translator/11096] New: Getting global module vars in functions mjw at redhat dot com
  2009-12-16 19:49 ` [Bug translator/11096] " jistone at redhat dot com
  2009-12-16 20:55 ` mjw at redhat dot com
@ 2009-12-16 22:55 ` jistone at redhat dot com
  2010-05-21 21:39 ` fche at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: jistone at redhat dot com @ 2009-12-16 22:55 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From jistone at redhat dot com  2009-12-16 22:54 -------
I clarified my confusion with mjw on IRC -- in my response I was thinking of
probes on a C function that access global variables, which should work fine.  He
is talking about a stap function (with no $ context) that wants to access a
module's global variables.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11096

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug translator/11096] Getting global module vars in functions
  2009-12-16 11:39 [Bug translator/11096] New: Getting global module vars in functions mjw at redhat dot com
                   ` (2 preceding siblings ...)
  2009-12-16 22:55 ` jistone at redhat dot com
@ 2010-05-21 21:39 ` fche at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fche at redhat dot com @ 2010-05-21 21:39 UTC (permalink / raw)
  To: systemtap


------- Additional Comments From fche at redhat dot com  2010-05-21 19:43 -------
*** Bug 4906 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dwilder at us dot ibm dot
                   |                            |com


http://sourceware.org/bugzilla/show_bug.cgi?id=11096

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-21 19:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-16 11:39 [Bug translator/11096] New: Getting global module vars in functions mjw at redhat dot com
2009-12-16 19:49 ` [Bug translator/11096] " jistone at redhat dot com
2009-12-16 20:55 ` mjw at redhat dot com
2009-12-16 22:55 ` jistone at redhat dot com
2010-05-21 21:39 ` fche at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).