Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
bingbingbingbing
mono
提交
44b1144e
M
mono
项目概览
bingbingbingbing
/
mono
与 Fork 源项目一致
从无法访问的项目Fork
通知
35
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mono
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
44b1144e
编写于
4月 18, 2014
作者:
R
Rodrigo Kumpera
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[counters] Introduce variance and units.
上级
8e4d85b5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
3 deletion
+33
-3
mono/utils/mono-counters.c
mono/utils/mono-counters.c
+13
-1
mono/utils/mono-counters.h
mono/utils/mono-counters.h
+20
-2
未找到文件。
mono/utils/mono-counters.c
浏览文件 @
44b1144e
...
...
@@ -20,6 +20,18 @@ static MonoCounter *counters = NULL;
static
int
valid_mask
=
0
;
static
int
set_mask
=
0
;
static
int
mono_counter_get_variance
(
MonoCounter
*
counter
)
{
return
counter
->
type
&
MONO_COUNTER_VARIANCE_MASK
;
}
static
int
mono_counter_get_unit
(
MonoCounter
*
counter
)
{
return
counter
->
type
&
MONO_COUNTER_UNIT_MASK
;
}
/**
* mono_counters_enable:
* @section_mask: a mask listing the sections that will be displayed
...
...
@@ -170,7 +182,7 @@ mono_counters_dump_section (int section, FILE *outfile)
{
MonoCounter
*
counter
=
counters
;
while
(
counter
)
{
if
(
counter
->
type
&
section
)
if
(
counter
->
type
&
section
&&
mono_counter_get_variance
(
counter
)
==
MONO_COUNTER_MONOTONIC
)
dump_counter
(
counter
,
outfile
);
counter
=
counter
->
next
;
}
...
...
mono/utils/mono-counters.h
浏览文件 @
44b1144e
...
...
@@ -5,6 +5,7 @@
#include <mono/utils/mono-publib.h>
enum
{
/* Counter type, bits 0-7. */
MONO_COUNTER_INT
,
/* 32 bit int */
MONO_COUNTER_UINT
,
/* 32 bit uint */
MONO_COUNTER_WORD
,
/* pointer-sized int */
...
...
@@ -16,7 +17,7 @@ enum {
MONO_COUNTER_TYPE_MASK
=
0xf
,
MONO_COUNTER_CALLBACK
=
128
,
/* ORed with the other values */
MONO_COUNTER_SECTION_MASK
=
0xffffff00
,
/*
sections
*/
/*
Sections, bits 8-15
*/
MONO_COUNTER_JIT
=
1
<<
8
,
MONO_COUNTER_GC
=
1
<<
9
,
MONO_COUNTER_METADATA
=
1
<<
10
,
...
...
@@ -24,7 +25,24 @@ enum {
MONO_COUNTER_SECURITY
=
1
<<
12
,
MONO_COUNTER_RUNTIME
=
1
<<
13
,
MONO_COUNTER_SYSTEM
=
1
<<
14
,
MONO_COUNTER_LAST_SECTION
MONO_COUNTER_LAST_SECTION
,
/* Unit, bits 16-23 */
MONO_COUNTER_UNIT_SHIFT
=
16
,
MONO_COUNTER_UNIT_MASK
=
0xFFu
<<
MONO_COUNTER_UNIT_SHIFT
,
MONO_COUNTER_RAW
=
0
<<
16
,
/* Raw value */
MONO_COUNTER_BYTES
=
1
<<
16
,
/* Quantity of bytes. RSS, active heap, etc */
MONO_COUNTER_TIME
=
2
<<
16
,
/* Time interval in 100ns units. Minor pause, JIT compilation*/
MONO_COUNTER_EVENTS
=
3
<<
16
,
/* Number of times the given event happens. Major collections, Compiled methods. */
MONO_COUNTER_ITEMS
=
4
<<
16
,
/* Current number of things. Threads, queued jobs.*/
MONO_COUNTER_PERCENTAGE
=
5
<<
16
,
/* [0-1] Fraction Percentage of something. Load average. */
/* Monotonicity, bits 24-31 */
MONO_COUNTER_VARIANCE_SHIFT
=
24
,
MONO_COUNTER_VARIANCE_MASK
=
0xFFu
<<
MONO_COUNTER_VARIANCE_SHIFT
,
MONO_COUNTER_MONOTONIC
=
0
<<
24
,
/* This counter value always increase/decreases over time. Reported by --stat. */
MONO_COUNTER_CONSTANT
=
1
<<
24
,
/* Fixed value. Used by configuration data. */
MONO_COUNTER_VARIABLE
=
2
<<
24
,
/* This counter value can be anything on each sampling. Only interesting when sampling. */
};
MONO_API
void
mono_counters_enable
(
int
section_mask
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录