aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/debug
diff options
context:
space:
mode:
authorGravatar Shanqing Cai <cais@google.com>2017-12-06 20:32:37 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-12-06 20:39:10 -0800
commit93dc52c707032ee4de6885edba064ee4e7308d40 (patch)
tree75230e1f4674475e374887cd6243f246d580f125 /tensorflow/core/debug
parent072bc6a28a5f21c46c80c145d2bae3da475b32e7 (diff)
tfdbg: Add protocol for sending tracebacks and source code to debug server
PiperOrigin-RevId: 178192708
Diffstat (limited to 'tensorflow/core/debug')
-rw-r--r--tensorflow/core/debug/BUILD1
-rw-r--r--tensorflow/core/debug/debug_service.proto40
2 files changed, 41 insertions, 0 deletions
diff --git a/tensorflow/core/debug/BUILD b/tensorflow/core/debug/BUILD
index 108dc59919..a32badef6d 100644
--- a/tensorflow/core/debug/BUILD
+++ b/tensorflow/core/debug/BUILD
@@ -56,6 +56,7 @@ tf_proto_library(
cc_grpc_version = 1,
protodeps = [
":debugger_event_metadata_proto",
+ "//tensorflow/core/profiler:protos_all",
] + tf_additional_all_protos(),
visibility = ["//tensorflow:__subpackages__"],
)
diff --git a/tensorflow/core/debug/debug_service.proto b/tensorflow/core/debug/debug_service.proto
index 547c0576f0..4bef74dfc5 100644
--- a/tensorflow/core/debug/debug_service.proto
+++ b/tensorflow/core/debug/debug_service.proto
@@ -18,6 +18,8 @@ syntax = "proto3";
package tensorflow;
import "tensorflow/core/framework/tensor.proto";
+import "tensorflow/core/profiler/tfprof_log.proto";
+import "tensorflow/core/protobuf/debug.proto";
import "tensorflow/core/util/event.proto";
// Reply message from EventListener to the client, i.e., to the source of the
@@ -46,6 +48,38 @@ message EventReply {
// during debugging.
}
+// Data on the traceback of a debugged call, e.g., a Session.run() call, or the
+// execution of an eager operation.
+message CallTraceback {
+ enum CallType {
+ UNSPECIFIED = 0;
+ GRAPH_EXECUTION = 1;
+ EAGER_EXECUTION = 2;
+ }
+
+ CallType call_type = 1;
+
+ // A key for the call. For example, for graph execution, this is a key
+ // consisting of the names of the fed and fetched tensors.
+ string call_key = 2;
+
+ // Traceback stack for the origin of the call event.
+ // For graph execution, this is the stack of the Session.run() call.
+ // For eager execution, this is the stack of the Python line that invokes
+ // the execution of the eager op.
+ tfprof.CodeDef origin_stack = 3;
+
+ // Keeps track of the mapping from integer IDs in `origin_stack` to actual
+ // string values (e.g., file paths, function names).
+ map<int64, string> origin_id_to_string = 4;
+
+ // Traceback for the graph (if any) involved in the call.
+ tfprof.OpLogProto graph_traceback = 5;
+
+ // Version of the graph in `graph_traceback` (if any).
+ int64 graph_version = 6;
+}
+
// EventListener: Receives Event protos, e.g., from debugged TensorFlow
// runtime(s).
service EventListener {
@@ -57,4 +91,10 @@ service EventListener {
// ops that get executed immediately after the beginning of the graph
// execution.
rpc SendEvents(stream Event) returns (stream EventReply);
+
+ // Send the tracebacks of a TensorFlow execution call.
+ rpc SendTracebacks(CallTraceback) returns (EventReply);
+
+ // Send a collection of source code files being debugged.
+ rpc SendSourceFiles(DebuggedSourceFiles) returns (EventReply);
}