< prev index next >

src/hotspot/share/utilities/vmError.cpp

Print this page
rev 55587 : [mq]: nestegg
rev 55588 : imported patch 8227031-optionally-print-nmt-report-on-oom


1510           out.print_raw_cr("# Can not save log file, dump to screen..");
1511           fd_log = 1;
1512         }
1513       }
1514       log.set_fd(fd_log);
1515     }
1516 
1517     report(&log, true);
1518     log_done = true;
1519     _current_step = 0;
1520     _current_step_info = "";
1521 
1522     if (fd_log > 3) {
1523       close(fd_log);
1524       fd_log = -1;
1525     }
1526 
1527     log.set_fd(-1);
1528   }
1529 






1530   static bool skip_replay = ReplayCompiles; // Do not overwrite file during replay
1531   if (DumpReplayDataOnError && _thread && _thread->is_Compiler_thread() && !skip_replay) {
1532     skip_replay = true;
1533     ciEnv* env = ciEnv::current();
1534     if (env != NULL) {
1535       const bool overwrite = false; // We do not overwrite an existing replay file.
1536       int fd = prepare_log_file(ReplayDataFile, "replay_pid%p.log", overwrite, buffer, sizeof(buffer));
1537       if (fd != -1) {
1538         FILE* replay_data_file = os::open(fd, "w");
1539         if (replay_data_file != NULL) {
1540           fileStream replay_data_stream(replay_data_file, /*need_close=*/true);
1541           env->dump_replay_data_unsafe(&replay_data_stream);
1542           out.print_raw("#\n# Compiler replay data is saved as:\n# ");
1543           out.print_raw_cr(buffer);
1544         } else {
1545           int e = errno;
1546           out.print_raw("#\n# Can't open file to dump replay data. Error: ");
1547           out.print_raw_cr(os::strerror(e));
1548         }
1549       }




1510           out.print_raw_cr("# Can not save log file, dump to screen..");
1511           fd_log = 1;
1512         }
1513       }
1514       log.set_fd(fd_log);
1515     }
1516 
1517     report(&log, true);
1518     log_done = true;
1519     _current_step = 0;
1520     _current_step_info = "";
1521 
1522     if (fd_log > 3) {
1523       close(fd_log);
1524       fd_log = -1;
1525     }
1526 
1527     log.set_fd(-1);
1528   }
1529 
1530   // Print out NMT statistics if this was desired.
1531   if (PrintNMTStatistics) {
1532     fdStream fds(fd_out);
1533     MemTracker::final_report(&fds);
1534   }
1535 
1536   static bool skip_replay = ReplayCompiles; // Do not overwrite file during replay
1537   if (DumpReplayDataOnError && _thread && _thread->is_Compiler_thread() && !skip_replay) {
1538     skip_replay = true;
1539     ciEnv* env = ciEnv::current();
1540     if (env != NULL) {
1541       const bool overwrite = false; // We do not overwrite an existing replay file.
1542       int fd = prepare_log_file(ReplayDataFile, "replay_pid%p.log", overwrite, buffer, sizeof(buffer));
1543       if (fd != -1) {
1544         FILE* replay_data_file = os::open(fd, "w");
1545         if (replay_data_file != NULL) {
1546           fileStream replay_data_stream(replay_data_file, /*need_close=*/true);
1547           env->dump_replay_data_unsafe(&replay_data_stream);
1548           out.print_raw("#\n# Compiler replay data is saved as:\n# ");
1549           out.print_raw_cr(buffer);
1550         } else {
1551           int e = errno;
1552           out.print_raw("#\n# Can't open file to dump replay data. Error: ");
1553           out.print_raw_cr(os::strerror(e));
1554         }
1555       }


< prev index next >