Skip to content
Snippets Groups Projects
Commit 46863cff authored by Craig Tiller's avatar Craig Tiller
Browse files

Make it possible to compile out tracing

parent e23555a7
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/support/env.h" #include "src/core/support/env.h"
#if GRPC_ENABLE_TRACING
gpr_uint32 grpc_trace_bits; gpr_uint32 grpc_trace_bits;
static void add(const char *beg, const char *end, char ***ss, size_t *ns) { static void add(const char *beg, const char *end, char ***ss, size_t *ns) {
...@@ -102,4 +103,8 @@ void grpc_init_trace_bits() { ...@@ -102,4 +103,8 @@ void grpc_init_trace_bits() {
gpr_free(e); gpr_free(e);
} }
} }
#else
void grpc_init_trace_bits() {
}
#endif
...@@ -36,6 +36,11 @@ ...@@ -36,6 +36,11 @@
#include <grpc/support/port_platform.h> #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 { typedef enum {
GRPC_TRACE_SURFACE = 1 << 0, GRPC_TRACE_SURFACE = 1 << 0,
GRPC_TRACE_CHANNEL = 1 << 1, GRPC_TRACE_CHANNEL = 1 << 1,
...@@ -43,7 +48,11 @@ typedef enum { ...@@ -43,7 +48,11 @@ typedef enum {
GRPC_TRACE_SECURE_ENDPOINT = 1 << 3 GRPC_TRACE_SECURE_ENDPOINT = 1 << 3
} grpc_trace_bit_value; } grpc_trace_bit_value;
#if GRPC_ENABLE_TRACING
extern gpr_uint32 grpc_trace_bits; extern gpr_uint32 grpc_trace_bits;
#else
# define grpc_trace_bits 0
#endif
void grpc_init_trace_bits(); void grpc_init_trace_bits();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment