未验证 提交 c65786ff 编写于 作者: O openharmony_ci 提交者: Gitee

!1536 make libhidebug a static library in init, speed up service bring up

Merge pull request !1536 from stesen/master
......@@ -61,6 +61,7 @@ if (defined(ohos_lite)) {
install_images = [
"system",
"updater",
"ramdisk",
]
symlink_target_name = [ "libinit_module_engine.so" ]
}
......
......@@ -132,6 +132,7 @@ ohos_executable("init") {
}
if (support_jsapi) {
defines += [ "SUPPORT_PROFILER_HIDEBUG" ]
external_deps = [ "profiler:libhidebug_init" ]
}
if (asan_detector) {
defines += [ "ASAN_DETECTOR" ]
......
......@@ -44,6 +44,10 @@
#include "securec.h"
#include "fscrypt_utils.h"
#ifdef SUPPORT_PROFILER_HIDEBUG
#include <hidebug_base.h>
#endif
#define FSCRYPT_POLICY_BUF_SIZE (60)
#define DECIMAL 10
#define OCTAL 8
......@@ -526,30 +530,7 @@ const struct CmdTable *GetCmdTable(int *number)
void OpenHidebug(const char *name)
{
#ifdef SUPPORT_PROFILER_HIDEBUG
#ifdef __aarch64__
const char *debugSoPath = "/system/lib64/libhidebug.so";
#else
const char *debugSoPath = "/system/lib/libhidebug.so";
#endif
do {
if (access(debugSoPath, F_OK) != 0) {
break;
}
void* handle = dlopen(debugSoPath, RTLD_LAZY);
if (handle == NULL) {
INIT_LOGE("Failed to dlopen libhidebug.so, %s\n", dlerror());
break;
}
bool (* initParam)();
initParam = (bool (*)())dlsym(handle, "InitEnvironmentParam");
if (initParam == NULL) {
INIT_LOGE("Failed to dlsym InitEnvironmentParam, %s\n", dlerror());
dlclose(handle);
break;
}
(*initParam)(name);
dlclose(handle);
} while (0);
InitEnvironmentParam(name);
#endif
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册