Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
7b8f4d16
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看板
提交
7b8f4d16
编写于
10月 01, 2018
作者:
S
shade
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8211239: Build fails without JFR: empty JFR events signatures mismatch
Reviewed-by: mgronlun, dholmes
上级
8d36b439
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
85 addition
and
92 deletion
+85
-92
src/share/vm/jfr/GenerateJfrFiles.java
src/share/vm/jfr/GenerateJfrFiles.java
+85
-92
未找到文件。
src/share/vm/jfr/GenerateJfrFiles.java
浏览文件 @
7b8f4d16
...
...
@@ -478,6 +478,7 @@ public class GenerateJfrFiles {
out
.
write
(
""
);
out
.
write
(
"#else // !INCLUDE_JFR"
);
out
.
write
(
""
);
out
.
write
(
"template <typename T>"
);
out
.
write
(
"class JfrEvent {"
);
out
.
write
(
" public:"
);
out
.
write
(
" JfrEvent() {}"
);
...
...
@@ -498,103 +499,83 @@ public class GenerateJfrFiles {
private
static
void
printTypes
(
Printer
out
,
Metadata
metadata
,
boolean
empty
)
{
for
(
TypeElement
t
:
metadata
.
getStructs
())
{
if
(
empty
)
{
out
.
write
(
""
);
printEmptyType
(
out
,
t
);
}
else
{
printType
(
out
,
t
);
}
printType
(
out
,
t
,
empty
);
out
.
write
(
""
);
}
for
(
EventElement
e
:
metadata
.
getEvents
())
{
if
(
empty
)
{
printEmptyEvent
(
out
,
e
);
}
else
{
printEvent
(
out
,
e
);
}
printEvent
(
out
,
e
,
empty
);
out
.
write
(
""
);
}
}
private
static
void
printEmptyEvent
(
Printer
out
,
EventElement
event
)
{
out
.
write
(
"class Event"
+
event
.
name
+
" : public JfrEvent"
);
out
.
write
(
"{"
);
out
.
write
(
" public:"
);
out
.
write
(
" Event"
+
event
.
name
+
"(EventStartTime ignore=TIMED) {}"
);
if
(
event
.
startTime
)
{
StringJoiner
sj
=
new
StringJoiner
(
",\n "
);
for
(
FieldElement
f
:
event
.
fields
)
{
sj
.
add
(
f
.
getParameterType
());
}
out
.
write
(
" Event"
+
event
.
name
+
"("
);
out
.
write
(
" "
+
sj
.
toString
()
+
") { }"
);
}
for
(
FieldElement
f
:
event
.
fields
)
{
out
.
write
(
" void set_"
+
f
.
name
+
"("
+
f
.
getParameterType
()
+
") { }"
);
}
out
.
write
(
"};"
);
}
private
static
void
printEmptyType
(
Printer
out
,
TypeElement
t
)
{
private
static
void
printType
(
Printer
out
,
TypeElement
t
,
boolean
empty
)
{
out
.
write
(
"struct JfrStruct"
+
t
.
name
);
out
.
write
(
"{"
);
out
.
write
(
" public:"
);
for
(
FieldElement
f
:
t
.
fields
)
{
out
.
write
(
" void set_"
+
f
.
name
+
"("
+
f
.
getParameterType
()
+
") { }"
);
if
(!
empty
)
{
out
.
write
(
" private:"
);
for
(
FieldElement
f
:
t
.
fields
)
{
printField
(
out
,
f
);
}
out
.
write
(
""
);
}
out
.
write
(
"};"
);
}
private
static
void
printType
(
Printer
out
,
TypeElement
t
)
{
out
.
write
(
"struct JfrStruct"
+
t
.
name
);
out
.
write
(
"{"
);
out
.
write
(
" private:"
);
for
(
FieldElement
f
:
t
.
fields
)
{
printField
(
out
,
f
);
}
out
.
write
(
""
);
out
.
write
(
" public:"
);
for
(
FieldElement
f
:
t
.
fields
)
{
printTypeSetter
(
out
,
f
);
printTypeSetter
(
out
,
f
,
empty
);
}
out
.
write
(
""
);
printWriteData
(
out
,
t
.
fields
);
if
(!
empty
)
{
printWriteData
(
out
,
t
.
fields
);
}
out
.
write
(
"};"
);
out
.
write
(
""
);
}
private
static
void
printEvent
(
Printer
out
,
EventElement
event
)
{
private
static
void
printEvent
(
Printer
out
,
EventElement
event
,
boolean
empty
)
{
out
.
write
(
"class Event"
+
event
.
name
+
" : public JfrEvent<Event"
+
event
.
name
+
">"
);
out
.
write
(
"{"
);
out
.
write
(
" private:"
);
for
(
FieldElement
f
:
event
.
fields
)
{
printField
(
out
,
f
);
if
(!
empty
)
{
out
.
write
(
" private:"
);
for
(
FieldElement
f
:
event
.
fields
)
{
printField
(
out
,
f
);
}
out
.
write
(
""
);
}
out
.
write
(
""
);
out
.
write
(
" public:"
);
out
.
write
(
" static const bool hasThread = "
+
event
.
thread
+
";"
);
out
.
write
(
" static const bool hasStackTrace = "
+
event
.
stackTrace
+
";"
);
out
.
write
(
" static const bool isInstant = "
+
!
event
.
startTime
+
";"
);
out
.
write
(
" static const bool hasCutoff = "
+
event
.
cutoff
+
";"
);
out
.
write
(
" static const bool isRequestable = "
+
event
.
periodic
+
";"
);
out
.
write
(
" static const JfrEventId eventId = Jfr"
+
event
.
name
+
"Event;"
);
out
.
write
(
""
);
out
.
write
(
" Event"
+
event
.
name
+
"(EventStartTime timing=TIMED) : JfrEvent<Event"
+
event
.
name
+
">(timing) {}"
);
if
(!
empty
)
{
out
.
write
(
" static const bool hasThread = "
+
event
.
thread
+
";"
);
out
.
write
(
" static const bool hasStackTrace = "
+
event
.
stackTrace
+
";"
);
out
.
write
(
" static const bool isInstant = "
+
!
event
.
startTime
+
";"
);
out
.
write
(
" static const bool hasCutoff = "
+
event
.
cutoff
+
";"
);
out
.
write
(
" static const bool isRequestable = "
+
event
.
periodic
+
";"
);
out
.
write
(
" static const JfrEventId eventId = Jfr"
+
event
.
name
+
"Event;"
);
out
.
write
(
""
);
}
if
(!
empty
)
{
out
.
write
(
" Event"
+
event
.
name
+
"(EventStartTime timing=TIMED) : JfrEvent<Event"
+
event
.
name
+
">(timing) {}"
);
}
else
{
out
.
write
(
" Event"
+
event
.
name
+
"(EventStartTime timing=TIMED) {}"
);
}
out
.
write
(
""
);
int
index
=
0
;
for
(
FieldElement
f
:
event
.
fields
)
{
out
.
write
(
" void set_"
+
f
.
name
+
"("
+
f
.
getParameterType
()
+
" "
+
f
.
getParameterName
()
+
") {"
);
out
.
write
(
" this->_"
+
f
.
name
+
" = "
+
f
.
getParameterName
()
+
";"
);
out
.
write
(
" DEBUG_ONLY(set_field_bit("
+
index
++
+
"));"
);
if
(!
empty
)
{
out
.
write
(
" this->_"
+
f
.
name
+
" = "
+
f
.
getParameterName
()
+
";"
);
out
.
write
(
" DEBUG_ONLY(set_field_bit("
+
index
++
+
"));"
);
}
out
.
write
(
" }"
);
}
out
.
write
(
""
);
printWriteData
(
out
,
event
.
fields
);
out
.
write
(
""
);
if
(!
empty
)
{
printWriteData
(
out
,
event
.
fields
);
out
.
write
(
""
);
}
out
.
write
(
" using JfrEvent<Event"
+
event
.
name
+
">::commit; // else commit() is hidden by overloaded versions in this class"
);
printConstructor2
(
out
,
event
);
printCommitMethod
(
out
,
event
);
printVerify
(
out
,
event
.
fields
);
printConstructor2
(
out
,
event
,
empty
);
printCommitMethod
(
out
,
event
,
empty
);
if
(!
empty
)
{
printVerify
(
out
,
event
.
fields
);
}
out
.
write
(
"};"
);
}
...
...
@@ -611,8 +592,12 @@ public class GenerateJfrFiles {
out
.
write
(
" }"
);
}
private
static
void
printTypeSetter
(
Printer
out
,
FieldElement
field
)
{
out
.
write
(
" void set_"
+
field
.
name
+
"("
+
field
.
getParameterType
()
+
" new_value) { this->_"
+
field
.
name
+
" = new_value; }"
);
private
static
void
printTypeSetter
(
Printer
out
,
FieldElement
field
,
boolean
empty
)
{
if
(!
empty
)
{
out
.
write
(
" void set_"
+
field
.
name
+
"("
+
field
.
getParameterType
()
+
" new_value) { this->_"
+
field
.
name
+
" = new_value; }"
);
}
else
{
out
.
write
(
" void set_"
+
field
.
name
+
"("
+
field
.
getParameterType
()
+
" new_value) { }"
);
}
}
private
static
void
printVerify
(
Printer
out
,
List
<
FieldElement
>
fields
)
{
...
...
@@ -627,7 +612,7 @@ public class GenerateJfrFiles {
out
.
write
(
"#endif"
);
}
private
static
void
printCommitMethod
(
Printer
out
,
EventElement
event
)
{
private
static
void
printCommitMethod
(
Printer
out
,
EventElement
event
,
boolean
empty
)
{
if
(
event
.
startTime
)
{
StringJoiner
sj
=
new
StringJoiner
(
",\n "
);
for
(
FieldElement
f
:
event
.
fields
)
{
...
...
@@ -635,12 +620,14 @@ public class GenerateJfrFiles {
}
out
.
write
(
""
);
out
.
write
(
" void commit("
+
sj
.
toString
()
+
") {"
);
out
.
write
(
" if (should_commit()) {"
);
for
(
FieldElement
f
:
event
.
fields
)
{
out
.
write
(
" set_"
+
f
.
name
+
"("
+
f
.
name
+
");"
);
if
(!
empty
)
{
out
.
write
(
" if (should_commit()) {"
);
for
(
FieldElement
f
:
event
.
fields
)
{
out
.
write
(
" set_"
+
f
.
name
+
"("
+
f
.
name
+
");"
);
}
out
.
write
(
" commit();"
);
out
.
write
(
" }"
);
}
out
.
write
(
" commit();"
);
out
.
write
(
" }"
);
out
.
write
(
" }"
);
}
out
.
write
(
""
);
...
...
@@ -653,22 +640,24 @@ public class GenerateJfrFiles {
sj
.
add
(
f
.
getParameterType
()
+
" "
+
f
.
name
);
}
out
.
write
(
" static void commit("
+
sj
.
toString
()
+
") {"
);
out
.
write
(
" Event"
+
event
.
name
+
" me(UNTIMED);"
);
out
.
write
(
""
);
out
.
write
(
" if (me.should_commit()) {"
);
if
(
event
.
startTime
)
{
out
.
write
(
" me.set_starttime(startTicks);"
);
out
.
write
(
" me.set_endtime(endTicks);"
);
if
(!
empty
)
{
out
.
write
(
" Event"
+
event
.
name
+
" me(UNTIMED);"
);
out
.
write
(
""
);
out
.
write
(
" if (me.should_commit()) {"
);
if
(
event
.
startTime
)
{
out
.
write
(
" me.set_starttime(startTicks);"
);
out
.
write
(
" me.set_endtime(endTicks);"
);
}
for
(
FieldElement
f
:
event
.
fields
)
{
out
.
write
(
" me.set_"
+
f
.
name
+
"("
+
f
.
name
+
");"
);
}
out
.
write
(
" me.commit();"
);
out
.
write
(
" }"
);
}
for
(
FieldElement
f
:
event
.
fields
)
{
out
.
write
(
" me.set_"
+
f
.
name
+
"("
+
f
.
name
+
");"
);
}
out
.
write
(
" me.commit();"
);
out
.
write
(
" }"
);
out
.
write
(
" }"
);
}
private
static
void
printConstructor2
(
Printer
out
,
EventElement
event
)
{
private
static
void
printConstructor2
(
Printer
out
,
EventElement
event
,
boolean
empty
)
{
if
(!
event
.
startTime
)
{
out
.
write
(
""
);
out
.
write
(
""
);
...
...
@@ -680,12 +669,16 @@ public class GenerateJfrFiles {
for
(
FieldElement
f
:
event
.
fields
)
{
sj
.
add
(
f
.
getParameterType
()
+
" "
+
f
.
name
);
}
out
.
write
(
" "
+
sj
.
toString
()
+
") : JfrEvent<Event"
+
event
.
name
+
">(TIMED) {"
);
out
.
write
(
" if (should_commit()) {"
);
for
(
FieldElement
f
:
event
.
fields
)
{
out
.
write
(
" set_"
+
f
.
name
+
"("
+
f
.
name
+
");"
);
if
(!
empty
)
{
out
.
write
(
" "
+
sj
.
toString
()
+
") : JfrEvent<Event"
+
event
.
name
+
">(TIMED) {"
);
out
.
write
(
" if (should_commit()) {"
);
for
(
FieldElement
f
:
event
.
fields
)
{
out
.
write
(
" set_"
+
f
.
name
+
"("
+
f
.
name
+
");"
);
}
out
.
write
(
" }"
);
}
else
{
out
.
write
(
" "
+
sj
.
toString
()
+
") {"
);
}
out
.
write
(
" }"
);
out
.
write
(
" }"
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录