Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
967ad215
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看板
提交
967ad215
编写于
1月 17, 2020
作者:
E
egahlin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8209960: -Xlog:jfr* doesn't work with the JFR
Reviewed-by: mgronlun
上级
f5480510
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
31 addition
and
30 deletion
+31
-30
src/share/classes/jdk/jfr/internal/JVMSupport.java
src/share/classes/jdk/jfr/internal/JVMSupport.java
+3
-0
src/share/classes/jdk/jfr/internal/LogTag.java
src/share/classes/jdk/jfr/internal/LogTag.java
+1
-9
src/share/classes/jdk/jfr/internal/Logger.java
src/share/classes/jdk/jfr/internal/Logger.java
+13
-2
src/share/classes/jdk/jfr/internal/MetadataReader.java
src/share/classes/jdk/jfr/internal/MetadataReader.java
+1
-1
src/share/classes/jdk/jfr/internal/PlatformRecording.java
src/share/classes/jdk/jfr/internal/PlatformRecording.java
+1
-1
src/share/classes/jdk/jfr/internal/SettingsManager.java
src/share/classes/jdk/jfr/internal/SettingsManager.java
+3
-3
src/share/classes/jdk/jfr/internal/Type.java
src/share/classes/jdk/jfr/internal/Type.java
+2
-2
src/share/classes/jdk/jfr/internal/TypeLibrary.java
src/share/classes/jdk/jfr/internal/TypeLibrary.java
+2
-2
src/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java
src/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java
+1
-1
src/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java
src/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java
+1
-1
src/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java
src/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java
+1
-1
src/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java
src/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java
+1
-6
src/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java
src/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java
+1
-1
未找到文件。
src/share/classes/jdk/jfr/internal/JVMSupport.java
浏览文件 @
967ad215
...
...
@@ -80,4 +80,7 @@ public final class JVMSupport {
public
static
boolean
isNotAvailable
()
{
return
notAvailable
;
}
public
static
void
tryToInitializeJVM
()
{
}
}
src/share/classes/jdk/jfr/internal/LogTag.java
浏览文件 @
967ad215
...
...
@@ -80,19 +80,11 @@ public enum LogTag {
JFR_DCMD
(
10
);
/* set from native side */
private
volatile
int
tagSetLevel
=
100
;
// prevent logging if JVM log system has not been initialized
volatile
int
tagSetLevel
=
100
;
// prevent logging if JVM log system has not been initialized
final
int
id
;
LogTag
(
int
tagId
)
{
id
=
tagId
;
}
public
boolean
shouldLog
(
int
level
)
{
return
true
;
// XXX level >= tagSetLevel;
}
public
boolean
shouldLog
(
LogLevel
logLevel
)
{
return
shouldLog
(
logLevel
.
level
);
}
}
src/share/classes/jdk/jfr/internal/Logger.java
浏览文件 @
967ad215
...
...
@@ -35,15 +35,20 @@ import java.util.function.Supplier;
public
final
class
Logger
{
private
final
static
int
MAX_SIZE
=
10000
;
static
{
// This will try to initialize the JVM logging system
JVMSupport
.
tryToInitializeJVM
();
}
public
static
void
log
(
LogTag
logTag
,
LogLevel
logLevel
,
String
message
)
{
if
(
logTag
.
shouldLog
(
logLevel
.
l
evel
))
{
if
(
shouldLog
(
logTag
,
logL
evel
))
{
logInternal
(
logTag
,
logLevel
,
message
);
}
}
public
static
void
log
(
LogTag
logTag
,
LogLevel
logLevel
,
Supplier
<
String
>
messageSupplier
)
{
if
(
logTag
.
shouldLog
(
logLevel
.
l
evel
))
{
if
(
shouldLog
(
logTag
,
logL
evel
))
{
logInternal
(
logTag
,
logLevel
,
messageSupplier
.
get
());
}
}
...
...
@@ -55,4 +60,10 @@ public final class Logger {
JVM
.
log
(
logTag
.
id
,
logLevel
.
level
,
message
.
substring
(
0
,
MAX_SIZE
));
}
}
public
static
boolean
shouldLog
(
LogTag
tag
,
LogLevel
level
)
{
// Logging level is not initialized because of lack of Xlog support in jdk8,
// so this method returns true directly now.
return
true
;
// TODO: level.level >= tag.tagSetLevel;
}
}
src/share/classes/jdk/jfr/internal/MetadataReader.java
浏览文件 @
967ad215
...
...
@@ -79,7 +79,7 @@ final class MetadataReader {
descriptor
.
gmtOffset
=
time
.
attribute
(
MetadataDescriptor
.
ATTRIBUTE_GMT_OFFSET
,
1
);
descriptor
.
locale
=
time
.
attribute
(
MetadataDescriptor
.
ATTRIBUTE_LOCALE
,
""
);
descriptor
.
root
=
root
;
if
(
Log
Tag
.
JFR_SYSTEM_PARSER
.
shouldLog
(
LogLevel
.
TRACE
.
level
))
{
if
(
Log
ger
.
shouldLog
(
LogTag
.
JFR_SYSTEM_PARSER
,
LogLevel
.
TRACE
))
{
List
<
Type
>
ts
=
new
ArrayList
<>(
types
.
values
());
Collections
.
sort
(
ts
,
(
x
,
y
)
->
x
.
getName
().
compareTo
(
y
.
getName
()));
for
(
Type
t
:
ts
)
{
...
...
src/share/classes/jdk/jfr/internal/PlatformRecording.java
浏览文件 @
967ad215
...
...
@@ -453,7 +453,7 @@ public final class PlatformRecording implements AutoCloseable {
}
private
void
setSettings
(
Map
<
String
,
String
>
settings
,
boolean
update
)
{
if
(
Log
Tag
.
JFR_SETTING
.
shouldLog
(
LogLevel
.
INFO
.
level
)
&&
update
)
{
if
(
Log
ger
.
shouldLog
(
LogTag
.
JFR_SETTING
,
LogLevel
.
INFO
)
&&
update
)
{
TreeMap
<
String
,
String
>
ordered
=
new
TreeMap
<>(
settings
);
Logger
.
log
(
LogTag
.
JFR_SETTING
,
LogLevel
.
INFO
,
"New settings for recording \""
+
getName
()
+
"\" ("
+
getId
()
+
")"
);
for
(
Map
.
Entry
<
String
,
String
>
entry
:
ordered
.
entrySet
())
{
...
...
src/share/classes/jdk/jfr/internal/SettingsManager.java
浏览文件 @
967ad215
...
...
@@ -140,7 +140,7 @@ final class SettingsManager {
ec
.
disable
();
}
}
else
{
if
(
Log
Tag
.
JFR_SETTING
.
shouldLog
(
LogLevel
.
INFO
.
level
))
{
if
(
Log
ger
.
shouldLog
(
LogTag
.
JFR_SETTING
,
LogLevel
.
INFO
))
{
Collections
.
sort
(
eventControls
,
(
x
,
y
)
->
x
.
getEventType
().
getName
().
compareTo
(
y
.
getEventType
().
getName
()));
}
for
(
EventControl
ec
:
eventControls
)
{
...
...
@@ -225,7 +225,7 @@ final class SettingsManager {
if
(
values
!=
null
)
{
control
.
apply
(
values
);
String
after
=
control
.
getLastValue
();
if
(
Log
Tag
.
JFR_SETTING
.
shouldLog
(
LogLevel
.
INFO
.
level
))
{
if
(
Log
ger
.
shouldLog
(
LogTag
.
JFR_SETTING
,
LogLevel
.
INFO
))
{
if
(
Utils
.
isSettingVisible
(
control
,
ec
.
getEventType
().
hasEventHook
()))
{
if
(
values
.
size
()
>
1
)
{
StringJoiner
sj
=
new
StringJoiner
(
", "
,
"{"
,
"}"
);
...
...
@@ -242,7 +242,7 @@ final class SettingsManager {
}
}
else
{
control
.
setDefault
();
if
(
Log
Tag
.
JFR_SETTING
.
shouldLog
(
LogLevel
.
INFO
.
level
))
{
if
(
Log
ger
.
shouldLog
(
LogTag
.
JFR_SETTING
,
LogLevel
.
INFO
))
{
String
message
=
" "
+
settingName
+
"=\""
+
control
.
getLastValue
()
+
"\""
;
Logger
.
log
(
LogTag
.
JFR_SETTING
,
LogLevel
.
INFO
,
message
);
}
...
...
src/share/classes/jdk/jfr/internal/Type.java
浏览文件 @
967ad215
...
...
@@ -275,7 +275,7 @@ public class Type implements Comparable<Type> {
}
void
log
(
String
action
,
LogTag
logTag
,
LogLevel
level
)
{
if
(
logTag
.
shouldLog
(
level
.
level
)
&&
!
isSimpleType
())
{
if
(
Logger
.
shouldLog
(
logTag
,
level
)
&&
!
isSimpleType
())
{
Logger
.
log
(
logTag
,
LogLevel
.
TRACE
,
action
+
" "
+
typeText
()
+
" "
+
getLogName
()
+
" {"
);
for
(
ValueDescriptor
v
:
getFields
())
{
String
array
=
v
.
isArray
()
?
"[]"
:
""
;
...
...
@@ -283,7 +283,7 @@ public class Type implements Comparable<Type> {
}
Logger
.
log
(
logTag
,
LogLevel
.
TRACE
,
"}"
);
}
else
{
if
(
logTag
.
shouldLog
(
LogLevel
.
INFO
.
level
)
&&
!
isSimpleType
())
{
if
(
Logger
.
shouldLog
(
logTag
,
LogLevel
.
INFO
)
&&
!
isSimpleType
())
{
Logger
.
log
(
logTag
,
LogLevel
.
INFO
,
action
+
" "
+
typeText
()
+
" "
+
getLogName
());
}
}
...
...
src/share/classes/jdk/jfr/internal/TypeLibrary.java
浏览文件 @
967ad215
...
...
@@ -69,7 +69,7 @@ public final class TypeLibrary {
private
TypeLibrary
(
List
<
Type
>
jvmTypes
)
{
visitReachable
(
jvmTypes
,
t
->
!
types
.
containsKey
(
t
.
getId
()),
t
->
types
.
put
(
t
.
getId
(),
t
));
if
(
Log
Tag
.
JFR_SYSTEM_METADATA
.
shouldLog
(
LogLevel
.
INFO
.
level
))
{
if
(
Log
ger
.
shouldLog
(
LogTag
.
JFR_SYSTEM_METADATA
,
LogLevel
.
INFO
))
{
Stream
<
Type
>
s
=
types
.
values
().
stream
().
sorted
((
x
,
y
)
->
Long
.
compare
(
x
.
getId
(),
y
.
getId
()));
s
.
forEach
(
t
->
t
.
log
(
"Added"
,
LogTag
.
JFR_SYSTEM_METADATA
,
LogLevel
.
INFO
));
}
...
...
@@ -423,7 +423,7 @@ public final class TypeLibrary {
for
(
Type
type
:
types
.
values
())
{
if
(
type
.
getRemove
()
&&
!
Type
.
isDefinedByJVM
(
type
.
getId
()))
{
removeIds
.
add
(
type
.
getId
());
if
(
Log
Tag
.
JFR_METADATA
.
shouldLog
(
LogLevel
.
TRACE
.
level
))
{
if
(
Log
ger
.
shouldLog
(
LogTag
.
JFR_METADATA
,
LogLevel
.
TRACE
))
{
Logger
.
log
(
LogTag
.
JFR_METADATA
,
LogLevel
.
TRACE
,
"Removed obsolete metadata "
+
type
.
getName
());
}
}
...
...
src/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java
浏览文件 @
967ad215
...
...
@@ -64,7 +64,7 @@ final class DCmdCheck extends AbstractDCmd {
}
private
void
executeInternal
(
String
name
,
Boolean
verbose
)
throws
DCmdException
{
if
(
Log
Tag
.
JFR_DCMD
.
shouldLog
(
LogLevel
.
DEBUG
))
{
if
(
Log
ger
.
shouldLog
(
LogTag
.
JFR_DCMD
,
LogLevel
.
DEBUG
))
{
Logger
.
log
(
LogTag
.
JFR_DCMD
,
LogLevel
.
DEBUG
,
"Executing DCmdCheck: name="
+
name
+
", verbose="
+
verbose
);
}
...
...
src/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java
浏览文件 @
967ad215
...
...
@@ -70,7 +70,7 @@ final class DCmdConfigure extends AbstractDCmd {
Boolean
sampleThreads
)
throws
DCmdException
{
if
(
Log
Tag
.
JFR_DCMD
.
shouldLog
(
LogLevel
.
DEBUG
))
{
if
(
Log
ger
.
shouldLog
(
LogTag
.
JFR_DCMD
,
LogLevel
.
DEBUG
))
{
Logger
.
log
(
LogTag
.
JFR_DCMD
,
LogLevel
.
DEBUG
,
"Executing DCmdConfigure: repositorypath="
+
repositoryPath
+
", dumppath="
+
dumpPath
+
", stackdepth="
+
stackDepth
+
...
...
src/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java
浏览文件 @
967ad215
...
...
@@ -70,7 +70,7 @@ final class DCmdDump extends AbstractDCmd {
* @throws DCmdException if the dump could not be completed
*/
public
String
execute
(
String
name
,
String
filename
,
Long
maxAge
,
Long
maxSize
,
String
begin
,
String
end
,
Boolean
pathToGcRoots
)
throws
DCmdException
{
if
(
Log
Tag
.
JFR_DCMD
.
shouldLog
(
LogLevel
.
DEBUG
))
{
if
(
Log
ger
.
shouldLog
(
LogTag
.
JFR_DCMD
,
LogLevel
.
DEBUG
))
{
Logger
.
log
(
LogTag
.
JFR_DCMD
,
LogLevel
.
DEBUG
,
"Executing DCmdDump: name="
+
name
+
", filename="
+
filename
+
...
...
src/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java
浏览文件 @
967ad215
...
...
@@ -82,7 +82,7 @@ final class DCmdStart extends AbstractDCmd {
*/
@SuppressWarnings
(
"resource"
)
public
String
execute
(
String
name
,
String
[]
settings
,
Long
delay
,
Long
duration
,
Boolean
disk
,
String
path
,
Long
maxAge
,
Long
maxSize
,
Boolean
dumpOnExit
,
Boolean
pathToGcRoots
)
throws
DCmdException
{
if
(
Log
Tag
.
JFR_DCMD
.
shouldLog
(
LogLevel
.
DEBUG
))
{
if
(
Log
ger
.
shouldLog
(
LogTag
.
JFR_DCMD
,
LogLevel
.
DEBUG
))
{
Logger
.
log
(
LogTag
.
JFR_DCMD
,
LogLevel
.
DEBUG
,
"Executing DCmdStart: name="
+
name
+
", settings="
+
(
settings
!=
null
?
Arrays
.
asList
(
settings
)
:
"(none)"
)
+
", delay="
+
delay
+
...
...
@@ -110,11 +110,6 @@ final class DCmdStart extends AbstractDCmd {
throw
new
DCmdException
(
"No settings specified. Use settings=none to start without any settings"
);
}
Map
<
String
,
String
>
s
=
new
HashMap
<>();
if
(
settings
==
null
||
settings
.
length
==
0
)
{
settings
=
new
String
[]
{
"default"
};
}
for
(
String
configName
:
settings
)
{
try
{
s
.
putAll
(
JFC
.
createKnown
(
configName
).
getSettings
());
...
...
src/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java
浏览文件 @
967ad215
...
...
@@ -56,7 +56,7 @@ final class DCmdStop extends AbstractDCmd {
* @throws DCmdException if recording could not be stopped
*/
public
String
execute
(
String
name
,
String
filename
)
throws
DCmdException
{
if
(
Log
Tag
.
JFR_DCMD
.
shouldLog
(
LogLevel
.
DEBUG
))
{
if
(
Log
ger
.
shouldLog
(
LogTag
.
JFR_DCMD
,
LogLevel
.
DEBUG
))
{
Logger
.
log
(
LogTag
.
JFR_DCMD
,
LogLevel
.
DEBUG
,
"Executing DCmdStart: name="
+
name
+
", filename="
+
filename
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录