5525 char filename[MAX_PATH]; 5526 if (PauseAtStartupFile && PauseAtStartupFile[0]) { 5527 jio_snprintf(filename, MAX_PATH, PauseAtStartupFile); 5528 } else { 5529 jio_snprintf(filename, MAX_PATH, "./vm.paused.%d", current_process_id()); 5530 } 5531 5532 int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); 5533 if (fd != -1) { 5534 struct stat buf; 5535 ::close(fd); 5536 while (::stat(filename, &buf) == 0) { 5537 (void)::poll(NULL, 0, 100); 5538 } 5539 } else { 5540 jio_fprintf(stderr, 5541 "Could not open pause file '%s', continuing immediately.\n", filename); 5542 } 5543 } 5544 5545 #ifndef PRODUCT 5546 #ifdef INTERPOSE_ON_SYSTEM_SYNCH_FUNCTIONS 5547 // Turn this on if you need to trace synch operations. 5548 // Set RECORD_SYNCH_LIMIT to a large-enough value, 5549 // and call record_synch_enable and record_synch_disable 5550 // around the computation of interest. 5551 5552 void record_synch(char* name, bool returning); // defined below 5553 5554 class RecordSynch { 5555 char* _name; 5556 public: 5557 RecordSynch(char* name) :_name(name) 5558 { record_synch(_name, false); } 5559 ~RecordSynch() { record_synch(_name, true); } 5560 }; 5561 5562 #define CHECK_SYNCH_OP(ret, name, params, args, inner) \ 5563 extern "C" ret name params { \ 5564 typedef ret name##_t params; \ | 5525 char filename[MAX_PATH]; 5526 if (PauseAtStartupFile && PauseAtStartupFile[0]) { 5527 jio_snprintf(filename, MAX_PATH, PauseAtStartupFile); 5528 } else { 5529 jio_snprintf(filename, MAX_PATH, "./vm.paused.%d", current_process_id()); 5530 } 5531 5532 int fd = ::open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666); 5533 if (fd != -1) { 5534 struct stat buf; 5535 ::close(fd); 5536 while (::stat(filename, &buf) == 0) { 5537 (void)::poll(NULL, 0, 100); 5538 } 5539 } else { 5540 jio_fprintf(stderr, 5541 "Could not open pause file '%s', continuing immediately.\n", filename); 5542 } 5543 } 5544 5545 void os::deallocate_pages() { 5546 // Unimplemented. 5547 } 5548 5549 #ifndef PRODUCT 5550 #ifdef INTERPOSE_ON_SYSTEM_SYNCH_FUNCTIONS 5551 // Turn this on if you need to trace synch operations. 5552 // Set RECORD_SYNCH_LIMIT to a large-enough value, 5553 // and call record_synch_enable and record_synch_disable 5554 // around the computation of interest. 5555 5556 void record_synch(char* name, bool returning); // defined below 5557 5558 class RecordSynch { 5559 char* _name; 5560 public: 5561 RecordSynch(char* name) :_name(name) 5562 { record_synch(_name, false); } 5563 ~RecordSynch() { record_synch(_name, true); } 5564 }; 5565 5566 #define CHECK_SYNCH_OP(ret, name, params, args, inner) \ 5567 extern "C" ret name params { \ 5568 typedef ret name##_t params; \ |