comparison agent/src/os/bsd/ps_core.c @ 10229:f6a055fcf47d

8005038: remove crufty '_g' support from SA Reviewed-by: coleenp, mgronlun, rbackman
author sla
date Tue, 07 May 2013 14:33:09 +0200
parents 39432a1cefdd
children 5705c7ee6dd7
comparison
equal deleted inserted replaced
10228:b5fef8013a95 10229:f6a055fcf47d
197 } 197 }
198 198
199 //--------------------------------------------------------------- 199 //---------------------------------------------------------------
200 // Part of the class sharing workaround: 200 // Part of the class sharing workaround:
201 // 201 //
202 // With class sharing, pages are mapped from classes[_g].jsa file. 202 // With class sharing, pages are mapped from classes.jsa file.
203 // The read-only class sharing pages are mapped as MAP_SHARED, 203 // The read-only class sharing pages are mapped as MAP_SHARED,
204 // PROT_READ pages. These pages are not dumped into core dump. 204 // PROT_READ pages. These pages are not dumped into core dump.
205 // With this workaround, these pages are read from classes[_g].jsa. 205 // With this workaround, these pages are read from classes.jsa.
206 206
207 // FIXME: !HACK ALERT! 207 // FIXME: !HACK ALERT!
208 // The format of sharing achive file header is needed to read shared heap 208 // The format of sharing achive file header is needed to read shared heap
209 // file mappings. For now, I am hard coding portion of FileMapHeader here. 209 // file mappings. For now, I am hard coding portion of FileMapHeader here.
210 // Refer to filemap.hpp. 210 // Refer to filemap.hpp.
296 int m; 296 int m;
297 size_t n; 297 size_t n;
298 lib_info* lib = ph->libs; 298 lib_info* lib = ph->libs;
299 while (lib != NULL) { 299 while (lib != NULL) {
300 // we are iterating over shared objects from the core dump. look for 300 // we are iterating over shared objects from the core dump. look for
301 // libjvm[_g].so. 301 // libjvm.so.
302 const char *jvm_name = 0; 302 const char *jvm_name = 0;
303 #ifdef __APPLE__ 303 #ifdef __APPLE__
304 if ((jvm_name = strstr(lib->name, "/libjvm.dylib")) != 0 || 304 if ((jvm_name = strstr(lib->name, "/libjvm.dylib")) != 0)
305 (jvm_name = strstr(lib->name, "/libjvm_g.dylib")) != 0)
306 #else 305 #else
307 if ((jvm_name = strstr(lib->name, "/libjvm.so")) != 0 || 306 if ((jvm_name = strstr(lib->name, "/libjvm.so")) != 0)
308 (jvm_name = strstr(lib->name, "/libjvm_g.so")) != 0)
309 #endif // __APPLE__ 307 #endif // __APPLE__
310 { 308 {
311 char classes_jsa[PATH_MAX]; 309 char classes_jsa[PATH_MAX];
312 struct FileMapHeader header; 310 struct FileMapHeader header;
313 int fd = -1; 311 int fd = -1;
387 close(fd); 385 close(fd);
388 return false; 386 return false;
389 } 387 }
390 388
391 ph->core->classes_jsa_fd = fd; 389 ph->core->classes_jsa_fd = fd;
392 // add read-only maps from classes[_g].jsa to the list of maps 390 // add read-only maps from classes.jsa to the list of maps
393 for (m = 0; m < NUM_SHARED_MAPS; m++) { 391 for (m = 0; m < NUM_SHARED_MAPS; m++) {
394 if (header._space[m]._read_only) { 392 if (header._space[m]._read_only) {
395 base = (uintptr_t) header._space[m]._base; 393 base = (uintptr_t) header._space[m]._base;
396 // no need to worry about the fractional pages at-the-end. 394 // no need to worry about the fractional pages at-the-end.
397 // possible fractional pages are handled by core_read_data. 395 // possible fractional pages are handled by core_read_data.