Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
14612e0c
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看板
提交
14612e0c
编写于
2月 22, 2012
作者:
D
dsamersoff
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
03902729
99ee1432
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
271 addition
and
3 deletion
+271
-3
src/share/vm/classfile/vmSymbols.hpp
src/share/vm/classfile/vmSymbols.hpp
+4
-1
src/share/vm/services/diagnosticCommand.cpp
src/share/vm/services/diagnosticCommand.cpp
+188
-1
src/share/vm/services/diagnosticCommand.hpp
src/share/vm/services/diagnosticCommand.hpp
+79
-1
未找到文件。
src/share/vm/classfile/vmSymbols.hpp
浏览文件 @
14612e0c
/*
* Copyright (c) 1997, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -509,6 +509,9 @@
template(clear_name, "clear") \
template(trigger_method_signature, "(ILjava/lang/management/MemoryUsage;)V") \
template(startAgent_name, "startAgent") \
template(startRemoteAgent_name, "startRemoteManagementAgent") \
template(startLocalAgent_name, "startLocalManagementAgent") \
template(stopRemoteAgent_name, "stopRemoteManagementAgent") \
template(java_lang_management_ThreadInfo_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;)V") \
template(java_lang_management_ThreadInfo_with_locks_constructor_signature, "(Ljava/lang/Thread;ILjava/lang/Object;Ljava/lang/Thread;JJJJ[Ljava/lang/StackTraceElement;[Ljava/lang/Object;[I[Ljava/lang/Object;)V") \
template(long_long_long_long_void_signature, "(JJJJ)V") \
...
...
src/share/vm/services/diagnosticCommand.cpp
浏览文件 @
14612e0c
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -49,6 +49,11 @@ void DCmdRegistrant::register_dcmds(){
DCmdFactory
::
register_DCmdFactory
(
new
DCmdFactoryImpl
<
ClassHistogramDCmd
>
(
true
,
false
));
DCmdFactory
::
register_DCmdFactory
(
new
DCmdFactoryImpl
<
ThreadDumpDCmd
>
(
true
,
false
));
//Enhanced JMX Agent Support
DCmdFactory
::
register_DCmdFactory
(
new
DCmdFactoryImpl
<
JMXStartRemoteDCmd
>
(
true
,
false
));
DCmdFactory
::
register_DCmdFactory
(
new
DCmdFactoryImpl
<
JMXStartLocalDCmd
>
(
true
,
false
));
DCmdFactory
::
register_DCmdFactory
(
new
DCmdFactoryImpl
<
JMXStopRemoteDCmd
>
(
true
,
false
));
}
#ifndef HAVE_EXTRA_DCMD
...
...
@@ -344,3 +349,185 @@ int ThreadDumpDCmd::num_arguments() {
return
0
;
}
}
// Enhanced JMX Agent support
JMXStartRemoteDCmd
::
JMXStartRemoteDCmd
(
outputStream
*
output
,
bool
heap_allocated
)
:
DCmdWithParser
(
output
,
heap_allocated
),
_config_file
(
"config.file"
,
"set com.sun.management.config.file"
,
"STRING"
,
false
),
_jmxremote_port
(
"jmxremote.port"
,
"set com.sun.management.jmxremote.port"
,
"STRING"
,
false
),
_jmxremote_rmi_port
(
"jmxremote.rmi.port"
,
"set com.sun.management.jmxremote.rmi.port"
,
"STRING"
,
false
),
_jmxremote_ssl
(
"jmxremote.ssl"
,
"set com.sun.management.jmxremote.ssl"
,
"STRING"
,
false
),
_jmxremote_registry_ssl
(
"jmxremote.registry.ssl"
,
"set com.sun.management.jmxremote.registry.ssl"
,
"STRING"
,
false
),
_jmxremote_authenticate
(
"jmxremote.authenticate"
,
"set com.sun.management.jmxremote.authenticate"
,
"STRING"
,
false
),
_jmxremote_password_file
(
"jmxremote.password.file"
,
"set com.sun.management.jmxremote.password.file"
,
"STRING"
,
false
),
_jmxremote_access_file
(
"jmxremote.access.file"
,
"set com.sun.management.jmxremote.access.file"
,
"STRING"
,
false
),
_jmxremote_login_config
(
"jmxremote.login.config"
,
"set com.sun.management.jmxremote.login.config"
,
"STRING"
,
false
),
_jmxremote_ssl_enabled_cipher_suites
(
"jmxremote.ssl.enabled.cipher.suites"
,
"set com.sun.management.jmxremote.ssl.enabled.cipher.suite"
,
"STRING"
,
false
),
_jmxremote_ssl_enabled_protocols
(
"jmxremote.ssl.enabled.protocols"
,
"set com.sun.management.jmxremote.ssl.enabled.protocols"
,
"STRING"
,
false
),
_jmxremote_ssl_need_client_auth
(
"jmxremote.ssl.need.client.auth"
,
"set com.sun.management.jmxremote.need.client.auth"
,
"STRING"
,
false
),
_jmxremote_ssl_config_file
(
"jmxremote.ssl.config.file"
,
"set com.sun.management.jmxremote.ssl_config_file"
,
"STRING"
,
false
)
{
_dcmdparser
.
add_dcmd_option
(
&
_config_file
);
_dcmdparser
.
add_dcmd_option
(
&
_jmxremote_port
);
_dcmdparser
.
add_dcmd_option
(
&
_jmxremote_rmi_port
);
_dcmdparser
.
add_dcmd_option
(
&
_jmxremote_ssl
);
_dcmdparser
.
add_dcmd_option
(
&
_jmxremote_registry_ssl
);
_dcmdparser
.
add_dcmd_option
(
&
_jmxremote_authenticate
);
_dcmdparser
.
add_dcmd_option
(
&
_jmxremote_password_file
);
_dcmdparser
.
add_dcmd_option
(
&
_jmxremote_access_file
);
_dcmdparser
.
add_dcmd_option
(
&
_jmxremote_login_config
);
_dcmdparser
.
add_dcmd_option
(
&
_jmxremote_ssl_enabled_cipher_suites
);
_dcmdparser
.
add_dcmd_option
(
&
_jmxremote_ssl_enabled_protocols
);
_dcmdparser
.
add_dcmd_option
(
&
_jmxremote_ssl_need_client_auth
);
_dcmdparser
.
add_dcmd_option
(
&
_jmxremote_ssl_config_file
);
}
int
JMXStartRemoteDCmd
::
num_arguments
()
{
ResourceMark
rm
;
JMXStartRemoteDCmd
*
dcmd
=
new
JMXStartRemoteDCmd
(
NULL
,
false
);
if
(
dcmd
!=
NULL
)
{
DCmdMark
mark
(
dcmd
);
return
dcmd
->
_dcmdparser
.
num_arguments
();
}
else
{
return
0
;
}
}
void
JMXStartRemoteDCmd
::
execute
(
TRAPS
)
{
ResourceMark
rm
(
THREAD
);
HandleMark
hm
(
THREAD
);
// Load and initialize the sun.management.Agent class
// invoke startRemoteManagementAgent(string) method to start
// the remote management server.
// throw java.lang.NoSuchMethodError if the method doesn't exist
Handle
loader
=
Handle
(
THREAD
,
SystemDictionary
::
java_system_loader
());
klassOop
k
=
SystemDictionary
::
resolve_or_fail
(
vmSymbols
::
sun_management_Agent
(),
loader
,
Handle
(),
true
,
CHECK
);
instanceKlassHandle
ik
(
THREAD
,
k
);
JavaValue
result
(
T_VOID
);
// Pass all command line arguments to java as key=value,...
// All checks are done on java side
int
len
=
0
;
stringStream
options
;
char
comma
[
2
]
=
{
0
,
0
};
// Leave default values on Agent.class side and pass only
// agruments explicitly set by user. All arguments passed
// to jcmd override properties with the same name set by
// command line with -D or by managmenent.properties
// file.
#define PUT_OPTION(a) \
if ( (a).is_set() ){ \
options.print("%scom.sun.management.%s=%s", comma, (a).name(), (a).value()); \
comma[0] = ','; \
}
PUT_OPTION
(
_config_file
);
PUT_OPTION
(
_jmxremote_port
);
PUT_OPTION
(
_jmxremote_rmi_port
);
PUT_OPTION
(
_jmxremote_ssl
);
PUT_OPTION
(
_jmxremote_registry_ssl
);
PUT_OPTION
(
_jmxremote_authenticate
);
PUT_OPTION
(
_jmxremote_password_file
);
PUT_OPTION
(
_jmxremote_access_file
);
PUT_OPTION
(
_jmxremote_login_config
);
PUT_OPTION
(
_jmxremote_ssl_enabled_cipher_suites
);
PUT_OPTION
(
_jmxremote_ssl_enabled_protocols
);
PUT_OPTION
(
_jmxremote_ssl_need_client_auth
);
PUT_OPTION
(
_jmxremote_ssl_config_file
);
#undef PUT_OPTION
Handle
str
=
java_lang_String
::
create_from_str
(
options
.
as_string
(),
CHECK
);
JavaCalls
::
call_static
(
&
result
,
ik
,
vmSymbols
::
startRemoteAgent_name
(),
vmSymbols
::
string_void_signature
(),
str
,
CHECK
);
}
JMXStartLocalDCmd
::
JMXStartLocalDCmd
(
outputStream
*
output
,
bool
heap_allocated
)
:
DCmd
(
output
,
heap_allocated
)
{
// do nothing
}
void
JMXStartLocalDCmd
::
execute
(
TRAPS
)
{
ResourceMark
rm
(
THREAD
);
HandleMark
hm
(
THREAD
);
// Load and initialize the sun.management.Agent class
// invoke startLocalManagementAgent(void) method to start
// the local management server
// throw java.lang.NoSuchMethodError if method doesn't exist
Handle
loader
=
Handle
(
THREAD
,
SystemDictionary
::
java_system_loader
());
klassOop
k
=
SystemDictionary
::
resolve_or_fail
(
vmSymbols
::
sun_management_Agent
(),
loader
,
Handle
(),
true
,
CHECK
);
instanceKlassHandle
ik
(
THREAD
,
k
);
JavaValue
result
(
T_VOID
);
JavaCalls
::
call_static
(
&
result
,
ik
,
vmSymbols
::
startLocalAgent_name
(),
vmSymbols
::
void_method_signature
(),
CHECK
);
}
void
JMXStopRemoteDCmd
::
execute
(
TRAPS
)
{
ResourceMark
rm
(
THREAD
);
HandleMark
hm
(
THREAD
);
// Load and initialize the sun.management.Agent class
// invoke stopRemoteManagementAgent method to stop the
// management server
// throw java.lang.NoSuchMethodError if method doesn't exist
Handle
loader
=
Handle
(
THREAD
,
SystemDictionary
::
java_system_loader
());
klassOop
k
=
SystemDictionary
::
resolve_or_fail
(
vmSymbols
::
sun_management_Agent
(),
loader
,
Handle
(),
true
,
CHECK
);
instanceKlassHandle
ik
(
THREAD
,
k
);
JavaValue
result
(
T_VOID
);
JavaCalls
::
call_static
(
&
result
,
ik
,
vmSymbols
::
stopRemoteAgent_name
(),
vmSymbols
::
void_method_signature
(),
CHECK
);
}
src/share/vm/services/diagnosticCommand.hpp
浏览文件 @
14612e0c
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011,
2012,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -214,4 +214,82 @@ public:
virtual
void
execute
(
TRAPS
);
};
// Enhanced JMX Agent support
class
JMXStartRemoteDCmd
:
public
DCmdWithParser
{
// Explicitly list all properties that could be
// passed to Agent.startRemoteManagementAgent()
// com.sun.management is omitted
DCmdArgument
<
char
*>
_config_file
;
DCmdArgument
<
char
*>
_jmxremote_port
;
DCmdArgument
<
char
*>
_jmxremote_rmi_port
;
DCmdArgument
<
char
*>
_jmxremote_ssl
;
DCmdArgument
<
char
*>
_jmxremote_registry_ssl
;
DCmdArgument
<
char
*>
_jmxremote_authenticate
;
DCmdArgument
<
char
*>
_jmxremote_password_file
;
DCmdArgument
<
char
*>
_jmxremote_access_file
;
DCmdArgument
<
char
*>
_jmxremote_login_config
;
DCmdArgument
<
char
*>
_jmxremote_ssl_enabled_cipher_suites
;
DCmdArgument
<
char
*>
_jmxremote_ssl_enabled_protocols
;
DCmdArgument
<
char
*>
_jmxremote_ssl_need_client_auth
;
DCmdArgument
<
char
*>
_jmxremote_ssl_config_file
;
public:
JMXStartRemoteDCmd
(
outputStream
*
output
,
bool
heap_allocated
);
static
const
char
*
name
()
{
return
"ManagementAgent.start"
;
}
static
const
char
*
description
()
{
return
"Start remote management agent."
;
}
static
int
num_arguments
();
virtual
void
execute
(
TRAPS
);
};
class
JMXStartLocalDCmd
:
public
DCmd
{
// Explicitly request start of local agent,
// it will not be started by start dcmd
public:
JMXStartLocalDCmd
(
outputStream
*
output
,
bool
heap_allocated
);
static
const
char
*
name
()
{
return
"ManagementAgent.start_local"
;
}
static
const
char
*
description
()
{
return
"Start local management agent."
;
}
virtual
void
execute
(
TRAPS
);
};
class
JMXStopRemoteDCmd
:
public
DCmd
{
public:
JMXStopRemoteDCmd
(
outputStream
*
output
,
bool
heap_allocated
)
:
DCmd
(
output
,
heap_allocated
)
{
// Do Nothing
}
static
const
char
*
name
()
{
return
"ManagementAgent.stop"
;
}
static
const
char
*
description
()
{
return
"Stop remote management agent."
;
}
virtual
void
execute
(
TRAPS
);
};
#endif // SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录