Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
98c962d6
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看板
提交
98c962d6
编写于
7月 15, 2020
作者:
D
Denghui Dong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "[JFR] add support for opto object allocations sampling"
This reverts commit
42338688
.
上级
7e0613f0
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
3 addition
and
165 deletion
+3
-165
src/share/classes/jdk/jfr/EventNames.java
src/share/classes/jdk/jfr/EventNames.java
+0
-32
src/share/classes/jdk/jfr/Recording.java
src/share/classes/jdk/jfr/Recording.java
+0
-3
src/share/classes/jdk/jfr/consumer/RecordedClass.java
src/share/classes/jdk/jfr/consumer/RecordedClass.java
+0
-23
src/share/classes/jdk/jfr/internal/JVM.java
src/share/classes/jdk/jfr/internal/JVM.java
+0
-14
src/share/classes/jdk/jfr/internal/Options.java
src/share/classes/jdk/jfr/internal/Options.java
+0
-31
src/share/classes/jdk/jfr/internal/PlatformRecorder.java
src/share/classes/jdk/jfr/internal/PlatformRecorder.java
+0
-5
src/share/classes/jdk/jfr/internal/PlatformRecording.java
src/share/classes/jdk/jfr/internal/PlatformRecording.java
+0
-4
src/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java
src/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java
+2
-39
src/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java
src/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java
+1
-12
test/lib/testlibrary/jdk/testlibrary/jfr/EventNames.java
test/lib/testlibrary/jdk/testlibrary/jfr/EventNames.java
+0
-2
未找到文件。
src/share/classes/jdk/jfr/EventNames.java
已删除
100644 → 0
浏览文件 @
7e0613f0
/*
* Copyright (c) 2019 Alibaba Group Holding Limited. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Alibaba designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
package
jdk.jfr
;
/**
* A constant class for JFR Event, contains the names of some events used by jdk.
*/
public
class
EventNames
{
private
final
static
String
PREFIX
=
"com.oracle.jdk."
;
public
final
static
String
OptoInstanceObjectAllocation
=
PREFIX
+
"OptoInstanceObjectAllocation"
;
public
final
static
String
OptoArrayObjectAllocation
=
PREFIX
+
"OptoArrayObjectAllocation"
;
}
src/share/classes/jdk/jfr/Recording.java
浏览文件 @
98c962d6
...
...
@@ -668,7 +668,4 @@ public final class Recording implements Closeable {
internal
.
setSetting
(
id
,
value
);
}
public
boolean
isRecorderEnabled
(
String
eventName
)
{
return
internal
.
isRecorderEnabled
(
eventName
);
}
}
src/share/classes/jdk/jfr/consumer/RecordedClass.java
浏览文件 @
98c962d6
...
...
@@ -100,27 +100,4 @@ public final class RecordedClass extends RecordedObject {
public
long
getId
()
{
return
uniqueId
;
}
/**
* Returns the object size for the class.
* <p>
* The object size for instance class is accurate. But for the array class, it
* is a magic code 0x1111baba. The array object size can not be determined statically
* from the JVM klass information because array object size is affected by
* actual element length.
*
* @return the object size (instance object), or magic code 0x1111baba (array object)
*/
public
int
getObjectSize
()
{
return
getTyped
(
"objectSize"
,
Integer
.
class
,
-
1
);
}
/**
* Checks whether the class is for instance or array.
*
* @return true or false
*/
public
boolean
isArray
()
{
return
getName
().
startsWith
(
"["
);
}
}
src/share/classes/jdk/jfr/internal/JVM.java
浏览文件 @
98c962d6
...
...
@@ -287,20 +287,6 @@ public final class JVM {
*/
public
native
void
setSampleThreads
(
boolean
sampleThreads
)
throws
IllegalStateException
;
/**
* Turn on/off objects allocations sampling.
*
* @param sampleAllocations true if object allocations should be sampled, false otherwise.
*/
public
native
void
setSampleObjectAllocations
(
boolean
sampleAllocations
);
/**
* Set object allocations sampling interval.
*
* @param interval
*/
public
native
void
setObjectAllocationsSamplingInterval
(
long
interval
)
throws
IllegalArgumentException
;
/**
* Turn on/off compressed integers.
*
...
...
src/share/classes/jdk/jfr/internal/Options.java
浏览文件 @
98c962d6
...
...
@@ -49,8 +49,6 @@ public final class Options {
private
static
final
boolean
DEFAULT_SAMPLE_THREADS
=
true
;
private
static
final
long
DEFAULT_MAX_CHUNK_SIZE
=
12
*
1024
*
1024
;
private
static
final
SafePath
DEFAULT_DUMP_PATH
=
SecuritySupport
.
USER_HOME
;
private
static
final
boolean
DEFAULT_SAMPLE_OBJECT_ALLOCATIONS
=
false
;
private
static
final
long
DEFAULT_OBJECT_ALLOCATIONS_SAMPLING_INTERVAL
=
1024
;
private
static
long
memorySize
;
private
static
long
globalBufferSize
;
...
...
@@ -60,8 +58,6 @@ public final class Options {
private
static
boolean
sampleThreads
;
private
static
long
maxChunkSize
;
private
static
SafePath
dumpPath
;
private
static
boolean
sampleObjectAllocations
;
private
static
long
objectAllocationsSamplingInterval
;
static
{
final
long
pageSize
=
Unsafe
.
getUnsafe
().
pageSize
();
...
...
@@ -143,31 +139,6 @@ public final class Options {
return
sampleThreads
;
}
public
static
synchronized
void
setSampleObjectAllocations
(
Boolean
sample
)
{
jvm
.
setSampleObjectAllocations
(
sample
);
sampleObjectAllocations
=
sample
;
}
public
static
synchronized
boolean
getSampleObjectAllocations
()
{
return
sampleObjectAllocations
;
}
/**
* Set interval of sampling object allocation events
* @param interval the number of newly created objects between two sampling
*/
public
static
synchronized
void
setObjectAllocationsSamplingInterval
(
Long
interval
)
{
if
(
interval
<=
0
)
{
throw
new
IllegalArgumentException
(
"interval should be greater than 0"
);
}
jvm
.
setObjectAllocationsSamplingInterval
(
interval
);
objectAllocationsSamplingInterval
=
interval
;
}
public
static
synchronized
long
getObjectAllocationsSamplingInterval
()
{
return
objectAllocationsSamplingInterval
;
}
private
static
synchronized
void
reset
()
{
setMaxChunkSize
(
DEFAULT_MAX_CHUNK_SIZE
);
setMemorySize
(
DEFAULT_MEMORY_SIZE
);
...
...
@@ -177,8 +148,6 @@ public final class Options {
setSampleThreads
(
DEFAULT_SAMPLE_THREADS
);
setStackDepth
(
DEFAULT_STACK_DEPTH
);
setThreadBufferSize
(
DEFAULT_THREAD_BUFFER_SIZE
);
setSampleObjectAllocations
(
DEFAULT_SAMPLE_OBJECT_ALLOCATIONS
);
setObjectAllocationsSamplingInterval
(
DEFAULT_OBJECT_ALLOCATIONS_SAMPLING_INTERVAL
);
}
static
synchronized
long
getWaitInterval
()
{
...
...
src/share/classes/jdk/jfr/internal/PlatformRecorder.java
浏览文件 @
98c962d6
...
...
@@ -47,7 +47,6 @@ import java.util.TimerTask;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
jdk.jfr.Enabled
;
import
jdk.jfr.EventNames
;
import
jdk.jfr.EventType
;
import
jdk.jfr.FlightRecorder
;
import
jdk.jfr.FlightRecorderListener
;
...
...
@@ -561,8 +560,4 @@ public final class PlatformRecorder {
internal
.
setInternalDuration
(
Duration
.
between
(
startTime
,
endTime
));
return
snapshot
;
}
public
boolean
isEnabled
(
String
eventName
)
{
return
MetadataRepository
.
getInstance
().
isEnabled
(
eventName
);
}
}
src/share/classes/jdk/jfr/internal/PlatformRecording.java
浏览文件 @
98c962d6
...
...
@@ -693,8 +693,4 @@ public final class PlatformRecording implements AutoCloseable {
boolean
shouldWriteMetadataEvent
()
{
return
shuoldWriteActiveRecordingEvent
;
}
public
boolean
isRecorderEnabled
(
String
eventName
)
{
return
recorder
.
isEnabled
(
eventName
);
}
}
src/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java
浏览文件 @
98c962d6
...
...
@@ -43,7 +43,6 @@ final class DCmdConfigure extends AbstractDCmd {
/**
* Execute JFR.configure.
*
* @param onVMStart if cmd is invoked at the moment when vm is started
* @param repositoryPath the path
* @param dumpPath path to dump to on fatal error (oom)
* @param stackDepth depth of stack traces
...
...
@@ -52,8 +51,6 @@ final class DCmdConfigure extends AbstractDCmd {
* @param threadBufferSize size of thread buffer for events
* @param maxChunkSize threshold at which a new chunk is created in the disk repository
* @param sampleThreads if thread sampling should be enabled
* @param sampleObjectAllocations if object allocations sampling should be enbaled
* @param objectAllocationsSamplingInterval interval of object allocations samplings
*
* @return result
...
...
@@ -62,7 +59,6 @@ final class DCmdConfigure extends AbstractDCmd {
*/
public
String
execute
(
Boolean
onVMStart
,
String
repositoryPath
,
String
dumpPath
,
Integer
stackDepth
,
...
...
@@ -71,18 +67,9 @@ final class DCmdConfigure extends AbstractDCmd {
Long
threadBufferSize
,
Long
memorySize
,
Long
maxChunkSize
,
Boolean
sampleThreads
,
Boolean
sampleObjectAllocations
,
Long
objectAllocationsSamplingInterval
)
throws
DCmdException
{
// Check parameters correctness
if
(!
onVMStart
)
{
if
(
sampleObjectAllocations
!=
null
||
objectAllocationsSamplingInterval
!=
null
)
{
Logger
.
log
(
LogTag
.
JFR
,
LogLevel
.
ERROR
,
"Could not change sampleObjectAllocations and objectAllocationsSamplingInterval during application's running"
);
return
getResult
();
}
}
Boolean
sampleThreads
)
throws
DCmdException
{
boolean
updated
=
false
;
if
(
repositoryPath
!=
null
)
{
try
{
...
...
@@ -152,20 +139,6 @@ final class DCmdConfigure extends AbstractDCmd {
updated
=
true
;
}
if
(
objectAllocationsSamplingInterval
!=
null
)
{
Options
.
setObjectAllocationsSamplingInterval
(
objectAllocationsSamplingInterval
);
Logger
.
log
(
LogTag
.
JFR
,
LogLevel
.
INFO
,
"object allocations sampling interval set to "
+
objectAllocationsSamplingInterval
);
printObjectAllocationsSamplingInterval
();
updated
=
true
;
}
if
(
sampleObjectAllocations
!=
null
)
{
Options
.
setSampleObjectAllocations
(
sampleObjectAllocations
);
Logger
.
log
(
LogTag
.
JFR
,
LogLevel
.
INFO
,
"Sample object allocations set to "
+
sampleObjectAllocations
);
printSampleObjectAllocations
();
updated
=
true
;
}
if
(!
updated
)
{
println
(
"Current configuration:"
);
println
();
...
...
@@ -177,8 +150,6 @@ final class DCmdConfigure extends AbstractDCmd {
printMemorySize
();
printMaxChunkSize
();
printSampleThreads
();
printSampleObjectAllocations
();
printObjectAllocationsSamplingInterval
();
}
return
getResult
();
}
...
...
@@ -230,12 +201,4 @@ final class DCmdConfigure extends AbstractDCmd {
printBytes
(
Options
.
getMaxChunkSize
(),
" "
);
println
();
}
private
void
printSampleObjectAllocations
()
{
println
(
"Sample object allocations: "
+
Options
.
getSampleObjectAllocations
());
}
private
void
printObjectAllocationsSamplingInterval
()
{
println
(
"objects allocations sampling interval: "
+
Options
.
getObjectAllocationsSamplingInterval
());
}
}
src/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java
浏览文件 @
98c962d6
...
...
@@ -32,11 +32,9 @@ import java.time.Duration;
import
java.util.HashMap
;
import
java.util.Map
;
import
jdk.jfr.EventNames
;
import
jdk.jfr.FlightRecorder
;
import
jdk.jfr.Recording
;
import
jdk.jfr.internal.JVM
;
import
jdk.jfr.internal.Options
;
import
jdk.jfr.internal.SecuritySupport.SafePath
;
import
jdk.jfr.internal.Type
;
import
jdk.jfr.internal.Utils
;
...
...
@@ -88,7 +86,6 @@ final class DCmdStart extends AbstractDCmd {
if
(
duration
==
null
&&
Boolean
.
FALSE
.
equals
(
dumpOnExit
)
&&
path
!=
null
)
{
throw
new
DCmdException
(
"Filename can only be set for a time bound recording or if dumponexit=true. Set duration/dumponexit or omit filename."
);
}
if
(
dumpOnExit
==
null
&&
path
!=
null
)
{
dumpOnExit
=
Boolean
.
TRUE
;
}
...
...
@@ -103,7 +100,7 @@ final class DCmdStart extends AbstractDCmd {
try
{
s
.
putAll
(
JFC
.
createKnown
(
configName
).
getSettings
());
}
catch
(
IOException
|
ParseException
e
)
{
throw
new
DCmdException
(
"Could not parse setting "
+
config
Name
,
e
);
throw
new
DCmdException
(
"Could not parse setting "
+
config
urations
[
0
]
,
e
);
}
}
...
...
@@ -139,14 +136,6 @@ final class DCmdStart extends AbstractDCmd {
}
recording
.
setSettings
(
s
);
if
(
recording
.
isRecorderEnabled
(
EventNames
.
OptoInstanceObjectAllocation
)
||
recording
.
isRecorderEnabled
(
EventNames
.
OptoArrayObjectAllocation
))
{
if
(!
Options
.
getSampleObjectAllocations
())
{
println
(
"Please add -XX:FlightRecorderOptions=sampleobjectallocations=true in JVM options."
);
return
getResult
();
}
}
if
(
path
!=
null
)
{
try
{
recording
.
setDestination
(
Paths
.
get
(
path
));
...
...
test/lib/testlibrary/jdk/testlibrary/jfr/EventNames.java
浏览文件 @
98c962d6
...
...
@@ -173,8 +173,6 @@ public class EventNames {
public
final
static
String
CPUTimeStampCounter
=
PREFIX
+
"CPUTimeStampCounter"
;
// "os.processor.cpu_tsc";
public
final
static
String
ActiveRecording
=
PREFIX
+
"ActiveRecording"
;
//"com.oracle.jdk.ActiveRecording"
public
final
static
String
ActiveSetting
=
PREFIX
+
"ActiveSetting"
;
//"com.oracle.jdk.ActiveSetting"
public
final
static
String
OptoInstanceObjectAllocation
=
PREFIX
+
"OptoInstanceObjectAllocation"
;
//"com.oracle.jdk.OptoInstanceObjectAllocation"
public
final
static
String
OptoArrayObjectAllocation
=
PREFIX
+
"OptoArrayObjectAllocation"
;
//"com.oracle.jdk.OptoArrayObjectAllocation"
public
static
boolean
isGcEvent
(
EventType
et
)
{
return
et
.
getCategoryNames
().
contains
(
GC_CATEGORY
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录