Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
39632963
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看板
未验证
提交
39632963
编写于
5月 24, 2022
作者:
O
openharmony_ci
提交者:
Gitee
5月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
!641 fix bootchart 功能
Merge pull request !641 from Mupceet/bootchart
上级
d6c998f9
930dabc9
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
57 addition
and
14 deletion
+57
-14
interfaces/innerkits/hookmgr/hookmgr.c
interfaces/innerkits/hookmgr/hookmgr.c
+1
-1
interfaces/innerkits/modulemgr/modulemgr.c
interfaces/innerkits/modulemgr/modulemgr.c
+5
-2
services/init/module_engine/include/bootstage.h
services/init/module_engine/include/bootstage.h
+6
-1
services/init/module_engine/init_modulemgr.c
services/init/module_engine/init_modulemgr.c
+6
-3
services/init/standard/init.c
services/init/standard/init.c
+2
-3
services/init/standard/init_cmds.c
services/init/standard/init_cmds.c
+4
-2
services/modules/bootchart/bootchart.c
services/modules/bootchart/bootchart.c
+32
-1
services/modules/bootchart/bootchart_static.c
services/modules/bootchart/bootchart_static.c
+1
-1
未找到文件。
interfaces/innerkits/hookmgr/hookmgr.c
浏览文件 @
39632963
...
...
@@ -271,7 +271,7 @@ static int hookTraversalProc(ListNode *node, void *cookie)
if
((
args
!=
NULL
)
&&
(
args
->
preHook
!=
NULL
))
{
args
->
preHook
(
&
hookInfo
);
}
hookInfo
.
retVal
=
hookItem
->
hook
(
hookInfo
.
stage
,
hookItem
->
prio
,
args
->
cookie
);
hookInfo
.
retVal
=
hookItem
->
hook
(
hookInfo
.
stage
,
hookItem
->
prio
,
hookInfo
.
cookie
);
if
((
args
!=
NULL
)
&&
(
args
->
postHook
!=
NULL
))
{
args
->
postHook
(
&
hookInfo
);
}
...
...
interfaces/innerkits/modulemgr/modulemgr.c
浏览文件 @
39632963
...
...
@@ -22,6 +22,7 @@
#include <dirent.h>
#include <linux/limits.h>
#include "beget_ext.h"
#include "list.h"
#include "securec.h"
#include "modulemgr.h"
...
...
@@ -127,11 +128,13 @@ static void *moduleInstall(MODULE_ITEM *module, int argc, const char *argv[])
return
NULL
;
}
}
BEGET_LOGV
(
"moduleInstall path %s"
,
path
);
currentInstallArgs
=
&
(
module
->
moduleMgr
->
installArgs
);
handle
=
dlopen
(
path
,
RTLD_LAZY
|
RTLD_GLOBAL
);
currentInstallArgs
=
NULL
;
if
(
handle
==
NULL
)
{
BEGET_LOGE
(
"moduleInstall path %s fail %d"
,
path
,
errno
);
}
return
handle
;
}
...
...
services/init/module_engine/include/bootstage.h
浏览文件 @
39632963
...
...
@@ -29,7 +29,8 @@ enum INIT_BOOTSTAGE {
INIT_PRE_PARAM_SERVICE
=
10
,
INIT_PRE_PARAM_LOAD
=
20
,
INIT_PRE_CFG_LOAD
=
30
,
INIT_POST_CFG_LOAD
=
40
INIT_POST_PERSIST_PARAM_LOAD
=
40
,
INIT_POST_CFG_LOAD
=
50
};
inline
int
InitAddGlobalInitHook
(
int
prio
,
OhosHook
hook
)
...
...
@@ -57,6 +58,10 @@ inline int InitAddPostCfgLoadHook(int prio, OhosHook hook)
return
HookMgrAdd
(
NULL
,
INIT_POST_CFG_LOAD
,
prio
,
hook
);
}
inline
int
InitAddPostPersistParamLoadHook
(
int
prio
,
OhosHook
hook
)
{
return
HookMgrAdd
(
NULL
,
INIT_POST_PERSIST_PARAM_LOAD
,
prio
,
hook
);
}
#ifdef __cplusplus
#if __cplusplus
}
...
...
services/init/module_engine/init_modulemgr.c
浏览文件 @
39632963
...
...
@@ -25,7 +25,7 @@ int InitModuleMgrInstall(const char *moduleName)
}
if
(
defaultModuleMgr
==
NULL
)
{
defaultModuleMgr
=
ModuleMgrCreate
(
moduleName
);
defaultModuleMgr
=
ModuleMgrCreate
(
"init"
);
}
if
(
defaultModuleMgr
==
NULL
)
{
return
-
1
;
...
...
@@ -43,8 +43,11 @@ static int ModuleMgrCmdInstall(int id, const char *name, int argc, const char **
{
INIT_ERROR_CHECK
(
argv
!=
NULL
&&
argc
>=
1
,
return
-
1
,
"Invalid install parameter"
);
int
ret
;
ret
=
ModuleMgrInstall
(
NULL
,
argv
[
0
],
argc
-
1
,
argv
+
1
);
INIT_ERROR_CHECK
(
ret
==
0
,
return
ret
,
"Install module %s fail"
,
argv
[
0
]);
if
(
defaultModuleMgr
==
NULL
)
{
defaultModuleMgr
=
ModuleMgrCreate
(
"init"
);
}
ret
=
ModuleMgrInstall
(
defaultModuleMgr
,
argv
[
0
],
argc
-
1
,
argv
+
1
);
INIT_ERROR_CHECK
(
ret
==
0
,
return
ret
,
"Install module %s fail errno %d"
,
argv
[
0
],
ret
);
return
0
;
}
...
...
services/init/standard/init.c
浏览文件 @
39632963
...
...
@@ -253,6 +253,8 @@ static void BootStateChange(const char *content)
}
if
(
strcmp
(
"post-init"
,
content
)
==
0
)
{
StartAllServices
(
START_MODE_NARMAL
);
// Destroy all hooks
HookMgrDestroy
(
NULL
);
return
;
}
}
...
...
@@ -358,9 +360,6 @@ void SystemConfig(void)
INIT_LOGI
(
"Parse init config file done."
);
HookMgrExecute
(
NULL
,
INIT_POST_CFG_LOAD
,
(
void
*
)
&
args
);
// Destroy all hooks
HookMgrDestroy
(
NULL
);
// dump config
#if defined(OHOS_SERVICE_DUMP)
AddCmdExecutor
(
"display"
,
SystemDump
);
...
...
services/init/standard/init_cmds.c
浏览文件 @
39632963
...
...
@@ -29,8 +29,9 @@
#include <sys/sysmacros.h>
#include <sys/wait.h>
#include <unistd.h>
#include <linux/module.h>
#include "bootstage.h"
#include "fs_manager/fs_manager.h"
#include "init_jobs_internal.h"
#include "init_log.h"
...
...
@@ -178,8 +179,9 @@ static void DoSetParam(const struct CmdArgs *ctx)
static
void
DoLoadPersistParams
(
const
struct
CmdArgs
*
ctx
)
{
INIT_LOGV
(
"
load persist params : %s"
,
ctx
->
argv
[
0
]
);
INIT_LOGV
(
"
LoadPersistParams"
);
LoadPersistParams
();
HookMgrExecute
(
NULL
,
INIT_POST_PERSIST_PARAM_LOAD
,
NULL
);
}
static
void
DoTriggerCmd
(
const
struct
CmdArgs
*
ctx
)
...
...
services/modules/bootchart/bootchart.c
浏览文件 @
39632963
...
...
@@ -264,14 +264,45 @@ static int DoBootchartStop(void)
return
0
;
}
static
int
DoBootchartCmd
(
int
id
,
const
char
*
name
,
int
argc
,
const
char
**
argv
)
{
PLUGIN_LOGI
(
"DoBootchartCmd argc %d %s"
,
argc
,
name
);
PLUGIN_CHECK
(
argc
>=
1
,
return
-
1
,
"Invalid parameter"
);
if
(
strcmp
(
argv
[
0
],
"start"
)
==
0
)
{
return
DoBootchartStart
();
}
else
if
(
strcmp
(
argv
[
0
],
"stop"
)
==
0
)
{
return
DoBootchartStop
();
}
return
0
;
}
static
int32_t
g_executorId
=
-
1
;
static
int
BootchartInit
(
void
)
{
if
(
g_executorId
==
-
1
)
{
g_executorId
=
AddCmdExecutor
(
"bootchart"
,
DoBootchartCmd
);
PLUGIN_LOGI
(
"BootchartInit executorId %d"
,
g_executorId
);
}
return
0
;
}
static
void
BootchartExit
(
void
)
{
PLUGIN_LOGI
(
"BootchartExit executorId %d"
,
g_executorId
);
if
(
g_executorId
!=
-
1
)
{
RemoveCmdExecutor
(
"bootchart"
,
g_executorId
);
}
}
MODULE_CONSTRUCTOR
(
void
)
{
PLUGIN_LOGI
(
"DoBootchartStart now ..."
);
DoBootchartStar
t
();
BootchartIni
t
();
}
MODULE_DESTRUCTOR
(
void
)
{
PLUGIN_LOGI
(
"DoBootchartStop now ..."
);
DoBootchartStop
();
BootchartExit
();
}
services/modules/bootchart/bootchart_static.c
浏览文件 @
39632963
...
...
@@ -34,5 +34,5 @@ static int bootchartEarlyHook(int stage, int prio, void *cookie)
MODULE_CONSTRUCTOR
(
void
)
{
// Depends on parameter service
InitAddP
reCfg
LoadHook
(
0
,
bootchartEarlyHook
);
InitAddP
ostPersistParam
LoadHook
(
0
,
bootchartEarlyHook
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录