Browse Source

!1791 modify dump config

From: @zhou_chao1993
Reviewed-by: @xchu42,@wqtshg
Signed-off-by: @wqtshg
tags/v1.3.0
mindspore-ci-bot Gitee 3 years ago
parent
commit
535b674d1a
2 changed files with 13 additions and 2 deletions
  1. +2
    -2
      ge/common/dump/dump_manager.cc
  2. +11
    -0
      tests/ut/ge/common/dump_manager_unittest.cc

+ 2
- 2
ge/common/dump/dump_manager.cc View File

@@ -33,7 +33,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY DumpManager &DumpManager::GetIn

bool DumpManager::NeedDoDump(const DumpConfig &dump_config, DumpProperties &dump_properties) {
if (dump_config.dump_status.empty() && dump_config.dump_debug.empty()) {
dump_properties_map_.emplace(kInferSessionId, dump_properties);
dump_properties_map_[kInferSessionId] = dump_properties;
GELOGI("Dump does not open");
return false;
}
@@ -41,7 +41,7 @@ bool DumpManager::NeedDoDump(const DumpConfig &dump_config, DumpProperties &dump
if ((dump_config.dump_status == kDumpoff || dump_config.dump_status == kDumpOFF) &&
dump_config.dump_debug == kDumpoff) {
dump_properties.ClearDumpPropertyValue();
dump_properties_map_.emplace(kInferSessionId, dump_properties);
dump_properties_map_[kInferSessionId] = dump_properties;
return false;
}
if (dump_config.dump_status == kDumpOn && dump_config.dump_debug == kDumpOn) {


+ 11
- 0
tests/ut/ge/common/dump_manager_unittest.cc View File

@@ -16,6 +16,8 @@

#include <gtest/gtest.h>

#define protected public
#define private public
#include "common/dump/dump_manager.h"
#include "common/debug/log.h"
#include "common/ge_inner_error_codes.h"
@@ -102,4 +104,13 @@ TEST_F(UTEST_dump_manager, is_dump_single_op_close_success) {
auto dump = DumpManager::GetInstance().GetDumpProperties(0);
DumpManager::GetInstance().RemoveDumpProperties(0);
}

TEST_F(UTEST_dump_manager, not_need_do_dump) {
DumpConfig dump_config;
dump_config.dump_status = "off";
dump_config.dump_debug = "off";
DumpProperties dump_properties;
bool ret = DumpManager::GetInstance().NeedDoDump(dump_config, dump_properties);
EXPECT_EQ(ret, false);
}
} // namespace ge

Loading…
Cancel
Save