diff options
Diffstat (limited to 'src/core/surface')
-rw-r--r-- | src/core/surface/call.h | 13 | ||||
-rw-r--r-- | src/core/surface/call_log_batch.c | 16 | ||||
-rw-r--r-- | src/core/surface/server.c | 3 |
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 0bf7f8331f..85ae246012 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -1036,6 +1036,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; |