diff --git a/tensorflow/core/common_runtime/executor.cc b/tensorflow/core/common_runtime/executor.cc index 39f396d2286..d2cb7961454 100644 --- a/tensorflow/core/common_runtime/executor.cc +++ b/tensorflow/core/common_runtime/executor.cc @@ -625,7 +625,14 @@ template void ExecutorState::Process(TaggedNode tagged_node, int64 scheduled_nsec) { profiler::TraceMe activity( - [&] { return absl::StrCat("ExecutorState::Process#id=", step_id_, "#"); }, + [&] { + // NOTE: This tracing uses the iteration number from the first tagged + // node that executes during this call to `Process()`. In principle, + // subsequent nodes could have different values of `iter_num` that + // will not be traced. + return absl::StrCat("ExecutorState::Process#id=", step_id_, + ",iter_num=", tagged_node.get_iter_num(), "#"); + }, 2); WithContext wc(context_); TaggedNodeSeq ready; diff --git a/tensorflow/core/common_runtime/propagator_state.h b/tensorflow/core/common_runtime/propagator_state.h index d82d3bf7261..4a5a26ba0f6 100644 --- a/tensorflow/core/common_runtime/propagator_state.h +++ b/tensorflow/core/common_runtime/propagator_state.h @@ -74,6 +74,7 @@ class PropagatorState { const NodeItem& get_node_item() const { return *node_item; } bool get_is_dead() const { return is_dead; } + int64 get_iter_num() const { return input_iter; } }; // A drop-in replacement for std::deque. We typically don't