hotspot/src/share/vm/services/classLoadingService.cpp
changeset 10739 91935236600e
parent 8921 14bfe81f2a9d
child 13728 882756847a04
--- a/hotspot/src/share/vm/services/classLoadingService.cpp	Mon Oct 10 21:01:36 2011 -0400
+++ b/hotspot/src/share/vm/services/classLoadingService.cpp	Thu Oct 13 09:35:42 2011 -0700
@@ -36,6 +36,8 @@
 
 // Only bother with this argument setup if dtrace is available
 
+#ifndef USDT2
+
 HS_DTRACE_PROBE_DECL4(hotspot, class__loaded, char*, int, oop, bool);
 HS_DTRACE_PROBE_DECL4(hotspot, class__unloaded, char*, int, oop, bool);
 
@@ -52,6 +54,24 @@
       data, len, (clss)->class_loader(), (shared)); \
   }
 
+#else /* USDT2 */
+
+#define HOTSPOT_CLASS_unloaded HOTSPOT_CLASS_UNLOADED
+#define HOTSPOT_CLASS_loaded HOTSPOT_CLASS_LOADED
+#define DTRACE_CLASSLOAD_PROBE(type, clss, shared)  \
+  {                                                 \
+    char* data = NULL;                              \
+    int len = 0;                                    \
+    Symbol* name = (clss)->name();                  \
+    if (name != NULL) {                             \
+      data = (char*)name->bytes();                  \
+      len = name->utf8_length();                    \
+    }                                               \
+    HOTSPOT_CLASS_##type( /* type = unloaded, loaded */ \
+      data, len, (clss)->class_loader(), (shared)); \
+  }
+
+#endif /* USDT2 */
 #else //  ndef DTRACE_ENABLED
 
 #define DTRACE_CLASSLOAD_PROBE(type, clss, shared)