From 14fac2c688cb987be3b06d879a1c067206d341b9 Mon Sep 17 00:00:00 2001 From: taoxiangdong Date: Sat, 12 Dec 2020 18:24:31 +0800 Subject: [PATCH 1/6] Slog adjust --- ge/offline/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ge/offline/CMakeLists.txt b/ge/offline/CMakeLists.txt index 21221042..39f3d5fe 100644 --- a/ge/offline/CMakeLists.txt +++ b/ge/offline/CMakeLists.txt @@ -58,6 +58,7 @@ target_include_directories(atc PRIVATE target_link_libraries(atc PRIVATE $ ascend_protobuf + slog ge_common register c_sec @@ -68,7 +69,6 @@ target_link_libraries(atc PRIVATE gflags json runtime_compile - slog static_mmpa -lrt -ldl @@ -118,6 +118,7 @@ target_include_directories(atc_atc.bin PRIVATE target_link_libraries(atc_atc.bin PRIVATE $ ascend_protobuf + slog ge_common register c_sec @@ -128,7 +129,6 @@ target_link_libraries(atc_atc.bin PRIVATE gflags json runtime_compile - slog static_mmpa -lrt -ldl @@ -183,6 +183,7 @@ target_include_directories(fwk_atc.bin PRIVATE target_link_libraries(fwk_atc.bin PRIVATE $ ascend_protobuf + slog ge_common register c_sec @@ -193,7 +194,6 @@ target_link_libraries(fwk_atc.bin PRIVATE gflags json runtime - slog static_mmpa -lrt -ldl From 311f429357c8322c04d653954ab8085dae339227 Mon Sep 17 00:00:00 2001 From: taoxiangdong Date: Sat, 12 Dec 2020 20:01:47 +0800 Subject: [PATCH 2/6] update cmakelist add start-group --- ge/offline/CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ge/offline/CMakeLists.txt b/ge/offline/CMakeLists.txt index 39f3d5fe..c4103809 100644 --- a/ge/offline/CMakeLists.txt +++ b/ge/offline/CMakeLists.txt @@ -58,13 +58,15 @@ target_include_directories(atc PRIVATE target_link_libraries(atc PRIVATE $ ascend_protobuf - slog ge_common register c_sec graph error_manager + -Wl,--start-group + slog ge_compiler + -Wl,--end-group parser_common gflags json @@ -118,13 +120,15 @@ target_include_directories(atc_atc.bin PRIVATE target_link_libraries(atc_atc.bin PRIVATE $ ascend_protobuf - slog ge_common register c_sec graph error_manager + -Wl,--start-group + slog ge_compiler + -Wl,--end-group parser_common gflags json @@ -183,13 +187,15 @@ target_include_directories(fwk_atc.bin PRIVATE target_link_libraries(fwk_atc.bin PRIVATE $ ascend_protobuf - slog ge_common register c_sec graph error_manager + -Wl,--start-group + slog ge_runner + -Wl,--end-group parser_common gflags json From 7a914446502341fb8605fb9d4d4792a473c0dbba Mon Sep 17 00:00:00 2001 From: taoxiangdong Date: Sat, 12 Dec 2020 21:41:40 +0800 Subject: [PATCH 3/6] slogd LOG_CPP --- ge/graph/build/memory/CMakeLists.txt | 1 + ge/offline/CMakeLists.txt | 12 +++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ge/graph/build/memory/CMakeLists.txt b/ge/graph/build/memory/CMakeLists.txt index bdd869a9..e988b4ce 100644 --- a/ge/graph/build/memory/CMakeLists.txt +++ b/ge/graph/build/memory/CMakeLists.txt @@ -18,6 +18,7 @@ target_compile_options(ge_memory PRIVATE target_compile_definitions(ge_memory PRIVATE google=ascend_private + LOG_CPP ) target_link_libraries(ge_memory PRIVATE diff --git a/ge/offline/CMakeLists.txt b/ge/offline/CMakeLists.txt index c4103809..21221042 100644 --- a/ge/offline/CMakeLists.txt +++ b/ge/offline/CMakeLists.txt @@ -63,14 +63,12 @@ target_link_libraries(atc PRIVATE c_sec graph error_manager - -Wl,--start-group - slog ge_compiler - -Wl,--end-group parser_common gflags json runtime_compile + slog static_mmpa -lrt -ldl @@ -125,14 +123,12 @@ target_link_libraries(atc_atc.bin PRIVATE c_sec graph error_manager - -Wl,--start-group - slog ge_compiler - -Wl,--end-group parser_common gflags json runtime_compile + slog static_mmpa -lrt -ldl @@ -192,14 +188,12 @@ target_link_libraries(fwk_atc.bin PRIVATE c_sec graph error_manager - -Wl,--start-group - slog ge_runner - -Wl,--end-group parser_common gflags json runtime + slog static_mmpa -lrt -ldl From b0c1eabedb08d69ba8ad19a2d1627d4795ff13f6 Mon Sep 17 00:00:00 2001 From: taoxiangdong Date: Sun, 13 Dec 2020 15:42:31 +0800 Subject: [PATCH 4/6] update dlog change --- ge/common/CMakeLists.txt | 1 + ge/executor/CMakeLists.txt | 1 + ge/ge_local_engine/CMakeLists.txt | 1 + ge/host_cpu_engine/CMakeLists.txt | 1 + 4 files changed, 4 insertions(+) diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index d196995c..05838df8 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -130,6 +130,7 @@ target_compile_definitions(ge_common_static PRIVATE google=ascend_private $,OS_TYPE=WIN,OS_TYPE=0> $<$:SECUREC_USING_STD_SECURE_LIB=0 NOMINMAX> + LOG_CPP ) target_compile_options(ge_common_static PRIVATE diff --git a/ge/executor/CMakeLists.txt b/ge/executor/CMakeLists.txt index cc5c1710..d59afd03 100644 --- a/ge/executor/CMakeLists.txt +++ b/ge/executor/CMakeLists.txt @@ -173,6 +173,7 @@ target_compile_definitions(ge_executor PRIVATE google=ascend_private $,OS_TYPE=WIN,OS_TYPE=0> $<$:SECUREC_USING_STD_SECURE_LIB=0 NOMINMAX> + LOG_CPP ) target_include_directories(ge_executor PRIVATE diff --git a/ge/ge_local_engine/CMakeLists.txt b/ge/ge_local_engine/CMakeLists.txt index 615a968f..8f5c9777 100755 --- a/ge/ge_local_engine/CMakeLists.txt +++ b/ge/ge_local_engine/CMakeLists.txt @@ -203,6 +203,7 @@ target_compile_options(ge_local_opskernel_builder_static PRIVATE target_compile_definitions(ge_local_opskernel_builder_static PRIVATE google=ascend_private + LOG_CPP ) target_include_directories(ge_local_opskernel_builder_static PRIVATE diff --git a/ge/host_cpu_engine/CMakeLists.txt b/ge/host_cpu_engine/CMakeLists.txt index 97b5a0f5..d5ed7674 100644 --- a/ge/host_cpu_engine/CMakeLists.txt +++ b/ge/host_cpu_engine/CMakeLists.txt @@ -193,6 +193,7 @@ target_compile_options(host_cpu_opskernel_builder_static PRIVATE target_compile_definitions(host_cpu_opskernel_builder_static PRIVATE google=ascend_private + LOG_CPP ) target_include_directories(host_cpu_opskernel_builder_static PRIVATE From 19bf1dff1580564284c7918b18e7474b9b5acb1b Mon Sep 17 00:00:00 2001 From: taoxiangdong Date: Mon, 14 Dec 2020 17:50:20 +0800 Subject: [PATCH 5/6] update atc atc.bin fwk_atc.bin --- ge/offline/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ge/offline/CMakeLists.txt b/ge/offline/CMakeLists.txt index 21221042..af259ecb 100644 --- a/ge/offline/CMakeLists.txt +++ b/ge/offline/CMakeLists.txt @@ -27,6 +27,7 @@ target_compile_definitions(atc PRIVATE PROTOBUF_INLINE_NOT_IN_HEADERS=0 COMPILE_OMG_PACKAGE google=ascend_private + LOG_CPP ) target_include_directories(atc PRIVATE @@ -87,6 +88,7 @@ target_compile_definitions(atc_atc.bin PRIVATE PROTOBUF_INLINE_NOT_IN_HEADERS=0 COMPILE_OMG_PACKAGE google=ascend_private + LOG_CPP ) target_include_directories(atc_atc.bin PRIVATE @@ -152,6 +154,7 @@ target_compile_definitions(fwk_atc.bin PRIVATE PROTOBUF_INLINE_NOT_IN_HEADERS=0 COMPILE_OMG_PACKAGE google=ascend_private + LOG_CPP ) target_include_directories(fwk_atc.bin PRIVATE From 3b7ac7d954d6f8615264ed7170f29aca3ea21453 Mon Sep 17 00:00:00 2001 From: taoxiangdong Date: Sat, 19 Dec 2020 17:39:25 +0800 Subject: [PATCH 6/6] reset slog.h change --- third_party/fwkacllib/inc/toolchain/slog.h | 25 ---------------------- 1 file changed, 25 deletions(-) diff --git a/third_party/fwkacllib/inc/toolchain/slog.h b/third_party/fwkacllib/inc/toolchain/slog.h index 5faca0ae..bce58f32 100644 --- a/third_party/fwkacllib/inc/toolchain/slog.h +++ b/third_party/fwkacllib/inc/toolchain/slog.h @@ -18,9 +18,7 @@ #define D_SYSLOG_H_ #ifdef __cplusplus -#ifndef LOG_CPP extern "C" { -#endif #endif // __cplusplus #ifndef LINUX @@ -107,7 +105,6 @@ extern "C" { #define SECURITY_LOG_MASK (0x00100000) #define RUN_LOG_MASK (0x01000000) #define OPERATION_LOG_MASK (0x10000000) -#define RESERVERD_LENGTH 52 typedef struct tagDCODE { const char *cName; @@ -119,18 +116,6 @@ typedef struct tagKV { char *value; } KeyValue; -typedef enum { - APPLICATION = 0, - SYSTEM -} ProcessType; - -typedef struct { - ProcessType type; - unsigned int pid; - unsigned int deviceId; - char reserved[RESERVERD_LENGTH]; -} LogAttr; - /** * @ingroup slog * @@ -243,14 +228,6 @@ DLL_EXPORT int dlog_setlevel(int moduleId, int level, int enableEvent); */ DLL_EXPORT int CheckLogLevel(int moduleId, int logLevel); -/** - * @ingroup slog - * @brief DlogSetAttr: set log attr, default pid is 0, default device id is 0, default process type is APPLICATION - * @param [in]logAttr: attr info, include pid(must be larger than 0), process type and device id(chip ID) - * @return: 0: SUCCEED, others: FAILED - */ -DLL_EXPORT int DlogSetAttr(LogAttr logAttr); - /** * @ingroup slog * @brief dlog_error: print error log @@ -390,8 +367,6 @@ void DlogInner(int moduleId, int level, const char *fmt, ...); void DlogWithKVInner(int moduleId, int level, KeyValue *pstKVArray, int kvNum, const char *fmt, ...); #ifdef __cplusplus -#ifndef LOG_CPP } -#endif // LOG_CPP #endif // __cplusplus #endif // D_SYSLOG_H_