1790 // ------------------------------------------------------------------
1791 // CompileBroker::init_compiler_thread_log
1792 //
1793 // Set up state required by +LogCompilation.
1794 void CompileBroker::init_compiler_thread_log() {
1795 CompilerThread* thread = CompilerThread::current();
1796 char file_name[4*K];
1797 FILE* fp = NULL;
1798 intx thread_id = os::current_thread_id();
1799 for (int try_temp_dir = 1; try_temp_dir >= 0; try_temp_dir--) {
1800 const char* dir = (try_temp_dir ? os::get_temp_directory() : NULL);
1801 if (dir == NULL) {
1802 jio_snprintf(file_name, sizeof(file_name), "hs_c" UINTX_FORMAT "_pid%u.log",
1803 thread_id, os::current_process_id());
1804 } else {
1805 jio_snprintf(file_name, sizeof(file_name),
1806 "%s%shs_c" UINTX_FORMAT "_pid%u.log", dir,
1807 os::file_separator(), thread_id, os::current_process_id());
1808 }
1809
1810 fp = fopen(file_name, "at");
1811 if (fp != NULL) {
1812 if (LogCompilation && Verbose) {
1813 tty->print_cr("Opening compilation log %s", file_name);
1814 }
1815 CompileLog* log = new(ResourceObj::C_HEAP, mtCompiler) CompileLog(file_name, fp, thread_id);
1816 thread->init_log(log);
1817
1818 if (xtty != NULL) {
1819 ttyLocker ttyl;
1820 // Record any per thread log files
1821 xtty->elem("thread_logfile thread='" INTX_FORMAT "' filename='%s'", thread_id, file_name);
1822 }
1823 return;
1824 }
1825 }
1826 warning("Cannot open log file: %s", file_name);
1827 }
1828
1829 void CompileBroker::log_metaspace_failure() {
1830 const char* message = "some methods may not be compiled because metaspace "
|
1790 // ------------------------------------------------------------------
1791 // CompileBroker::init_compiler_thread_log
1792 //
1793 // Set up state required by +LogCompilation.
1794 void CompileBroker::init_compiler_thread_log() {
1795 CompilerThread* thread = CompilerThread::current();
1796 char file_name[4*K];
1797 FILE* fp = NULL;
1798 intx thread_id = os::current_thread_id();
1799 for (int try_temp_dir = 1; try_temp_dir >= 0; try_temp_dir--) {
1800 const char* dir = (try_temp_dir ? os::get_temp_directory() : NULL);
1801 if (dir == NULL) {
1802 jio_snprintf(file_name, sizeof(file_name), "hs_c" UINTX_FORMAT "_pid%u.log",
1803 thread_id, os::current_process_id());
1804 } else {
1805 jio_snprintf(file_name, sizeof(file_name),
1806 "%s%shs_c" UINTX_FORMAT "_pid%u.log", dir,
1807 os::file_separator(), thread_id, os::current_process_id());
1808 }
1809
1810 fp = fopen(file_name, "wt");
1811 if (fp != NULL) {
1812 if (LogCompilation && Verbose) {
1813 tty->print_cr("Opening compilation log %s", file_name);
1814 }
1815 CompileLog* log = new(ResourceObj::C_HEAP, mtCompiler) CompileLog(file_name, fp, thread_id);
1816 thread->init_log(log);
1817
1818 if (xtty != NULL) {
1819 ttyLocker ttyl;
1820 // Record any per thread log files
1821 xtty->elem("thread_logfile thread='" INTX_FORMAT "' filename='%s'", thread_id, file_name);
1822 }
1823 return;
1824 }
1825 }
1826 warning("Cannot open log file: %s", file_name);
1827 }
1828
1829 void CompileBroker::log_metaspace_failure() {
1830 const char* message = "some methods may not be compiled because metaspace "
|