From 8159360864fe772d8517536cfddba34fabe9dbaa Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Tue, 13 Apr 2021 20:33:28 +0800 Subject: [PATCH] ge log optimize --- ge/analyzer/analyzer.cc | 6 +++--- ge/client/ge_api.cc | 10 +++++----- ge/common/auth/file_saver.cc | 4 ++-- ge/common/helper/model_helper.cc | 15 +++++++++------ 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/ge/analyzer/analyzer.cc b/ge/analyzer/analyzer.cc index 4930bff2..c4ebd393 100755 --- a/ge/analyzer/analyzer.cc +++ b/ge/analyzer/analyzer.cc @@ -234,9 +234,9 @@ ge::Status Analyzer::SaveAnalyzerDataToFile(uint64_t session_id, uint64_t graph_ try { json_file_ << jsn.dump(kJsonDumpLevel) << std::endl; } catch (nlohmann::detail::type_error &e) { - GELOGE(FAILED, + GELOGE(FAILED, "[Json.dump][GraphInfo]Dump analyze file [%s] failed because [%s]," - "session_id:%lu, graph_id:%lu", + "session_id:%lu, graph_id:%lu", json_file_name_.c_str(), e.what(), session_id, graph_id); REPORT_INNER_ERROR("E19999", "Dump analyze file %s failed because %s, " "session_id %lu, graph_id %lu", @@ -260,7 +260,7 @@ ge::Status Analyzer::DoAnalyze(DataInfo &data_info) { GE_CHECK_NOTNULL(graph_info); auto status = SaveOpInfo(desc, data_info, graph_info); if (status != SUCCESS) { - GELOGE(status, + GELOGE(status, "[Check][SaveOpInfo]save op info: desc_name [%s] desc_type [%s] failed!", desc->GetName().c_str(), desc->GetType().c_str()); REPORT_CALL_ERROR("E19999", "Save op info: desc_name %s, desc_type %s failed", diff --git a/ge/client/ge_api.cc b/ge/client/ge_api.cc index 48c708e3..d9441cc2 100644 --- a/ge/client/ge_api.cc +++ b/ge/client/ge_api.cc @@ -498,7 +498,7 @@ Status Session::RemoveGraph(uint32_t graph_id) { if (ret != SUCCESS) { GELOGE(ret, "[Remove][Graph]Failed, error code:%u, session_id:%lu, graph_id:%u.", - ret, sessionId_, graph_id); + ret, sessionId_, graph_id); REPORT_CALL_ERROR("E19999", "Remove graph failed, error code:%u, " "session_id:%lu, graph_id:%u", ret, sessionId_, graph_id); return FAILED; @@ -568,7 +568,7 @@ Status Session::RunGraph(uint32_t graph_id, const std::vector &inputs, s GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Run][Graph]Failed, GELib instance is nullptr or is not InitFlag."); REPORT_INNER_ERROR("E19999", - "RunGraph Failed, GELib instance is nullptr or is not InitFlag."); + "RunGraph Failed, GELib instance is nullptr or is not InitFlag."); return FAILED; } GELOGT(TRACE_RUNNING, "Running Graph"); @@ -577,7 +577,7 @@ Status Session::RunGraph(uint32_t graph_id, const std::vector &inputs, s if (ret != SUCCESS) { GELOGE(ret, "[Run][Graph]Failed, error code:%u, session_id:%lu, graph_id:%u.", - ret, sessionId_, graph_id); + ret, sessionId_, graph_id); REPORT_CALL_ERROR("E19999", "Remove graph failed, error code:%u, " "session_id:%lu, graph_id:%u", ret, sessionId_, graph_id); return FAILED; @@ -617,7 +617,7 @@ Status Session::BuildGraph(uint32_t graph_id, const std::vector GELOGE(GE_CLI_GE_NOT_INITIALIZED, "[Build][Graph]Failed, the GELib instance is nullptr or is not InitFlag."); REPORT_INNER_ERROR("E19999", - "Build graph failed, the GELib instance is nullptr or is not InitFlag."); + "Build graph failed, the GELib instance is nullptr or is not InitFlag."); return FAILED; } GELOGT(TRACE_RUNNING, "Building Graph"); @@ -625,7 +625,7 @@ Status Session::BuildGraph(uint32_t graph_id, const std::vector if (ret != SUCCESS) { GELOGE(ret, "[Build][Graph]Failed, error code:%u, session_id:%lu, graph_id:%u.", - ret, sessionId_, graph_id); + ret, sessionId_, graph_id); REPORT_CALL_ERROR("E19999", "Build graph failed , error code:%u, " "session_id:%lu, graph_id:%u", ret, sessionId_, graph_id); return FAILED; diff --git a/ge/common/auth/file_saver.cc b/ge/common/auth/file_saver.cc index 4cad5a31..cb297d88 100755 --- a/ge/common/auth/file_saver.cc +++ b/ge/common/auth/file_saver.cc @@ -69,8 +69,8 @@ Status FileSaver::WriteData(const void *data, uint32_t size, int32_t fd) { if (write_count == EN_INVALID_PARAM || write_count == EN_ERROR) { GELOGE(FAILED, "[Write][Data]Failed, mmpa_errorno = %ld, error:%s", write_count, strerror(errno)); - REPORT_INNER_ERROR("E19999", "Write data failed, mmpa_errorno = %ld, error:%s.", - write_count, strerror(errno)); + REPORT_INNER_ERROR("E19999", "Write data failed, mmpa_errorno = %ld, error:%s.", + write_count, strerror(errno)); return FAILED; } size -= size_1g; diff --git a/ge/common/helper/model_helper.cc b/ge/common/helper/model_helper.cc index f15fb99e..646f8b2c 100644 --- a/ge/common/helper/model_helper.cc +++ b/ge/common/helper/model_helper.cc @@ -195,8 +195,8 @@ Status ModelHelper::SaveModelTaskDef(std::shared_ptr &om_file_ GE_IF_BOOL_EXEC(partition_task_size == 0 || partition_task_size > INT_MAX, GELOGE(FAILED, "[Check][ModelDefSize]Invalid, size %zu!", partition_task_size); - REPORT_CALL_ERROR("E19999", "Model def size %zu check invalid,", - partition_task_size); + REPORT_CALL_ERROR("E19999", "Model def size %zu check invalid,", + partition_task_size); return FAILED); task_buffer = ge::Buffer(partition_task_size); @@ -365,8 +365,10 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::SaveToOmRoo REPORT_INNER_ERROR("E19999", "Ge_root_model has no sub model"); return FAILED); GE_IF_BOOL_EXEC(output_file.empty(), - GELOGE(FAILED, "[Save][Model]GraphBuilder SaveModel received invalid file name prefix"); - REPORT_INNER_ERROR("E19999", "GraphBuilder SaveModel received invalid file name prefix"); + GELOGE(FAILED, "[Save][Model]GraphBuilder SaveModel received invalid " + "file name prefix"); + REPORT_INNER_ERROR("E19999", "GraphBuilder SaveModel received invalid " + "file name prefix"); return FAILED); if (!is_unknown_shape) { @@ -516,9 +518,10 @@ ModelHelper::SaveOriginalGraphToOmModel(const ge::Graph &graph, const std::strin FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadModel(const ge::ModelData &model_data) { if (model_data.model_data == nullptr || model_data.model_len == 0) { - GELOGE(ACL_ERROR_GE_EXEC_MODEL_DATA_SIZE_INVALID, + GELOGE(ACL_ERROR_GE_EXEC_MODEL_DATA_SIZE_INVALID, "[Load][Model]Model_data is nullptr or model_data_size is 0"); - REPORT_INNER_ERROR("E19999", "Load model failed, Model_data is nullptr or model_data_size is 0"); + REPORT_INNER_ERROR("E19999", "Load model failed, " + "Model_data is nullptr or model_data_size is 0"); return ACL_ERROR_GE_EXEC_MODEL_DATA_SIZE_INVALID; }