diff --git a/common/dfxlog/BUILD.gn b/common/dfxlog/BUILD.gn deleted file mode 100644 index 98d72e01814d28f095fd7f3e30ae2f4d193638f3..0000000000000000000000000000000000000000 --- a/common/dfxlog/BUILD.gn +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright (c) 2022-2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//base/hiviewdfx/faultloggerd/faultloggerd.gni") - -if (defined(ohos_lite)) { - config("dfx_log_config") { - visibility = [ ":*" ] - include_dirs = [ - ".", - "$faultloggerd_interfaces_path/common", - "$hilog_lite_include_path", - ] - defines = [ - "is_ohos=${is_ohos}", - "is_ohos_lite", - ] - } - - static_library("dfx_hilog") { - public_configs = [ ":dfx_log_config" ] - deps = [ "$hilog_lite_deps_path" ] - } -} else { - config("dfx_log_config") { - visibility = [ ":*" ] - include_dirs = [ - ".", - "$faultloggerd_interfaces_path/common", - ] - } - - ohos_static_library("dfx_hilog") { - public_configs = [ ":dfx_log_config" ] - external_deps = [ - "c_utils:utils", - "hilog:libhilog", - ] - part_name = "faultloggerd" - subsystem_name = "hiviewdfx" - } - - ohos_static_library("dfx_hilog_base") { - public_configs = [ ":dfx_log_config" ] - defines = [ "DFX_LOG_HILOG_BASE" ] - external_deps = [ - "c_utils:utils", - "hilog:libhilog_base", - ] - part_name = "faultloggerd" - subsystem_name = "hiviewdfx" - } - - # just for updater subsystem, use dfx_libhilog_base first - ohos_static_library("dfx_hilog_base_static") { - public_configs = [ ":dfx_log_config" ] - defines = [ "DFX_LOG_HILOG_BASE" ] - external_deps = [ - "bounds_checking_function:libsec_static", - "c_utils:utilsbase", - "hilog:libhilog_base", - ] - part_name = "faultloggerd" - subsystem_name = "hiviewdfx" - } -} diff --git a/common/dfxlog/dfx_log.h b/common/dfxlog/dfx_log.h index 3fea0fa2fdaf3db1aad5db572d21afa7ec3a7bfd..25f268d1358533d83b524b1f7b0acf15ae668c80 100644 --- a/common/dfxlog/dfx_log.h +++ b/common/dfxlog/dfx_log.h @@ -22,7 +22,6 @@ #else #include #endif -#include "dfx_log_define.h" #endif #ifdef __cplusplus diff --git a/common/dfxlog/dfx_log_define.h b/common/dfxlog/dfx_log_define.h deleted file mode 100644 index 1a8cce46d31dada8f36ebec6e36b4ac62a03fa44..0000000000000000000000000000000000000000 --- a/common/dfxlog/dfx_log_define.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef DFX_LOG_DEFINE_H -#define DFX_LOG_DEFINE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#undef LOG_DOMAIN -#undef LOG_TAG -#define LOG_DOMAIN 0xD002D11 -#define LOG_TAG "DfxFaultLogger" - -#define LOG_BUF_LEN 1024 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/common/dfxutil/dfx_util.cpp b/common/dfxutil/dfx_util.cpp index c59fd9e12f66a7e410e54dd91968274d1bf7f0c0..03897c6ade9cdf824d995bbb10366043e2e514f0 100644 --- a/common/dfxutil/dfx_util.cpp +++ b/common/dfxutil/dfx_util.cpp @@ -46,8 +46,8 @@ // defile Domain ID #ifndef LOG_DOMAIN #undef LOG_DOMAIN -#endif #define LOG_DOMAIN 0xD002D11 +#endif #ifdef LOG_TAG #undef LOG_TAG diff --git a/common/dfxutil/smart_fd.h b/common/dfxutil/smart_fd.h index fd5e8384350a140761895bccd987ea63277f1b6c..f24d67f43ee83777064f889f9f0f5ab7ad657f8a 100644 --- a/common/dfxutil/smart_fd.h +++ b/common/dfxutil/smart_fd.h @@ -19,7 +19,6 @@ #include #include #include -#include "dfx_log_define.h" namespace OHOS { namespace HiviewDFX { @@ -29,7 +28,7 @@ public: explicit SmartFd(int fd, bool fdsan = true) : fd_(fd), fdsan_(fdsan) { if (fd_ >= 0 && fdsan_) { - fdsan_exchange_owner_tag(fd_, 0, fdsan_create_owner_tag(FDSAN_OWNER_TYPE_FILE, LOG_DOMAIN)); + fdsan_exchange_owner_tag(fd_, 0, fdsan_create_owner_tag(FDSAN_OWNER_TYPE_FILE, DFX_FDSAN_DOMAIN)); } } @@ -86,12 +85,13 @@ private: return; } if (fdsan_) { - fdsan_close_with_tag(fd_, fdsan_create_owner_tag(FDSAN_OWNER_TYPE_FILE, LOG_DOMAIN)); + fdsan_close_with_tag(fd_, fdsan_create_owner_tag(FDSAN_OWNER_TYPE_FILE, DFX_FDSAN_DOMAIN)); return; } close(fd_); } + static constexpr uint64_t DFX_FDSAN_DOMAIN = 0xD002D11; int fd_{-1}; bool fdsan_{false}; };