Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
3118c289
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
1 年多 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3118c289
编写于
5月 30, 2022
作者:
M
Mupceet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
init: fix bugs
Signed-off-by:
N
Mupceet
<
laiguizhong@huawei.com
>
上级
8cb57654
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
8 addition
and
14 deletion
+8
-14
services/begetctl/BUILD.gn
services/begetctl/BUILD.gn
+1
-0
services/init/include/init_service_manager.h
services/init/include/init_service_manager.h
+1
-4
services/init/init_service_manager.c
services/init/init_service_manager.c
+1
-3
services/init/standard/init.c
services/init/standard/init.c
+5
-5
services/init/standard/init_control_fd_service.c
services/init/standard/init_control_fd_service.c
+0
-2
未找到文件。
services/begetctl/BUILD.gn
浏览文件 @
3118c289
...
...
@@ -130,6 +130,7 @@ if (defined(ohos_lite)) {
"stop_service",
"service",
"sandbox",
"dump_service",
]
install_images = [ "system" ]
...
...
services/init/include/init_service_manager.h
浏览文件 @
3118c289
...
...
@@ -63,11 +63,8 @@ void ReleaseService(Service *service);
void
StartAllServices
(
int
startMode
);
void
LoadAccessTokenId
(
void
);
Service
*
AddService
(
const
char
*
name
);
#ifdef OHOS_SERVICE_DUMP
void
DumpAllServices
();
void
DumpAllServices
(
void
);
void
DumpOneService
(
const
Service
*
service
);
#endif
#ifdef __cplusplus
#if __cplusplus
}
...
...
services/init/init_service_manager.c
浏览文件 @
3118c289
...
...
@@ -43,7 +43,6 @@ static const int CRITICAL_DEFAULT_CRASH_TIME = 20;
static
const
int
CRITICAL_DEFAULT_CRASH_COUNT
=
4
;
static
const
int
CRITICAL_CONFIG_ARRAY_LEN
=
3
;
#ifdef OHOS_SERVICE_DUMP
static
void
DumpServiceArgs
(
const
char
*
info
,
const
ServiceArgs
*
args
)
{
printf
(
"
\t
service %s count %d
\n
"
,
info
,
args
->
count
);
...
...
@@ -116,7 +115,7 @@ void DumpOneService(const Service *service)
}
}
void
DumpAllServices
()
void
DumpAllServices
(
void
)
{
printf
(
"Ready to dump all services:
\n
"
);
printf
(
"total service number: %d
\n
"
,
g_serviceSpace
.
serviceCount
);
...
...
@@ -132,7 +131,6 @@ void DumpAllServices()
}
printf
(
"Dump all services finished
\n
"
);
}
#endif
static
void
FreeServiceArg
(
ServiceArgs
*
arg
)
{
...
...
services/init/standard/init.c
浏览文件 @
3118c289
...
...
@@ -266,7 +266,6 @@ static int SystemDump(int id, const char *name, int argc, const char **argv)
{
INIT_ERROR_CHECK
(
argv
!=
NULL
&&
argc
>=
1
,
return
0
,
"Invalid install parameter"
);
INIT_LOGI
(
"Dump system info %s"
,
argv
[
0
]);
DumpAllServices
();
SystemDumpParameters
(
1
);
SystemDumpTriggers
(
1
);
return
0
;
...
...
@@ -318,18 +317,19 @@ static void InitPreHook(const HOOK_INFO *hookInfo)
static
void
InitPostHook
(
const
HOOK_INFO
*
hookInfo
)
{
long
long
diff
;
const
long
long
baseTime
=
1000
;
HOOK_TIMING_STAT
*
stat
=
(
HOOK_TIMING_STAT
*
)
hookInfo
->
cookie
;
clock_gettime
(
CLOCK_MONOTONIC
,
&
(
stat
->
endTime
));
diff
=
(
long
long
)((
stat
->
endTime
.
tv_sec
-
stat
->
startTime
.
tv_sec
)
/
1000
);
diff
=
(
long
long
)((
stat
->
endTime
.
tv_sec
-
stat
->
startTime
.
tv_sec
)
/
baseTime
);
if
(
stat
->
endTime
.
tv_nsec
>
stat
->
startTime
.
tv_nsec
)
{
diff
+=
(
stat
->
endTime
.
tv_nsec
-
stat
->
startTime
.
tv_nsec
)
*
1000
;
diff
+=
(
stat
->
endTime
.
tv_nsec
-
stat
->
startTime
.
tv_nsec
)
*
baseTime
;
}
else
{
diff
-=
(
stat
->
endTime
.
tv_nsec
-
stat
->
startTime
.
tv_nsec
)
*
1000
;
diff
-=
(
stat
->
endTime
.
tv_nsec
-
stat
->
startTime
.
tv_nsec
)
*
baseTime
;
}
INIT_LOGV
(
"Executing hook [%d:%d:%p] cost [%lld]ms, return %d."
,
hookInfo
->
stage
,
hookInfo
->
prio
,
hookInfo
->
hook
,
diff
,
hookInfo
->
retVal
);
hookInfo
->
stage
,
hookInfo
->
prio
,
hookInfo
->
hook
,
diff
,
hookInfo
->
retVal
);
}
void
SystemConfig
(
void
)
...
...
services/init/standard/init_control_fd_service.c
浏览文件 @
3118c289
...
...
@@ -47,11 +47,9 @@ static void ProcessDumpServiceControlFd(uint16_t type, const char *serviceCmd)
Service
*
service
=
GetServiceByName
(
serviceCmd
);
if
(
service
==
NULL
)
{
#ifdef OHOS_SERVICE_DUMP
DumpAllServices
();
}
else
{
DumpOneService
(
service
);
#endif
}
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录