From 861fbcbf22b2aae7d8793051ce6ef598fc6e074a Mon Sep 17 00:00:00 2001
From: Masood Malekghassemi <soltanmm@users.noreply.github.com>
Date: Wed, 19 Aug 2015 16:31:36 -0700
Subject: [PATCH] Coalesce GRPC_TRACE=surface,batch into GRPC_TRACE=surface

---
 src/core/surface/call.h           | 9 ++++-----
 src/core/surface/call_log_batch.c | 2 --
 src/core/surface/init.c           | 1 -
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/core/surface/call.h b/src/core/surface/call.h
index 7ac0c92ab7..b1a1045792 100644
--- a/src/core/surface/call.h
+++ b/src/core/surface/call.h
@@ -36,6 +36,7 @@
 
 #include "src/core/channel/channel_stack.h"
 #include "src/core/channel/context.h"
+#include "src/core/surface/surface_trace.h"
 #include <grpc/grpc.h>
 
 #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. */
 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,
                          grpc_call *call, const grpc_op *ops, size_t nops,
                          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);
 
 #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,             \
                                      initial_metadata, cq_bound_to_call,     \
                                      cq_for_notifications, tag)              \
-  if (grpc_trace_batch)                                                      \
+  if (grpc_surface_trace)                                                    \
   grpc_server_log_request_call(sev, server, call, details, initial_metadata, \
                                cq_bound_to_call, cq_for_notifications, 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);
 
diff --git a/src/core/surface/call_log_batch.c b/src/core/surface/call_log_batch.c
index 5a3ef1e5f4..2dd9737cf8 100644
--- a/src/core/surface/call_log_batch.c
+++ b/src/core/surface/call_log_batch.c
@@ -37,8 +37,6 @@
 #include <grpc/support/alloc.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) {
   size_t i;
   for (i = 0; i < count; i++) {
diff --git a/src/core/surface/init.c b/src/core/surface/init.c
index 93c27c77bf..7d7e72440e 100644
--- a/src/core/surface/init.c
+++ b/src/core/surface/init.c
@@ -102,7 +102,6 @@ void grpc_init(void) {
     grpc_register_tracer("surface", &grpc_surface_trace);
     grpc_register_tracer("http", &grpc_http_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_security_pre_init();
     grpc_iomgr_init();
-- 
GitLab