Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
c150c15d
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c150c15d
编写于
6月 02, 2010
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6950927: Testcase failure sun/management/jmxremote/bootstrap/JvmstatCountersTest.java
Reviewed-by: dholmes, dcubed
上级
7dd1dbb8
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
19 addition
and
17 deletion
+19
-17
src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java
...solaris/classes/sun/tools/attach/LinuxVirtualMachine.java
+9
-11
src/solaris/classes/sun/tools/attach/SolarisVirtualMachine.java
...laris/classes/sun/tools/attach/SolarisVirtualMachine.java
+10
-6
未找到文件。
src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java
浏览文件 @
c150c15d
...
@@ -37,6 +37,8 @@ import java.util.Properties;
...
@@ -37,6 +37,8 @@ import java.util.Properties;
* Linux implementation of HotSpotVirtualMachine
* Linux implementation of HotSpotVirtualMachine
*/
*/
public
class
LinuxVirtualMachine
extends
HotSpotVirtualMachine
{
public
class
LinuxVirtualMachine
extends
HotSpotVirtualMachine
{
// temp directory for socket file
private
static
final
String
tmpdir
=
System
.
getProperty
(
"java.io.tmpdir"
);
// Indicates if this machine uses the old LinuxThreads
// Indicates if this machine uses the old LinuxThreads
static
boolean
isLinuxThreads
;
static
boolean
isLinuxThreads
;
...
@@ -260,7 +262,7 @@ public class LinuxVirtualMachine extends HotSpotVirtualMachine {
...
@@ -260,7 +262,7 @@ public class LinuxVirtualMachine extends HotSpotVirtualMachine {
// Return the socket file for the given process.
// Return the socket file for the given process.
// Checks working directory of process for .java_pid<pid>. If not
// Checks working directory of process for .java_pid<pid>. If not
// found it looks in
/tmp
.
// found it looks in
temp directory
.
private
String
findSocketFile
(
int
pid
)
{
private
String
findSocketFile
(
int
pid
)
{
// First check for a .java_pid<pid> file in the working directory
// First check for a .java_pid<pid> file in the working directory
// of the target process
// of the target process
...
@@ -268,20 +270,17 @@ public class LinuxVirtualMachine extends HotSpotVirtualMachine {
...
@@ -268,20 +270,17 @@ public class LinuxVirtualMachine extends HotSpotVirtualMachine {
String
path
=
"/proc/"
+
pid
+
"/cwd/"
+
fn
;
String
path
=
"/proc/"
+
pid
+
"/cwd/"
+
fn
;
File
f
=
new
File
(
path
);
File
f
=
new
File
(
path
);
if
(!
f
.
exists
())
{
if
(!
f
.
exists
())
{
// Not found, so try /tmp
// Not found, so try temp directory
path
=
"/tmp/"
+
fn
;
f
=
new
File
(
tmpdir
,
fn
);
f
=
new
File
(
path
);
path
=
f
.
exists
()
?
f
.
getPath
()
:
null
;
if
(!
f
.
exists
())
{
return
null
;
// not found
}
}
}
return
path
;
return
path
;
}
}
// On Solaris/Linux a simple handshake is used to start the attach mechanism
// On Solaris/Linux a simple handshake is used to start the attach mechanism
// if not already started. The client creates a .attach_pid<pid> file in the
// if not already started. The client creates a .attach_pid<pid> file in the
// target VM's working directory (or
/tmp), and the SIGQUIT handler checks
// target VM's working directory (or
temp directory), and the SIGQUIT handler
// for the file.
//
checks
for the file.
private
File
createAttachFile
(
int
pid
)
throws
IOException
{
private
File
createAttachFile
(
int
pid
)
throws
IOException
{
String
fn
=
".attach_pid"
+
pid
;
String
fn
=
".attach_pid"
+
pid
;
String
path
=
"/proc/"
+
pid
+
"/cwd/"
+
fn
;
String
path
=
"/proc/"
+
pid
+
"/cwd/"
+
fn
;
...
@@ -289,8 +288,7 @@ public class LinuxVirtualMachine extends HotSpotVirtualMachine {
...
@@ -289,8 +288,7 @@ public class LinuxVirtualMachine extends HotSpotVirtualMachine {
try
{
try
{
f
.
createNewFile
();
f
.
createNewFile
();
}
catch
(
IOException
x
)
{
}
catch
(
IOException
x
)
{
path
=
"/tmp/"
+
fn
;
f
=
new
File
(
tmpdir
,
fn
);
f
=
new
File
(
path
);
f
.
createNewFile
();
f
.
createNewFile
();
}
}
return
f
;
return
f
;
...
...
src/solaris/classes/sun/tools/attach/SolarisVirtualMachine.java
浏览文件 @
c150c15d
...
@@ -38,6 +38,11 @@ import java.util.Properties;
...
@@ -38,6 +38,11 @@ import java.util.Properties;
* Solaris implementation of HotSpotVirtualMachine.
* Solaris implementation of HotSpotVirtualMachine.
*/
*/
public
class
SolarisVirtualMachine
extends
HotSpotVirtualMachine
{
public
class
SolarisVirtualMachine
extends
HotSpotVirtualMachine
{
// Use /tmp instead of /var/tmp on Solaris as /tmp is the default used by
// HotSpot when the property is not set on the command line.
private
static
final
String
tmpdir1
=
System
.
getProperty
(
"java.io.tmpdir"
);
private
static
final
String
tmpdir
=
(
tmpdir1
.
equals
(
"/var/tmp"
)
||
tmpdir1
.
equals
(
"/var/tmp/"
))
?
"/tmp"
:
tmpdir1
;
// door descriptor;
// door descriptor;
private
int
fd
=
-
1
;
private
int
fd
=
-
1
;
...
@@ -187,7 +192,7 @@ public class SolarisVirtualMachine extends HotSpotVirtualMachine {
...
@@ -187,7 +192,7 @@ public class SolarisVirtualMachine extends HotSpotVirtualMachine {
}
}
// The door is attached to .java_pid<pid> in the target VM's working
// The door is attached to .java_pid<pid> in the target VM's working
// directory or
/tmp
.
// directory or
temporary directory
.
private
int
openDoor
(
int
pid
)
throws
IOException
{
private
int
openDoor
(
int
pid
)
throws
IOException
{
// First check for a .java_pid<pid> file in the working directory
// First check for a .java_pid<pid> file in the working directory
// of the target process
// of the target process
...
@@ -196,7 +201,7 @@ public class SolarisVirtualMachine extends HotSpotVirtualMachine {
...
@@ -196,7 +201,7 @@ public class SolarisVirtualMachine extends HotSpotVirtualMachine {
try
{
try
{
fd
=
open
(
path
);
fd
=
open
(
path
);
}
catch
(
FileNotFoundException
fnf
)
{
}
catch
(
FileNotFoundException
fnf
)
{
path
=
"/tmp
/"
+
fn
;
path
=
tmpdir
+
"
/"
+
fn
;
fd
=
open
(
path
);
fd
=
open
(
path
);
}
}
...
@@ -213,8 +218,8 @@ public class SolarisVirtualMachine extends HotSpotVirtualMachine {
...
@@ -213,8 +218,8 @@ public class SolarisVirtualMachine extends HotSpotVirtualMachine {
// On Solaris/Linux a simple handshake is used to start the attach mechanism
// On Solaris/Linux a simple handshake is used to start the attach mechanism
// if not already started. The client creates a .attach_pid<pid> file in the
// if not already started. The client creates a .attach_pid<pid> file in the
// target VM's working directory (or
/tmp), and the SIGQUIT handler checks
// target VM's working directory (or
temporary directory), and the SIGQUIT
// for the file.
//
handler checks
for the file.
private
File
createAttachFile
(
int
pid
)
throws
IOException
{
private
File
createAttachFile
(
int
pid
)
throws
IOException
{
String
fn
=
".attach_pid"
+
pid
;
String
fn
=
".attach_pid"
+
pid
;
String
path
=
"/proc/"
+
pid
+
"/cwd/"
+
fn
;
String
path
=
"/proc/"
+
pid
+
"/cwd/"
+
fn
;
...
@@ -222,8 +227,7 @@ public class SolarisVirtualMachine extends HotSpotVirtualMachine {
...
@@ -222,8 +227,7 @@ public class SolarisVirtualMachine extends HotSpotVirtualMachine {
try
{
try
{
f
.
createNewFile
();
f
.
createNewFile
();
}
catch
(
IOException
x
)
{
}
catch
(
IOException
x
)
{
path
=
"/tmp/"
+
fn
;
f
=
new
File
(
tmpdir
,
fn
);
f
=
new
File
(
path
);
f
.
createNewFile
();
f
.
createNewFile
();
}
}
return
f
;
return
f
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录