Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
9c9bc43d
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9c9bc43d
编写于
4月 07, 2010
作者:
K
kamg
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
a495aeeb
a2966d4b
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
83 addition
and
51 deletion
+83
-51
src/os/linux/vm/attachListener_linux.cpp
src/os/linux/vm/attachListener_linux.cpp
+5
-3
src/os/linux/vm/os_linux.cpp
src/os/linux/vm/os_linux.cpp
+6
-2
src/os/linux/vm/perfMemory_linux.cpp
src/os/linux/vm/perfMemory_linux.cpp
+4
-3
src/os/solaris/vm/attachListener_solaris.cpp
src/os/solaris/vm/attachListener_solaris.cpp
+5
-3
src/os/solaris/vm/os_solaris.cpp
src/os/solaris/vm/os_solaris.cpp
+4
-10
src/os/solaris/vm/perfMemory_solaris.cpp
src/os/solaris/vm/perfMemory_solaris.cpp
+4
-3
src/os/windows/vm/os_windows.cpp
src/os/windows/vm/os_windows.cpp
+10
-9
src/os/windows/vm/perfMemory_windows.cpp
src/os/windows/vm/perfMemory_windows.cpp
+4
-3
src/share/vm/compiler/compileBroker.cpp
src/share/vm/compiler/compileBroker.cpp
+8
-3
src/share/vm/utilities/ostream.cpp
src/share/vm/utilities/ostream.cpp
+31
-10
src/share/vm/utilities/vmError.cpp
src/share/vm/utilities/vmError.cpp
+2
-2
未找到文件。
src/os/linux/vm/attachListener_linux.cpp
浏览文件 @
9c9bc43d
...
...
@@ -192,7 +192,8 @@ int LinuxAttachListener::init() {
res
=
::
bind
(
listener
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
));
}
if
(
res
==
-
1
)
{
sprintf
(
path
,
"%s/.java_pid%d"
,
os
::
get_temp_directory
(),
os
::
current_process_id
());
snprintf
(
path
,
PATH_MAX
+
1
,
"%s/.java_pid%d"
,
os
::
get_temp_directory
(),
os
::
current_process_id
());
strcpy
(
addr
.
sun_path
,
path
);
::
unlink
(
path
);
res
=
::
bind
(
listener
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
));
...
...
@@ -460,13 +461,14 @@ bool AttachListener::is_init_trigger() {
if
(
init_at_startup
()
||
is_initialized
())
{
return
false
;
// initialized at startup or already initialized
}
char
fn
[
32
];
char
fn
[
128
];
sprintf
(
fn
,
".attach_pid%d"
,
os
::
current_process_id
());
int
ret
;
struct
stat64
st
;
RESTARTABLE
(
::
stat64
(
fn
,
&
st
),
ret
);
if
(
ret
==
-
1
)
{
sprintf
(
fn
,
"/tmp/.attach_pid%d"
,
os
::
current_process_id
());
snprintf
(
fn
,
sizeof
(
fn
),
"%s/.attach_pid%d"
,
os
::
get_temp_directory
(),
os
::
current_process_id
());
RESTARTABLE
(
::
stat64
(
fn
,
&
st
),
ret
);
}
if
(
ret
==
0
)
{
...
...
src/os/linux/vm/os_linux.cpp
浏览文件 @
9c9bc43d
...
...
@@ -1522,7 +1522,10 @@ int os::current_process_id() {
const
char
*
os
::
dll_file_extension
()
{
return
".so"
;
}
const
char
*
os
::
get_temp_directory
()
{
return
"/tmp/"
;
}
const
char
*
os
::
get_temp_directory
()
{
const
char
*
prop
=
Arguments
::
get_property
(
"java.io.tmpdir"
);
return
prop
==
NULL
?
"/tmp"
:
prop
;
}
static
bool
file_exists
(
const
char
*
filename
)
{
struct
stat
statbuf
;
...
...
@@ -2305,7 +2308,8 @@ void linux_wrap_code(char* base, size_t size) {
char
buf
[
40
];
int
num
=
Atomic
::
add
(
1
,
&
cnt
);
sprintf
(
buf
,
"/tmp/hs-vm-%d-%d"
,
os
::
current_process_id
(),
num
);
snprintf
(
buf
,
sizeof
(
buf
),
"%s/hs-vm-%d-%d"
,
os
::
get_temp_directory
(),
os
::
current_process_id
(),
num
);
unlink
(
buf
);
int
fd
=
open
(
buf
,
O_CREAT
|
O_RDWR
,
S_IRWXU
);
...
...
src/os/linux/vm/perfMemory_linux.cpp
浏览文件 @
9c9bc43d
...
...
@@ -145,11 +145,11 @@ static char* get_user_tmp_dir(const char* user) {
const
char
*
tmpdir
=
os
::
get_temp_directory
();
const
char
*
perfdir
=
PERFDATA_NAME
;
size_t
nbytes
=
strlen
(
tmpdir
)
+
strlen
(
perfdir
)
+
strlen
(
user
)
+
2
;
size_t
nbytes
=
strlen
(
tmpdir
)
+
strlen
(
perfdir
)
+
strlen
(
user
)
+
3
;
char
*
dirname
=
NEW_C_HEAP_ARRAY
(
char
,
nbytes
);
// construct the path name to user specific tmp directory
snprintf
(
dirname
,
nbytes
,
"%s%s_%s"
,
tmpdir
,
perfdir
,
user
);
snprintf
(
dirname
,
nbytes
,
"%s
/
%s_%s"
,
tmpdir
,
perfdir
,
user
);
return
dirname
;
}
...
...
@@ -331,8 +331,9 @@ static char* get_user_name_slow(int vmid, TRAPS) {
}
char
*
usrdir_name
=
NEW_C_HEAP_ARRAY
(
char
,
strlen
(
tmpdirname
)
+
strlen
(
dentry
->
d_name
)
+
1
);
strlen
(
tmpdirname
)
+
strlen
(
dentry
->
d_name
)
+
2
);
strcpy
(
usrdir_name
,
tmpdirname
);
strcat
(
usrdir_name
,
"/"
);
strcat
(
usrdir_name
,
dentry
->
d_name
);
DIR
*
subdirp
=
os
::
opendir
(
usrdir_name
);
...
...
src/os/solaris/vm/attachListener_solaris.cpp
浏览文件 @
9c9bc43d
...
...
@@ -375,7 +375,8 @@ int SolarisAttachListener::create_door() {
return
-
1
;
}
sprintf
(
door_path
,
"%s/.java_pid%d"
,
os
::
get_temp_directory
(),
os
::
current_process_id
());
snprintf
(
door_path
,
sizeof
(
door_path
),
"%s/.java_pid%d"
,
os
::
get_temp_directory
(),
os
::
current_process_id
());
RESTARTABLE
(
::
creat
(
door_path
,
S_IRUSR
|
S_IWUSR
),
fd
);
if
(
fd
==
-
1
)
{
...
...
@@ -591,13 +592,14 @@ bool AttachListener::is_init_trigger() {
if
(
init_at_startup
()
||
is_initialized
())
{
return
false
;
// initialized at startup or already initialized
}
char
fn
[
32
];
char
fn
[
128
];
sprintf
(
fn
,
".attach_pid%d"
,
os
::
current_process_id
());
int
ret
;
struct
stat64
st
;
RESTARTABLE
(
::
stat64
(
fn
,
&
st
),
ret
);
if
(
ret
==
-
1
)
{
sprintf
(
fn
,
"/tmp/.attach_pid%d"
,
os
::
current_process_id
());
snprintf
(
fn
,
sizeof
(
fn
),
"%s/.attach_pid%d"
,
os
::
get_temp_directory
(),
os
::
current_process_id
());
RESTARTABLE
(
::
stat64
(
fn
,
&
st
),
ret
);
}
if
(
ret
==
0
)
{
...
...
src/os/solaris/vm/os_solaris.cpp
浏览文件 @
9c9bc43d
...
...
@@ -676,15 +676,6 @@ bool os::have_special_privileges() {
}
static
char
*
get_property
(
char
*
name
,
char
*
buffer
,
int
buffer_size
)
{
if
(
os
::
getenv
(
name
,
buffer
,
buffer_size
))
{
return
buffer
;
}
static
char
empty
[]
=
""
;
return
empty
;
}
void
os
::
init_system_properties_values
()
{
char
arch
[
12
];
sysinfo
(
SI_ARCHITECTURE
,
arch
,
sizeof
(
arch
));
...
...
@@ -1826,7 +1817,10 @@ void os::set_error_file(const char *logfile) {}
const
char
*
os
::
dll_file_extension
()
{
return
".so"
;
}
const
char
*
os
::
get_temp_directory
()
{
return
"/tmp/"
;
}
const
char
*
os
::
get_temp_directory
()
{
const
char
*
prop
=
Arguments
::
get_property
(
"java.io.tmpdir"
);
return
prop
==
NULL
?
"/tmp"
:
prop
;
}
static
bool
file_exists
(
const
char
*
filename
)
{
struct
stat
statbuf
;
...
...
src/os/solaris/vm/perfMemory_solaris.cpp
浏览文件 @
9c9bc43d
...
...
@@ -147,11 +147,11 @@ static char* get_user_tmp_dir(const char* user) {
const
char
*
tmpdir
=
os
::
get_temp_directory
();
const
char
*
perfdir
=
PERFDATA_NAME
;
size_t
nbytes
=
strlen
(
tmpdir
)
+
strlen
(
perfdir
)
+
strlen
(
user
)
+
2
;
size_t
nbytes
=
strlen
(
tmpdir
)
+
strlen
(
perfdir
)
+
strlen
(
user
)
+
3
;
char
*
dirname
=
NEW_C_HEAP_ARRAY
(
char
,
nbytes
);
// construct the path name to user specific tmp directory
snprintf
(
dirname
,
nbytes
,
"%s%s_%s"
,
tmpdir
,
perfdir
,
user
);
snprintf
(
dirname
,
nbytes
,
"%s
/
%s_%s"
,
tmpdir
,
perfdir
,
user
);
return
dirname
;
}
...
...
@@ -322,8 +322,9 @@ static char* get_user_name_slow(int vmid, TRAPS) {
}
char
*
usrdir_name
=
NEW_C_HEAP_ARRAY
(
char
,
strlen
(
tmpdirname
)
+
strlen
(
dentry
->
d_name
)
+
1
);
strlen
(
tmpdirname
)
+
strlen
(
dentry
->
d_name
)
+
2
);
strcpy
(
usrdir_name
,
tmpdirname
);
strcat
(
usrdir_name
,
"/"
);
strcat
(
usrdir_name
,
dentry
->
d_name
);
DIR
*
subdirp
=
os
::
opendir
(
usrdir_name
);
...
...
src/os/windows/vm/os_windows.cpp
浏览文件 @
9c9bc43d
...
...
@@ -998,8 +998,9 @@ os::closedir(DIR *dirp)
const
char
*
os
::
dll_file_extension
()
{
return
".dll"
;
}
const
char
*
os
::
get_temp_directory
()
{
const
char
*
os
::
get_temp_directory
()
{
const
char
*
prop
=
Arguments
::
get_property
(
"java.io.tmpdir"
);
if
(
prop
!=
0
)
return
prop
;
static
char
path_buf
[
MAX_PATH
];
if
(
GetTempPath
(
MAX_PATH
,
path_buf
)
>
0
)
return
path_buf
;
...
...
src/os/windows/vm/perfMemory_windows.cpp
浏览文件 @
9c9bc43d
...
...
@@ -149,11 +149,11 @@ static char* get_user_tmp_dir(const char* user) {
const
char
*
tmpdir
=
os
::
get_temp_directory
();
const
char
*
perfdir
=
PERFDATA_NAME
;
size_t
nbytes
=
strlen
(
tmpdir
)
+
strlen
(
perfdir
)
+
strlen
(
user
)
+
2
;
size_t
nbytes
=
strlen
(
tmpdir
)
+
strlen
(
perfdir
)
+
strlen
(
user
)
+
3
;
char
*
dirname
=
NEW_C_HEAP_ARRAY
(
char
,
nbytes
);
// construct the path name to user specific tmp directory
_snprintf
(
dirname
,
nbytes
,
"%s%s_%s"
,
tmpdir
,
perfdir
,
user
);
_snprintf
(
dirname
,
nbytes
,
"%s
\\
%s_%s"
,
tmpdir
,
perfdir
,
user
);
return
dirname
;
}
...
...
@@ -318,8 +318,9 @@ static char* get_user_name_slow(int vmid) {
}
char
*
usrdir_name
=
NEW_C_HEAP_ARRAY
(
char
,
strlen
(
tmpdirname
)
+
strlen
(
dentry
->
d_name
)
+
1
);
strlen
(
tmpdirname
)
+
strlen
(
dentry
->
d_name
)
+
2
);
strcpy
(
usrdir_name
,
tmpdirname
);
strcat
(
usrdir_name
,
"
\\
"
);
strcat
(
usrdir_name
,
dentry
->
d_name
);
DIR
*
subdirp
=
os
::
opendir
(
usrdir_name
);
...
...
src/share/vm/compiler/compileBroker.cpp
浏览文件 @
9c9bc43d
...
...
@@ -1414,9 +1414,14 @@ void CompileBroker::init_compiler_thread_log() {
intx
thread_id
=
os
::
current_thread_id
();
for
(
int
try_temp_dir
=
1
;
try_temp_dir
>=
0
;
try_temp_dir
--
)
{
const
char
*
dir
=
(
try_temp_dir
?
os
::
get_temp_directory
()
:
NULL
);
if
(
dir
==
NULL
)
dir
=
""
;
sprintf
(
fileBuf
,
"%shs_c"
UINTX_FORMAT
"_pid%u.log"
,
dir
,
thread_id
,
os
::
current_process_id
());
if
(
dir
==
NULL
)
{
jio_snprintf
(
fileBuf
,
sizeof
(
fileBuf
),
"hs_c"
UINTX_FORMAT
"_pid%u.log"
,
thread_id
,
os
::
current_process_id
());
}
else
{
jio_snprintf
(
fileBuf
,
sizeof
(
fileBuf
),
"%s%shs_c"
UINTX_FORMAT
"_pid%u.log"
,
dir
,
os
::
file_separator
(),
thread_id
,
os
::
current_process_id
());
}
fp
=
fopen
(
fileBuf
,
"at"
);
if
(
fp
!=
NULL
)
{
file
=
NEW_C_HEAP_ARRAY
(
char
,
strlen
(
fileBuf
)
+
1
);
...
...
src/share/vm/utilities/ostream.cpp
浏览文件 @
9c9bc43d
...
...
@@ -363,7 +363,7 @@ bool defaultStream::has_log_file() {
return
_log_file
!=
NULL
;
}
static
const
char
*
make_log_name
(
const
char
*
log_name
,
const
char
*
force_directory
,
char
*
buf
)
{
static
const
char
*
make_log_name
(
const
char
*
log_name
,
const
char
*
force_directory
)
{
const
char
*
basename
=
log_name
;
char
file_sep
=
os
::
file_separator
()[
0
];
const
char
*
cp
;
...
...
@@ -374,6 +374,27 @@ static const char* make_log_name(const char* log_name, const char* force_directo
}
const
char
*
nametail
=
log_name
;
// Compute buffer length
size_t
buffer_length
;
if
(
force_directory
!=
NULL
)
{
buffer_length
=
strlen
(
force_directory
)
+
strlen
(
os
::
file_separator
())
+
strlen
(
basename
)
+
1
;
}
else
{
buffer_length
=
strlen
(
log_name
)
+
1
;
}
const
char
*
star
=
strchr
(
basename
,
'*'
);
int
star_pos
=
(
star
==
NULL
)
?
-
1
:
(
star
-
nametail
);
char
pid
[
32
];
if
(
star_pos
>=
0
)
{
jio_snprintf
(
pid
,
sizeof
(
pid
),
"%u"
,
os
::
current_process_id
());
buffer_length
+=
strlen
(
pid
);
}
// Create big enough buffer.
char
*
buf
=
NEW_C_HEAP_ARRAY
(
char
,
buffer_length
);
strcpy
(
buf
,
""
);
if
(
force_directory
!=
NULL
)
{
strcat
(
buf
,
force_directory
);
...
...
@@ -381,14 +402,11 @@ static const char* make_log_name(const char* log_name, const char* force_directo
nametail
=
basename
;
// completely skip directory prefix
}
const
char
*
star
=
strchr
(
basename
,
'*'
);
int
star_pos
=
(
star
==
NULL
)
?
-
1
:
(
star
-
nametail
);
if
(
star_pos
>=
0
)
{
// convert foo*bar.log to foo123bar.log
int
buf_pos
=
(
int
)
strlen
(
buf
);
strncpy
(
&
buf
[
buf_pos
],
nametail
,
star_pos
);
s
printf
(
&
buf
[
buf_pos
+
star_pos
],
"%u"
,
os
::
current_process_id
()
);
s
trcpy
(
&
buf
[
buf_pos
+
star_pos
],
pid
);
nametail
+=
star_pos
+
1
;
// skip prefix and star
}
...
...
@@ -399,20 +417,23 @@ static const char* make_log_name(const char* log_name, const char* force_directo
void
defaultStream
::
init_log
()
{
// %%% Need a MutexLocker?
const
char
*
log_name
=
LogFile
!=
NULL
?
LogFile
:
"hotspot.log"
;
char
buf
[
O_BUFLEN
*
2
];
const
char
*
try_name
=
make_log_name
(
log_name
,
NULL
,
buf
);
const
char
*
try_name
=
make_log_name
(
log_name
,
NULL
);
fileStream
*
file
=
new
(
ResourceObj
::
C_HEAP
)
fileStream
(
try_name
);
if
(
!
file
->
is_open
())
{
// Try again to open the file.
char
warnbuf
[
O_BUFLEN
*
2
];
sprintf
(
warnbuf
,
"Warning: Cannot open log file: %s
\n
"
,
try_name
);
jio_snprintf
(
warnbuf
,
sizeof
(
warnbuf
),
"Warning: Cannot open log file: %s
\n
"
,
try_name
);
// Note: This feature is for maintainer use only. No need for L10N.
jio_print
(
warnbuf
);
try_name
=
make_log_name
(
"hs_pid*.log"
,
os
::
get_temp_directory
(),
buf
);
sprintf
(
warnbuf
,
"Warning: Forcing option -XX:LogFile=%s
\n
"
,
try_name
);
FREE_C_HEAP_ARRAY
(
char
,
try_name
);
try_name
=
make_log_name
(
"hs_pid*.log"
,
os
::
get_temp_directory
());
jio_snprintf
(
warnbuf
,
sizeof
(
warnbuf
),
"Warning: Forcing option -XX:LogFile=%s
\n
"
,
try_name
);
jio_print
(
warnbuf
);
delete
file
;
file
=
new
(
ResourceObj
::
C_HEAP
)
fileStream
(
try_name
);
FREE_C_HEAP_ARRAY
(
char
,
try_name
);
}
if
(
file
->
is_open
())
{
_log_file
=
file
;
...
...
src/share/vm/utilities/vmError.cpp
浏览文件 @
9c9bc43d
...
...
@@ -807,8 +807,8 @@ void VMError::report_and_die() {
if
(
fd
==
-
1
)
{
// try temp directory
const
char
*
tmpdir
=
os
::
get_temp_directory
();
jio_snprintf
(
buffer
,
sizeof
(
buffer
),
"%shs_err_pid%u.log"
,
(
tmpdir
?
tmpdir
:
""
),
os
::
current_process_id
());
jio_snprintf
(
buffer
,
sizeof
(
buffer
),
"%s
%s
hs_err_pid%u.log"
,
tmpdir
,
os
::
file_separator
(
),
os
::
current_process_id
());
fd
=
open
(
buffer
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
,
0666
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录