diff --git a/mindspore/ccsrc/debug/trace.cc b/mindspore/ccsrc/debug/trace.cc index 3d5c73c951f..f7447e210ee 100644 --- a/mindspore/ccsrc/debug/trace.cc +++ b/mindspore/ccsrc/debug/trace.cc @@ -116,13 +116,14 @@ void TraceGraphEval() { auto &infer_stack = GetCurrenGraphEvalStack(); std::ostringstream oss; if (infer_stack.empty()) { + MS_LOG(ERROR) << "Length of analysis graph stack is empty."; return; } - MS_LOG(INFO) << "\n*******************************graph evaluate stack**********************************"; + MS_LOG(ERROR) << "\n*******************************graph evaluate stack**********************************"; oss << std::endl; DumpInferStack(oss); - MS_LOG(INFO) << oss.str(); - MS_LOG(INFO) << "\n*************************************************************************************"; + MS_LOG(ERROR) << oss.str(); + MS_LOG(ERROR) << "\n*************************************************************************************"; } class AnalyzedFuncGraphExporter : public AnfExporter { @@ -501,7 +502,7 @@ void GetEvalStackInfo(std::ostringstream &oss) { MS_LOG(INFO) << "Get graph analysis information begin"; auto stack = GetCNodeDebugStack(); if (stack.empty()) { - MS_LOG(INFO) << "Length of analysis information stack is empty."; + MS_LOG(ERROR) << "Length of analysis information stack is empty."; return; } static int fileNumber = 0; diff --git a/mindspore/ccsrc/pipeline/jit/static_analysis/stack_frame.cc b/mindspore/ccsrc/pipeline/jit/static_analysis/stack_frame.cc index 829322bbee5..467a7de81bb 100644 --- a/mindspore/ccsrc/pipeline/jit/static_analysis/stack_frame.cc +++ b/mindspore/ccsrc/pipeline/jit/static_analysis/stack_frame.cc @@ -116,7 +116,14 @@ StackFramePtr StackFrame::Jump(const AnalysisEnginePtr &engine) { } // It's FuncGraph Call or MetaFuncGraph Call. `maybe_func` is definitely a AbstractFunction. - return DoJump(engine, cnode, dyn_cast(maybe_func)); + AnfNodeConfigPtr call_node_conf = engine->MakeConfig(cnode, current_context_); + // Enter the call CNode. + trace::TraceEvalCNodeEnter(call_node_conf); + auto res = DoJump(engine, cnode, dyn_cast(maybe_func)); + if (res == nullptr) { + trace::TraceEvalCNodeLeave(); + } + return res; } // Run one step in current func graph. @@ -150,6 +157,9 @@ void StackFrame::Back(const AnalysisEnginePtr &engine, const StackFramePtr &last << ", current_context_: " << current_context_->ToString(); AnfNodeConfigPtr node_conf = engine->MakeConfig(current_node, current_context_); engine->SaveEvalResultInCache(node_conf, result); + + // Leave the call CNode. + trace::TraceEvalCNodeLeave(); } } // namespace abstract } // namespace mindspore