Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
dc6ae366
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
1 年多 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
dc6ae366
编写于
8月 11, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 11, 2023
浏览文件
操作
浏览文件
下载
差异文件
!1021 修复trace_marker测试用例超时
Merge pull request !1021 from zzulilyw/master
上级
55e3d212
f4f2637e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
42 addition
and
49 deletion
+42
-49
libc-test/src/functionalext/trace/trace_marker.c
libc-test/src/functionalext/trace/trace_marker.c
+42
-49
未找到文件。
libc-test/src/functionalext/trace/trace_marker.c
浏览文件 @
dc6ae366
...
...
@@ -51,6 +51,8 @@
_rc; \
})
#endif
#define ENABLE_TRACE system("echo 1 > /sys/kernel/debug/tracing/tracing_on");
#define DISABLE_TRACE system("echo 0 > /sys/kernel/debug/tracing/tracing_on");
typedef
void
(
*
TEST_FUN
)(
void
);
static
const
int
WAIT_TIME
=
1
;
...
...
@@ -96,10 +98,10 @@ static void dump_trace(int trace_fd)
static
void
trace_marker_0010
(
void
)
{
clear_trace
();
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_begin
(
HITRACE_TAG_MUSL
,
"Musl_Trace_Marker_0010"
,
""
);
trace_marker_end
(
HITRACE_TAG_MUSL
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -147,10 +149,10 @@ static void trace_marker_0010(void)
static
void
trace_marker_0020
(
void
)
{
clear_trace
();
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_async_begin
(
HITRACE_TAG_MUSL
,
"async_begin_0200"
,
"trace_async"
,
1
);
trace_marker_async_end
(
HITRACE_TAG_MUSL
,
"async_end_0200"
,
"trace_async"
,
1
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -198,10 +200,10 @@ static void trace_marker_0020(void)
static
void
trace_marker_0030
(
void
)
{
clear_trace
();
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
int
traceCount
=
5
;
trace_marker_count
(
HITRACE_TAG_MUSL
,
"traceCount"
,
traceCount
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -256,10 +258,10 @@ static void trace_marker_0040(void)
printf
(
"error in fork!
\n
"
);
}
else
if
(
fpid
==
0
)
{
int
pidChild
=
getpid
();
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_begin
(
HITRACE_TAG_MUSL
,
"Trace_Marker0400_Forkfir"
,
""
);
trace_marker_end
(
HITRACE_TAG_MUSL
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
|
O_APPEND
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -294,10 +296,10 @@ static void trace_marker_0040(void)
close
(
trace_fd
);
exit
(
pidChild
);
}
else
{
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_begin
(
HITRACE_TAG_MUSL
,
"Trace_Marker0400_Forksec"
,
""
);
trace_marker_end
(
HITRACE_TAG_MUSL
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
|
O_APPEND
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -353,10 +355,10 @@ static void trace_marker_0050(void)
printf
(
"error in fork!
\n
"
);
}
else
if
(
fpid
==
0
)
{
int
pidChild
=
getpid
();
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_async_begin
(
HITRACE_TAG_MUSL
,
"async0500_Forkfir"
,
"begin_fir"
,
2
);
trace_marker_async_end
(
HITRACE_TAG_MUSL
,
"async0500_Forkfir"
,
"end_fir"
,
2
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
|
O_APPEND
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -391,10 +393,10 @@ static void trace_marker_0050(void)
close
(
trace_fd
);
exit
(
pidChild
);
}
else
{
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_async_begin
(
HITRACE_TAG_MUSL
,
"async0500_Forksec"
,
"begin_sec"
,
3
);
trace_marker_async_end
(
HITRACE_TAG_MUSL
,
"async0500_Forksec"
,
"end_sec"
,
3
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
|
O_APPEND
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -451,9 +453,9 @@ static void trace_marker_0060(void)
}
else
if
(
fpid
==
0
)
{
int
pidChild
=
getpid
();
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_count
(
HITRACE_TAG_MUSL
,
"traceCount_forkfir"
,
traceCount
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
|
O_APPEND
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -482,9 +484,9 @@ static void trace_marker_0060(void)
close
(
trace_fd
);
exit
(
pidChild
);
}
else
{
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_count
(
HITRACE_TAG_MUSL
,
"traceCount_forksec"
,
traceCount
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
|
O_APPEND
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -516,10 +518,8 @@ static void trace_marker_0060(void)
static
void
*
ThreadTraceMarkerFir
(
void
*
arg
)
{
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
trace_marker_begin
(
HITRACE_TAG_MUSL
,
"Trace_Marker_Threadfir"
,
"pthreadfir"
);
trace_marker_end
(
HITRACE_TAG_MUSL
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -562,10 +562,8 @@ static void *ThreadTraceMarkerFir(void *arg)
static
void
*
ThreadTraceMarkerSec
(
void
*
arg
)
{
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
trace_marker_begin
(
HITRACE_TAG_MUSL
,
"Trace_Marker_Threadsec"
,
"pthreadsec"
);
trace_marker_end
(
HITRACE_TAG_MUSL
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -613,6 +611,7 @@ static void *ThreadTraceMarkerSec(void *arg)
*/
static
void
trace_marker_0070
(
void
)
{
ENABLE_TRACE
clear_trace
();
int
res
;
const
char
msgThread1
[
1024
]
=
{
"msgThread1"
};
...
...
@@ -622,21 +621,19 @@ static void trace_marker_0070(void)
if
(
res
!=
0
)
{
t_printf
(
"pthread_create1 error."
);
}
sleep
(
WAIT_TIME
);
res
=
pthread_create
(
&
fatalMessageThread2
,
NULL
,
ThreadTraceMarkerSec
,
(
void
*
)
msgThread2
);
if
(
res
!=
0
)
{
t_printf
(
"pthread_create2 error."
);
}
pthread_join
(
fatalMessageThread1
,
NULL
);
pthread_join
(
fatalMessageThread2
,
NULL
);
DISABLE_TRACE
}
static
void
*
ThreadTraceMarkerAsyncFir
(
void
*
arg
)
{
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
trace_marker_async_begin
(
HITRACE_TAG_MUSL
,
"Async_Threadfir"
,
"begin_threadfir"
,
4
);
trace_marker_async_end
(
HITRACE_TAG_MUSL
,
"Async_Threadfir"
,
"end_threadfir"
,
4
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -679,10 +676,8 @@ static void *ThreadTraceMarkerAsyncFir(void *arg)
static
void
*
ThreadTraceMarkerAsyncSec
(
void
*
arg
)
{
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
trace_marker_async_begin
(
HITRACE_TAG_MUSL
,
"Async_Threadsec"
,
"begin_threadsec"
,
5
);
trace_marker_async_end
(
HITRACE_TAG_MUSL
,
"Async_Threadsec"
,
"end_threadsec"
,
5
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -730,6 +725,7 @@ static void *ThreadTraceMarkerAsyncSec(void *arg)
*/
static
void
trace_marker_0080
(
void
)
{
ENABLE_TRACE
clear_trace
();
int
res
;
const
char
msgThread1
[
1024
]
=
{
"msgThread3"
};
...
...
@@ -739,21 +735,19 @@ static void trace_marker_0080(void)
if
(
res
!=
0
)
{
t_printf
(
"pthread_create3 error."
);
}
sleep
(
WAIT_TIME
);
res
=
pthread_create
(
&
fatalMessageThread2
,
NULL
,
ThreadTraceMarkerAsyncSec
,
(
void
*
)
msgThread2
);
if
(
res
!=
0
)
{
t_printf
(
"pthread_create4 error."
);
}
pthread_join
(
fatalMessageThread1
,
NULL
);
pthread_join
(
fatalMessageThread2
,
NULL
);
DISABLE_TRACE
}
static
void
*
ThreadTraceMarkerCountFir
(
void
*
arg
)
{
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
int
traceCount
=
5
;
trace_marker_count
(
HITRACE_TAG_MUSL
,
"traceCount_Threadfir"
,
traceCount
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -791,10 +785,8 @@ static void *ThreadTraceMarkerCountFir(void *arg)
static
void
*
ThreadTraceMarkerCountSec
(
void
*
arg
)
{
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
int
traceCount
=
5
;
trace_marker_count
(
HITRACE_TAG_MUSL
,
"traceCount_Threadsec"
,
traceCount
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -836,6 +828,7 @@ static void *ThreadTraceMarkerCountSec(void *arg)
*/
static
void
trace_marker_0090
(
void
)
{
ENABLE_TRACE
clear_trace
();
int
res
;
const
char
msgThread1
[
1024
]
=
{
"msgThread5"
};
...
...
@@ -845,13 +838,13 @@ static void trace_marker_0090(void)
if
(
res
!=
0
)
{
t_printf
(
"pthread_create5 error."
);
}
sleep
(
WAIT_TIME
);
res
=
pthread_create
(
&
fatalMessageThread2
,
NULL
,
ThreadTraceMarkerCountSec
,
(
void
*
)
msgThread2
);
if
(
res
!=
0
)
{
t_printf
(
"pthread_create6 error."
);
}
pthread_join
(
fatalMessageThread1
,
NULL
);
pthread_join
(
fatalMessageThread2
,
NULL
);
DISABLE_TRACE
}
/**
...
...
@@ -862,10 +855,10 @@ static void trace_marker_0090(void)
static
void
trace_marker_0100
(
void
)
{
clear_trace
();
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_begin
(
HITRACE_TAG_MUSL
,
"Musl_Trace_Marker_0100"
,
NULL
);
trace_marker_end
(
HITRACE_TAG_MUSL
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -918,10 +911,10 @@ static void trace_marker_0110(void)
memset
(
message
,
1
,
1025
);
message
[
1025
]
=
'\0'
;
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_begin
(
HITRACE_TAG_MUSL
,
message
,
""
);
trace_marker_end
(
HITRACE_TAG_MUSL
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -971,10 +964,10 @@ static void trace_marker_0110(void)
static
void
trace_marker_0120
(
void
)
{
clear_trace
();
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_begin
(
HITRACE_TAG_MUSL
,
NULL
,
""
);
trace_marker_end
(
HITRACE_TAG_MUSL
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -1015,10 +1008,10 @@ static void trace_marker_0120(void)
static
void
trace_marker_0140
(
void
)
{
clear_trace
();
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_async_begin
(
HITRACE_TAG_MUSL
,
"async_begin_0200"
,
NULL
,
1
);
trace_marker_async_end
(
HITRACE_TAG_MUSL
,
"async_end_0200"
,
NULL
,
1
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -1072,10 +1065,10 @@ static void trace_marker_0150(void)
memset
(
message
,
1
,
1025
);
message
[
1025
]
=
'\0'
;
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_async_begin
(
HITRACE_TAG_MUSL
,
message
,
"trace_async"
,
1
);
trace_marker_async_end
(
HITRACE_TAG_MUSL
,
message
,
"trace_async"
,
1
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -1123,10 +1116,10 @@ static void trace_marker_0150(void)
static
void
trace_marker_0160
(
void
)
{
clear_trace
();
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
trace_marker_async_begin
(
HITRACE_TAG_MUSL
,
NULL
,
"trace_async"
,
1
);
trace_marker_async_end
(
HITRACE_TAG_MUSL
,
NULL
,
"trace_async"
,
1
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -1174,14 +1167,14 @@ static void trace_marker_0160(void)
static
void
trace_marker_0180
(
void
)
{
clear_trace
();
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
int
traceCount
=
5
;
char
message
[
1026
]
=
{
0
};
memset
(
message
,
1
,
1025
);
message
[
1025
]
=
'\0'
;
trace_marker_count
(
HITRACE_TAG_MUSL
,
message
,
traceCount
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
@@ -1224,10 +1217,10 @@ static void trace_marker_0180(void)
static
void
trace_marker_0190
(
void
)
{
clear_trace
();
system
(
"cd /sys/kernel/debug/tracing;echo 1 > tracing_on"
);
ENABLE_TRACE
int
traceCount
=
5
;
trace_marker_count
(
HITRACE_TAG_MUSL
,
NULL
,
traceCount
);
system
(
"cd /sys/kernel/debug/tracing;echo 0 > tracing_on"
);
DISABLE_TRACE
int
trace_fd
=
open
(
"/sys/kernel/tracing/trace"
,
O_CLOEXEC
|
O_RDONLY
);
if
(
trace_fd
==
-
1
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录