changeset 2525:3622f089d9f3

* tapset/jstack.stp.in: Use @var construct if available. Newer versions of systemtap (since 1.8) make it possible to use the @var construct if available to pick target variables from the right CU. Which is needed by newer DWARF/gcc versions which don't add a defining variable declaration to each CU anymore.
author Mark Wielaard <mark@klomp.org>
date Tue, 13 Mar 2012 17:24:50 +0100
parents 91870f1e0c92
children 5cc05c7552ef
files ChangeLog tapset/jstack.stp.in
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Mar 13 16:41:32 2012 +0100
+++ b/ChangeLog	Tue Mar 13 17:24:50 2012 +0100
@@ -1,3 +1,9 @@
+2012-03-13  Mark Wielaard  <mjw@redhat.com>
+
+	* tapset/jstack.stp.in: Use @var construct if available to pick
+	target variable from the right CU (needed by newer DWARF/gcc
+	versions).
+
 2012-03-13  Mark Wielaard  <mjw@redhat.com>
 
 	* tapset/jstack.stp.in: Index globals on pid() to support multiple
--- a/tapset/jstack.stp.in	Tue Mar 13 16:41:32 2012 +0100
+++ b/tapset/jstack.stp.in	Tue Mar 13 17:24:50 2012 +0100
@@ -67,7 +67,9 @@
 probe hotspot.vm_init_end
 {
   // The parent/type oop for a methodOop.
-  Universe_methodKlassObj[pid()] = $_methodKlassObj;
+  Universe_methodKlassObj[pid()] = %( systemtap_v >= "1.8"
+                                     %? @var("_methodKlassObj@universe.cpp")
+                                     %: $_methodKlassObj %);
 
   // For compressed oops.
   // Universe_heap_base = $_heap_base;
@@ -82,7 +84,9 @@
    *
    * Note that we access it through its "short name" _collectedHeap.
    */
-  Universe_collectedHeap[pid()] = $_collectedHeap;
+  Universe_collectedHeap[pid()] = %( systemtap_v >= "1.8"
+                                    %? @var("_collectedHeap@universe.cpp")
+                                    %: $_collectedHeap %);
   HeapWordSize[pid()] = $HeapWordSize;
 
   /**
@@ -101,7 +105,9 @@
    * the segment at index - N (which can be recursive if a block
    * contains more than 0xFE segments).
    */
-  CodeCache_heap[pid()] = $_heap;
+  CodeCache_heap[pid()] = %( systemtap_v >= "1.8"
+                            %? @var("_heap@codeCache.cpp")
+                            %: $_heap %);
 
   // Should really check arch of user space (for 32bit jvm on 64bit kernel).
   %( arch == "i386" %?