Coalesce GRPC_TRACE=surface,batch into GRPC_TRACE=surface

pull/3006/head
Masood Malekghassemi 9 years ago
parent 25061413cf
commit 861fbcbf22
  1. 9
      src/core/surface/call.h
  2. 2
      src/core/surface/call_log_batch.c
  3. 1
      src/core/surface/init.c

@ -36,6 +36,7 @@
#include "src/core/channel/channel_stack.h" #include "src/core/channel/channel_stack.h"
#include "src/core/channel/context.h" #include "src/core/channel/context.h"
#include "src/core/surface/surface_trace.h"
#include <grpc/grpc.h> #include <grpc/grpc.h>
#ifdef __cplusplus #ifdef __cplusplus
@ -128,8 +129,6 @@ grpc_call_stack *grpc_call_get_call_stack(grpc_call *call);
/* Given the top call_element, get the call object. */ /* Given the top call_element, get the call object. */
grpc_call *grpc_call_from_top_element(grpc_call_element *surface_element); grpc_call *grpc_call_from_top_element(grpc_call_element *surface_element);
extern int grpc_trace_batch;
void grpc_call_log_batch(char *file, int line, gpr_log_severity severity, void grpc_call_log_batch(char *file, int line, gpr_log_severity severity,
grpc_call *call, const grpc_op *ops, size_t nops, grpc_call *call, const grpc_op *ops, size_t nops,
void *tag); void *tag);
@ -155,17 +154,17 @@ void grpc_call_context_set(grpc_call *call, grpc_context_index elem,
void *grpc_call_context_get(grpc_call *call, grpc_context_index elem); void *grpc_call_context_get(grpc_call *call, grpc_context_index elem);
#define GRPC_CALL_LOG_BATCH(sev, call, ops, nops, tag) \ #define GRPC_CALL_LOG_BATCH(sev, call, ops, nops, tag) \
if (grpc_trace_batch) grpc_call_log_batch(sev, call, ops, nops, tag) if (grpc_surface_trace) grpc_call_log_batch(sev, call, ops, nops, tag)
#define GRPC_SERVER_LOG_REQUEST_CALL(sev, server, call, details, \ #define GRPC_SERVER_LOG_REQUEST_CALL(sev, server, call, details, \
initial_metadata, cq_bound_to_call, \ initial_metadata, cq_bound_to_call, \
cq_for_notifications, tag) \ cq_for_notifications, tag) \
if (grpc_trace_batch) \ if (grpc_surface_trace) \
grpc_server_log_request_call(sev, server, call, details, initial_metadata, \ grpc_server_log_request_call(sev, server, call, details, initial_metadata, \
cq_bound_to_call, cq_for_notifications, tag) cq_bound_to_call, cq_for_notifications, tag)
#define GRPC_SERVER_LOG_SHUTDOWN(sev, server, cq, tag) \ #define GRPC_SERVER_LOG_SHUTDOWN(sev, server, cq, tag) \
if (grpc_trace_batch) grpc_server_log_shutdown(sev, server, cq, tag) if (grpc_surface_trace) grpc_server_log_shutdown(sev, server, cq, tag)
gpr_uint8 grpc_call_is_client(grpc_call *call); gpr_uint8 grpc_call_is_client(grpc_call *call);

@ -37,8 +37,6 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
int grpc_trace_batch = 0;
static void add_metadata(gpr_strvec *b, const grpc_metadata *md, size_t count) { static void add_metadata(gpr_strvec *b, const grpc_metadata *md, size_t count) {
size_t i; size_t i;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {

@ -102,7 +102,6 @@ void grpc_init(void) {
grpc_register_tracer("surface", &grpc_surface_trace); grpc_register_tracer("surface", &grpc_surface_trace);
grpc_register_tracer("http", &grpc_http_trace); grpc_register_tracer("http", &grpc_http_trace);
grpc_register_tracer("flowctl", &grpc_flowctl_trace); grpc_register_tracer("flowctl", &grpc_flowctl_trace);
grpc_register_tracer("batch", &grpc_trace_batch);
grpc_register_tracer("connectivity_state", &grpc_connectivity_state_trace); grpc_register_tracer("connectivity_state", &grpc_connectivity_state_trace);
grpc_security_pre_init(); grpc_security_pre_init();
grpc_iomgr_init(); grpc_iomgr_init();

Loading…
Cancel
Save