src/share/vm/utilities/ostream.cpp

Print this page
rev 6841 : mq

*** 350,359 **** --- 350,360 ---- stringStream::~stringStream() {} xmlStream* xtty; outputStream* tty; outputStream* gclog_or_tty; + fileStream* classlist_file; // Only dump the classes that can be stored into the CDS archive extern Mutex* tty_lock; #define EXTRACHARLEN 32 #define CURRENTAPPX ".current" #define FILENAMEBUFLEN 1024
*** 461,471 **** } strcat(buf, tail); // append rest of name, or all of name return buf; } ! // log_name comes from -XX:LogFile=log_name or -Xloggc:log_name // in log_name, %p => pid1234 and // %t => YYYY-MM-DD_HH-MM-SS static const char* make_log_name(const char* log_name, const char* force_directory) { char timestr[32]; get_datetime_string(timestr, sizeof(timestr)); --- 462,473 ---- } strcat(buf, tail); // append rest of name, or all of name return buf; } ! // log_name comes from -XX:LogFile=log_name, -Xloggc:log_name or ! // -XX:DumpLoadedClassList=<file_name> // in log_name, %p => pid1234 and // %t => YYYY-MM-DD_HH-MM-SS static const char* make_log_name(const char* log_name, const char* force_directory) { char timestr[32]; get_datetime_string(timestr, sizeof(timestr));
*** 1101,1110 **** --- 1103,1120 ---- gclog->time_stamp().update_to(tty->time_stamp().ticks()); } gclog_or_tty = gclog; } + // For -XX:DumpLoadedClassList=<file> option + if (DumpLoadedClassList != NULL) { + const char* list_name = make_log_name(DumpLoadedClassList, NULL); + classlist_file = new(ResourceObj::C_HEAP, mtInternal) + fileStream(list_name); + FREE_C_HEAP_ARRAY(char, list_name, mtInternal); + } + // If we haven't lazily initialized the logfile yet, do it now, // to avoid the possibility of lazy initialization during a VM // crash, which can affect the stability of the fatal error handler. defaultStream::instance->has_log_file(); }
*** 1113,1122 **** --- 1123,1135 ---- // output and free resource. void ostream_exit() { static bool ostream_exit_called = false; if (ostream_exit_called) return; ostream_exit_called = true; + if (classlist_file != NULL) { + delete classlist_file; + } if (gclog_or_tty != tty) { delete gclog_or_tty; } { // we temporaly disable PrintMallocFree here