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 |
|
54 HS_DTRACE_PROBE_DECL8(hotspot, compiled__method__load, |
|
55 const char*, int, const char*, int, const char*, int, void*, size_t); |
|
56 |
|
57 HS_DTRACE_PROBE_DECL6(hotspot, compiled__method__unload, |
|
58 char*, int, char*, int, char*, int); |
|
59 |
|
60 #define DTRACE_METHOD_UNLOAD_PROBE(method) \ |
|
61 { \ |
|
62 Method* m = (method); \ |
|
63 if (m != NULL) { \ |
|
64 Symbol* klass_name = m->klass_name(); \ |
|
65 Symbol* name = m->name(); \ |
|
66 Symbol* signature = m->signature(); \ |
|
67 HS_DTRACE_PROBE6(hotspot, compiled__method__unload, \ |
|
68 klass_name->bytes(), klass_name->utf8_length(), \ |
|
69 name->bytes(), name->utf8_length(), \ |
|
70 signature->bytes(), signature->utf8_length()); \ |
|
71 } \ |
|
72 } |
|
73 #else /* USDT2 */ |
|
74 #define DTRACE_METHOD_UNLOAD_PROBE(method) \ |
53 #define DTRACE_METHOD_UNLOAD_PROBE(method) \ |
75 { \ |
54 { \ |
76 Method* m = (method); \ |
55 Method* m = (method); \ |
77 if (m != NULL) { \ |
56 if (m != NULL) { \ |
78 Symbol* klass_name = m->klass_name(); \ |
57 Symbol* klass_name = m->klass_name(); \ |
82 (char *) klass_name->bytes(), klass_name->utf8_length(), \ |
61 (char *) klass_name->bytes(), klass_name->utf8_length(), \ |
83 (char *) name->bytes(), name->utf8_length(), \ |
62 (char *) name->bytes(), name->utf8_length(), \ |
84 (char *) signature->bytes(), signature->utf8_length()); \ |
63 (char *) signature->bytes(), signature->utf8_length()); \ |
85 } \ |
64 } \ |
86 } |
65 } |
87 #endif /* USDT2 */ |
|
88 |
66 |
89 #else // ndef DTRACE_ENABLED |
67 #else // ndef DTRACE_ENABLED |
90 |
68 |
91 #define DTRACE_METHOD_UNLOAD_PROBE(method) |
69 #define DTRACE_METHOD_UNLOAD_PROBE(method) |
92 |
70 |
1518 // new method for install_code() path |
1496 // new method for install_code() path |
1519 // Transfer information from compilation to jvmti |
1497 // Transfer information from compilation to jvmti |
1520 void nmethod::post_compiled_method_load_event() { |
1498 void nmethod::post_compiled_method_load_event() { |
1521 |
1499 |
1522 Method* moop = method(); |
1500 Method* moop = method(); |
1523 #ifndef USDT2 |
|
1524 HS_DTRACE_PROBE8(hotspot, compiled__method__load, |
|
1525 moop->klass_name()->bytes(), |
|
1526 moop->klass_name()->utf8_length(), |
|
1527 moop->name()->bytes(), |
|
1528 moop->name()->utf8_length(), |
|
1529 moop->signature()->bytes(), |
|
1530 moop->signature()->utf8_length(), |
|
1531 insts_begin(), insts_size()); |
|
1532 #else /* USDT2 */ |
|
1533 HOTSPOT_COMPILED_METHOD_LOAD( |
1501 HOTSPOT_COMPILED_METHOD_LOAD( |
1534 (char *) moop->klass_name()->bytes(), |
1502 (char *) moop->klass_name()->bytes(), |
1535 moop->klass_name()->utf8_length(), |
1503 moop->klass_name()->utf8_length(), |
1536 (char *) moop->name()->bytes(), |
1504 (char *) moop->name()->bytes(), |
1537 moop->name()->utf8_length(), |
1505 moop->name()->utf8_length(), |
1538 (char *) moop->signature()->bytes(), |
1506 (char *) moop->signature()->bytes(), |
1539 moop->signature()->utf8_length(), |
1507 moop->signature()->utf8_length(), |
1540 insts_begin(), insts_size()); |
1508 insts_begin(), insts_size()); |
1541 #endif /* USDT2 */ |
|
1542 |
1509 |
1543 if (JvmtiExport::should_post_compiled_method_load() || |
1510 if (JvmtiExport::should_post_compiled_method_load() || |
1544 JvmtiExport::should_post_compiled_method_unload()) { |
1511 JvmtiExport::should_post_compiled_method_unload()) { |
1545 get_and_cache_jmethod_id(); |
1512 get_and_cache_jmethod_id(); |
1546 } |
1513 } |