Browse Source

!1946 fix dump step check for dump_debug_mode

Merge pull request !1946 from HW_KK/dump-option-check
tags/v1.5.1
i-robot Gitee 3 years ago
parent
commit
1e4e874fff
2 changed files with 5 additions and 11 deletions
  1. +3
    -9
      ge/common/dump/dump_properties.cc
  2. +2
    -2
      tests/ut/ge/common/dump_properties_unittest.cc

+ 3
- 9
ge/common/dump/dump_properties.cc View File

@@ -441,16 +441,10 @@ Status DumpProperties::SetDumpDebugOptions() {
if (enable_dump_debug_ == kEnableFlag) {
std::string dump_debug_mode;
if (GetContext().GetOption(OPTION_EXEC_DUMP_DEBUG_MODE, dump_debug_mode) == GRAPH_SUCCESS) {
GELOGD("Get dump debug mode %s successfully", dump_debug_mode.c_str());
GELOGD("Get ge.exec.dumpDebugMode %s successfully", dump_debug_mode.c_str());
} else {
REPORT_INPUT_ERROR("E10001", std::vector<std::string>({"parameter", "value", "reason"}),
std::vector<std::string>({
"ge.exec.dumpDebugMode",
dump_debug_mode,
"ge.exec.dumpDebugMode is not set."}));
GELOGE(PARAM_INVALID, "[Check][dump_debug_mode] failed. Dump debug mode is not set.");

return PARAM_INVALID;
GELOGW("ge.exec.dumpDebugMode is not set.");
return SUCCESS;
}

if (dump_debug_mode == OP_DEBUG_AICORE) {


+ 2
- 2
tests/ut/ge/common/dump_properties_unittest.cc View File

@@ -115,12 +115,12 @@ TEST_F(UTEST_dump_properties, init_by_options_success_2) {
EXPECT_EQ(st, SUCCESS);
}

TEST_F(UTEST_dump_properties, init_by_options_failed) {
TEST_F(UTEST_dump_properties, init_by_options_success_3) {
DumpProperties dp;
std::map<std::string, std::string> options {{OPTION_EXEC_ENABLE_DUMP_DEBUG, "1"},
{OPTION_EXEC_DUMP_PATH, "/tmp/"}};
GetThreadLocalContext().SetGlobalOption(options);
Status st = dp.InitByOptions();
EXPECT_NE(st, SUCCESS);
EXPECT_EQ(st, SUCCESS);
}
} // namespace ge

Loading…
Cancel
Save