Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
e42c8965
R
runtime
项目概览
dotNET Platform
/
runtime
12 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e42c8965
编写于
6月 08, 2021
作者:
A
Andrew Au
提交者:
GitHub
6月 08, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve GC stress log instrumentation (#53547)
上级
54f78b8a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
164 addition
and
252 deletion
+164
-252
src/coreclr/gc/env/gcenv.h
src/coreclr/gc/env/gcenv.h
+1
-125
src/coreclr/gc/gc.cpp
src/coreclr/gc/gc.cpp
+4
-1
src/coreclr/inc/gcmsg.inl
src/coreclr/inc/gcmsg.inl
+132
-0
src/coreclr/inc/stresslog.h
src/coreclr/inc/stresslog.h
+1
-125
src/coreclr/tools/StressLogAnalyzer/StressLogPlugin/StressLogPlugin.cpp
...ols/StressLogAnalyzer/StressLogPlugin/StressLogPlugin.cpp
+26
-1
未找到文件。
src/coreclr/gc/env/gcenv.h
浏览文件 @
e42c8965
...
...
@@ -195,131 +195,7 @@ enum LogLevel
class
ThreadStressLog
{
public:
static
const
char
*
gcStartMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"{ =========== BEGINGC %d, (requested generation = %lu, collect_classes = %lu) ==========
\n
"
;
}
static
const
char
*
gcEndMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"========== ENDGC %d (gen = %lu, collect_classes = %lu) ===========}
\n
"
;
}
static
const
char
*
gcRootMsg
()
{
STATIC_CONTRACT_LEAF
;
return
" GC Root %p RELOCATED %p -> %p MT = %pT
\n
"
;
}
static
const
char
*
gcRootPromoteMsg
()
{
STATIC_CONTRACT_LEAF
;
return
" IGCHeap::Promote: Promote GC Root *%p = %p MT = %pT
\n
"
;
}
static
const
char
*
gcPlugMoveMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"GC_HEAP RELOCATING Objects in heap within range [%p %p) by -0x%x bytes
\n
"
;
}
static
const
char
*
gcServerThread0StartMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"%d gc thread waiting..."
;
}
static
const
char
*
gcServerThreadNStartMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"%d gc thread waiting... Done"
;
}
static
const
char
*
gcDetailedStartMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"*GC* %d(gen0:%d)(%d)(alloc: %Id)(%s)(%d)"
;
}
static
const
char
*
gcDetailedEndMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"*EGC* %Id(gen0:%Id)(%Id)(%d)(%s)(%s)(%s)(ml: %d->%d)"
;
}
static
const
char
*
gcStartMarkMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"---- Mark Phase on heap %d condemning %d ----"
;
}
static
const
char
*
gcStartPlanMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"---- Plan Phase on heap %d ---- Condemned generation %d, promotion: %d"
;
}
static
const
char
*
gcStartRelocateMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"---- Relocate phase on heap %d -----"
;
}
static
const
char
*
gcEndRelocateMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"---- End of Relocate phase on heap %d ----"
;
}
static
const
char
*
gcStartCompactMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"---- Compact Phase on heap %d: %Ix(%Ix)----"
;
}
static
const
char
*
gcEndCompactMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"---- End of Compact phase on heap %d ----"
;
}
static
const
char
*
gcMemCopyMsg
()
{
STATIC_CONTRACT_LEAF
;
return
" mc: [%Ix->%Ix, %Ix->%Ix["
;
}
static
const
char
*
gcPlanPlugMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"(%Ix)[%Ix->%Ix, NA: [%Ix(%Id), %Ix[: %Ix(%d), x: %Ix (%s)"
;
}
static
const
char
*
gcPlanPinnedPlugMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"(%Ix)PP: [%Ix, %Ix[%Ix](m:%d)"
;
}
static
const
char
*
gcDesiredNewAllocationMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"h%d g%d surv: %Id current: %Id alloc: %Id (%d%%) f: %d%% new-size: %Id new-alloc: %Id"
;
}
static
const
char
*
gcMakeUnusedArrayMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"Making unused array [%Ix, %Ix["
;
}
static
const
char
*
gcStartBgcThread
()
{
STATIC_CONTRACT_LEAF
;
return
"beginning of bgc on heap %d: gen2 FL: %d, FO: %d, frag: %d"
;
}
#include "../../inc/gcmsg.inl"
};
struct
StressLogMsg
...
...
src/coreclr/gc/gc.cpp
浏览文件 @
e42c8965
...
...
@@ -29214,6 +29214,7 @@ void gc_heap::relocate_address (uint8_t** pold_address THREAD_NUMBER_DCL)
}
}
dprintf (4, (ThreadStressLog::gcRelocateReferenceMsg(), pold_address, old_address, new_address));
*pold_address = new_address;
return;
}
...
...
@@ -29243,7 +29244,9 @@ void gc_heap::relocate_address (uint8_t** pold_address THREAD_NUMBER_DCL)
#endif
)
{
*pold_address = old_address + loh_node_relocation_distance (old_address);
new_address = old_address + loh_node_relocation_distance (old_address);
dprintf (4, (ThreadStressLog::gcRelocateReferenceMsg(), pold_address, old_address, new_address));
*pold_address = new_address;
}
}
}
src/coreclr/inc/gcmsg.inl
0 → 100644
浏览文件 @
e42c8965
static const char* gcStartMsg()
{
STATIC_CONTRACT_LEAF;
return "{ =========== BEGINGC %d, (requested generation = %lu, collect_classes = %lu) ==========\n";
}
static const char* gcEndMsg()
{
STATIC_CONTRACT_LEAF;
return "========== ENDGC %d (gen = %lu, collect_classes = %lu) ===========}\n";
}
static const char* gcRootMsg()
{
STATIC_CONTRACT_LEAF;
return " GC Root %p RELOCATED %p -> %p MT = %pT\n";
}
static const char* gcRootPromoteMsg()
{
STATIC_CONTRACT_LEAF;
return " IGCHeap::Promote: Promote GC Root *%p = %p MT = %pT\n";
}
static const char* gcPlugMoveMsg()
{
STATIC_CONTRACT_LEAF;
return "GC_HEAP RELOCATING Objects in heap within range [%p %p) by -0x%x bytes\n";
}
static const char* gcServerThread0StartMsg()
{
STATIC_CONTRACT_LEAF;
return "%d gc thread waiting...";
}
static const char* gcServerThreadNStartMsg()
{
STATIC_CONTRACT_LEAF;
return "%d gc thread waiting... Done";
}
static const char* gcDetailedStartMsg()
{
STATIC_CONTRACT_LEAF;
return "*GC* %d(gen0:%d)(%d)(alloc: %Id)(%s)(%d)";
}
static const char* gcDetailedEndMsg()
{
STATIC_CONTRACT_LEAF;
return "*EGC* %Id(gen0:%Id)(%Id)(%d)(%s)(%s)(%s)(ml: %d->%d)";
}
static const char* gcStartMarkMsg()
{
STATIC_CONTRACT_LEAF;
return "---- Mark Phase on heap %d condemning %d ----";
}
static const char* gcStartPlanMsg()
{
STATIC_CONTRACT_LEAF;
return "---- Plan Phase on heap %d ---- Condemned generation %d, promotion: %d";
}
static const char* gcStartRelocateMsg()
{
STATIC_CONTRACT_LEAF;
return "---- Relocate phase on heap %d -----";
}
static const char* gcEndRelocateMsg()
{
STATIC_CONTRACT_LEAF;
return "---- End of Relocate phase on heap %d ----";
}
static const char* gcStartCompactMsg()
{
STATIC_CONTRACT_LEAF;
return "---- Compact Phase on heap %d: %Ix(%Ix)----";
}
static const char* gcEndCompactMsg()
{
STATIC_CONTRACT_LEAF;
return "---- End of Compact phase on heap %d ----";
}
static const char* gcMemCopyMsg()
{
STATIC_CONTRACT_LEAF;
return " mc: [%Ix->%Ix, %Ix->%Ix[";
}
static const char* gcPlanPlugMsg()
{
STATIC_CONTRACT_LEAF;
return "(%Ix)[%Ix->%Ix, NA: [%Ix(%Id), %Ix[: %Ix(%d), x: %Ix (%s)";
}
static const char* gcPlanPinnedPlugMsg()
{
STATIC_CONTRACT_LEAF;
return "(%Ix)PP: [%Ix, %Ix[%Ix](m:%d)";
}
static const char* gcDesiredNewAllocationMsg()
{
STATIC_CONTRACT_LEAF;
return "h%d g%d surv: %Id current: %Id alloc: %Id (%d%%) f: %d%% new-size: %Id new-alloc: %Id";
}
static const char* gcMakeUnusedArrayMsg()
{
STATIC_CONTRACT_LEAF;
return "Making unused array [%Ix, %Ix[";
}
static const char* gcStartBgcThread()
{
STATIC_CONTRACT_LEAF;
return "beginning of bgc on heap %d: gen2 FL: %d, FO: %d, frag: %d";
}
static const char* gcRelocateReferenceMsg()
{
STATIC_CONTRACT_LEAF;
return "Relocating reference *(%p) from %p to %p";
}
src/coreclr/inc/stresslog.h
浏览文件 @
e42c8965
...
...
@@ -787,131 +787,7 @@ public:
}
#endif //STRESS_LOG_READONLY
static
const
char
*
gcStartMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"{ =========== BEGINGC %d, (requested generation = %lu, collect_classes = %lu) ==========
\n
"
;
}
static
const
char
*
gcEndMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"========== ENDGC %d (gen = %lu, collect_classes = %lu) ===========}
\n
"
;
}
static
const
char
*
gcRootMsg
()
{
STATIC_CONTRACT_LEAF
;
return
" GC Root %p RELOCATED %p -> %p MT = %pT
\n
"
;
}
static
const
char
*
gcRootPromoteMsg
()
{
STATIC_CONTRACT_LEAF
;
return
" IGCHeap::Promote: Promote GC Root *%p = %p MT = %pT
\n
"
;
}
static
const
char
*
gcPlugMoveMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"GC_HEAP RELOCATING Objects in heap within range [%p %p) by -0x%x bytes
\n
"
;
}
static
const
char
*
gcServerThread0StartMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"%d gc thread waiting..."
;
}
static
const
char
*
gcServerThreadNStartMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"%d gc thread waiting... Done"
;
}
static
const
char
*
gcDetailedStartMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"*GC* %d(gen0:%d)(%d)(alloc: %Id)(%s)(%d)"
;
}
static
const
char
*
gcDetailedEndMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"*EGC* %Id(gen0:%Id)(%Id)(%d)(%s)(%s)(%s)(ml: %d->%d)"
;
}
static
const
char
*
gcStartMarkMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"---- Mark Phase on heap %d condemning %d ----"
;
}
static
const
char
*
gcStartPlanMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"---- Plan Phase on heap %d ---- Condemned generation %d, promotion: %d"
;
}
static
const
char
*
gcStartRelocateMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"---- Relocate phase on heap %d -----"
;
}
static
const
char
*
gcEndRelocateMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"---- End of Relocate phase on heap %d ----"
;
}
static
const
char
*
gcStartCompactMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"---- Compact Phase on heap %d: %Ix(%Ix)----"
;
}
static
const
char
*
gcEndCompactMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"---- End of Compact phase on heap %d ----"
;
}
static
const
char
*
gcMemCopyMsg
()
{
STATIC_CONTRACT_LEAF
;
return
" mc: [%Ix->%Ix, %Ix->%Ix["
;
}
static
const
char
*
gcPlanPlugMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"(%Ix)[%Ix->%Ix, NA: [%Ix(%Id), %Ix[: %Ix(%d), x: %Ix (%s)"
;
}
static
const
char
*
gcPlanPinnedPlugMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"(%Ix)PP: [%Ix, %Ix[%Ix](m:%d)"
;
}
static
const
char
*
gcDesiredNewAllocationMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"h%d g%d surv: %Id current: %Id alloc: %Id (%d%%) f: %d%% new-size: %Id new-alloc: %Id"
;
}
static
const
char
*
gcMakeUnusedArrayMsg
()
{
STATIC_CONTRACT_LEAF
;
return
"Making unused array [%Ix, %Ix["
;
}
static
const
char
*
gcStartBgcThread
()
{
STATIC_CONTRACT_LEAF
;
return
"beginning of bgc on heap %d: gen2 FL: %d, FO: %d, frag: %d"
;
}
#include "gcmsg.inl"
static
const
char
*
TaskSwitchMsg
()
{
...
...
src/coreclr/tools/StressLogAnalyzer/StressLogPlugin/StressLogPlugin.cpp
浏览文件 @
e42c8965
...
...
@@ -139,6 +139,7 @@ d(IS_PLAN_PINNED_PLUG, ThreadStressLog::gcPlanPinnedPlugMsg())
d(IS_DESIRED_NEW_ALLOCATION, ThreadStressLog::gcDesiredNewAllocationMsg()) \
d(IS_MAKE_UNUSED_ARRAY, ThreadStressLog::gcMakeUnusedArrayMsg()) \
d(IS_START_BGC_THREAD, ThreadStressLog::gcStartBgcThread()) \
d(IS_RELOCATE_REFERENCE, ThreadStressLog::gcRelocateReferenceMsg()) \
d(IS_UNINTERESTING, "")
enum
InterestingStringId
:
unsigned
char
...
...
@@ -469,6 +470,26 @@ bool FilterMessage(StressLog::StressLogHeader* hdr, ThreadStressLog* tsl, uint32
case
IS_START_BGC_THREAD
:
RememberThreadForHeap
(
tsl
->
threadId
,
(
int64_t
)
args
[
0
],
GC_THREAD_BG
);
break
;
case
IS_RELOCATE_REFERENCE
:
if
(
s_valueFilterCount
>
0
)
{
size_t
src
=
(
size_t
)
args
[
0
];
size_t
dst_from
=
(
size_t
)
args
[
1
];
size_t
dst_to
=
(
size_t
)
args
[
2
];
// print this message if the source or destination contain (part of) the range we're looking for
for
(
int
i
=
0
;
i
<
s_valueFilterCount
;
i
++
)
{
if
((
s_valueFilter
[
i
].
end
<
src
||
src
<
s_valueFilter
[
i
].
start
)
&&
(
s_valueFilter
[
i
].
end
<
dst_from
||
dst_from
<
s_valueFilter
[
i
].
start
))
&&
(
s_valueFilter
[
i
].
end
<
dst_to
||
dst_to
<
s_valueFilter
[
i
].
start
))
{
// empty intersection with both the source and the destination
continue
;
}
return
true
;
}
}
break
;
}
return
fLevelFilter
||
s_interestingStringFilter
[
isd
];
}
...
...
@@ -521,7 +542,7 @@ static ThreadStressLogDesc s_threadStressLogDesc[MAX_THREADSTRESSLOGS];
static
int
s_threadStressLogCount
;
static
LONG
s_wrappedWriteThreadCount
;
static
const
LONG
MAX_MESSAGE_COUNT
=
102
4
*
1024
*
1024
;
static
const
LONG
MAX_MESSAGE_COUNT
=
6
4
*
1024
*
1024
;
static
StressThreadAndMsg
*
s_threadMsgBuf
;
static
volatile
LONG
s_msgCount
=
0
;
static
volatile
LONG
s_totalMsgCount
=
0
;
...
...
@@ -956,6 +977,10 @@ bool ParseOptions(int argc, wchar_t* argv[])
return
false
;
}
}
else
{
return
false
;
}
i
++
;
}
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录