Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
8af32fc3
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看板
提交
8af32fc3
编写于
12月 13, 2018
作者:
M
mgronlun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8215284: Reduce noise induced by periodic task getFileSize()
Reviewed-by: redestad, egahlin
上级
348423a0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
61 addition
and
49 deletion
+61
-49
src/share/vm/jfr/jni/jfrJniMethod.cpp
src/share/vm/jfr/jni/jfrJniMethod.cpp
+5
-2
src/share/vm/jfr/jni/jfrJniMethod.hpp
src/share/vm/jfr/jni/jfrJniMethod.hpp
+3
-0
src/share/vm/jfr/jni/jfrJniMethodRegistration.cpp
src/share/vm/jfr/jni/jfrJniMethodRegistration.cpp
+2
-1
src/share/vm/jfr/recorder/repository/jfrChunkRotation.cpp
src/share/vm/jfr/recorder/repository/jfrChunkRotation.cpp
+37
-29
src/share/vm/jfr/recorder/repository/jfrChunkRotation.hpp
src/share/vm/jfr/recorder/repository/jfrChunkRotation.hpp
+11
-12
src/share/vm/jfr/recorder/service/jfrRecorderService.cpp
src/share/vm/jfr/recorder/service/jfrRecorderService.cpp
+3
-5
未找到文件。
src/share/vm/jfr/jni/jfrJniMethod.cpp
浏览文件 @
8af32fc3
...
...
@@ -33,7 +33,7 @@
#include "jfr/recorder/checkpoint/jfrMetadataEvent.hpp"
#include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp"
#include "jfr/recorder/repository/jfrRepository.hpp"
#include "jfr/recorder/repository/jfrChunk
SizeNotifier
.hpp"
#include "jfr/recorder/repository/jfrChunk
Rotation
.hpp"
#include "jfr/recorder/repository/jfrChunkWriter.hpp"
#include "jfr/recorder/service/jfrOptionSet.hpp"
#include "jfr/recorder/stacktrace/jfrStackTraceRepository.hpp"
...
...
@@ -113,7 +113,7 @@ NO_TRANSITION(void, jfr_set_enabled(JNIEnv* env, jobject jvm, jlong event_type_i
NO_TRANSITION_END
NO_TRANSITION
(
void
,
jfr_set_file_notification
(
JNIEnv
*
env
,
jobject
jvm
,
jlong
threshold
))
JfrChunk
SizeNotifier
::
set_chunk_size_threshold
((
size
_t
)
threshold
);
JfrChunk
Rotation
::
set_threshold
((
intptr
_t
)
threshold
);
NO_TRANSITION_END
NO_TRANSITION
(
void
,
jfr_set_sample_threads
(
JNIEnv
*
env
,
jobject
jvm
,
jboolean
sampleThreads
))
...
...
@@ -172,6 +172,9 @@ NO_TRANSITION(jboolean, jfr_set_cutoff(JNIEnv* env, jobject jvm, jlong event_typ
return
JfrEventSetting
::
set_cutoff
(
event_type_id
,
cutoff_ticks
)
?
JNI_TRUE
:
JNI_FALSE
;
NO_TRANSITION_END
NO_TRANSITION
(
jboolean
,
jfr_should_rotate_disk
(
JNIEnv
*
env
,
jobject
jvm
))
return
JfrChunkRotation
::
should_rotate
()
?
JNI_TRUE
:
JNI_FALSE
;
NO_TRANSITION_END
/*
* JVM_ENTRY_NO_ENV entries
...
...
src/share/vm/jfr/jni/jfrJniMethod.hpp
浏览文件 @
8af32fc3
...
...
@@ -129,6 +129,9 @@ jboolean JNICALL jfr_set_cutoff(JNIEnv* env, jobject jvm, jlong event_type_id, j
void
JNICALL
jfr_emit_old_object_samples
(
JNIEnv
*
env
,
jobject
jvm
,
jlong
cutoff_ticks
,
jboolean
);
jboolean
JNICALL
jfr_should_rotate_disk
(
JNIEnv
*
env
,
jobject
jvm
);
#ifdef __cplusplus
}
#endif
...
...
src/share/vm/jfr/jni/jfrJniMethodRegistration.cpp
浏览文件 @
8af32fc3
...
...
@@ -78,7 +78,8 @@ JfrJniMethodRegistration::JfrJniMethodRegistration(JNIEnv* env) {
(
char
*
)
"setForceInstrumentation"
,
(
char
*
)
"(Z)V"
,
(
void
*
)
jfr_set_force_instrumentation
,
(
char
*
)
"getUnloadedEventClassCount"
,
(
char
*
)
"()J"
,
(
void
*
)
jfr_get_unloaded_event_classes_count
,
(
char
*
)
"setCutoff"
,
(
char
*
)
"(JJ)Z"
,
(
void
*
)
jfr_set_cutoff
,
(
char
*
)
"emitOldObjectSamples"
,
(
char
*
)
"(JZ)V"
,
(
void
*
)
jfr_emit_old_object_samples
(
char
*
)
"emitOldObjectSamples"
,
(
char
*
)
"(JZ)V"
,
(
void
*
)
jfr_emit_old_object_samples
,
(
char
*
)
"shouldRotateDisk"
,
(
char
*
)
"()Z"
,
(
void
*
)
jfr_should_rotate_disk
};
const
size_t
method_array_length
=
sizeof
(
method
)
/
sizeof
(
JNINativeMethod
);
...
...
src/share/vm/jfr/recorder/repository/jfrChunk
SizeNotifier
.cpp
→
src/share/vm/jfr/recorder/repository/jfrChunk
Rotation
.cpp
浏览文件 @
8af32fc3
...
...
@@ -24,29 +24,15 @@
#include "precompiled.hpp"
#include "jfr/jni/jfrJavaSupport.hpp"
#include "jfr/recorder/repository/jfrChunkRotation.hpp"
#include "jfr/recorder/repository/jfrChunkWriter.hpp"
#include "jfr/recorder/repository/jfrChunkSizeNotifier.hpp"
size_t
JfrChunkSizeNotifier
::
_chunk_size_threshold
=
0
;
static
jobject
chunk_monitor
=
NULL
;
static
intptr_t
threshold
=
0
;
static
bool
rotate
=
false
;
void
JfrChunkSizeNotifier
::
set_chunk_size_threshold
(
size_t
bytes
)
{
_chunk_size_threshold
=
bytes
;
}
size_t
JfrChunkSizeNotifier
::
chunk_size_threshold
()
{
return
_chunk_size_threshold
;
}
static
jobject
new_chunk_monitor
=
NULL
;
// lazy install
static
jobject
get_new_chunk_monitor
(
Thread
*
thread
)
{
static
bool
initialized
=
false
;
if
(
initialized
)
{
assert
(
new_chunk_monitor
!=
NULL
,
"invariant"
);
return
new_chunk_monitor
;
}
assert
(
new_chunk_monitor
==
NULL
,
"invariant"
);
static
jobject
install_chunk_monitor
(
Thread
*
thread
)
{
assert
(
chunk_monitor
==
NULL
,
"invariant"
);
// read static field
HandleMark
hm
(
thread
);
static
const
char
klass
[]
=
"jdk/jfr/internal/JVM"
;
...
...
@@ -55,19 +41,41 @@ static jobject get_new_chunk_monitor(Thread* thread) {
JavaValue
result
(
T_OBJECT
);
JfrJavaArguments
field_args
(
&
result
,
klass
,
field
,
signature
,
thread
);
JfrJavaSupport
::
get_field_global_ref
(
&
field_args
,
thread
);
new_chunk_monitor
=
result
.
get_jobject
();
initialized
=
new_chunk_monitor
!=
NULL
;
return
new_chunk_monitor
;
chunk_monitor
=
result
.
get_jobject
();
return
chunk_monitor
;
}
void
JfrChunkSizeNotifier
::
notify
()
{
// lazy install
static
jobject
get_chunk_monitor
(
Thread
*
thread
)
{
return
chunk_monitor
!=
NULL
?
chunk_monitor
:
install_chunk_monitor
(
thread
);
}
static
void
notify
()
{
Thread
*
const
thread
=
Thread
::
current
();
JfrJavaSupport
::
notify_all
(
get_
new_
chunk_monitor
(
thread
),
thread
);
JfrJavaSupport
::
notify_all
(
get_chunk_monitor
(
thread
),
thread
);
}
void
JfrChunkSizeNotifier
::
release_monitor
()
{
if
(
new_chunk_monitor
!=
NULL
)
{
JfrJavaSupport
::
destroy_global_jni_handle
(
new_chunk_monitor
);
new_chunk_monitor
=
NULL
;
void
JfrChunkRotation
::
evaluate
(
const
JfrChunkWriter
&
writer
)
{
assert
(
threshold
>
0
,
"invariant"
);
if
(
rotate
)
{
// already in progress
return
;
}
assert
(
!
rotate
,
"invariant"
);
if
(
writer
.
size_written
()
>
threshold
)
{
rotate
=
true
;
notify
();
}
}
bool
JfrChunkRotation
::
should_rotate
()
{
return
rotate
;
}
void
JfrChunkRotation
::
on_rotation
()
{
rotate
=
false
;
}
void
JfrChunkRotation
::
set_threshold
(
intptr_t
bytes
)
{
threshold
=
bytes
;
}
src/share/vm/jfr/recorder/repository/jfrChunk
SizeNotifier
.hpp
→
src/share/vm/jfr/recorder/repository/jfrChunk
Rotation
.hpp
浏览文件 @
8af32fc3
...
...
@@ -22,24 +22,23 @@
*
*/
#ifndef SHARE_VM_JFR_RECORDER_REPOSITORY_JFR
RCHUNKSIZENOTIFIER
_HPP
#define SHARE_VM_JFR_RECORDER_REPOSITORY_JFR
RCHUNKSIZENOTIFIER
_HPP
#ifndef SHARE_VM_JFR_RECORDER_REPOSITORY_JFR
CHUNKROTATION
_HPP
#define SHARE_VM_JFR_RECORDER_REPOSITORY_JFR
CHUNKROTATION
_HPP
#include "memory/allocation.hpp"
class
JfrChunkWriter
;
//
// Responsible for notifications about current chunk size now exceeding threshold.
// This is a means to initiate a chunk rotation on the basis of size written.
// This is a means to initiate a chunk rotation on the basis of
the
size written.
//
class
JfrChunkSizeNotifier
:
AllStatic
{
friend
class
JfrRecorder
;
private:
static
size_t
_chunk_size_threshold
;
static
void
release_monitor
();
class
JfrChunkRotation
:
AllStatic
{
public:
static
void
set_chunk_size_threshold
(
size_t
bytes
);
static
size_t
chunk_size_threshold
();
static
void
notify
();
static
void
evaluate
(
const
JfrChunkWriter
&
writer
);
static
void
set_threshold
(
intptr_t
bytes
);
static
bool
should_rotate
();
static
void
on_rotation
();
};
#endif // SHARE_VM_JFR_RECORDER_REPOSITORY_JFR
RCHUNKSIZENOTIFIER
_HPP
#endif // SHARE_VM_JFR_RECORDER_REPOSITORY_JFR
CHUNKROTATION
_HPP
src/share/vm/jfr/recorder/service/jfrRecorderService.cpp
浏览文件 @
8af32fc3
...
...
@@ -28,7 +28,7 @@
#include "jfr/recorder/jfrRecorder.hpp"
#include "jfr/recorder/checkpoint/jfrCheckpointManager.hpp"
#include "jfr/recorder/checkpoint/jfrMetadataEvent.hpp"
#include "jfr/recorder/repository/jfrChunk
SizeNotifier
.hpp"
#include "jfr/recorder/repository/jfrChunk
Rotation
.hpp"
#include "jfr/recorder/repository/jfrChunkWriter.hpp"
#include "jfr/recorder/repository/jfrRepository.hpp"
#include "jfr/recorder/service/jfrPostBox.hpp"
...
...
@@ -339,6 +339,7 @@ void JfrRecorderService::prepare_for_vm_error_rotation() {
void
JfrRecorderService
::
open_new_chunk
(
bool
vm_error
)
{
assert
(
!
_chunkwriter
.
is_valid
(),
"invariant"
);
assert
(
!
JfrStream_lock
->
owned_by_self
(),
"invariant"
);
JfrChunkRotation
::
on_rotation
();
MutexLockerEx
stream_lock
(
JfrStream_lock
,
Mutex
::
_no_safepoint_check_flag
);
if
(
!
_repository
.
open_chunk
(
vm_error
))
{
assert
(
!
_chunkwriter
.
is_valid
(),
"invariant"
);
...
...
@@ -534,8 +535,5 @@ void JfrRecorderService::scavenge() {
}
void
JfrRecorderService
::
evaluate_chunk_size_for_rotation
()
{
const
size_t
size_written
=
_chunkwriter
.
size_written
();
if
(
size_written
>
JfrChunkSizeNotifier
::
chunk_size_threshold
())
{
JfrChunkSizeNotifier
::
notify
();
}
JfrChunkRotation
::
evaluate
(
_chunkwriter
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录