!5 同步sp2 到 22.03 next 分支

From: @yanansong 
Reviewed-by: @chrisshangguan, @yukaii 
Signed-off-by: @chrisshangguan, @yukaii
This commit is contained in:
openeuler-ci-bot 2023-10-26 12:43:26 +00:00 committed by Gitee
commit 6be3565fc3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 4268 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,67 @@
From d0d35591b378d879f1659f4bfd082b165b31e8f1 Mon Sep 17 00:00:00 2001
From: tian2020 <tian_hang@hoperun.com>
Date: Wed, 14 Jun 2023 19:55:41 +0800
Subject: [PATCH 2/3] fix build gn files config
---
interfaces/native/innerkits/BUILD.gn | 34 +++++++++++++++++++++-------
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git a/interfaces/native/innerkits/BUILD.gn b/interfaces/native/innerkits/BUILD.gn
index ee27551..c74beda 100644
--- a/interfaces/native/innerkits/BUILD.gn
+++ b/interfaces/native/innerkits/BUILD.gn
@@ -22,16 +22,16 @@ config("libhilog_pub_config") {
ohos_shared_library("libhilog") {
public_configs = [ ":libhilog_pub_config" ]
sources = [
- "//base/hiviewdfx/hilog/libhilog/hilog.cpp",
- "//base/hiviewdfx/hilog/libhilog/vsnprintf/vsnprintf_s_p.cpp",
- "//base/hiviewdfx/hilog/libhilog/utils/log_utils.cpp",
- "//base/hiviewdfx/hilog/libhilog/utils/log_print.cpp",
+ "//base/hiviewdfx/hilog/frameworks/libhilog/hilog.cpp",
+ "//base/hiviewdfx/hilog/frameworks/libhilog/vsnprintf/vsnprintf_s_p.cpp",
+ "//base/hiviewdfx/hilog/frameworks/libhilog/utils/log_utils.cpp",
+ "//base/hiviewdfx/hilog/frameworks/libhilog/utils/log_print.cpp",
]
include_dirs = [
- "//base/hiviewdfx/hilog/libhilog/include/",
- "//base/hiviewdfx/hilog/libhilog/vsnprintf/include/",
- "//base/hiviewdfx/hilog/libhilog/utils/include/",
+ "//base/hiviewdfx/hilog/frameworks/libhilog/include/",
+ "//base/hiviewdfx/hilog/frameworks/libhilog/vsnprintf/include/",
+ "//base/hiviewdfx/hilog/frameworks/libhilog/utils/include/",
]
defines = []
@@ -56,7 +56,25 @@ config("libhilog_base_pub_cfg") {
ohos_static_library("libhilog_base") {
public_configs = [ ":libhilog_base_pub_cfg" ]
- deps = [ "//base/hiviewdfx/hilog/frameworks/libhilog:libhilog_base_source" ]
+ #deps = [ "//base/hiviewdfx/hilog/frameworks/libhilog:libhilog_base_source" ]
+
+ include_dirs = [
+ "//base/hiviewdfx/hilog/frameworks/libhilog/vsnprintf/include",
+ "//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
+ ]
+
+ # vsnprintf_sources = [ "$vsnprintf_root/vsnprintf_s_p.cpp" ]
+
+ sources = [ "//base/hiviewdfx/hilog/frameworks/libhilog/base/hilog_base.cpp" ]
+ # sources += vsnprintf_sources
+
+ public_configs += [ "//base/hiviewdfx/hilog/frameworks/libhilog/:libhilog_base_config" ]
+ configs = [ "//base/hiviewdfx/hilog/frameworks/libhilog/:libhilog_base_config" ]
+
+ defines = [
+ "__RECV_MSG_WITH_UCRED_",
+ "HILOG_PROHIBIT_ALLOCATION",
+ ]
subsystem_name = "hiviewdfx"
part_name = "hilog_native"
--
2.33.0

View File

@ -0,0 +1,30 @@
From bcefda18f27ea4c427ad11ac1ae373e503787fca Mon Sep 17 00:00:00 2001
From: tian2020 <tian_hang@hoperun.com>
Date: Thu, 15 Jun 2023 10:52:07 +0800
Subject: [PATCH 3/3] feat set priv false
---
frameworks/libhilog/hilog_printf.cpp | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/frameworks/libhilog/hilog_printf.cpp b/frameworks/libhilog/hilog_printf.cpp
index 1316128..ccfef1d 100644
--- a/frameworks/libhilog/hilog_printf.cpp
+++ b/frameworks/libhilog/hilog_printf.cpp
@@ -219,12 +219,7 @@ int HiLogPrintArgs(const LogType type, const LogLevel level, const unsigned int
}
/* format log string */
-#if not (defined( __WINDOWS__ ) || defined( __MAC__ ) || defined( __LINUX__ ))
- bool debug = IsDebugOn();
- bool priv = (!debug) && IsPrivateSwitchOn();
-#else
- bool priv = true;
-#endif
+ bool priv = false;
#ifdef __clang__
/* code specific to clang compiler */
--
2.33.0

View File

@ -0,0 +1,25 @@
From 4109037a7f708c6d23ccdff64a5638ef592c7598 Mon Sep 17 00:00:00 2001
From: heppen <hepeng68@huawei.com>
Date: Mon, 31 Jul 2023 10:24:25 +0800
Subject: [PATCH] Close private print in hilog.cpp file
---
frameworks/libhilog/hilog.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frameworks/libhilog/hilog.cpp b/frameworks/libhilog/hilog.cpp
index e58c6d6..8da82c5 100644
--- a/frameworks/libhilog/hilog.cpp
+++ b/frameworks/libhilog/hilog.cpp
@@ -77,7 +77,7 @@ int HiLogPrintArgs(const LogType type, const LogLevel level, const unsigned int
char *logBuf = buf;
int traceBufLen = 0;
int ret;
- bool priv = true;
+ bool priv = false;
#ifdef __clang__
/* code specific to clang compiler */
--
2.33.0

90
hilog.spec Normal file
View File

@ -0,0 +1,90 @@
%define debug_package %{nil}
%global openHarmony_source_release OpenHarmony-v3.2-Release
%global hilog_dir %{_builddir}/base/hiviewdfx
%global build_opt /opt/distributed-middleware-build
Name: hilog
Version: 1.0.0
Release: 2
Summary: OpenEuler supports hilog for distributed softbus capability
License: Apache License 2.0
Url: https://gitee.com/openharmony/hiviewdfx_hilog
Source0: https://gitee.com/openharmony/hiviewdfx_hilog/repository/archive/%{openHarmony_source_release}.tar.gz #/hiviewdfx_hilog-%{openHarmony_source_release}.tar.gz
Patch0000: 0001-init-and-adapt-to-openeuler.patch
Patch0001: 0002-fix-build-gn-files-config.patch
Patch0002: 0003-feat-set-priv-false.patch
Patch0003: 0004-close-private-print-in-hilog.cpp-file.patch
BuildRequires: distributed-build, libboundscheck,libatomic
Requires: libboundscheck, libatomic
%description
OpenEuler supports hilog for distributed softbus capability
%prep
#clean %{_builddir}
rm -rf %{_builddir}/*
%autosetup -p1 -n hiviewdfx_hilog-%{openHarmony_source_release}
cd %{_builddir}
mkdir -p %{hilog_dir}
mv hiviewdfx_hilog-%{openHarmony_source_release} %{hilog_dir}/hilog
# build directory
cp -rp %{build_opt} %{_builddir}/build
[ ! -L "%{_builddir}/build.sh" ] && ln -s %{_builddir}/build/build_scripts/build.sh %{_builddir}/build.sh
[ ! -L "%{_builddir}/.gn" ] && ln -s %{_builddir}/build/core/gn/dotfile.gn %{_builddir}/.gn
[ ! -L "%{_builddir}/build.py" ] && ln -s %{_builddir}/build/lite/build.py %{_builddir}/build.py
cp -r %{_builddir}/build/openeuler/vendor %{_builddir}/
cp -r %{_builddir}/build/openeuler/compiler_gn/third_party %{_builddir}/
#directory to avoid %build fail
mkdir hiviewdfx_hilog-%{openHarmony_source_release}
%build
cd %{_builddir}
rm -rf %{_builddir}/out
%ifarch x86_64
./build.sh --product-name openeuler --target-cpu x86_64
%endif
%ifarch aarch64
./build.sh --product-name openeuler --target-cpu arm64
%endif
%install
install -d %{buildroot}/%{_includedir}/hilog
install -d %{buildroot}/%{_includedir}/hilog/hilog
install -d %{buildroot}/%{_includedir}/hilog/hilog_base
install -d %{buildroot}/%{_libdir}
# prepare so
install -m 0755 %{_builddir}/out/openeuler/packages/phone/system/lib64/libhilog*.so %{buildroot}/%{_libdir}
%ifarch x86_64
install -m 0755 %{_builddir}/out/openeuler/linux_clang_x86_64/obj/base/hiviewdfx/hilog/interfaces/native/innerkits/libhilog_base.a %{buildroot}/%{_libdir}
%endif
%ifarch aarch64
install -m 0755 %{_builddir}/out/openeuler/linux_clang_arm64/obj/base/hiviewdfx/hilog/interfaces/native/innerkits/libhilog_base.a %{buildroot}/%{_libdir}
%endif
# prepare head files according to bundle.json
install -m 554 %{hilog_dir}/hilog/interfaces/native/innerkits/include/*.h %{buildroot}/%{_includedir}/hilog
install -m 554 %{hilog_dir}/hilog/interfaces/native/innerkits/include/hilog/*.h %{buildroot}/%{_includedir}/hilog/hilog
install -m 554 %{hilog_dir}/hilog/interfaces/native/innerkits/include/hilog_base/*.h %{buildroot}/%{_includedir}/hilog/hilog_base
%files
%{_includedir}/hilog/*
%{_libdir}/*.so
%{_libdir}/*.a
%changelog
* Mon Jul 31 2023 Peng He <hepeng68@huawei.com> - 1.0.0-2
- Close private print in hilog.cpp file.
* Thu Jun 15 2023 tianhang <tian_hang@hoperun.com> - 1.0.0-1
- Init and adapt to openeuler

Binary file not shown.