From 7070f39692e49823bc6e4bfc3a9525f4f6113cde Mon Sep 17 00:00:00 2001 From: "liyihan2@huawei.com" Date: Tue, 23 Mar 2021 21:58:25 +0800 Subject: [PATCH] Common log optimize --- ge/common/debug/memory_dumper.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ge/common/debug/memory_dumper.cc b/ge/common/debug/memory_dumper.cc index 2fcb13a9..1e5e9295 100644 --- a/ge/common/debug/memory_dumper.cc +++ b/ge/common/debug/memory_dumper.cc @@ -49,8 +49,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::DumpToFile // Open the file int fd = OpenFile(filename); if (fd == kInvalidFd) { - GELOGE(FAILED, "[Open][File]Failed, filename:%s.", filename.c_str()); - REPORT_INNER_ERROR("E19999", "Opne file failed, filename:%s.", filename.c_str()); + GELOGE(FAILED, "[Open][File]Failed, filename:%s.", filename); + REPORT_INNER_ERROR("E19999", "Opne file failed, filename:%s.", filename); return FAILED; } @@ -66,8 +66,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::DumpToFile // Close the file if (mmClose(fd) != EN_OK) { // mmClose return 0: success - GELOGE(FAILED, "[Close][File]Failed, error_code:%u, filename:%s.", ret, file_name.c_str()); - REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u, filename:%s.", ret, filename.c_str()); + GELOGE(FAILED, "[Close][File]Failed, error_code:%u, filename:%s.", ret, file_name); + REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u, filename:%s.", ret, filename); ret = FAILED; } @@ -164,7 +164,7 @@ int MemoryDumper::OpenFile(const char *filename) { int32_t fd = mmOpen2(real_path.c_str(), M_RDWR | M_CREAT | O_TRUNC, mode); if (fd == EN_ERROR || fd == EN_INVALID_PARAM) { GELOGE(kInvalidFd, "[Open][File]Failed. errno = %d, error:%s, filename:%s.", - fd, strerror(errno), filename.c_str()); + fd, strerror(errno), filename); return kInvalidFd; } return fd;