Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
304f8211
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
接近 2 年 前同步成功
通知
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看板
未验证
提交
304f8211
编写于
8月 01, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
!437 加载器完善Log
Merge pull request !437 from dhy308/branch_musl_hilog
上级
a2251488
11b3efd4
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
274 addition
and
250 deletion
+274
-250
porting/linux/user/ldso/dynlink.c
porting/linux/user/ldso/dynlink.c
+153
-125
porting/linux/user/ldso/ld_log.h
porting/linux/user/ldso/ld_log.h
+4
-4
porting/linux/user/ldso/namespace.c
porting/linux/user/ldso/namespace.c
+109
-100
porting/linux/user/ldso/ns_config.c
porting/linux/user/ldso/ns_config.c
+6
-19
porting/linux/user/src/hilog/hilog_adapter.c
porting/linux/user/src/hilog/hilog_adapter.c
+2
-2
未找到文件。
porting/linux/user/ldso/dynlink.c
浏览文件 @
304f8211
此差异已折叠。
点击以展开。
porting/linux/user/ldso/ld_log.h
浏览文件 @
304f8211
...
...
@@ -27,25 +27,25 @@
#define LD_LOG_TAG "MUSL-LDSO"
#if (
LD_LOG_LEVEL & LD_LOG_ERROR
)
#if (
defined(ENABLE_MUSL_LOG) && (LD_LOG_LEVEL & LD_LOG_ERROR)
)
#define LD_LOGE(...) ((void)HiLogAdapterPrint(MUSL_LOG_TYPE, LOG_ERROR, MUSL_LOG_DOMAIN, LD_LOG_TAG, __VA_ARGS__))
#else
#define LD_LOGE(...)
#endif
#if (
LD_LOG_LEVEL & LD_LOG_WARNING
)
#if (
defined(ENABLE_MUSL_LOG) && (LD_LOG_LEVEL & LD_LOG_WARNING)
)
#define LD_LOGW(...) ((void)HiLogAdapterPrint(MUSL_LOG_TYPE, LOG_WARN, MUSL_LOG_DOMAIN, LD_LOG_TAG, __VA_ARGS__))
#else
#define LD_LOGW(...)
#endif
#if (
LD_LOG_LEVEL & LD_LOG_INFO
)
#if (
defined(ENABLE_MUSL_LOG) && (LD_LOG_LEVEL & LD_LOG_INFO)
)
#define LD_LOGI(...) ((void)HiLogAdapterPrint(MUSL_LOG_TYPE, LOG_INFO, MUSL_LOG_DOMAIN, LD_LOG_TAG, __VA_ARGS__))
#else
#define LD_LOGI(...)
#endif
#if (
LD_LOG_LEVEL & LD_LOG_DEBUG
)
#if (
defined(ENABLE_MUSL_LOG) && (LD_LOG_LEVEL & LD_LOG_DEBUG)
)
#define LD_LOGD(...) ((void)HiLogAdapterPrint(MUSL_LOG_TYPE, LOG_DEBUG, MUSL_LOG_DOMAIN, LD_LOG_TAG, __VA_ARGS__))
#else
#define LD_LOGD(...)
...
...
porting/linux/user/ldso/namespace.c
浏览文件 @
304f8211
此差异已折叠。
点击以展开。
porting/linux/user/ldso/ns_config.c
浏览文件 @
304f8211
...
...
@@ -375,7 +375,6 @@ static kvlist *config_get_kvs(const char *sname)
static
char
*
config_get_value_by_acquiescence
(
kvlist
*
acquiescence_kvs
,
const
char
*
key
)
{
if
(
!
acquiescence_kvs
)
{
LD_LOGW
(
"config_get_value_by_acquiescence acquiescence_kvs is NULL!
\n
"
);
return
NULL
;
}
size_t
i
;
...
...
@@ -391,7 +390,6 @@ static char *config_get_value_by_acquiescence(kvlist *acquiescence_kvs, const ch
static
char
*
config_get_acquiescence_lib_path
(
kvlist
*
acquiescence_kvs
)
{
if
(
!
acquiescence_kvs
)
{
LD_LOGW
(
"config_get_acquiescence_lib_path acquiescence_kvs is NULL!
\n
"
);
return
NULL
;
}
config_key_join
(
ATTR_NS_PREFIX
,
true
);
...
...
@@ -406,7 +404,6 @@ static char *config_get_acquiescence_lib_path(kvlist *acquiescence_kvs)
static
char
*
config_get_acquiescence_asan_lib_path
(
kvlist
*
acquiescence_kvs
)
{
if
(
!
acquiescence_kvs
)
{
LD_LOGW
(
"config_get_acquiescence_asan_lib_path acquiescence_kvs is NULL!
\n
"
);
return
NULL
;
}
config_key_join
(
ATTR_NS_PREFIX
,
true
);
...
...
@@ -423,7 +420,6 @@ static char *config_get_acquiescence_asan_lib_path(kvlist *acquiescence_kvs)
static
char
*
config_get_value
(
const
char
*
key
)
{
if
(
!
g_configor
.
kvs
)
{
LD_LOGW
(
"config_get_value g_configor.kvs is NULL!
\n
"
);
return
NULL
;
}
size_t
i
;
...
...
@@ -437,7 +433,6 @@ static char *config_get_value(const char *key)
static
char
*
config_get_lib_paths
(
const
char
*
ns_name
)
{
if
(
ns_name
==
NULL
)
{
LD_LOGW
(
"config_get_lib_paths ns_name is NULL!
\n
"
);
return
NULL
;
}
config_key_join
(
ATTR_NS_PREFIX
,
true
);
...
...
@@ -452,7 +447,6 @@ static char *config_get_lib_paths(const char *ns_name)
static
char
*
config_get_asan_lib_paths
(
const
char
*
ns_name
)
{
if
(
ns_name
==
NULL
)
{
LD_LOGW
(
"config_get_asan_lib_paths ns_name is NULL!
\n
"
);
return
NULL
;
}
config_key_join
(
ATTR_NS_PREFIX
,
true
);
...
...
@@ -478,13 +472,13 @@ static int config_parse(const char *file_path, const char *exe_path)
g_configor
.
sections
=
config_load
(
fpath
);
if
(
!
g_configor
.
sections
)
{
LD_LOG
E
(
"config_parse load ini config fail!
\n
"
);
LD_LOG
D
(
"config_parse load ini config fail!
"
);
return
-
2
;
}
dirkvs
=
config_get_kvs
(
SECTION_DIR_MAP
);
acquiescence_kvs
=
config_get_kvs
(
ATTR_NS_ACQUIESCENCE
);
if
(
!
dirkvs
||!
acquiescence_kvs
)
{
LD_LOG
E
(
"config_parse get dirkvs or acquiescence_kvs fail!
\n
"
);
LD_LOG
D
(
"config_parse get dirkvs or acquiescence_kvs fail!
"
);
return
-
3
;
/* no section directory map or acquiescence section found */
}
g_configor
.
config_sys_path
=
config_get_acquiescence_lib_path
(
acquiescence_kvs
);
...
...
@@ -504,11 +498,11 @@ static int config_parse(const char *file_path, const char *exe_path)
if
(
sname
)
break
;
}
if
(
!
sname
)
{
LD_LOG
W
(
"config_parse no section found!
\n
"
);
LD_LOG
D
(
"config_parse no section found!
"
);
return
-
4
;
/* no section found */
}
if
(
!
(
g_configor
.
kvs
=
config_get_kvs
(
sname
)))
{
LD_LOG
W
(
"config_parse no section key-value list found!
\n
"
);
LD_LOG
D
(
"config_parse no section key-value list found!
"
);
return
-
5
;
/* no section key-value list found */
}
...
...
@@ -516,13 +510,13 @@ static int config_parse(const char *file_path, const char *exe_path)
if
(
default_lib_paths
)
{
g_configor
.
config_sys_path
=
default_lib_paths
;
}
else
{
LD_LOGW
(
"config_parse get default lib paths fail! Config namespace default lib paths,please!
\n
"
);
LD_LOGW
(
"config_parse get default lib paths fail! Config namespace default lib paths,please!"
);
}
char
*
default_asan_lib_paths
=
config_get_asan_lib_paths
(
ATTR_NS_DEFAULT
);
if
(
default_asan_lib_paths
)
{
g_configor
.
config_asan_sys_path
=
default_asan_lib_paths
;
}
else
{
LD_LOGW
(
"config_parse get default asan lib paths fail! Config namespace default asan lib paths,please!
\n
"
);
LD_LOGW
(
"config_parse get default asan lib paths fail! Config namespace default asan lib paths,please!"
);
}
return
0
;
}
...
...
@@ -539,7 +533,6 @@ static strlist *config_get_namespaces()
static
char
*
config_get_permitted_paths
(
const
char
*
ns_name
)
{
if
(
ns_name
==
NULL
)
{
LD_LOGW
(
"config_get_permitted_paths ns_name is NULL!
\n
"
);
return
NULL
;
}
config_key_join
(
ATTR_NS_PREFIX
,
true
);
...
...
@@ -554,7 +547,6 @@ static char *config_get_permitted_paths(const char *ns_name)
static
char
*
config_get_asan_permitted_paths
(
const
char
*
ns_name
)
{
if
(
ns_name
==
NULL
)
{
LD_LOGW
(
"config_get_asan_permitted_paths ns_name is NULL!
\n
"
);
return
NULL
;
}
config_key_join
(
ATTR_NS_PREFIX
,
true
);
...
...
@@ -570,7 +562,6 @@ static char *config_get_asan_permitted_paths(const char *ns_name)
static
strlist
*
config_get_inherits
(
const
char
*
ns_name
)
{
if
(
ns_name
==
NULL
)
{
LD_LOGW
(
"config_get_inherits ns_name is NULL!
\n
"
);
return
NULL
;
}
config_key_join
(
ATTR_NS_PREFIX
,
true
);
...
...
@@ -585,7 +576,6 @@ static strlist *config_get_inherits(const char *ns_name)
static
bool
config_get_separated
(
const
char
*
ns_name
)
{
if
(
ns_name
==
NULL
)
{
LD_LOGW
(
"config_get_separated ns_name is NULL!
\n
"
);
return
false
;
}
config_key_join
(
ATTR_NS_PREFIX
,
true
);
...
...
@@ -603,7 +593,6 @@ static bool config_get_separated(const char *ns_name)
static
char
*
config_get_allowed_libs
(
const
char
*
ns_name
)
{
if
(
ns_name
==
NULL
)
{
LD_LOGW
(
"config_get_allowed_libs ns_name is NULL!
\n
"
);
return
NULL
;
}
config_key_join
(
ATTR_NS_PREFIX
,
true
);
...
...
@@ -616,9 +605,7 @@ static char *config_get_allowed_libs(const char *ns_name)
/* get shared libs by inherited namespace */
static
char
*
config_get_inherit_shared_libs
(
const
char
*
ns_name
,
const
char
*
inherited_ns_name
)
{
if
(
ns_name
==
NULL
||
inherited_ns_name
==
NULL
)
{
LD_LOGW
(
"config_get_inherit_shared_libs ns_name or inherited_ns_name is NULL!
\n
"
);
return
NULL
;
}
config_key_join
(
ATTR_NS_PREFIX
,
true
);
...
...
porting/linux/user/src/hilog/hilog_adapter.c
浏览文件 @
304f8211
...
...
@@ -41,14 +41,14 @@ static int SendMessage(HilogMsg *header, const char *tag, uint16_t tagLen, const
{
int
socketFd
=
TEMP_FAILURE_RETRY
(
socket
(
AF_UNIX
,
SOCKET_TYPE
,
0
));
if
(
socketFd
<
0
)
{
dprintf
(
ERROR_FD
,
"
%s %d Can't create socket! Errno: %d
\n
"
,
__FILE__
,
__LINE__
,
errno
);
dprintf
(
ERROR_FD
,
"
HiLogAdapter: Can't create socket! Errno: %d
\n
"
,
errno
);
return
socketFd
;
}
long
int
result
=
TEMP_FAILURE_RETRY
(
connect
(
socketFd
,
(
const
struct
sockaddr
*
)(
&
SOCKET_ADDR
),
sizeof
(
SOCKET_ADDR
)));
if
(
result
<
0
)
{
dprintf
(
ERROR_FD
,
"
%s %d Can't connect to server. Errno: %d
\n
"
,
__FILE__
,
__LINE__
,
errno
);
dprintf
(
ERROR_FD
,
"
HiLogAdapter: Can't connect to server. Errno: %d
\n
"
,
errno
);
if
(
socketFd
>=
0
)
{
close
(
socketFd
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录