hotspot/src/share/vm/services/classLoadingService.cpp
changeset 22796 bb0ea482a99e
parent 20300 fe4818444117
child 24424 2658d7834c6e
equal deleted inserted replaced
22795:2b5380bc0926 22796:bb0ea482a99e
    34 #include "utilities/macros.hpp"
    34 #include "utilities/macros.hpp"
    35 
    35 
    36 #ifdef DTRACE_ENABLED
    36 #ifdef DTRACE_ENABLED
    37 
    37 
    38 // Only bother with this argument setup if dtrace is available
    38 // Only bother with this argument setup if dtrace is available
    39 
       
    40 #ifndef USDT2
       
    41 
       
    42 HS_DTRACE_PROBE_DECL4(hotspot, class__loaded, char*, int, oop, bool);
       
    43 HS_DTRACE_PROBE_DECL4(hotspot, class__unloaded, char*, int, oop, bool);
       
    44 
       
    45 #define DTRACE_CLASSLOAD_PROBE(type, clss, shared)  \
       
    46   {                                                 \
       
    47     char* data = NULL;                              \
       
    48     int len = 0;                                    \
       
    49     Symbol* name = (clss)->name();                  \
       
    50     if (name != NULL) {                             \
       
    51       data = (char*)name->bytes();                  \
       
    52       len = name->utf8_length();                    \
       
    53     }                                               \
       
    54     HS_DTRACE_PROBE4(hotspot, class__##type,        \
       
    55       data, len, SOLARIS_ONLY((void *))(clss)->class_loader(), (shared)); \
       
    56   }
       
    57 
       
    58 #else /* USDT2 */
       
    59 
    39 
    60 #define HOTSPOT_CLASS_unloaded HOTSPOT_CLASS_UNLOADED
    40 #define HOTSPOT_CLASS_unloaded HOTSPOT_CLASS_UNLOADED
    61 #define HOTSPOT_CLASS_loaded HOTSPOT_CLASS_LOADED
    41 #define HOTSPOT_CLASS_loaded HOTSPOT_CLASS_LOADED
    62 #define DTRACE_CLASSLOAD_PROBE(type, clss, shared)  \
    42 #define DTRACE_CLASSLOAD_PROBE(type, clss, shared)  \
    63   {                                                 \
    43   {                                                 \
    70     }                                               \
    50     }                                               \
    71     HOTSPOT_CLASS_##type( /* type = unloaded, loaded */ \
    51     HOTSPOT_CLASS_##type( /* type = unloaded, loaded */ \
    72       data, len, (clss)->class_loader(), (shared)); \
    52       data, len, (clss)->class_loader(), (shared)); \
    73   }
    53   }
    74 
    54 
    75 #endif /* USDT2 */
       
    76 #else //  ndef DTRACE_ENABLED
    55 #else //  ndef DTRACE_ENABLED
    77 
    56 
    78 #define DTRACE_CLASSLOAD_PROBE(type, clss, shared)
    57 #define DTRACE_CLASSLOAD_PROBE(type, clss, shared)
    79 
    58 
    80 #endif
    59 #endif