146 } |
146 } |
147 |
147 |
148 |
148 |
149 #include <math.h> |
149 #include <math.h> |
150 |
150 |
|
151 #ifndef USDT2 |
151 HS_DTRACE_PROBE_DECL4(hotspot, object__alloc, Thread*, char*, int, size_t); |
152 HS_DTRACE_PROBE_DECL4(hotspot, object__alloc, Thread*, char*, int, size_t); |
152 HS_DTRACE_PROBE_DECL7(hotspot, method__entry, int, |
153 HS_DTRACE_PROBE_DECL7(hotspot, method__entry, int, |
153 char*, int, char*, int, char*, int); |
154 char*, int, char*, int, char*, int); |
154 HS_DTRACE_PROBE_DECL7(hotspot, method__return, int, |
155 HS_DTRACE_PROBE_DECL7(hotspot, method__return, int, |
155 char*, int, char*, int, char*, int); |
156 char*, int, char*, int, char*, int); |
|
157 #endif /* !USDT2 */ |
156 |
158 |
157 // Implementation of SharedRuntime |
159 // Implementation of SharedRuntime |
158 |
160 |
159 #ifndef PRODUCT |
161 #ifndef PRODUCT |
160 // For statistics |
162 // For statistics |
952 int SharedRuntime::dtrace_object_alloc_base(Thread* thread, oopDesc* o) { |
954 int SharedRuntime::dtrace_object_alloc_base(Thread* thread, oopDesc* o) { |
953 assert(DTraceAllocProbes, "wrong call"); |
955 assert(DTraceAllocProbes, "wrong call"); |
954 Klass* klass = o->blueprint(); |
956 Klass* klass = o->blueprint(); |
955 int size = o->size(); |
957 int size = o->size(); |
956 Symbol* name = klass->name(); |
958 Symbol* name = klass->name(); |
|
959 #ifndef USDT2 |
957 HS_DTRACE_PROBE4(hotspot, object__alloc, get_java_tid(thread), |
960 HS_DTRACE_PROBE4(hotspot, object__alloc, get_java_tid(thread), |
958 name->bytes(), name->utf8_length(), size * HeapWordSize); |
961 name->bytes(), name->utf8_length(), size * HeapWordSize); |
|
962 #else /* USDT2 */ |
|
963 HOTSPOT_OBJECT_ALLOC( |
|
964 get_java_tid(thread), |
|
965 (char *) name->bytes(), name->utf8_length(), size * HeapWordSize); |
|
966 #endif /* USDT2 */ |
959 return 0; |
967 return 0; |
960 } |
968 } |
961 |
969 |
962 JRT_LEAF(int, SharedRuntime::dtrace_method_entry( |
970 JRT_LEAF(int, SharedRuntime::dtrace_method_entry( |
963 JavaThread* thread, methodOopDesc* method)) |
971 JavaThread* thread, methodOopDesc* method)) |
964 assert(DTraceMethodProbes, "wrong call"); |
972 assert(DTraceMethodProbes, "wrong call"); |
965 Symbol* kname = method->klass_name(); |
973 Symbol* kname = method->klass_name(); |
966 Symbol* name = method->name(); |
974 Symbol* name = method->name(); |
967 Symbol* sig = method->signature(); |
975 Symbol* sig = method->signature(); |
|
976 #ifndef USDT2 |
968 HS_DTRACE_PROBE7(hotspot, method__entry, get_java_tid(thread), |
977 HS_DTRACE_PROBE7(hotspot, method__entry, get_java_tid(thread), |
969 kname->bytes(), kname->utf8_length(), |
978 kname->bytes(), kname->utf8_length(), |
970 name->bytes(), name->utf8_length(), |
979 name->bytes(), name->utf8_length(), |
971 sig->bytes(), sig->utf8_length()); |
980 sig->bytes(), sig->utf8_length()); |
|
981 #else /* USDT2 */ |
|
982 HOTSPOT_METHOD_ENTRY( |
|
983 get_java_tid(thread), |
|
984 (char *) kname->bytes(), kname->utf8_length(), |
|
985 (char *) name->bytes(), name->utf8_length(), |
|
986 (char *) sig->bytes(), sig->utf8_length()); |
|
987 #endif /* USDT2 */ |
972 return 0; |
988 return 0; |
973 JRT_END |
989 JRT_END |
974 |
990 |
975 JRT_LEAF(int, SharedRuntime::dtrace_method_exit( |
991 JRT_LEAF(int, SharedRuntime::dtrace_method_exit( |
976 JavaThread* thread, methodOopDesc* method)) |
992 JavaThread* thread, methodOopDesc* method)) |
977 assert(DTraceMethodProbes, "wrong call"); |
993 assert(DTraceMethodProbes, "wrong call"); |
978 Symbol* kname = method->klass_name(); |
994 Symbol* kname = method->klass_name(); |
979 Symbol* name = method->name(); |
995 Symbol* name = method->name(); |
980 Symbol* sig = method->signature(); |
996 Symbol* sig = method->signature(); |
|
997 #ifndef USDT2 |
981 HS_DTRACE_PROBE7(hotspot, method__return, get_java_tid(thread), |
998 HS_DTRACE_PROBE7(hotspot, method__return, get_java_tid(thread), |
982 kname->bytes(), kname->utf8_length(), |
999 kname->bytes(), kname->utf8_length(), |
983 name->bytes(), name->utf8_length(), |
1000 name->bytes(), name->utf8_length(), |
984 sig->bytes(), sig->utf8_length()); |
1001 sig->bytes(), sig->utf8_length()); |
|
1002 #else /* USDT2 */ |
|
1003 HOTSPOT_METHOD_RETURN( |
|
1004 get_java_tid(thread), |
|
1005 (char *) kname->bytes(), kname->utf8_length(), |
|
1006 (char *) name->bytes(), name->utf8_length(), |
|
1007 (char *) sig->bytes(), sig->utf8_length()); |
|
1008 #endif /* USDT2 */ |
985 return 0; |
1009 return 0; |
986 JRT_END |
1010 JRT_END |
987 |
1011 |
988 |
1012 |
989 // Finds receiver, CallInfo (i.e. receiver method), and calling bytecode) |
1013 // Finds receiver, CallInfo (i.e. receiver method), and calling bytecode) |