Make it possible to compile out tracing

pull/677/head
Craig Tiller 10 years ago
parent e23555a729
commit 46863cffb6
  1. 5
      src/core/debug/trace.c
  2. 9
      src/core/debug/trace.h

@ -39,6 +39,7 @@
#include <grpc/support/log.h>
#include "src/core/support/env.h"
#if GRPC_ENABLE_TRACING
gpr_uint32 grpc_trace_bits;
static void add(const char *beg, const char *end, char ***ss, size_t *ns) {
@ -102,4 +103,8 @@ void grpc_init_trace_bits() {
gpr_free(e);
}
}
#else
void grpc_init_trace_bits() {
}
#endif

@ -36,6 +36,11 @@
#include <grpc/support/port_platform.h>
/* set to zero to remove all debug trace code */
#ifndef GRPC_ENABLE_TRACING
# define GRPC_ENABLE_TRACING 1
#endif
typedef enum {
GRPC_TRACE_SURFACE = 1 << 0,
GRPC_TRACE_CHANNEL = 1 << 1,
@ -43,7 +48,11 @@ typedef enum {
GRPC_TRACE_SECURE_ENDPOINT = 1 << 3
} grpc_trace_bit_value;
#if GRPC_ENABLE_TRACING
extern gpr_uint32 grpc_trace_bits;
#else
# define grpc_trace_bits 0
#endif
void grpc_init_trace_bits();

Loading…
Cancel
Save