Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
0ffcb2ca
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0ffcb2ca
编写于
11月 01, 2011
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'stefanha/tracing' into staging
上级
110fc086
454e202d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
41 addition
and
4 deletion
+41
-4
docs/tracing.txt
docs/tracing.txt
+8
-1
trace/simple.c
trace/simple.c
+17
-2
trace/stderr.c
trace/stderr.c
+16
-1
未找到文件。
docs/tracing.txt
浏览文件 @
0ffcb2ca
...
...
@@ -132,12 +132,19 @@ This functionality is also provided through monitor commands:
means disabled.
* trace-event NAME on|off
Enable/disable a given trace event.
Enable/disable a given trace event or a group of events having common prefix
through wildcard.
The "-trace events=<file>" command line argument can be used to enable the
events listed in <file> from the very beginning of the program. This file must
contain one event name per line.
A basic wildcard matching is supported in both the monitor command "trace
-event" and the events list file. That means you can enable/disable the events
having a common prefix in a batch. For example, virtio-blk trace events could
be enabled using:
trace-event virtio_blk_* on
== Trace backends ==
The "tracetool" script automates tedious trace event code generation and also
...
...
trace/simple.c
浏览文件 @
0ffcb2ca
...
...
@@ -324,14 +324,29 @@ void trace_print_events(FILE *stream, fprintf_function stream_printf)
bool
trace_event_set_state
(
const
char
*
name
,
bool
state
)
{
unsigned
int
i
;
unsigned
int
len
;
bool
wildcard
=
false
;
bool
matched
=
false
;
len
=
strlen
(
name
);
if
(
len
>
0
&&
name
[
len
-
1
]
==
'*'
)
{
wildcard
=
true
;
len
-=
1
;
}
for
(
i
=
0
;
i
<
NR_TRACE_EVENTS
;
i
++
)
{
if
(
wildcard
)
{
if
(
!
strncmp
(
trace_list
[
i
].
tp_name
,
name
,
len
))
{
trace_list
[
i
].
state
=
state
;
matched
=
true
;
}
continue
;
}
if
(
!
strcmp
(
trace_list
[
i
].
tp_name
,
name
))
{
trace_list
[
i
].
state
=
state
;
return
true
;
}
}
return
false
;
return
matched
;
}
/* Helper function to create a thread with signals blocked. Use glib's
...
...
trace/stderr.c
浏览文件 @
0ffcb2ca
...
...
@@ -15,14 +15,29 @@ void trace_print_events(FILE *stream, fprintf_function stream_printf)
bool
trace_event_set_state
(
const
char
*
name
,
bool
state
)
{
unsigned
int
i
;
unsigned
int
len
;
bool
wildcard
=
false
;
bool
matched
=
false
;
len
=
strlen
(
name
);
if
(
len
>
0
&&
name
[
len
-
1
]
==
'*'
)
{
wildcard
=
true
;
len
-=
1
;
}
for
(
i
=
0
;
i
<
NR_TRACE_EVENTS
;
i
++
)
{
if
(
wildcard
)
{
if
(
!
strncmp
(
trace_list
[
i
].
tp_name
,
name
,
len
))
{
trace_list
[
i
].
state
=
state
;
matched
=
true
;
}
continue
;
}
if
(
!
strcmp
(
trace_list
[
i
].
tp_name
,
name
))
{
trace_list
[
i
].
state
=
state
;
return
true
;
}
}
return
false
;
return
matched
;
}
bool
trace_backend_init
(
const
char
*
events
,
const
char
*
file
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录