48 |
48 |
49 #ifdef DTRACE_ENABLED |
49 #ifdef DTRACE_ENABLED |
50 |
50 |
51 // Only bother with this argument setup if dtrace is available |
51 // Only bother with this argument setup if dtrace is available |
52 |
52 |
|
53 #ifndef USDT2 |
53 HS_DTRACE_PROBE_DECL8(hotspot, compiled__method__load, |
54 HS_DTRACE_PROBE_DECL8(hotspot, compiled__method__load, |
54 const char*, int, const char*, int, const char*, int, void*, size_t); |
55 const char*, int, const char*, int, const char*, int, void*, size_t); |
55 |
56 |
56 HS_DTRACE_PROBE_DECL6(hotspot, compiled__method__unload, |
57 HS_DTRACE_PROBE_DECL6(hotspot, compiled__method__unload, |
57 char*, int, char*, int, char*, int); |
58 char*, int, char*, int, char*, int); |
67 klass_name->bytes(), klass_name->utf8_length(), \ |
68 klass_name->bytes(), klass_name->utf8_length(), \ |
68 name->bytes(), name->utf8_length(), \ |
69 name->bytes(), name->utf8_length(), \ |
69 signature->bytes(), signature->utf8_length()); \ |
70 signature->bytes(), signature->utf8_length()); \ |
70 } \ |
71 } \ |
71 } |
72 } |
|
73 #else /* USDT2 */ |
|
74 #define DTRACE_METHOD_UNLOAD_PROBE(method) \ |
|
75 { \ |
|
76 methodOop m = (method); \ |
|
77 if (m != NULL) { \ |
|
78 Symbol* klass_name = m->klass_name(); \ |
|
79 Symbol* name = m->name(); \ |
|
80 Symbol* signature = m->signature(); \ |
|
81 HOTSPOT_COMPILED_METHOD_UNLOAD( \ |
|
82 (char *) klass_name->bytes(), klass_name->utf8_length(), \ |
|
83 (char *) name->bytes(), name->utf8_length(), \ |
|
84 (char *) signature->bytes(), signature->utf8_length()); \ |
|
85 } \ |
|
86 } |
|
87 #endif /* USDT2 */ |
72 |
88 |
73 #else // ndef DTRACE_ENABLED |
89 #else // ndef DTRACE_ENABLED |
74 |
90 |
75 #define DTRACE_METHOD_UNLOAD_PROBE(method) |
91 #define DTRACE_METHOD_UNLOAD_PROBE(method) |
76 |
92 |
1471 // new method for install_code() path |
1487 // new method for install_code() path |
1472 // Transfer information from compilation to jvmti |
1488 // Transfer information from compilation to jvmti |
1473 void nmethod::post_compiled_method_load_event() { |
1489 void nmethod::post_compiled_method_load_event() { |
1474 |
1490 |
1475 methodOop moop = method(); |
1491 methodOop moop = method(); |
|
1492 #ifndef USDT2 |
1476 HS_DTRACE_PROBE8(hotspot, compiled__method__load, |
1493 HS_DTRACE_PROBE8(hotspot, compiled__method__load, |
1477 moop->klass_name()->bytes(), |
1494 moop->klass_name()->bytes(), |
1478 moop->klass_name()->utf8_length(), |
1495 moop->klass_name()->utf8_length(), |
1479 moop->name()->bytes(), |
1496 moop->name()->bytes(), |
1480 moop->name()->utf8_length(), |
1497 moop->name()->utf8_length(), |
1481 moop->signature()->bytes(), |
1498 moop->signature()->bytes(), |
1482 moop->signature()->utf8_length(), |
1499 moop->signature()->utf8_length(), |
1483 insts_begin(), insts_size()); |
1500 insts_begin(), insts_size()); |
|
1501 #else /* USDT2 */ |
|
1502 HOTSPOT_COMPILED_METHOD_LOAD( |
|
1503 (char *) moop->klass_name()->bytes(), |
|
1504 moop->klass_name()->utf8_length(), |
|
1505 (char *) moop->name()->bytes(), |
|
1506 moop->name()->utf8_length(), |
|
1507 (char *) moop->signature()->bytes(), |
|
1508 moop->signature()->utf8_length(), |
|
1509 insts_begin(), insts_size()); |
|
1510 #endif /* USDT2 */ |
1484 |
1511 |
1485 if (JvmtiExport::should_post_compiled_method_load() || |
1512 if (JvmtiExport::should_post_compiled_method_load() || |
1486 JvmtiExport::should_post_compiled_method_unload()) { |
1513 JvmtiExport::should_post_compiled_method_unload()) { |
1487 get_and_cache_jmethod_id(); |
1514 get_and_cache_jmethod_id(); |
1488 } |
1515 } |