Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
4b7806bb
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看板
提交
4b7806bb
编写于
1月 23, 2014
作者:
S
sla
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8032250: Add trace event for VM flag changes
Reviewed-by: coleenp, ehelin, egahlin, mgronlun
上级
59a0853d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
73 addition
and
0 deletion
+73
-0
src/share/vm/runtime/globals.cpp
src/share/vm/runtime/globals.cpp
+24
-0
src/share/vm/trace/trace.xml
src/share/vm/trace/trace.xml
+40
-0
src/share/vm/trace/tracetypes.xml
src/share/vm/trace/tracetypes.xml
+9
-0
未找到文件。
src/share/vm/runtime/globals.cpp
浏览文件 @
4b7806bb
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "utilities/ostream.hpp"
#include "utilities/ostream.hpp"
#include "utilities/macros.hpp"
#include "utilities/macros.hpp"
#include "utilities/top.hpp"
#include "utilities/top.hpp"
#include "trace/tracing.hpp"
#if INCLUDE_ALL_GCS
#if INCLUDE_ALL_GCS
#include "gc_implementation/g1/g1_globals.hpp"
#include "gc_implementation/g1/g1_globals.hpp"
#endif // INCLUDE_ALL_GCS
#endif // INCLUDE_ALL_GCS
...
@@ -593,6 +594,17 @@ bool CommandLineFlags::wasSetOnCmdline(const char* name, bool* value) {
...
@@ -593,6 +594,17 @@ bool CommandLineFlags::wasSetOnCmdline(const char* name, bool* value) {
return
true
;
return
true
;
}
}
template
<
class
E
,
class
T
>
static
void
trace_flag_changed
(
const
char
*
name
,
const
T
old_value
,
const
T
new_value
,
const
Flag
::
Flags
origin
)
{
E
e
;
e
.
set_name
(
name
);
e
.
set_old_value
(
old_value
);
e
.
set_new_value
(
new_value
);
e
.
set_origin
(
origin
);
e
.
commit
();
}
bool
CommandLineFlags
::
boolAt
(
char
*
name
,
size_t
len
,
bool
*
value
)
{
bool
CommandLineFlags
::
boolAt
(
char
*
name
,
size_t
len
,
bool
*
value
)
{
Flag
*
result
=
Flag
::
find_flag
(
name
,
len
);
Flag
*
result
=
Flag
::
find_flag
(
name
,
len
);
if
(
result
==
NULL
)
return
false
;
if
(
result
==
NULL
)
return
false
;
...
@@ -606,6 +618,7 @@ bool CommandLineFlags::boolAtPut(char* name, size_t len, bool* value, Flag::Flag
...
@@ -606,6 +618,7 @@ bool CommandLineFlags::boolAtPut(char* name, size_t len, bool* value, Flag::Flag
if
(
result
==
NULL
)
return
false
;
if
(
result
==
NULL
)
return
false
;
if
(
!
result
->
is_bool
())
return
false
;
if
(
!
result
->
is_bool
())
return
false
;
bool
old_value
=
result
->
get_bool
();
bool
old_value
=
result
->
get_bool
();
trace_flag_changed
<
EventBooleanFlagChanged
,
bool
>
(
name
,
old_value
,
*
value
,
origin
);
result
->
set_bool
(
*
value
);
result
->
set_bool
(
*
value
);
*
value
=
old_value
;
*
value
=
old_value
;
result
->
set_origin
(
origin
);
result
->
set_origin
(
origin
);
...
@@ -615,6 +628,7 @@ bool CommandLineFlags::boolAtPut(char* name, size_t len, bool* value, Flag::Flag
...
@@ -615,6 +628,7 @@ bool CommandLineFlags::boolAtPut(char* name, size_t len, bool* value, Flag::Flag
void
CommandLineFlagsEx
::
boolAtPut
(
CommandLineFlagWithType
flag
,
bool
value
,
Flag
::
Flags
origin
)
{
void
CommandLineFlagsEx
::
boolAtPut
(
CommandLineFlagWithType
flag
,
bool
value
,
Flag
::
Flags
origin
)
{
Flag
*
faddr
=
address_of_flag
(
flag
);
Flag
*
faddr
=
address_of_flag
(
flag
);
guarantee
(
faddr
!=
NULL
&&
faddr
->
is_bool
(),
"wrong flag type"
);
guarantee
(
faddr
!=
NULL
&&
faddr
->
is_bool
(),
"wrong flag type"
);
trace_flag_changed
<
EventBooleanFlagChanged
,
bool
>
(
faddr
->
_name
,
faddr
->
get_bool
(),
value
,
origin
);
faddr
->
set_bool
(
value
);
faddr
->
set_bool
(
value
);
faddr
->
set_origin
(
origin
);
faddr
->
set_origin
(
origin
);
}
}
...
@@ -632,6 +646,7 @@ bool CommandLineFlags::intxAtPut(char* name, size_t len, intx* value, Flag::Flag
...
@@ -632,6 +646,7 @@ bool CommandLineFlags::intxAtPut(char* name, size_t len, intx* value, Flag::Flag
if
(
result
==
NULL
)
return
false
;
if
(
result
==
NULL
)
return
false
;
if
(
!
result
->
is_intx
())
return
false
;
if
(
!
result
->
is_intx
())
return
false
;
intx
old_value
=
result
->
get_intx
();
intx
old_value
=
result
->
get_intx
();
trace_flag_changed
<
EventLongFlagChanged
,
s8
>
(
name
,
old_value
,
*
value
,
origin
);
result
->
set_intx
(
*
value
);
result
->
set_intx
(
*
value
);
*
value
=
old_value
;
*
value
=
old_value
;
result
->
set_origin
(
origin
);
result
->
set_origin
(
origin
);
...
@@ -641,6 +656,7 @@ bool CommandLineFlags::intxAtPut(char* name, size_t len, intx* value, Flag::Flag
...
@@ -641,6 +656,7 @@ bool CommandLineFlags::intxAtPut(char* name, size_t len, intx* value, Flag::Flag
void
CommandLineFlagsEx
::
intxAtPut
(
CommandLineFlagWithType
flag
,
intx
value
,
Flag
::
Flags
origin
)
{
void
CommandLineFlagsEx
::
intxAtPut
(
CommandLineFlagWithType
flag
,
intx
value
,
Flag
::
Flags
origin
)
{
Flag
*
faddr
=
address_of_flag
(
flag
);
Flag
*
faddr
=
address_of_flag
(
flag
);
guarantee
(
faddr
!=
NULL
&&
faddr
->
is_intx
(),
"wrong flag type"
);
guarantee
(
faddr
!=
NULL
&&
faddr
->
is_intx
(),
"wrong flag type"
);
trace_flag_changed
<
EventLongFlagChanged
,
s8
>
(
faddr
->
_name
,
faddr
->
get_intx
(),
value
,
origin
);
faddr
->
set_intx
(
value
);
faddr
->
set_intx
(
value
);
faddr
->
set_origin
(
origin
);
faddr
->
set_origin
(
origin
);
}
}
...
@@ -658,6 +674,7 @@ bool CommandLineFlags::uintxAtPut(char* name, size_t len, uintx* value, Flag::Fl
...
@@ -658,6 +674,7 @@ bool CommandLineFlags::uintxAtPut(char* name, size_t len, uintx* value, Flag::Fl
if
(
result
==
NULL
)
return
false
;
if
(
result
==
NULL
)
return
false
;
if
(
!
result
->
is_uintx
())
return
false
;
if
(
!
result
->
is_uintx
())
return
false
;
uintx
old_value
=
result
->
get_uintx
();
uintx
old_value
=
result
->
get_uintx
();
trace_flag_changed
<
EventUnsignedLongFlagChanged
,
u8
>
(
name
,
old_value
,
*
value
,
origin
);
result
->
set_uintx
(
*
value
);
result
->
set_uintx
(
*
value
);
*
value
=
old_value
;
*
value
=
old_value
;
result
->
set_origin
(
origin
);
result
->
set_origin
(
origin
);
...
@@ -667,6 +684,7 @@ bool CommandLineFlags::uintxAtPut(char* name, size_t len, uintx* value, Flag::Fl
...
@@ -667,6 +684,7 @@ bool CommandLineFlags::uintxAtPut(char* name, size_t len, uintx* value, Flag::Fl
void
CommandLineFlagsEx
::
uintxAtPut
(
CommandLineFlagWithType
flag
,
uintx
value
,
Flag
::
Flags
origin
)
{
void
CommandLineFlagsEx
::
uintxAtPut
(
CommandLineFlagWithType
flag
,
uintx
value
,
Flag
::
Flags
origin
)
{
Flag
*
faddr
=
address_of_flag
(
flag
);
Flag
*
faddr
=
address_of_flag
(
flag
);
guarantee
(
faddr
!=
NULL
&&
faddr
->
is_uintx
(),
"wrong flag type"
);
guarantee
(
faddr
!=
NULL
&&
faddr
->
is_uintx
(),
"wrong flag type"
);
trace_flag_changed
<
EventUnsignedLongFlagChanged
,
u8
>
(
faddr
->
_name
,
faddr
->
get_uintx
(),
value
,
origin
);
faddr
->
set_uintx
(
value
);
faddr
->
set_uintx
(
value
);
faddr
->
set_origin
(
origin
);
faddr
->
set_origin
(
origin
);
}
}
...
@@ -684,6 +702,7 @@ bool CommandLineFlags::uint64_tAtPut(char* name, size_t len, uint64_t* value, Fl
...
@@ -684,6 +702,7 @@ bool CommandLineFlags::uint64_tAtPut(char* name, size_t len, uint64_t* value, Fl
if
(
result
==
NULL
)
return
false
;
if
(
result
==
NULL
)
return
false
;
if
(
!
result
->
is_uint64_t
())
return
false
;
if
(
!
result
->
is_uint64_t
())
return
false
;
uint64_t
old_value
=
result
->
get_uint64_t
();
uint64_t
old_value
=
result
->
get_uint64_t
();
trace_flag_changed
<
EventUnsignedLongFlagChanged
,
u8
>
(
name
,
old_value
,
*
value
,
origin
);
result
->
set_uint64_t
(
*
value
);
result
->
set_uint64_t
(
*
value
);
*
value
=
old_value
;
*
value
=
old_value
;
result
->
set_origin
(
origin
);
result
->
set_origin
(
origin
);
...
@@ -693,6 +712,7 @@ bool CommandLineFlags::uint64_tAtPut(char* name, size_t len, uint64_t* value, Fl
...
@@ -693,6 +712,7 @@ bool CommandLineFlags::uint64_tAtPut(char* name, size_t len, uint64_t* value, Fl
void
CommandLineFlagsEx
::
uint64_tAtPut
(
CommandLineFlagWithType
flag
,
uint64_t
value
,
Flag
::
Flags
origin
)
{
void
CommandLineFlagsEx
::
uint64_tAtPut
(
CommandLineFlagWithType
flag
,
uint64_t
value
,
Flag
::
Flags
origin
)
{
Flag
*
faddr
=
address_of_flag
(
flag
);
Flag
*
faddr
=
address_of_flag
(
flag
);
guarantee
(
faddr
!=
NULL
&&
faddr
->
is_uint64_t
(),
"wrong flag type"
);
guarantee
(
faddr
!=
NULL
&&
faddr
->
is_uint64_t
(),
"wrong flag type"
);
trace_flag_changed
<
EventUnsignedLongFlagChanged
,
u8
>
(
faddr
->
_name
,
faddr
->
get_uint64_t
(),
value
,
origin
);
faddr
->
set_uint64_t
(
value
);
faddr
->
set_uint64_t
(
value
);
faddr
->
set_origin
(
origin
);
faddr
->
set_origin
(
origin
);
}
}
...
@@ -710,6 +730,7 @@ bool CommandLineFlags::doubleAtPut(char* name, size_t len, double* value, Flag::
...
@@ -710,6 +730,7 @@ bool CommandLineFlags::doubleAtPut(char* name, size_t len, double* value, Flag::
if
(
result
==
NULL
)
return
false
;
if
(
result
==
NULL
)
return
false
;
if
(
!
result
->
is_double
())
return
false
;
if
(
!
result
->
is_double
())
return
false
;
double
old_value
=
result
->
get_double
();
double
old_value
=
result
->
get_double
();
trace_flag_changed
<
EventDoubleFlagChanged
,
double
>
(
name
,
old_value
,
*
value
,
origin
);
result
->
set_double
(
*
value
);
result
->
set_double
(
*
value
);
*
value
=
old_value
;
*
value
=
old_value
;
result
->
set_origin
(
origin
);
result
->
set_origin
(
origin
);
...
@@ -719,6 +740,7 @@ bool CommandLineFlags::doubleAtPut(char* name, size_t len, double* value, Flag::
...
@@ -719,6 +740,7 @@ bool CommandLineFlags::doubleAtPut(char* name, size_t len, double* value, Flag::
void
CommandLineFlagsEx
::
doubleAtPut
(
CommandLineFlagWithType
flag
,
double
value
,
Flag
::
Flags
origin
)
{
void
CommandLineFlagsEx
::
doubleAtPut
(
CommandLineFlagWithType
flag
,
double
value
,
Flag
::
Flags
origin
)
{
Flag
*
faddr
=
address_of_flag
(
flag
);
Flag
*
faddr
=
address_of_flag
(
flag
);
guarantee
(
faddr
!=
NULL
&&
faddr
->
is_double
(),
"wrong flag type"
);
guarantee
(
faddr
!=
NULL
&&
faddr
->
is_double
(),
"wrong flag type"
);
trace_flag_changed
<
EventDoubleFlagChanged
,
double
>
(
faddr
->
_name
,
faddr
->
get_double
(),
value
,
origin
);
faddr
->
set_double
(
value
);
faddr
->
set_double
(
value
);
faddr
->
set_origin
(
origin
);
faddr
->
set_origin
(
origin
);
}
}
...
@@ -738,6 +760,7 @@ bool CommandLineFlags::ccstrAtPut(char* name, size_t len, ccstr* value, Flag::Fl
...
@@ -738,6 +760,7 @@ bool CommandLineFlags::ccstrAtPut(char* name, size_t len, ccstr* value, Flag::Fl
if
(
result
==
NULL
)
return
false
;
if
(
result
==
NULL
)
return
false
;
if
(
!
result
->
is_ccstr
())
return
false
;
if
(
!
result
->
is_ccstr
())
return
false
;
ccstr
old_value
=
result
->
get_ccstr
();
ccstr
old_value
=
result
->
get_ccstr
();
trace_flag_changed
<
EventStringFlagChanged
,
const
char
*>
(
name
,
old_value
,
*
value
,
origin
);
char
*
new_value
=
NULL
;
char
*
new_value
=
NULL
;
if
(
*
value
!=
NULL
)
{
if
(
*
value
!=
NULL
)
{
new_value
=
NEW_C_HEAP_ARRAY
(
char
,
strlen
(
*
value
)
+
1
,
mtInternal
);
new_value
=
NEW_C_HEAP_ARRAY
(
char
,
strlen
(
*
value
)
+
1
,
mtInternal
);
...
@@ -760,6 +783,7 @@ void CommandLineFlagsEx::ccstrAtPut(CommandLineFlagWithType flag, ccstr value, F
...
@@ -760,6 +783,7 @@ void CommandLineFlagsEx::ccstrAtPut(CommandLineFlagWithType flag, ccstr value, F
Flag
*
faddr
=
address_of_flag
(
flag
);
Flag
*
faddr
=
address_of_flag
(
flag
);
guarantee
(
faddr
!=
NULL
&&
faddr
->
is_ccstr
(),
"wrong flag type"
);
guarantee
(
faddr
!=
NULL
&&
faddr
->
is_ccstr
(),
"wrong flag type"
);
ccstr
old_value
=
faddr
->
get_ccstr
();
ccstr
old_value
=
faddr
->
get_ccstr
();
trace_flag_changed
<
EventStringFlagChanged
,
const
char
*>
(
faddr
->
_name
,
old_value
,
value
,
origin
);
char
*
new_value
=
NEW_C_HEAP_ARRAY
(
char
,
strlen
(
value
)
+
1
,
mtInternal
);
char
*
new_value
=
NEW_C_HEAP_ARRAY
(
char
,
strlen
(
value
)
+
1
,
mtInternal
);
strcpy
(
new_value
,
value
);
strcpy
(
new_value
,
value
);
faddr
->
set_ccstr
(
new_value
);
faddr
->
set_ccstr
(
new_value
);
...
...
src/share/vm/trace/trace.xml
浏览文件 @
4b7806bb
...
@@ -122,6 +122,46 @@ Declares a structure type that can be used in other events.
...
@@ -122,6 +122,46 @@ Declares a structure type that can be used in other events.
<value
type=
"CLASS"
field=
"definingClassLoader"
label=
"Defining Class Loader"
/>
<value
type=
"CLASS"
field=
"definingClassLoader"
label=
"Defining Class Loader"
/>
</event>
</event>
<event
id=
"LongFlagChanged"
path=
"vm/flag/long_changed"
label=
"Long Flag Changed"
is_instant=
"true"
>
<value
type=
"UTF8"
field=
"name"
label=
"Name"
/>
<value
type=
"LONG"
field=
"old_value"
label=
"Old Value"
/>
<value
type=
"LONG"
field=
"new_value"
label=
"New Value"
/>
<value
type=
"FLAGVALUEORIGIN"
field=
"origin"
label=
"Origin"
/>
</event>
<event
id=
"UnsignedLongFlagChanged"
path=
"vm/flag/ulong_changed"
label=
"Unsigned Long Flag Changed"
is_instant=
"true"
>
<value
type=
"UTF8"
field=
"name"
label=
"Name"
/>
<value
type=
"ULONG"
field=
"old_value"
label=
"Old Value"
/>
<value
type=
"ULONG"
field=
"new_value"
label=
"New Value"
/>
<value
type=
"FLAGVALUEORIGIN"
field=
"origin"
label=
"Origin"
/>
</event>
<event
id=
"DoubleFlagChanged"
path=
"vm/flag/double_changed"
label=
"Double Flag Changed"
is_instant=
"true"
>
<value
type=
"UTF8"
field=
"name"
label=
"Name"
/>
<value
type=
"DOUBLE"
field=
"old_value"
label=
"Old Value"
/>
<value
type=
"DOUBLE"
field=
"new_value"
label=
"New Value"
/>
<value
type=
"FLAGVALUEORIGIN"
field=
"origin"
label=
"Origin"
/>
</event>
<event
id=
"BooleanFlagChanged"
path=
"vm/flag/boolean_changed"
label=
"Boolean Flag Changed"
is_instant=
"true"
>
<value
type=
"UTF8"
field=
"name"
label=
"Name"
/>
<value
type=
"BOOLEAN"
field=
"old_value"
label=
"Old Value"
/>
<value
type=
"BOOLEAN"
field=
"new_value"
label=
"New Value"
/>
<value
type=
"FLAGVALUEORIGIN"
field=
"origin"
label=
"Origin"
/>
</event>
<event
id=
"StringFlagChanged"
path=
"vm/flag/string_changed"
label=
"String Flag Changed"
is_instant=
"true"
>
<value
type=
"UTF8"
field=
"name"
label=
"Name"
/>
<value
type=
"UTF8"
field=
"old_value"
label=
"Old Value"
/>
<value
type=
"UTF8"
field=
"new_value"
label=
"New Value"
/>
<value
type=
"FLAGVALUEORIGIN"
field=
"origin"
label=
"Origin"
/>
</event>
<struct
id=
"VirtualSpace"
>
<struct
id=
"VirtualSpace"
>
<value
type=
"ADDRESS"
field=
"start"
label=
"Start Address"
description=
"Start address of the virtual space"
/>
<value
type=
"ADDRESS"
field=
"start"
label=
"Start Address"
description=
"Start address of the virtual space"
/>
<value
type=
"ADDRESS"
field=
"committedEnd"
label=
"Committed End Address"
description=
"End address of the committed memory for the virtual space"
/>
<value
type=
"ADDRESS"
field=
"committedEnd"
label=
"Committed End Address"
description=
"End address of the committed memory for the virtual space"
/>
...
...
src/share/vm/trace/tracetypes.xml
浏览文件 @
4b7806bb
...
@@ -150,6 +150,11 @@ Now we can use the content + data type in declaring event fields.
...
@@ -150,6 +150,11 @@ Now we can use the content + data type in declaring event fields.
<value
type=
"UTF8"
field=
"phase"
label=
"phase"
/>
<value
type=
"UTF8"
field=
"phase"
label=
"phase"
/>
</content_type>
</content_type>
<content_type
id=
"FlagValueOrigin"
hr_name=
"Flag Value Origin"
type=
"U1"
jvm_type=
"FLAGVALUEORIGIN"
>
<value
type=
"UTF8"
field=
"origin"
label=
"origin"
/>
</content_type>
</content_types>
</content_types>
...
@@ -334,6 +339,10 @@ Now we can use the content + data type in declaring event fields.
...
@@ -334,6 +339,10 @@ Now we can use the content + data type in declaring event fields.
<!-- VMOPERATIONTYPE -->
<!-- VMOPERATIONTYPE -->
<primary_type
symbol=
"VMOPERATIONTYPE"
datatype=
"U2"
contenttype=
"VMOPERATIONTYPE"
<primary_type
symbol=
"VMOPERATIONTYPE"
datatype=
"U2"
contenttype=
"VMOPERATIONTYPE"
type=
"u2"
sizeop=
"sizeof(u2)"
/>
type=
"u2"
sizeop=
"sizeof(u2)"
/>
<!-- FLAGVALUEORIGIN -->
<primary_type
symbol=
"FLAGVALUEORIGIN"
datatype=
"U1"
contenttype=
"FLAGVALUEORIGIN"
type=
"u1"
sizeop=
"sizeof(u1)"
/>
</primary_types>
</primary_types>
</types>
</types>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录