91 HS_DTRACE_PROBE_DECL5(hotspot, monitor__wait, |
91 HS_DTRACE_PROBE_DECL5(hotspot, monitor__wait, |
92 jlong, uintptr_t, char*, int, long); |
92 jlong, uintptr_t, char*, int, long); |
93 HS_DTRACE_PROBE_DECL4(hotspot, monitor__waited, |
93 HS_DTRACE_PROBE_DECL4(hotspot, monitor__waited, |
94 jlong, uintptr_t, char*, int); |
94 jlong, uintptr_t, char*, int); |
95 |
95 |
96 #define DTRACE_MONITOR_WAIT_PROBE(monitor, klassOop, thread, millis) \ |
96 #define DTRACE_MONITOR_WAIT_PROBE(monitor, obj, thread, millis) \ |
97 { \ |
97 { \ |
98 if (DTraceMonitorProbes) { \ |
98 if (DTraceMonitorProbes) { \ |
99 DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \ |
99 DTRACE_MONITOR_PROBE_COMMON(obj, thread); \ |
100 HS_DTRACE_PROBE5(hotspot, monitor__wait, jtid, \ |
100 HS_DTRACE_PROBE5(hotspot, monitor__wait, jtid, \ |
101 (monitor), bytes, len, (millis)); \ |
101 (monitor), bytes, len, (millis)); \ |
102 } \ |
102 } \ |
103 } |
103 } |
104 |
104 |
105 #define DTRACE_MONITOR_PROBE(probe, monitor, klassOop, thread) \ |
105 #define DTRACE_MONITOR_PROBE(probe, monitor, obj, thread) \ |
106 { \ |
106 { \ |
107 if (DTraceMonitorProbes) { \ |
107 if (DTraceMonitorProbes) { \ |
108 DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \ |
108 DTRACE_MONITOR_PROBE_COMMON(obj, thread); \ |
109 HS_DTRACE_PROBE4(hotspot, monitor__##probe, jtid, \ |
109 HS_DTRACE_PROBE4(hotspot, monitor__##probe, jtid, \ |
110 (uintptr_t)(monitor), bytes, len); \ |
110 (uintptr_t)(monitor), bytes, len); \ |
111 } \ |
111 } \ |
112 } |
112 } |
113 |
113 |
114 #else /* USDT2 */ |
114 #else /* USDT2 */ |
115 |
115 |
116 #define DTRACE_MONITOR_WAIT_PROBE(monitor, klassOop, thread, millis) \ |
116 #define DTRACE_MONITOR_WAIT_PROBE(monitor, obj, thread, millis) \ |
117 { \ |
117 { \ |
118 if (DTraceMonitorProbes) { \ |
118 if (DTraceMonitorProbes) { \ |
119 DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \ |
119 DTRACE_MONITOR_PROBE_COMMON(obj, thread); \ |
120 HOTSPOT_MONITOR_WAIT(jtid, \ |
120 HOTSPOT_MONITOR_WAIT(jtid, \ |
121 (uintptr_t)(monitor), bytes, len, (millis)); \ |
121 (uintptr_t)(monitor), bytes, len, (millis)); \ |
122 } \ |
122 } \ |
123 } |
123 } |
124 |
124 |
125 #define HOTSPOT_MONITOR_PROBE_waited HOTSPOT_MONITOR_PROBE_WAITED |
125 #define HOTSPOT_MONITOR_PROBE_waited HOTSPOT_MONITOR_PROBE_WAITED |
126 |
126 |
127 #define DTRACE_MONITOR_PROBE(probe, monitor, klassOop, thread) \ |
127 #define DTRACE_MONITOR_PROBE(probe, monitor, obj, thread) \ |
128 { \ |
128 { \ |
129 if (DTraceMonitorProbes) { \ |
129 if (DTraceMonitorProbes) { \ |
130 DTRACE_MONITOR_PROBE_COMMON(klassOop, thread); \ |
130 DTRACE_MONITOR_PROBE_COMMON(obj, thread); \ |
131 HOTSPOT_MONITOR_PROBE_##probe(jtid, /* probe = waited */ \ |
131 HOTSPOT_MONITOR_PROBE_##probe(jtid, /* probe = waited */ \ |
132 (uintptr_t)(monitor), bytes, len); \ |
132 (uintptr_t)(monitor), bytes, len); \ |
133 } \ |
133 } \ |
134 } |
134 } |
135 |
135 |
136 #endif /* USDT2 */ |
136 #endif /* USDT2 */ |
137 #else // ndef DTRACE_ENABLED |
137 #else // ndef DTRACE_ENABLED |
138 |
138 |
139 #define DTRACE_MONITOR_WAIT_PROBE(klassOop, thread, millis, mon) {;} |
139 #define DTRACE_MONITOR_WAIT_PROBE(obj, thread, millis, mon) {;} |
140 #define DTRACE_MONITOR_PROBE(probe, klassOop, thread, mon) {;} |
140 #define DTRACE_MONITOR_PROBE(probe, obj, thread, mon) {;} |
141 |
141 |
142 #endif // ndef DTRACE_ENABLED |
142 #endif // ndef DTRACE_ENABLED |
143 |
143 |
144 // This exists only as a workaround of dtrace bug 6254741 |
144 // This exists only as a workaround of dtrace bug 6254741 |
145 int dtrace_waited_probe(ObjectMonitor* monitor, Handle obj, Thread* thr) { |
145 int dtrace_waited_probe(ObjectMonitor* monitor, Handle obj, Thread* thr) { |