aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-27 07:27:54 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-27 07:27:54 -0700
commit97b74ff276b64e61312076cec07a39d34cebd0ae (patch)
tree34481458a8e7471613f23ca3d1e38228f0e028ce
parent5c19eb8ff6c378f368ac5b6e5db0633acb8a3ba5 (diff)
parentad7c20c833695f77feb6261723bfb639fbe6fd22 (diff)
Merge pull request #1732 from murgatroid99/core_request_call_trace
Added tracing for grpc_server_request_call
-rw-r--r--src/core/surface/call.h13
-rw-r--r--src/core/surface/call_log_batch.c16
-rw-r--r--src/core/surface/server.c3
3 files changed, 32 insertions, 0 deletions
diff --git a/src/core/surface/call.h b/src/core/surface/call.h
index 60222bf389..9116538948 100644
--- a/src/core/surface/call.h
+++ b/src/core/surface/call.h
@@ -122,6 +122,16 @@ void grpc_call_log_batch(char *file, int line, gpr_log_severity severity,
grpc_call *call, const grpc_op *ops, size_t nops,
void *tag);
+void grpc_server_log_request_call(char *file, int line,
+ gpr_log_severity severity,
+ grpc_server *server,
+ grpc_call **call,
+ grpc_call_details *details,
+ grpc_metadata_array *initial_metadata,
+ grpc_completion_queue *cq_bound_to_call,
+ grpc_completion_queue *cq_for_notification,
+ void *tag);
+
/* Set a context pointer.
No thread safety guarantees are made wrt this value. */
void grpc_call_context_set(grpc_call *call, grpc_context_index elem, void *value,
@@ -132,6 +142,9 @@ void *grpc_call_context_get(grpc_call *call, grpc_context_index elem);
#define GRPC_CALL_LOG_BATCH(sev, call, ops, nops, tag) \
if (grpc_trace_batch) grpc_call_log_batch(sev, call, ops, nops, tag)
+#define GRPC_SERVER_LOG_REQUEST_CALL(sev, server, call, details, initial_metadata, cq_bound_to_call, cq_for_notifications, tag) \
+ if (grpc_trace_batch) grpc_server_log_request_call(sev, server, call, details, initial_metadata, cq_bound_to_call, cq_for_notifications, tag)
+
gpr_uint8 grpc_call_is_client(grpc_call *call);
#endif /* GRPC_INTERNAL_CORE_SURFACE_CALL_H */
diff --git a/src/core/surface/call_log_batch.c b/src/core/surface/call_log_batch.c
index e3b3f75b45..9905401bee 100644
--- a/src/core/surface/call_log_batch.c
+++ b/src/core/surface/call_log_batch.c
@@ -119,3 +119,19 @@ void grpc_call_log_batch(char *file, int line, gpr_log_severity severity,
gpr_free(tmp);
}
}
+
+void grpc_server_log_request_call(char *file, int line,
+ gpr_log_severity severity,
+ grpc_server *server,
+ grpc_call **call,
+ grpc_call_details *details,
+ grpc_metadata_array *initial_metadata,
+ grpc_completion_queue *cq_bound_to_call,
+ grpc_completion_queue *cq_for_notification,
+ void *tag) {
+ gpr_log(file, line, severity,
+ "grpc_server_request_call(server=%p, call=%p, details=%p, "
+ "initial_metadata=%p, cq_bound_to_call=%p, cq_for_notification=%p, "
+ "tag=%p)", server, call, details, initial_metadata,
+ cq_bound_to_call, cq_for_notification, tag);
+}
diff --git a/src/core/surface/server.c b/src/core/surface/server.c
index 24a23ae5c4..e99e3e2b04 100644
--- a/src/core/surface/server.c
+++ b/src/core/surface/server.c
@@ -1010,6 +1010,9 @@ grpc_call_error grpc_server_request_call(
grpc_completion_queue *cq_bound_to_call,
grpc_completion_queue *cq_for_notification, void *tag) {
requested_call rc;
+ GRPC_SERVER_LOG_REQUEST_CALL(GPR_INFO, server, call, details,
+ initial_metadata, cq_bound_to_call,
+ cq_for_notification, tag);
grpc_cq_begin_op(cq_for_notification, NULL);
rc.type = BATCH_CALL;
rc.tag = tag;