提交 253cefe2 编写于 作者: V vlivanov

8025849: Redundant "pid" in VM log file name (e.g. hotspot_pidpid12345.log)

Reviewed-by: twisti, azeemj
上级 5033fdc9
...@@ -465,7 +465,7 @@ static const char* make_log_name_internal(const char* log_name, const char* forc ...@@ -465,7 +465,7 @@ static const char* make_log_name_internal(const char* log_name, const char* forc
} }
// log_name comes from -XX:LogFile=log_name or -Xloggc:log_name // log_name comes from -XX:LogFile=log_name or -Xloggc:log_name
// in log_name, %p => pipd1234 and // in log_name, %p => pid1234 and
// %t => YYYY-MM-DD_HH-MM-SS // %t => YYYY-MM-DD_HH-MM-SS
static const char* make_log_name(const char* log_name, const char* force_directory) { static const char* make_log_name(const char* log_name, const char* force_directory) {
char timestr[32]; char timestr[32];
...@@ -792,7 +792,7 @@ bool defaultStream::has_log_file() { ...@@ -792,7 +792,7 @@ bool defaultStream::has_log_file() {
void defaultStream::init_log() { void defaultStream::init_log() {
// %%% Need a MutexLocker? // %%% Need a MutexLocker?
const char* log_name = LogFile != NULL ? LogFile : "hotspot_pid%p.log"; const char* log_name = LogFile != NULL ? LogFile : "hotspot_%p.log";
const char* try_name = make_log_name(log_name, NULL); const char* try_name = make_log_name(log_name, NULL);
fileStream* file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name); fileStream* file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name);
if (!file->is_open()) { if (!file->is_open()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册