17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
18 * |
18 * |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 * or visit www.oracle.com if you need additional information or have any |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 * |
22 * |
23 */ |
23 */ |
24 |
24 |
25 /* This file is auto-generated */ |
25 /* This file is auto-generated */ |
26 #include "JvmOffsetsIndex.h" |
26 #include "JvmOffsetsIndex.h" |
27 |
27 |
28 #define DEBUG |
28 #define DEBUG |
29 |
29 |
30 #ifdef DEBUG |
30 #ifdef DEBUG |
31 #define MARK_LINE this->line = __LINE__ |
31 #define MARK_LINE this->line = __LINE__ |
32 #else |
32 #else |
33 #define MARK_LINE |
33 #define MARK_LINE |
34 #endif |
34 #endif |
35 |
35 |
36 #ifdef _LP64 |
36 #ifdef _LP64 |
37 #define STACK_BIAS 0x7ff |
37 #define STACK_BIAS 0x7ff |
38 #define pointer uint64_t |
38 #define pointer uint64_t |
39 #else |
39 #else |
40 #define STACK_BIAS 0 |
40 #define STACK_BIAS 0 |
41 #define pointer uint32_t |
41 #define pointer uint32_t |
42 #endif |
42 #endif |
43 |
43 |
44 extern pointer __JvmOffsets; |
44 extern uint64_t* __JvmOffsets; |
45 |
45 |
46 /* GrowableArray<CodeHeaps*>* */ |
46 /* GrowableArray<CodeHeaps*>* */ |
47 extern pointer __1cJCodeCacheG_heaps_; |
47 extern pointer __1cJCodeCacheG_heaps_; |
48 |
48 |
49 extern pointer __1cIUniverseO_collectedHeap_; |
49 extern pointer __1cIUniverseO_collectedHeap_; |
57 #define copyin_uint16(ADDR) *(uint16_t*) copyin((pointer) (ADDR), sizeof(uint16_t)) |
57 #define copyin_uint16(ADDR) *(uint16_t*) copyin((pointer) (ADDR), sizeof(uint16_t)) |
58 #define copyin_uint32(ADDR) *(uint32_t*) copyin((pointer) (ADDR), sizeof(uint32_t)) |
58 #define copyin_uint32(ADDR) *(uint32_t*) copyin((pointer) (ADDR), sizeof(uint32_t)) |
59 #define copyin_int32(ADDR) *(int32_t*) copyin((pointer) (ADDR), sizeof(int32_t)) |
59 #define copyin_int32(ADDR) *(int32_t*) copyin((pointer) (ADDR), sizeof(int32_t)) |
60 #define copyin_uint8(ADDR) *(uint8_t*) copyin((pointer) (ADDR), sizeof(uint8_t)) |
60 #define copyin_uint8(ADDR) *(uint8_t*) copyin((pointer) (ADDR), sizeof(uint8_t)) |
61 |
61 |
62 #define SAME(x) x |
|
63 #define copyin_offset(JVM_CONST) JVM_CONST = \ |
62 #define copyin_offset(JVM_CONST) JVM_CONST = \ |
64 copyin_int32(JvmOffsetsPtr + SAME(IDX_)JVM_CONST * sizeof(int32_t)) |
63 copyin_int32(JvmOffsetsPtr + IDX_##JVM_CONST * sizeof(int32_t)) |
65 |
64 |
66 int init_done; |
65 int init_done; |
67 |
66 |
68 dtrace:helper:ustack: |
67 dtrace:helper:ustack: |
69 { |
68 { |
95 |
94 |
96 dtrace:helper:ustack: |
95 dtrace:helper:ustack: |
97 /!init_done && !this->done/ |
96 /!init_done && !this->done/ |
98 { |
97 { |
99 MARK_LINE; |
98 MARK_LINE; |
100 |
99 |
101 copyin_offset(POINTER_SIZE); |
100 copyin_offset(POINTER_SIZE); |
102 copyin_offset(COMPILER); |
101 copyin_offset(COMPILER); |
103 copyin_offset(OFFSET_CollectedHeap_reserved); |
102 copyin_offset(OFFSET_CollectedHeap_reserved); |
104 copyin_offset(OFFSET_MemRegion_start); |
103 copyin_offset(OFFSET_MemRegion_start); |
105 copyin_offset(OFFSET_MemRegion_word_size); |
104 copyin_offset(OFFSET_MemRegion_word_size); |
156 #else |
155 #else |
157 #error "Don't know architecture" |
156 #error "Don't know architecture" |
158 #endif |
157 #endif |
159 |
158 |
160 /* Read address of GrowableArray<CodeHeaps*> */ |
159 /* Read address of GrowableArray<CodeHeaps*> */ |
161 this->code_heaps_address = copyin_ptr(&``__1cJCodeCacheG_heaps_); |
160 // this->code_heaps_address = copyin_ptr(&``__1cJCodeCacheG_heaps_); |
|
161 this->code_heaps_address = * ( uint64_t * ) copyin ( ( uint64_t ) ( &``__1cJCodeCacheG_heaps_ ) , sizeof ( uint64_t ) ); |
|
162 |
162 /* Read address of _data array field in GrowableArray */ |
163 /* Read address of _data array field in GrowableArray */ |
163 this->code_heaps_array_address = copyin_ptr(this->code_heaps_address + OFFSET_GrowableArray_CodeHeap_data); |
164 this->code_heaps_array_address = copyin_ptr(this->code_heaps_address + OFFSET_GrowableArray_CodeHeap_data); |
164 this->number_of_heaps = copyin_uint32(this->code_heaps_address + OFFSET_GrowableArray_CodeHeap_len); |
165 this->number_of_heaps = copyin_uint32(this->code_heaps_address + OFFSET_GrowableArray_CodeHeap_len); |
165 |
166 |
166 this->Method_vtbl = (pointer) &``__1cGMethodG__vtbl_; |
167 this->Method_vtbl = (pointer) &``__1cGMethodG__vtbl_; |
167 |
168 |
168 /* |
169 /* |
169 * Get Java heap bounds |
170 * Get Java heap bounds |
170 */ |
171 */ |
171 this->Universe_collectedHeap = copyin_ptr(&``__1cIUniverseO_collectedHeap_); |
172 // this->Universe_collectedHeap = copyin_ptr(&``__1cIUniverseO_collectedHeap_); |
|
173 this->Universe_collectedHeap = * ( uint64_t * ) copyin ( ( uint64_t ) ( &``__1cIUniverseO_collectedHeap_ ) , sizeof ( uint64_t ) ); |
|
174 |
172 this->heap_start = copyin_ptr(this->Universe_collectedHeap + |
175 this->heap_start = copyin_ptr(this->Universe_collectedHeap + |
173 OFFSET_CollectedHeap_reserved + |
176 OFFSET_CollectedHeap_reserved + |
174 OFFSET_MemRegion_start); |
177 OFFSET_MemRegion_start); |
175 this->heap_size = SIZE_HeapWord * |
178 this->heap_size = SIZE_HeapWord * |
176 copyin_ptr(this->Universe_collectedHeap + |
179 copyin_ptr(this->Universe_collectedHeap + |
179 ); |
182 ); |
180 this->heap_end = this->heap_start + this->heap_size; |
183 this->heap_end = this->heap_start + this->heap_size; |
181 } |
184 } |
182 |
185 |
183 /* |
186 /* |
184 * IMPORTANT: At the moment the ustack helper supports up to 5 code heaps in |
187 * IMPORTANT: At the moment the ustack helper supports up to 5 code heaps in |
185 * the code cache. If more code heaps are added the following probes have to |
188 * the code cache. If more code heaps are added the following probes have to |
186 * be extended. This is done by simply adding a probe to get the heap bounds |
189 * be extended. This is done by simply adding a probe to get the heap bounds |
187 * and another probe to set the code heap address of the newly created heap. |
190 * and another probe to set the code heap address of the newly created heap. |
188 */ |
191 */ |
189 |
192 |
190 /* |
193 /* |
195 { |
198 { |
196 MARK_LINE; |
199 MARK_LINE; |
197 /* CodeHeap 1 */ |
200 /* CodeHeap 1 */ |
198 init_done = 1; |
201 init_done = 1; |
199 this->code_heap1_address = copyin_ptr(this->code_heaps_array_address); |
202 this->code_heap1_address = copyin_ptr(this->code_heaps_array_address); |
200 this->code_heap1_low = copyin_ptr(this->code_heap1_address + |
203 this->code_heap1_low = copyin_ptr(this->code_heap1_address + |
201 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); |
204 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); |
202 this->code_heap1_high = copyin_ptr(this->code_heap1_address + |
205 this->code_heap1_high = copyin_ptr(this->code_heap1_address + |
203 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high); |
206 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high); |
204 } |
207 } |
205 |
208 |
209 MARK_LINE; |
212 MARK_LINE; |
210 /* CodeHeap 2 */ |
213 /* CodeHeap 2 */ |
211 init_done = 2; |
214 init_done = 2; |
212 this->code_heaps_array_address = this->code_heaps_array_address + POINTER_SIZE; |
215 this->code_heaps_array_address = this->code_heaps_array_address + POINTER_SIZE; |
213 this->code_heap2_address = copyin_ptr(this->code_heaps_array_address); |
216 this->code_heap2_address = copyin_ptr(this->code_heaps_array_address); |
214 this->code_heap2_low = copyin_ptr(this->code_heap2_address + |
217 this->code_heap2_low = copyin_ptr(this->code_heap2_address + |
215 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); |
218 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); |
216 this->code_heap2_high = copyin_ptr(this->code_heap2_address + |
219 this->code_heap2_high = copyin_ptr(this->code_heap2_address + |
217 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high); |
220 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high); |
218 } |
221 } |
219 |
222 |
222 { |
225 { |
223 /* CodeHeap 3 */ |
226 /* CodeHeap 3 */ |
224 init_done = 3; |
227 init_done = 3; |
225 this->code_heaps_array_address = this->code_heaps_array_address + POINTER_SIZE; |
228 this->code_heaps_array_address = this->code_heaps_array_address + POINTER_SIZE; |
226 this->code_heap3_address = copyin_ptr(this->code_heaps_array_address); |
229 this->code_heap3_address = copyin_ptr(this->code_heaps_array_address); |
227 this->code_heap3_low = copyin_ptr(this->code_heap3_address + |
230 this->code_heap3_low = copyin_ptr(this->code_heap3_address + |
228 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); |
231 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); |
229 this->code_heap3_high = copyin_ptr(this->code_heap3_address + |
232 this->code_heap3_high = copyin_ptr(this->code_heap3_address + |
230 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high); |
233 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high); |
231 } |
234 } |
232 |
235 |
235 { |
238 { |
236 /* CodeHeap 4 */ |
239 /* CodeHeap 4 */ |
237 init_done = 4; |
240 init_done = 4; |
238 this->code_heaps_array_address = this->code_heaps_array_address + POINTER_SIZE; |
241 this->code_heaps_array_address = this->code_heaps_array_address + POINTER_SIZE; |
239 this->code_heap4_address = copyin_ptr(this->code_heaps_array_address); |
242 this->code_heap4_address = copyin_ptr(this->code_heaps_array_address); |
240 this->code_heap4_low = copyin_ptr(this->code_heap4_address + |
243 this->code_heap4_low = copyin_ptr(this->code_heap4_address + |
241 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); |
244 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); |
242 this->code_heap4_high = copyin_ptr(this->code_heap4_address + |
245 this->code_heap4_high = copyin_ptr(this->code_heap4_address + |
243 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high); |
246 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high); |
244 } |
247 } |
245 |
248 |
248 { |
251 { |
249 /* CodeHeap 5 */ |
252 /* CodeHeap 5 */ |
250 init_done = 5; |
253 init_done = 5; |
251 this->code_heaps_array_address = this->code_heaps_array_address + POINTER_SIZE; |
254 this->code_heaps_array_address = this->code_heaps_array_address + POINTER_SIZE; |
252 this->code_heap5_address = copyin_ptr(this->code_heaps_array_address); |
255 this->code_heap5_address = copyin_ptr(this->code_heaps_array_address); |
253 this->code_heap5_low = copyin_ptr(this->code_heap5_address + |
256 this->code_heap5_low = copyin_ptr(this->code_heap5_address + |
254 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); |
257 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); |
255 this->code_heap5_high = copyin_ptr(this->code_heap5_address + |
258 this->code_heap5_high = copyin_ptr(this->code_heap5_address + |
256 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high); |
259 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high); |
257 } |
260 } |
258 /* |
261 /* |
307 |
310 |
308 dtrace:helper:ustack: |
311 dtrace:helper:ustack: |
309 /!this->done && this->codecache/ |
312 /!this->done && this->codecache/ |
310 { |
313 { |
311 MARK_LINE; |
314 MARK_LINE; |
312 /* |
315 /* |
313 * Get code heap configuration |
316 * Get code heap configuration |
314 */ |
317 */ |
315 this->code_heap_low = copyin_ptr(this->code_heap_address + |
318 this->code_heap_low = copyin_ptr(this->code_heap_address + |
316 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); |
319 OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low); |
317 this->code_heap_segmap_low = copyin_ptr(this->code_heap_address + |
320 this->code_heap_segmap_low = copyin_ptr(this->code_heap_address + |
318 OFFSET_CodeHeap_segmap + OFFSET_VirtualSpace_low); |
321 OFFSET_CodeHeap_segmap + OFFSET_VirtualSpace_low); |
319 this->code_heap_log2_segment_size = copyin_uint32( |
322 this->code_heap_log2_segment_size = copyin_uint32( |
320 this->code_heap_address + OFFSET_CodeHeap_log2_segment_size); |
323 this->code_heap_address + OFFSET_CodeHeap_log2_segment_size); |
504 this->nameSymbolLength + 1); |
507 this->nameSymbolLength + 1); |
505 |
508 |
506 /* |
509 /* |
507 * Now we need to add a trailing '\0' and possibly a tag character. |
510 * Now we need to add a trailing '\0' and possibly a tag character. |
508 */ |
511 */ |
509 this->result[this->klassSymbolLength + 1 + |
512 this->result[this->klassSymbolLength + 1 + |
510 this->nameSymbolLength + |
513 this->nameSymbolLength + |
511 this->signatureSymbolLength] = this->suffix; |
514 this->signatureSymbolLength] = this->suffix; |
512 this->result[this->klassSymbolLength + 2 + |
515 this->result[this->klassSymbolLength + 2 + |
513 this->nameSymbolLength + |
516 this->nameSymbolLength + |
514 this->signatureSymbolLength] = '\0'; |
517 this->signatureSymbolLength] = '\0'; |
515 |
518 |
516 this->done = 1; |
519 this->done = 1; |
517 } |
520 } |
518 |
521 |
519 dtrace:helper:ustack: |
522 dtrace:helper:ustack: |
520 /this->done && this->error == (char *) NULL/ |
523 /this->done && this->error == (char *) NULL/ |
521 { |
524 { |
522 this->result; |
525 this->result; |
523 } |
526 } |
524 |
527 |
525 dtrace:helper:ustack: |
528 dtrace:helper:ustack: |
526 /this->done && this->error != (char *) NULL/ |
529 /this->done && this->error != (char *) NULL/ |
527 { |
530 { |