diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/channel/channel_stack.c | 2 | ||||
-rw-r--r-- | src/core/channel/channel_stack.h | 4 | ||||
-rw-r--r-- | src/core/debug/trace.c | 65 | ||||
-rw-r--r-- | src/core/debug/trace.h | 22 | ||||
-rw-r--r-- | src/core/iomgr/iomgr_posix.c | 3 | ||||
-rw-r--r-- | src/core/iomgr/tcp_posix.c | 6 | ||||
-rw-r--r-- | src/core/iomgr/tcp_posix.h | 2 | ||||
-rw-r--r-- | src/core/security/secure_endpoint.c | 6 | ||||
-rw-r--r-- | src/core/security/secure_endpoint.h | 2 | ||||
-rw-r--r-- | src/core/surface/init.c | 10 | ||||
-rw-r--r-- | src/core/surface/init.h | 39 | ||||
-rw-r--r-- | src/core/surface/init_secure.c | 42 | ||||
-rw-r--r-- | src/core/surface/init_unsecure.c | 37 | ||||
-rw-r--r-- | src/core/surface/surface_trace.c | 36 | ||||
-rw-r--r-- | src/core/surface/surface_trace.h | 4 | ||||
-rw-r--r-- | src/core/transport/chttp2/frame_settings.c | 3 | ||||
-rw-r--r-- | src/core/transport/chttp2_transport.c | 5 | ||||
-rw-r--r-- | src/core/transport/chttp2_transport.h | 2 | ||||
-rw-r--r-- | src/core/tsi/transport_security.c | 4 | ||||
-rw-r--r-- | src/core/tsi/transport_security_interface.h | 4 |
20 files changed, 235 insertions, 63 deletions
diff --git a/src/core/channel/channel_stack.c b/src/core/channel/channel_stack.c index 0382a7a2f3..21df9771ce 100644 --- a/src/core/channel/channel_stack.c +++ b/src/core/channel/channel_stack.c @@ -36,6 +36,8 @@ #include <stdlib.h> +int grpc_trace_channel = 0; + /* Memory layouts. Channel stack is laid out as: { diff --git a/src/core/channel/channel_stack.h b/src/core/channel/channel_stack.h index c136f5c17c..ef1da7b33b 100644 --- a/src/core/channel/channel_stack.h +++ b/src/core/channel/channel_stack.h @@ -298,7 +298,9 @@ void grpc_call_element_recv_metadata(grpc_call_element *cur_elem, void grpc_call_element_send_cancel(grpc_call_element *cur_elem); void grpc_call_element_send_finish(grpc_call_element *cur_elem); +extern int grpc_trace_channel; + #define GRPC_CALL_LOG_OP(sev, elem, op) \ - if (grpc_trace_bits & GRPC_TRACE_CHANNEL) grpc_call_log_op(sev, elem, op) + if (grpc_trace_channel) grpc_call_log_op(sev, elem, op) #endif /* GRPC_INTERNAL_CORE_CHANNEL_CHANNEL_STACK_H */ diff --git a/src/core/debug/trace.c b/src/core/debug/trace.c index b8eb755bff..32c35e7fb3 100644 --- a/src/core/debug/trace.c +++ b/src/core/debug/trace.c @@ -39,8 +39,21 @@ #include <grpc/support/log.h> #include "src/core/support/env.h" -#if GRPC_ENABLE_TRACING -gpr_uint32 grpc_trace_bits = 0; +typedef struct tracer { + const char *name; + int *flag; + struct tracer *next; +} tracer; +static tracer *tracers; + +void grpc_register_tracer(const char *name, int *flag) { + tracer *t = gpr_malloc(sizeof(*t)); + t->name = name; + t->flag = flag; + t->next = tracers; + *flag = 0; + tracers = t; +} static void add(const char *beg, const char *end, char ***ss, size_t *ns) { size_t n = *ns; @@ -67,26 +80,26 @@ static void parse(const char *s) { char **strings = NULL; size_t nstrings = 0; size_t i; + tracer *t; split(s, &strings, &nstrings); - grpc_trace_bits = 0; - for (i = 0; i < nstrings; i++) { const char *s = strings[i]; - if (0 == strcmp(s, "surface")) { - grpc_trace_bits |= GRPC_TRACE_SURFACE; - } else if (0 == strcmp(s, "channel")) { - grpc_trace_bits |= GRPC_TRACE_CHANNEL; - } else if (0 == strcmp(s, "tcp")) { - grpc_trace_bits |= GRPC_TRACE_TCP; - } else if (0 == strcmp(s, "secure_endpoint")) { - grpc_trace_bits |= GRPC_TRACE_SECURE_ENDPOINT; - } else if (0 == strcmp(s, "http")) { - grpc_trace_bits |= GRPC_TRACE_HTTP; - } else if (0 == strcmp(s, "all")) { - grpc_trace_bits = -1; + if (0 == strcmp(s, "all")) { + for (t = tracers; t; t = t->next) { + *t->flag = 1; + } } else { - gpr_log(GPR_ERROR, "Unknown trace var: '%s'", s); + int found = 0; + for (t = tracers; t; t = t->next) { + if (0 == strcmp(s, t->name)) { + *t->flag = 1; + found = 1; + } + } + if (!found) { + gpr_log(GPR_ERROR, "Unknown trace var: '%s'", s); + } } } @@ -96,17 +109,15 @@ static void parse(const char *s) { gpr_free(strings); } -void grpc_init_trace_bits() { - char *e = gpr_getenv("GRPC_TRACE"); - if (e == NULL) { - grpc_trace_bits = 0; - } else { +void grpc_tracer_init(const char *env_var) { + char *e = gpr_getenv(env_var); + if (e != NULL) { parse(e); gpr_free(e); } + while (tracers) { + tracer *t = tracers; + tracers = t->next; + gpr_free(t); + } } -#else -void grpc_init_trace_bits() { -} -#endif - diff --git a/src/core/debug/trace.h b/src/core/debug/trace.h index 2059599a7d..c02f14b7f2 100644 --- a/src/core/debug/trace.h +++ b/src/core/debug/trace.h @@ -36,25 +36,7 @@ #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, - GRPC_TRACE_TCP = 1 << 2, - GRPC_TRACE_SECURE_ENDPOINT = 1 << 3, - GRPC_TRACE_HTTP = 1 << 4 -} 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(); +void grpc_register_tracer(const char *name, int *flag); +void grpc_tracer_init(const char *env_var_name); #endif /* GRPC_INTERNAL_CORE_DEBUG_TRACE_H */ diff --git a/src/core/iomgr/iomgr_posix.c b/src/core/iomgr/iomgr_posix.c index 14e3d182f6..758ae77b86 100644 --- a/src/core/iomgr/iomgr_posix.c +++ b/src/core/iomgr/iomgr_posix.c @@ -36,11 +36,14 @@ #ifdef GPR_POSIX_SOCKET #include "src/core/iomgr/iomgr_posix.h" +#include "src/core/debug/trace.h" #include "src/core/iomgr/fd_posix.h" +#include "src/core/iomgr/tcp_posix.h" void grpc_iomgr_platform_init(void) { grpc_fd_global_init(); grpc_pollset_global_init(); + grpc_register_tracer("tcp", &grpc_tcp_trace); } void grpc_iomgr_platform_shutdown(void) { diff --git a/src/core/iomgr/tcp_posix.c b/src/core/iomgr/tcp_posix.c index eceb0feadb..597a2a62d3 100644 --- a/src/core/iomgr/tcp_posix.c +++ b/src/core/iomgr/tcp_posix.c @@ -63,6 +63,8 @@ typedef struct grpc_tcp_slice_state { int memory_owned; /* True if slices array is owned */ } grpc_tcp_slice_state; +int grpc_tcp_trace = 0; + static void slice_state_init(grpc_tcp_slice_state *state, gpr_slice *slices, size_t nslices, size_t valid_slices) { state->slices = slices; @@ -294,7 +296,7 @@ static void call_read_cb(grpc_tcp *tcp, gpr_slice *slices, size_t nslices, grpc_endpoint_cb_status status) { grpc_endpoint_read_cb cb = tcp->read_cb; - if (grpc_trace_bits & GRPC_TRACE_TCP) { + if (grpc_tcp_trace) { size_t i; gpr_log(GPR_DEBUG, "read: status=%d", status); for (i = 0; i < nslices; i++) { @@ -495,7 +497,7 @@ static grpc_endpoint_write_status grpc_tcp_write(grpc_endpoint *ep, grpc_tcp *tcp = (grpc_tcp *)ep; grpc_endpoint_write_status status; - if (grpc_trace_bits & GRPC_TRACE_TCP) { + if (grpc_tcp_trace) { size_t i; for (i = 0; i < nslices; i++) { diff --git a/src/core/iomgr/tcp_posix.h b/src/core/iomgr/tcp_posix.h index 7e8064bffc..44279d5a26 100644 --- a/src/core/iomgr/tcp_posix.h +++ b/src/core/iomgr/tcp_posix.h @@ -49,6 +49,8 @@ #define GRPC_TCP_DEFAULT_READ_SLICE_SIZE 8192 +extern int grpc_tcp_trace; + /* Create a tcp endpoint given a file desciptor and a read slice size. Takes ownership of fd. */ grpc_endpoint *grpc_tcp_create(grpc_fd *fd, size_t read_slice_size); diff --git a/src/core/security/secure_endpoint.c b/src/core/security/secure_endpoint.c index d6bdf5a709..7bb1de4413 100644 --- a/src/core/security/secure_endpoint.c +++ b/src/core/security/secure_endpoint.c @@ -65,6 +65,8 @@ typedef struct { gpr_refcount ref; } secure_endpoint; +int grpc_trace_secure_endpoint = 0; + static void secure_endpoint_ref(secure_endpoint *ep) { gpr_ref(&ep->ref); } static void destroy(secure_endpoint *secure_ep) { @@ -96,7 +98,7 @@ static void flush_read_staging_buffer(secure_endpoint *ep, gpr_uint8 **cur, static void call_read_cb(secure_endpoint *ep, gpr_slice *slices, size_t nslices, grpc_endpoint_cb_status error) { - if (grpc_trace_bits & GRPC_TRACE_SECURE_ENDPOINT) { + if (grpc_trace_secure_endpoint) { size_t i; for (i = 0; i < nslices; i++) { char *data = @@ -231,7 +233,7 @@ static grpc_endpoint_write_status endpoint_write(grpc_endpoint *secure_ep, grpc_endpoint_write_status status; GPR_ASSERT(ep->output_buffer.count == 0); - if (grpc_trace_bits & GRPC_TRACE_SECURE_ENDPOINT) { + if (grpc_trace_secure_endpoint) { for (i = 0; i < nslices; i++) { char *data = gpr_hexdump((char *)GPR_SLICE_START_PTR(slices[i]), diff --git a/src/core/security/secure_endpoint.h b/src/core/security/secure_endpoint.h index 808889bf04..93c29b5111 100644 --- a/src/core/security/secure_endpoint.h +++ b/src/core/security/secure_endpoint.h @@ -39,6 +39,8 @@ struct tsi_frame_protector; +extern int grpc_trace_secure_endpoint; + /* Takes ownership of protector and to_wrap, and refs leftover_slices. */ grpc_endpoint *grpc_secure_endpoint_create( struct tsi_frame_protector *protector, grpc_endpoint *to_wrap, diff --git a/src/core/surface/init.c b/src/core/surface/init.c index 2d8f36e9c2..4db66fb66e 100644 --- a/src/core/surface/init.c +++ b/src/core/surface/init.c @@ -35,6 +35,10 @@ #include "src/core/iomgr/iomgr.h" #include "src/core/debug/trace.h" #include "src/core/statistics/census_interface.h" +#include "src/core/channel/channel_stack.h" +#include "src/core/surface/init.h" +#include "src/core/surface/surface_trace.h" +#include "src/core/transport/chttp2_transport.h" static gpr_once g_init = GPR_ONCE_INIT; static gpr_mu g_init_mu; @@ -50,7 +54,11 @@ void grpc_init(void) { gpr_mu_lock(&g_init_mu); if (++g_initializations == 1) { - grpc_init_trace_bits(); + grpc_register_tracer("channel", &grpc_trace_channel); + grpc_register_tracer("surface", &grpc_surface_trace); + grpc_register_tracer("http", &grpc_http_trace); + grpc_security_pre_init(); + grpc_tracer_init("GRPC_TRACE"); grpc_iomgr_init(); census_init(); } diff --git a/src/core/surface/init.h b/src/core/surface/init.h new file mode 100644 index 0000000000..ab40bedf87 --- /dev/null +++ b/src/core/surface/init.h @@ -0,0 +1,39 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_INTERNAL_CORE_SURFACE_INIT_H +#define GRPC_INTERNAL_CORE_SURFACE_INIT_H + +void grpc_security_pre_init(void); + +#endif /* GRPC_INTERNAL_CORE_SURFACE_INIT_H */ diff --git a/src/core/surface/init_secure.c b/src/core/surface/init_secure.c new file mode 100644 index 0000000000..fa20e91583 --- /dev/null +++ b/src/core/surface/init_secure.c @@ -0,0 +1,42 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/surface/init.h" +#include "src/core/debug/trace.h" +#include "src/core/security/secure_endpoint.h" +#include "src/core/tsi/transport_security_interface.h" + +void grpc_security_pre_init(void) { + grpc_register_tracer("secure_endpoint", &grpc_trace_secure_endpoint); + grpc_register_tracer("transport_security", &tsi_tracing_enabled); +} diff --git a/src/core/surface/init_unsecure.c b/src/core/surface/init_unsecure.c new file mode 100644 index 0000000000..ddb70cef8e --- /dev/null +++ b/src/core/surface/init_unsecure.c @@ -0,0 +1,37 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/surface/init.h" + +void grpc_security_pre_init(void) { +} diff --git a/src/core/surface/surface_trace.c b/src/core/surface/surface_trace.c new file mode 100644 index 0000000000..57a0053162 --- /dev/null +++ b/src/core/surface/surface_trace.c @@ -0,0 +1,36 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/surface/surface_trace.h" + +int grpc_surface_trace = 0; diff --git a/src/core/surface/surface_trace.h b/src/core/surface/surface_trace.h index 50071ee317..01302bb5d4 100644 --- a/src/core/surface/surface_trace.h +++ b/src/core/surface/surface_trace.h @@ -37,8 +37,10 @@ #include "src/core/debug/trace.h" #include <grpc/support/log.h> +extern int grpc_surface_trace; + #define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \ - if (grpc_trace_bits & GRPC_TRACE_SURFACE) { \ + if (grpc_surface_trace) { \ char *_ev = grpc_event_string(event); \ gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, _ev); \ gpr_free(_ev); \ diff --git a/src/core/transport/chttp2/frame_settings.c b/src/core/transport/chttp2/frame_settings.c index e6c4b7e38f..8d3250c34f 100644 --- a/src/core/transport/chttp2/frame_settings.c +++ b/src/core/transport/chttp2/frame_settings.c @@ -37,6 +37,7 @@ #include "src/core/debug/trace.h" #include "src/core/transport/chttp2/frame.h" +#include "src/core/transport/chttp2_transport.h" #include <grpc/support/log.h> #include <grpc/support/useful.h> @@ -218,7 +219,7 @@ grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse( } } parser->incoming_settings[parser->id] = parser->value; - if (grpc_trace_bits & GRPC_TRACE_HTTP) { + if (grpc_http_trace) { gpr_log(GPR_DEBUG, "CHTTP2: got setting %d = %d", parser->id, parser->value); } diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 6b7273e3e4..0d01a37112 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -37,7 +37,6 @@ #include <stdio.h> #include <string.h> -#include "src/core/debug/trace.h" #include "src/core/support/string.h" #include "src/core/transport/chttp2/frame_data.h" #include "src/core/transport/chttp2/frame_goaway.h" @@ -64,11 +63,13 @@ #define CLIENT_CONNECT_STRING "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" #define CLIENT_CONNECT_STRLEN 24 +int grpc_http_trace = 0; + typedef struct transport transport; typedef struct stream stream; #define IF_TRACING(stmt) \ - if (!(grpc_trace_bits & GRPC_TRACE_HTTP)) \ + if (!(grpc_http_trace)) \ ; \ else \ stmt diff --git a/src/core/transport/chttp2_transport.h b/src/core/transport/chttp2_transport.h index c5b65bd4f7..a7f1b9a864 100644 --- a/src/core/transport/chttp2_transport.h +++ b/src/core/transport/chttp2_transport.h @@ -37,6 +37,8 @@ #include "src/core/iomgr/endpoint.h" #include "src/core/transport/transport.h" +extern int grpc_http_trace; + void grpc_create_chttp2_transport(grpc_transport_setup_callback setup, void *arg, const grpc_channel_args *channel_args, diff --git a/src/core/tsi/transport_security.c b/src/core/tsi/transport_security.c index 04b30004fc..c8c74c5de5 100644 --- a/src/core/tsi/transport_security.c +++ b/src/core/tsi/transport_security.c @@ -40,10 +40,6 @@ int tsi_tracing_enabled = 0; -void tsi_enable_tracing() { - tsi_tracing_enabled = 1; -} - /* --- Utils. --- */ char* tsi_strdup(const char* src) { diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h index 33a19bef0d..0edff54235 100644 --- a/src/core/tsi/transport_security_interface.h +++ b/src/core/tsi/transport_security_interface.h @@ -63,8 +63,8 @@ const char* tsi_result_to_string(tsi_result result); /* --- tsi tracing --- */ -/* Call this function before any other tsi function to avoid races. */ -void tsi_enable_tracing(void); +/* Set this early to avoid races */ +extern int tsi_tracing_enabled; /* --- tsi_frame_protector object --- |