From 6014e8a945fa81fad7d0311a8a7cded0c2aaa827 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 16 Oct 2017 13:50:29 -0700 Subject: C++ize tracing --- src/core/lib/iomgr/tcp_client_posix.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/lib/iomgr/tcp_client_posix.cc') diff --git a/src/core/lib/iomgr/tcp_client_posix.cc b/src/core/lib/iomgr/tcp_client_posix.cc index 5611dd9062..4ef13dd1f5 100644 --- a/src/core/lib/iomgr/tcp_client_posix.cc +++ b/src/core/lib/iomgr/tcp_client_posix.cc @@ -43,7 +43,7 @@ #include "src/core/lib/iomgr/unix_sockets_posix.h" #include "src/core/lib/support/string.h" -extern grpc_tracer_flag grpc_tcp_trace; +extern grpc_core::Tracer grpc_tcp_trace; typedef struct { gpr_mu mu; @@ -99,7 +99,7 @@ done: static void tc_on_alarm(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) { int done; async_connect *ac = (async_connect *)acp; - if (GRPC_TRACER_ON(grpc_tcp_trace)) { + if (grpc_tcp_trace.enabled()) { const char *str = grpc_error_string(error); gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: on_alarm: error=%s", ac->addr_str, str); @@ -137,7 +137,7 @@ static void on_writable(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) { GRPC_ERROR_REF(error); - if (GRPC_TRACER_ON(grpc_tcp_trace)) { + if (grpc_tcp_trace.enabled()) { const char *str = grpc_error_string(error); gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: on_writable: error=%s", ac->addr_str, str); @@ -317,7 +317,7 @@ static void tcp_client_connect_impl(grpc_exec_ctx *exec_ctx, grpc_schedule_on_exec_ctx); ac->channel_args = grpc_channel_args_copy(channel_args); - if (GRPC_TRACER_ON(grpc_tcp_trace)) { + if (grpc_tcp_trace.enabled()) { gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %s: asynchronously connecting fd %p", ac->addr_str, fdobj); } -- cgit v1.2.3 From 694580faee3a3bb91f9922a1d04125aa48f50bd5 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 18 Oct 2017 14:48:14 -0700 Subject: Better name --- include/grpc/grpc.h | 2 +- src/core/ext/filters/client_channel/client_channel.cc | 2 +- src/core/ext/filters/client_channel/client_channel.h | 2 +- src/core/ext/filters/client_channel/lb_policy.cc | 2 +- src/core/ext/filters/client_channel/lb_policy.h | 2 +- .../filters/client_channel/lb_policy/grpclb/grpclb.cc | 2 +- .../client_channel/lb_policy/pick_first/pick_first.cc | 2 +- .../client_channel/lb_policy/round_robin/round_robin.cc | 2 +- src/core/ext/filters/client_channel/resolver.cc | 2 +- src/core/ext/filters/client_channel/resolver.h | 2 +- .../ext/transport/chttp2/transport/chttp2_transport.cc | 6 +++--- .../ext/transport/chttp2/transport/chttp2_transport.h | 8 ++++---- src/core/ext/transport/chttp2/transport/hpack_encoder.cc | 2 +- src/core/ext/transport/chttp2/transport/hpack_table.cc | 2 +- src/core/ext/transport/chttp2/transport/internal.h | 4 ++-- src/core/ext/transport/chttp2/transport/stream_lists.cc | 2 +- src/core/ext/transport/inproc/inproc_plugin.cc | 2 +- src/core/ext/transport/inproc/inproc_transport.h | 2 +- src/core/lib/channel/channel_stack.cc | 2 +- src/core/lib/channel/channel_stack.h | 2 +- src/core/lib/channel/channel_stack_builder.cc | 2 +- src/core/lib/channel/channel_stack_builder.h | 2 +- src/core/lib/debug/trace.cc | 16 ++++++++-------- src/core/lib/debug/trace.h | 10 +++++----- src/core/lib/http/parser.cc | 2 +- src/core/lib/http/parser.h | 2 +- src/core/lib/iomgr/call_combiner.cc | 2 +- src/core/lib/iomgr/call_combiner.h | 2 +- src/core/lib/iomgr/closure.cc | 2 +- src/core/lib/iomgr/closure.h | 2 +- src/core/lib/iomgr/combiner.cc | 2 +- src/core/lib/iomgr/combiner.h | 2 +- src/core/lib/iomgr/error.cc | 2 +- src/core/lib/iomgr/error.h | 2 +- src/core/lib/iomgr/ev_epollex_linux.cc | 2 +- src/core/lib/iomgr/ev_posix.cc | 4 ++-- src/core/lib/iomgr/ev_posix.h | 2 +- src/core/lib/iomgr/ev_windows.cc | 2 +- src/core/lib/iomgr/executor.cc | 2 +- src/core/lib/iomgr/lockfree_event.cc | 2 +- src/core/lib/iomgr/pollset.h | 2 +- src/core/lib/iomgr/pollset_uv.cc | 2 +- src/core/lib/iomgr/pollset_windows.cc | 2 +- src/core/lib/iomgr/resource_quota.cc | 2 +- src/core/lib/iomgr/resource_quota.h | 2 +- src/core/lib/iomgr/tcp_client_posix.cc | 2 +- src/core/lib/iomgr/tcp_client_uv.cc | 2 +- src/core/lib/iomgr/tcp_posix.cc | 2 +- src/core/lib/iomgr/tcp_posix.h | 2 +- src/core/lib/iomgr/tcp_uv.cc | 2 +- src/core/lib/iomgr/tcp_uv.h | 2 +- src/core/lib/iomgr/tcp_windows.cc | 2 +- src/core/lib/iomgr/timer_generic.cc | 4 ++-- src/core/lib/iomgr/timer_manager.cc | 2 +- src/core/lib/iomgr/timer_uv.cc | 4 ++-- src/core/lib/security/context/security_context.cc | 2 +- src/core/lib/security/context/security_context.h | 2 +- .../security/credentials/plugin/plugin_credentials.cc | 2 +- .../lib/security/credentials/plugin/plugin_credentials.h | 2 +- src/core/lib/security/transport/secure_endpoint.cc | 2 +- src/core/lib/security/transport/secure_endpoint.h | 2 +- src/core/lib/security/transport/security_connector.cc | 2 +- src/core/lib/security/transport/security_connector.h | 2 +- src/core/lib/surface/alarm.cc | 2 +- src/core/lib/surface/alarm_internal.h | 2 +- src/core/lib/surface/api_trace.cc | 2 +- src/core/lib/surface/api_trace.h | 2 +- src/core/lib/surface/call.cc | 4 ++-- src/core/lib/surface/call.h | 4 ++-- src/core/lib/surface/completion_queue.cc | 10 +++++----- src/core/lib/surface/completion_queue.h | 10 +++++----- src/core/lib/surface/server.cc | 2 +- src/core/lib/surface/server.h | 2 +- src/core/lib/transport/bdp_estimator.cc | 2 +- src/core/lib/transport/bdp_estimator.h | 2 +- src/core/lib/transport/connectivity_state.cc | 2 +- src/core/lib/transport/connectivity_state.h | 2 +- src/core/lib/transport/metadata.cc | 2 +- src/core/lib/transport/metadata.h | 2 +- src/core/lib/transport/transport.cc | 2 +- src/core/lib/transport/transport.h | 2 +- src/core/tsi/transport_security.cc | 2 +- src/core/tsi/transport_security.h | 2 +- src/core/tsi/transport_security_interface.h | 2 +- 84 files changed, 114 insertions(+), 114 deletions(-) (limited to 'src/core/lib/iomgr/tcp_client_posix.cc') diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index 1de289fba4..bc8d95fa4c 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -411,7 +411,7 @@ GRPCAPI void grpc_server_destroy(grpc_server *server); /** Enable or disable a tracer. - Tracers (usually controlled by the environment variable GRPC_TRACE) + TraceFlags (usually controlled by the environment variable GRPC_TRACE) allow printf-style debugging on GRPC internals, and are useful for tracking down problems in the field. diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index 8a8e76ff12..70209a5020 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -55,7 +55,7 @@ /* Client channel implementation */ -grpc_core::Tracer grpc_client_channel_trace(false, "client_channel"); +grpc_core::TraceFlag grpc_client_channel_trace(false, "client_channel"); /************************************************************************* * METHOD-CONFIG TABLE diff --git a/src/core/ext/filters/client_channel/client_channel.h b/src/core/ext/filters/client_channel/client_channel.h index b5d095fe5f..d78e7a798c 100644 --- a/src/core/ext/filters/client_channel/client_channel.h +++ b/src/core/ext/filters/client_channel/client_channel.h @@ -23,7 +23,7 @@ #include "src/core/ext/filters/client_channel/resolver.h" #include "src/core/lib/channel/channel_stack.h" -extern grpc_core::Tracer grpc_client_channel_trace; +extern grpc_core::TraceFlag grpc_client_channel_trace; // Channel arg key for server URI string. #define GRPC_ARG_SERVER_URI "grpc.server_uri" diff --git a/src/core/ext/filters/client_channel/lb_policy.cc b/src/core/ext/filters/client_channel/lb_policy.cc index 738486adbb..316377b845 100644 --- a/src/core/ext/filters/client_channel/lb_policy.cc +++ b/src/core/ext/filters/client_channel/lb_policy.cc @@ -22,7 +22,7 @@ #define WEAK_REF_BITS 16 #ifndef NDEBUG -grpc_core::Tracer grpc_trace_lb_policy_refcount(false, "lb_policy_refcount"); +grpc_core::TraceFlag grpc_trace_lb_policy_refcount(false, "lb_policy_refcount"); #endif void grpc_lb_policy_init(grpc_lb_policy *policy, diff --git a/src/core/ext/filters/client_channel/lb_policy.h b/src/core/ext/filters/client_channel/lb_policy.h index 0fcb2ef17b..710c9d9f38 100644 --- a/src/core/ext/filters/client_channel/lb_policy.h +++ b/src/core/ext/filters/client_channel/lb_policy.h @@ -34,7 +34,7 @@ typedef struct grpc_lb_policy_vtable grpc_lb_policy_vtable; typedef struct grpc_lb_policy_args grpc_lb_policy_args; #ifndef NDEBUG -extern grpc_core::Tracer grpc_trace_lb_policy_refcount; +extern grpc_core::TraceFlag grpc_trace_lb_policy_refcount; #endif struct grpc_lb_policy { diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 9ad54fabf5..eb699af6da 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -126,7 +126,7 @@ #define GRPC_GRPCLB_RECONNECT_JITTER 0.2 #define GRPC_GRPCLB_DEFAULT_FALLBACK_TIMEOUT_MS 10000 -grpc_core::Tracer grpc_lb_glb_trace(false, "glb"); +grpc_core::TraceFlag grpc_lb_glb_trace(false, "glb"); /* add lb_token of selected subchannel (address) to the call's initial * metadata */ diff --git a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc index 3454ff0cbd..831b78f345 100644 --- a/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +++ b/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc @@ -28,7 +28,7 @@ #include "src/core/lib/iomgr/sockaddr_utils.h" #include "src/core/lib/transport/connectivity_state.h" -grpc_core::Tracer grpc_lb_pick_first_trace(false, "pick_first"); +grpc_core::TraceFlag grpc_lb_pick_first_trace(false, "pick_first"); typedef struct pending_pick { struct pending_pick *next; diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc index e7cf8ce6f7..911df134cb 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc @@ -38,7 +38,7 @@ #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/static_metadata.h" -grpc_core::Tracer grpc_lb_round_robin_trace(false, "round_robin"); +grpc_core::TraceFlag grpc_lb_round_robin_trace(false, "round_robin"); /** List of entities waiting for a pick. * diff --git a/src/core/ext/filters/client_channel/resolver.cc b/src/core/ext/filters/client_channel/resolver.cc index 9ce4f80e63..93dd834fb2 100644 --- a/src/core/ext/filters/client_channel/resolver.cc +++ b/src/core/ext/filters/client_channel/resolver.cc @@ -20,7 +20,7 @@ #include "src/core/lib/iomgr/combiner.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_resolver_refcount(false, "resolver_refcount"); +grpc_core::TraceFlag grpc_trace_resolver_refcount(false, "resolver_refcount"); #endif void grpc_resolver_init(grpc_resolver *resolver, diff --git a/src/core/ext/filters/client_channel/resolver.h b/src/core/ext/filters/client_channel/resolver.h index 990e9737e9..3ff787acca 100644 --- a/src/core/ext/filters/client_channel/resolver.h +++ b/src/core/ext/filters/client_channel/resolver.h @@ -30,7 +30,7 @@ typedef struct grpc_resolver grpc_resolver; typedef struct grpc_resolver_vtable grpc_resolver_vtable; #ifndef NDEBUG -extern grpc_core::Tracer grpc_trace_resolver_refcount; +extern grpc_core::TraceFlag grpc_trace_resolver_refcount; #endif /** \a grpc_resolver provides \a grpc_channel_args objects to its caller */ diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index ae352d5d7a..19fdcc9150 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -90,11 +90,11 @@ static int g_default_max_pings_without_data = DEFAULT_MAX_PINGS_BETWEEN_DATA; static int g_default_max_ping_strikes = DEFAULT_MAX_PING_STRIKES; #define MAX_CLIENT_STREAM_ID 0x7fffffffu -grpc_core::Tracer grpc_http_trace(false, "http"); -grpc_core::Tracer grpc_flowctl_trace(false, "flowctl"); +grpc_core::TraceFlag grpc_http_trace(false, "http"); +grpc_core::TraceFlag grpc_flowctl_trace(false, "flowctl"); #ifndef NDEBUG -grpc_core::Tracer grpc_trace_chttp2_refcount(false, "chttp2_refcount"); +grpc_core::TraceFlag grpc_trace_chttp2_refcount(false, "chttp2_refcount"); #endif /* forward declarations of various callbacks that we'll build closures around */ diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/src/core/ext/transport/chttp2/transport/chttp2_transport.h index 08c22181a7..408759a292 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.h +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.h @@ -27,12 +27,12 @@ extern "C" { #endif -extern grpc_core::Tracer grpc_http_trace; -extern grpc_core::Tracer grpc_flowctl_trace; -extern grpc_core::Tracer grpc_trace_http2_stream_state; +extern grpc_core::TraceFlag grpc_http_trace; +extern grpc_core::TraceFlag grpc_flowctl_trace; +extern grpc_core::TraceFlag grpc_trace_http2_stream_state; #ifndef NDEBUG -extern grpc_core::Tracer grpc_trace_chttp2_refcount; +extern grpc_core::TraceFlag grpc_trace_chttp2_refcount; #endif grpc_transport *grpc_create_chttp2_transport( diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc index ddb75fc9e7..c380869fc6 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc @@ -57,7 +57,7 @@ static const grpc_slice terminal_slice = { {{0, 0}} /* data.refcounted */ }; -extern grpc_core::Tracer grpc_http_trace; +extern grpc_core::TraceFlag grpc_http_trace; typedef struct { int is_first_frame; diff --git a/src/core/ext/transport/chttp2/transport/hpack_table.cc b/src/core/ext/transport/chttp2/transport/hpack_table.cc index 66bd87c94e..1cb8c0a85b 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_table.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_table.cc @@ -28,7 +28,7 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/support/murmur_hash.h" -extern grpc_core::Tracer grpc_http_trace; +extern grpc_core::TraceFlag grpc_http_trace; static struct { const char *key; diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index f1d1334e84..6ef32958e0 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -678,8 +678,8 @@ void grpc_chttp2_complete_closure_step(grpc_exec_ctx *exec_ctx, #define GRPC_CHTTP2_CLIENT_CONNECT_STRLEN \ (sizeof(GRPC_CHTTP2_CLIENT_CONNECT_STRING) - 1) -extern grpc_core::Tracer grpc_http_trace; -extern grpc_core::Tracer grpc_flowctl_trace; +extern grpc_core::TraceFlag grpc_http_trace; +extern grpc_core::TraceFlag grpc_flowctl_trace; #define GRPC_CHTTP2_IF_TRACING(stmt) \ if (!(GRPC_TRACER_ON(grpc_http_trace))) \ diff --git a/src/core/ext/transport/chttp2/transport/stream_lists.cc b/src/core/ext/transport/chttp2/transport/stream_lists.cc index 76538976b6..f2acdd4165 100644 --- a/src/core/ext/transport/chttp2/transport/stream_lists.cc +++ b/src/core/ext/transport/chttp2/transport/stream_lists.cc @@ -39,7 +39,7 @@ static const char *stream_list_id_string(grpc_chttp2_stream_list_id id) { GPR_UNREACHABLE_CODE(return "unknown"); } -grpc_core::Tracer grpc_trace_http2_stream_state(false, "http2_stream_state"); +grpc_core::TraceFlag grpc_trace_http2_stream_state(false, "http2_stream_state"); /* core list management */ diff --git a/src/core/ext/transport/inproc/inproc_plugin.cc b/src/core/ext/transport/inproc/inproc_plugin.cc index 8e0203b5ed..2526dbfa06 100644 --- a/src/core/ext/transport/inproc/inproc_plugin.cc +++ b/src/core/ext/transport/inproc/inproc_plugin.cc @@ -19,7 +19,7 @@ #include "src/core/ext/transport/inproc/inproc_transport.h" #include "src/core/lib/debug/trace.h" -grpc_core::Tracer grpc_inproc_trace(false, "inproc"); +grpc_core::TraceFlag grpc_inproc_trace(false, "inproc"); extern "C" void grpc_inproc_plugin_init(void) { grpc_inproc_transport_init(); } diff --git a/src/core/ext/transport/inproc/inproc_transport.h b/src/core/ext/transport/inproc/inproc_transport.h index 8fd8caf402..248a9dd54e 100644 --- a/src/core/ext/transport/inproc/inproc_transport.h +++ b/src/core/ext/transport/inproc/inproc_transport.h @@ -29,7 +29,7 @@ grpc_channel *grpc_inproc_channel_create(grpc_server *server, grpc_channel_args *args, void *reserved); -extern grpc_core::Tracer grpc_inproc_trace; +extern grpc_core::TraceFlag grpc_inproc_trace; void grpc_inproc_transport_init(void); void grpc_inproc_transport_shutdown(void); diff --git a/src/core/lib/channel/channel_stack.cc b/src/core/lib/channel/channel_stack.cc index 5201d6bf3d..1e48d1c5e9 100644 --- a/src/core/lib/channel/channel_stack.cc +++ b/src/core/lib/channel/channel_stack.cc @@ -23,7 +23,7 @@ #include #include -grpc_core::Tracer grpc_trace_channel(false, "channel"); +grpc_core::TraceFlag grpc_trace_channel(false, "channel"); /* Memory layouts. diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h index 01d6310428..0796d6f17c 100644 --- a/src/core/lib/channel/channel_stack.h +++ b/src/core/lib/channel/channel_stack.h @@ -285,7 +285,7 @@ void grpc_call_log_op(const char *file, int line, gpr_log_severity severity, grpc_call_element *elem, grpc_transport_stream_op_batch *op); -extern grpc_core::Tracer grpc_trace_channel; +extern grpc_core::TraceFlag grpc_trace_channel; #define GRPC_CALL_LOG_OP(sev, elem, op) \ if (grpc_trace_channel.enabled()) grpc_call_log_op(sev, elem, op) diff --git a/src/core/lib/channel/channel_stack_builder.cc b/src/core/lib/channel/channel_stack_builder.cc index 3ee70a85be..f01650bd1b 100644 --- a/src/core/lib/channel/channel_stack_builder.cc +++ b/src/core/lib/channel/channel_stack_builder.cc @@ -23,7 +23,7 @@ #include #include -grpc_core::Tracer grpc_trace_channel_stack_builder(false, +grpc_core::TraceFlag grpc_trace_channel_stack_builder(false, "channel_stack_builder"); typedef struct filter_node { diff --git a/src/core/lib/channel/channel_stack_builder.h b/src/core/lib/channel/channel_stack_builder.h index d790cf9a63..981be90f68 100644 --- a/src/core/lib/channel/channel_stack_builder.h +++ b/src/core/lib/channel/channel_stack_builder.h @@ -160,7 +160,7 @@ grpc_error *grpc_channel_stack_builder_finish( void grpc_channel_stack_builder_destroy(grpc_exec_ctx *exec_ctx, grpc_channel_stack_builder *builder); -extern grpc_core::Tracer grpc_trace_channel_stack_builder; +extern grpc_core::TraceFlag grpc_trace_channel_stack_builder; #ifdef __cplusplus } diff --git a/src/core/lib/debug/trace.cc b/src/core/lib/debug/trace.cc index 5953be641a..52cfbe52ea 100644 --- a/src/core/lib/debug/trace.cc +++ b/src/core/lib/debug/trace.cc @@ -29,21 +29,21 @@ int grpc_tracer_set_enabled(const char *name, int enabled); namespace grpc_core { -Tracer::Tracer(bool default_enabled, const char *name) +TraceFlag::TraceFlag(bool default_enabled, const char *name) : next_tracer_(root_tracer_), name_(name), value_(default_enabled) { root_tracer_ = this; } -void Tracer::List() { +void TraceFlag::List() { gpr_log(GPR_DEBUG, "available tracers:"); - Tracer *t; + TraceFlag *t; for (t = root_tracer_; t != nullptr; t = t->next_tracer_) { gpr_log(GPR_DEBUG, "\t%s", t->name_); } } -bool Tracer::Set(const char *name, bool enabled) { - Tracer *t; +bool TraceFlag::Set(const char *name, bool enabled) { + TraceFlag *t; if (0 == strcmp(name, "all")) { for (t = root_tracer_; t; t = t->next_tracer_) { t->set_enabled(enabled); @@ -107,9 +107,9 @@ static void parse(const char *s) { for (i = 0; i < nstrings; i++) { if (strings[i][0] == '-') { - grpc_core::Tracer::Set(strings[i] + 1, false); + grpc_core::TraceFlag::Set(strings[i] + 1, false); } else { - grpc_core::Tracer::Set(strings[i], true); + grpc_core::TraceFlag::Set(strings[i], true); } } @@ -130,5 +130,5 @@ void grpc_tracer_init(const char *env_var) { void grpc_tracer_shutdown(void) {} int grpc_tracer_set_enabled(const char *name, int enabled) { - return grpc_core::Tracer::Set(name, enabled != 0); + return grpc_core::TraceFlag::Set(name, enabled != 0); } diff --git a/src/core/lib/debug/trace.h b/src/core/lib/debug/trace.h index c9ce850d3f..c09aa01703 100644 --- a/src/core/lib/debug/trace.h +++ b/src/core/lib/debug/trace.h @@ -44,10 +44,10 @@ void grpc_tracer_shutdown(void); namespace grpc_core { -class Tracer { +class TraceFlag { public: - Tracer(bool default_enabled, const char *name); - ~Tracer(); + TraceFlag(bool default_enabled, const char *name); + ~TraceFlag(); static bool Set(const char *tracer, bool enabled); @@ -70,8 +70,8 @@ class Tracer { #endif } - static Tracer *root_tracer_; - Tracer *next_tracer_; + static TraceFlag *root_tracer_; + TraceFlag *next_tracer_; const char *const name_; #ifdef GRPC_THREADSAFE_TRACER gpr_atm value_; diff --git a/src/core/lib/http/parser.cc b/src/core/lib/http/parser.cc index f272df11dd..720e8e85ee 100644 --- a/src/core/lib/http/parser.cc +++ b/src/core/lib/http/parser.cc @@ -25,7 +25,7 @@ #include #include -grpc_core::Tracer grpc_http1_trace(false, "http1"); +grpc_core::TraceFlag grpc_http1_trace(false, "http1"); static char *buf2str(void *buffer, size_t length) { char *out = (char *)gpr_malloc(length + 1); diff --git a/src/core/lib/http/parser.h b/src/core/lib/http/parser.h index b6efeda28a..044f159f73 100644 --- a/src/core/lib/http/parser.h +++ b/src/core/lib/http/parser.h @@ -111,7 +111,7 @@ grpc_error *grpc_http_parser_eof(grpc_http_parser *parser); void grpc_http_request_destroy(grpc_http_request *request); void grpc_http_response_destroy(grpc_http_response *response); -extern grpc_core::Tracer grpc_http1_trace; +extern grpc_core::TraceFlag grpc_http1_trace; #ifdef __cplusplus } diff --git a/src/core/lib/iomgr/call_combiner.cc b/src/core/lib/iomgr/call_combiner.cc index 48122d6b55..752303e260 100644 --- a/src/core/lib/iomgr/call_combiner.cc +++ b/src/core/lib/iomgr/call_combiner.cc @@ -24,7 +24,7 @@ #include "src/core/lib/debug/stats.h" #include "src/core/lib/profiling/timers.h" -grpc_core::Tracer grpc_call_combiner_trace(false, "call_combiner"); +grpc_core::TraceFlag grpc_call_combiner_trace(false, "call_combiner"); static grpc_error* decode_cancel_state_error(gpr_atm cancel_state) { if (cancel_state & 1) { diff --git a/src/core/lib/iomgr/call_combiner.h b/src/core/lib/iomgr/call_combiner.h index 463501a660..77420fa3e0 100644 --- a/src/core/lib/iomgr/call_combiner.h +++ b/src/core/lib/iomgr/call_combiner.h @@ -40,7 +40,7 @@ extern "C" { // when it is done with the action that was kicked off by the original // callback. -extern grpc_core::Tracer grpc_call_combiner_trace; +extern grpc_core::TraceFlag grpc_call_combiner_trace; typedef struct { gpr_atm size; // size_t, num closures in queue or currently executing diff --git a/src/core/lib/iomgr/closure.cc b/src/core/lib/iomgr/closure.cc index b2dfdbc207..8639c2b7d2 100644 --- a/src/core/lib/iomgr/closure.cc +++ b/src/core/lib/iomgr/closure.cc @@ -25,7 +25,7 @@ #include "src/core/lib/profiling/timers.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_closure(false, "closure"); +grpc_core::TraceFlag grpc_trace_closure(false, "closure"); #endif #ifndef NDEBUG diff --git a/src/core/lib/iomgr/closure.h b/src/core/lib/iomgr/closure.h index ae946072ce..66484a210f 100644 --- a/src/core/lib/iomgr/closure.h +++ b/src/core/lib/iomgr/closure.h @@ -34,7 +34,7 @@ struct grpc_closure; typedef struct grpc_closure grpc_closure; #ifndef NDEBUG -extern grpc_core::Tracer grpc_trace_closure; +extern grpc_core::TraceFlag grpc_trace_closure; #endif typedef struct grpc_closure_list { diff --git a/src/core/lib/iomgr/combiner.cc b/src/core/lib/iomgr/combiner.cc index b77ddbffa1..30e3b9111f 100644 --- a/src/core/lib/iomgr/combiner.cc +++ b/src/core/lib/iomgr/combiner.cc @@ -29,7 +29,7 @@ #include "src/core/lib/iomgr/executor.h" #include "src/core/lib/profiling/timers.h" -grpc_core::Tracer grpc_combiner_trace(false, "combiner"); +grpc_core::TraceFlag grpc_combiner_trace(false, "combiner"); #define GRPC_COMBINER_TRACE(fn) \ do { \ diff --git a/src/core/lib/iomgr/combiner.h b/src/core/lib/iomgr/combiner.h index 5f80e1de27..8eeb0df06a 100644 --- a/src/core/lib/iomgr/combiner.h +++ b/src/core/lib/iomgr/combiner.h @@ -65,7 +65,7 @@ grpc_closure_scheduler *grpc_combiner_finally_scheduler(grpc_combiner *lock); bool grpc_combiner_continue_exec_ctx(grpc_exec_ctx *exec_ctx); -extern grpc_core::Tracer grpc_combiner_trace; +extern grpc_core::TraceFlag grpc_combiner_trace; #ifdef __cplusplus } diff --git a/src/core/lib/iomgr/error.cc b/src/core/lib/iomgr/error.cc index 578d35764f..898a18cb9e 100644 --- a/src/core/lib/iomgr/error.cc +++ b/src/core/lib/iomgr/error.cc @@ -38,7 +38,7 @@ #include "src/core/lib/slice/slice_internal.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_error_refcount(false, "error_refcount"); +grpc_core::TraceFlag grpc_trace_error_refcount(false, "error_refcount"); #endif static const char *error_int_name(grpc_error_ints key) { diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index 0d91006a90..d4050c1138 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -39,7 +39,7 @@ extern "C" { typedef struct grpc_error grpc_error; #ifndef NDEBUG -extern grpc_core::Tracer grpc_trace_error_refcount; +extern grpc_core::TraceFlag grpc_trace_error_refcount; #endif typedef enum { diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc index d30ca3fd5e..bdcaf926b4 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.cc +++ b/src/core/lib/iomgr/ev_epollex_linux.cc @@ -58,7 +58,7 @@ #define MAX_EPOLL_EVENTS_HANDLED_EACH_POLL_CALL 5 #ifndef NDEBUG -grpc_core::Tracer grpc_trace_pollable_refcount(false, "pollable_refcount"); +grpc_core::TraceFlag grpc_trace_pollable_refcount(false, "pollable_refcount"); #endif /******************************************************************************* diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc index 28e4efa011..87fcfd2e04 100644 --- a/src/core/lib/iomgr/ev_posix.cc +++ b/src/core/lib/iomgr/ev_posix.cc @@ -36,11 +36,11 @@ #include "src/core/lib/iomgr/ev_poll_posix.h" #include "src/core/lib/support/env.h" -grpc_core::Tracer grpc_polling_trace(false, +grpc_core::TraceFlag grpc_polling_trace(false, "polling"); /* Disabled by default */ #ifndef NDEBUG -grpc_core::Tracer grpc_trace_fd_refcount(false, "fd_refcount"); +grpc_core::TraceFlag grpc_trace_fd_refcount(false, "fd_refcount"); #endif /** Default poll() function - a pointer so that it can be overridden by some diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h index 1f585259c1..d4d6d98cae 100644 --- a/src/core/lib/iomgr/ev_posix.h +++ b/src/core/lib/iomgr/ev_posix.h @@ -31,7 +31,7 @@ extern "C" { #endif -extern grpc_core::Tracer grpc_polling_trace; /* Disabled by default */ +extern grpc_core::TraceFlag grpc_polling_trace; /* Disabled by default */ typedef struct grpc_fd grpc_fd; diff --git a/src/core/lib/iomgr/ev_windows.cc b/src/core/lib/iomgr/ev_windows.cc index c2e5d55df8..cb66de0a06 100644 --- a/src/core/lib/iomgr/ev_windows.cc +++ b/src/core/lib/iomgr/ev_windows.cc @@ -22,7 +22,7 @@ #include "src/core/lib/debug/trace.h" -grpc_core::Tracer grpc_polling_trace(false, +grpc_core::TraceFlag grpc_polling_trace(false, "polling"); /* Disabled by default */ #endif // GRPC_WINSOCK_SOCKET diff --git a/src/core/lib/iomgr/executor.cc b/src/core/lib/iomgr/executor.cc index 085c2127a1..59c7818347 100644 --- a/src/core/lib/iomgr/executor.cc +++ b/src/core/lib/iomgr/executor.cc @@ -51,7 +51,7 @@ static gpr_spinlock g_adding_thread_lock = GPR_SPINLOCK_STATIC_INITIALIZER; GPR_TLS_DECL(g_this_thread_state); -static grpc_core::Tracer executor_trace(false, "executor"); +static grpc_core::TraceFlag executor_trace(false, "executor"); static void executor_thread(void *arg); diff --git a/src/core/lib/iomgr/lockfree_event.cc b/src/core/lib/iomgr/lockfree_event.cc index 27e720d219..a4aeacccf9 100644 --- a/src/core/lib/iomgr/lockfree_event.cc +++ b/src/core/lib/iomgr/lockfree_event.cc @@ -22,7 +22,7 @@ #include "src/core/lib/debug/trace.h" -extern grpc_core::Tracer grpc_polling_trace; +extern grpc_core::TraceFlag grpc_polling_trace; /* 'state' holds the to call when the fd is readable or writable respectively. It can contain one of the following values: diff --git a/src/core/lib/iomgr/pollset.h b/src/core/lib/iomgr/pollset.h index 33bfcf824c..d48f7f8574 100644 --- a/src/core/lib/iomgr/pollset.h +++ b/src/core/lib/iomgr/pollset.h @@ -30,7 +30,7 @@ extern "C" { #endif #ifndef NDEBUG -extern grpc_core::Tracer grpc_trace_fd_refcount; +extern grpc_core::TraceFlag grpc_trace_fd_refcount; #endif /* A grpc_pollset is a set of file descriptors that a higher level item is diff --git a/src/core/lib/iomgr/pollset_uv.cc b/src/core/lib/iomgr/pollset_uv.cc index cf3566d08f..2016d5d808 100644 --- a/src/core/lib/iomgr/pollset_uv.cc +++ b/src/core/lib/iomgr/pollset_uv.cc @@ -35,7 +35,7 @@ #include "src/core/lib/debug/trace.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_fd_refcount(false, "fd_refcount"); +grpc_core::TraceFlag grpc_trace_fd_refcount(false, "fd_refcount"); #endif struct grpc_pollset { diff --git a/src/core/lib/iomgr/pollset_windows.cc b/src/core/lib/iomgr/pollset_windows.cc index d0d299b6b7..88354991d5 100644 --- a/src/core/lib/iomgr/pollset_windows.cc +++ b/src/core/lib/iomgr/pollset_windows.cc @@ -31,7 +31,7 @@ #define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker *)1) #ifndef NDEBUG -grpc_core::Tracer grpc_trace_fd_refcount(false, "fd_refcount"); +grpc_core::TraceFlag grpc_trace_fd_refcount(false, "fd_refcount"); #endif gpr_mu grpc_polling_mu; diff --git a/src/core/lib/iomgr/resource_quota.cc b/src/core/lib/iomgr/resource_quota.cc index d3ed87a1c0..28098ecd08 100644 --- a/src/core/lib/iomgr/resource_quota.cc +++ b/src/core/lib/iomgr/resource_quota.cc @@ -31,7 +31,7 @@ #include "src/core/lib/iomgr/combiner.h" -grpc_core::Tracer grpc_resource_quota_trace(false, "resource_quota"); +grpc_core::TraceFlag grpc_resource_quota_trace(false, "resource_quota"); #define MEMORY_USAGE_ESTIMATION_MAX 65536 diff --git a/src/core/lib/iomgr/resource_quota.h b/src/core/lib/iomgr/resource_quota.h index 04c80c692c..fdebe89b86 100644 --- a/src/core/lib/iomgr/resource_quota.h +++ b/src/core/lib/iomgr/resource_quota.h @@ -65,7 +65,7 @@ extern "C" { maintain lists of users (which users arrange to leave before they are destroyed) */ -extern grpc_core::Tracer grpc_resource_quota_trace; +extern grpc_core::TraceFlag grpc_resource_quota_trace; grpc_resource_quota *grpc_resource_quota_ref_internal( grpc_resource_quota *resource_quota); diff --git a/src/core/lib/iomgr/tcp_client_posix.cc b/src/core/lib/iomgr/tcp_client_posix.cc index 4ef13dd1f5..05c2adae20 100644 --- a/src/core/lib/iomgr/tcp_client_posix.cc +++ b/src/core/lib/iomgr/tcp_client_posix.cc @@ -43,7 +43,7 @@ #include "src/core/lib/iomgr/unix_sockets_posix.h" #include "src/core/lib/support/string.h" -extern grpc_core::Tracer grpc_tcp_trace; +extern grpc_core::TraceFlag grpc_tcp_trace; typedef struct { gpr_mu mu; diff --git a/src/core/lib/iomgr/tcp_client_uv.cc b/src/core/lib/iomgr/tcp_client_uv.cc index bebb7634b6..b2aefc282e 100644 --- a/src/core/lib/iomgr/tcp_client_uv.cc +++ b/src/core/lib/iomgr/tcp_client_uv.cc @@ -32,7 +32,7 @@ #include "src/core/lib/iomgr/tcp_uv.h" #include "src/core/lib/iomgr/timer.h" -extern grpc_core::Tracer grpc_tcp_trace; +extern grpc_core::TraceFlag grpc_tcp_trace; typedef struct grpc_uv_tcp_connect { uv_connect_t connect_req; diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index cfdacaf988..3fa175df95 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -61,7 +61,7 @@ typedef GRPC_MSG_IOVLEN_TYPE msg_iovlen_type; typedef size_t msg_iovlen_type; #endif -grpc_core::Tracer grpc_tcp_trace(false, "tcp"); +grpc_core::TraceFlag grpc_tcp_trace(false, "tcp"); typedef struct { grpc_endpoint base; diff --git a/src/core/lib/iomgr/tcp_posix.h b/src/core/lib/iomgr/tcp_posix.h index 3a51529874..d9963c2f2f 100644 --- a/src/core/lib/iomgr/tcp_posix.h +++ b/src/core/lib/iomgr/tcp_posix.h @@ -37,7 +37,7 @@ extern "C" { #endif -extern grpc_core::Tracer grpc_tcp_trace; +extern grpc_core::TraceFlag grpc_tcp_trace; /* Create a tcp endpoint given a file desciptor and a read slice size. Takes ownership of fd. */ diff --git a/src/core/lib/iomgr/tcp_uv.cc b/src/core/lib/iomgr/tcp_uv.cc index ece494065a..b245ce4ecf 100644 --- a/src/core/lib/iomgr/tcp_uv.cc +++ b/src/core/lib/iomgr/tcp_uv.cc @@ -38,7 +38,7 @@ #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/lib/support/string.h" -grpc_core::Tracer grpc_tcp_trace(false, "tcp"); +grpc_core::TraceFlag grpc_tcp_trace(false, "tcp"); typedef struct { grpc_endpoint base; diff --git a/src/core/lib/iomgr/tcp_uv.h b/src/core/lib/iomgr/tcp_uv.h index 63f028173e..3d4afe0fb8 100644 --- a/src/core/lib/iomgr/tcp_uv.h +++ b/src/core/lib/iomgr/tcp_uv.h @@ -34,7 +34,7 @@ #include -extern grpc_core::Tracer grpc_tcp_trace; +extern grpc_core::TraceFlag grpc_tcp_trace; #define GRPC_TCP_DEFAULT_READ_SLICE_SIZE 8192 diff --git a/src/core/lib/iomgr/tcp_windows.cc b/src/core/lib/iomgr/tcp_windows.cc index 9024f2b743..99304bb764 100644 --- a/src/core/lib/iomgr/tcp_windows.cc +++ b/src/core/lib/iomgr/tcp_windows.cc @@ -49,7 +49,7 @@ #define GRPC_FIONBIO FIONBIO #endif -grpc_core::Tracer grpc_tcp_trace(false, "tcp"); +grpc_core::TraceFlag grpc_tcp_trace(false, "tcp"); static grpc_error *set_non_block(SOCKET sock) { int status; diff --git a/src/core/lib/iomgr/timer_generic.cc b/src/core/lib/iomgr/timer_generic.cc index 98b4ca22ab..1735aeb19f 100644 --- a/src/core/lib/iomgr/timer_generic.cc +++ b/src/core/lib/iomgr/timer_generic.cc @@ -44,8 +44,8 @@ #define MAX_QUEUE_WINDOW_DURATION 1 extern "C" { -grpc_core::Tracer grpc_timer_trace(false, "timer"); -grpc_core::Tracer grpc_timer_check_trace(false, "timer_check"); +grpc_core::TraceFlag grpc_timer_trace(false, "timer"); +grpc_core::TraceFlag grpc_timer_check_trace(false, "timer_check"); } /* A "timer shard". Contains a 'heap' and a 'list' of timers. All timers with diff --git a/src/core/lib/iomgr/timer_manager.cc b/src/core/lib/iomgr/timer_manager.cc index 951059d43e..9f2dcb52d3 100644 --- a/src/core/lib/iomgr/timer_manager.cc +++ b/src/core/lib/iomgr/timer_manager.cc @@ -33,7 +33,7 @@ typedef struct completed_thread { struct completed_thread *next; } completed_thread; -extern grpc_core::Tracer grpc_timer_check_trace; +extern grpc_core::TraceFlag grpc_timer_check_trace; // global mutex static gpr_mu g_mu; diff --git a/src/core/lib/iomgr/timer_uv.cc b/src/core/lib/iomgr/timer_uv.cc index a64269585c..c4d46ff48f 100644 --- a/src/core/lib/iomgr/timer_uv.cc +++ b/src/core/lib/iomgr/timer_uv.cc @@ -30,8 +30,8 @@ #include extern "C" { -grpc_core::Tracer grpc_timer_trace(false, "timer"); -grpc_core::Tracer grpc_timer_check_trace(false, "timer_check"); +grpc_core::TraceFlag grpc_timer_trace(false, "timer"); +grpc_core::TraceFlag grpc_timer_check_trace(false, "timer_check"); } static void timer_close_callback(uv_handle_t *handle) { gpr_free(handle); } diff --git a/src/core/lib/security/context/security_context.cc b/src/core/lib/security/context/security_context.cc index 39f92fe595..b0868950e1 100644 --- a/src/core/lib/security/context/security_context.cc +++ b/src/core/lib/security/context/security_context.cc @@ -30,7 +30,7 @@ #include #ifndef NDEBUG -grpc_core::Tracer grpc_trace_auth_context_refcount(false, +grpc_core::TraceFlag grpc_trace_auth_context_refcount(false, "auth_context_refcount"); #endif diff --git a/src/core/lib/security/context/security_context.h b/src/core/lib/security/context/security_context.h index f8ea0bad12..cc03bd6084 100644 --- a/src/core/lib/security/context/security_context.h +++ b/src/core/lib/security/context/security_context.h @@ -23,7 +23,7 @@ #include "src/core/lib/security/credentials/credentials.h" #ifndef NDEBUG -extern grpc_core::Tracer grpc_trace_auth_context_refcount; +extern grpc_core::TraceFlag grpc_trace_auth_context_refcount; #endif #ifdef __cplusplus diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.cc b/src/core/lib/security/credentials/plugin/plugin_credentials.cc index cf03241016..47007988d2 100644 --- a/src/core/lib/security/credentials/plugin/plugin_credentials.cc +++ b/src/core/lib/security/credentials/plugin/plugin_credentials.cc @@ -31,7 +31,7 @@ #include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/validate_metadata.h" -grpc_core::Tracer grpc_plugin_credentials_trace(false, "plugin_credentials"); +grpc_core::TraceFlag grpc_plugin_credentials_trace(false, "plugin_credentials"); static void plugin_destruct(grpc_exec_ctx *exec_ctx, grpc_call_credentials *creds) { diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.h b/src/core/lib/security/credentials/plugin/plugin_credentials.h index 9c8bc18e27..f0d757e04d 100644 --- a/src/core/lib/security/credentials/plugin/plugin_credentials.h +++ b/src/core/lib/security/credentials/plugin/plugin_credentials.h @@ -21,7 +21,7 @@ #include "src/core/lib/security/credentials/credentials.h" -extern grpc_core::Tracer grpc_plugin_credentials_trace; +extern grpc_core::TraceFlag grpc_plugin_credentials_trace; struct grpc_plugin_credentials; diff --git a/src/core/lib/security/transport/secure_endpoint.cc b/src/core/lib/security/transport/secure_endpoint.cc index e2772980cd..5964f3ba70 100644 --- a/src/core/lib/security/transport/secure_endpoint.cc +++ b/src/core/lib/security/transport/secure_endpoint.cc @@ -61,7 +61,7 @@ typedef struct { gpr_refcount ref; } secure_endpoint; -grpc_core::Tracer grpc_trace_secure_endpoint(false, "secure_endpoint"); +grpc_core::TraceFlag grpc_trace_secure_endpoint(false, "secure_endpoint"); static void destroy(grpc_exec_ctx *exec_ctx, secure_endpoint *secure_ep) { secure_endpoint *ep = secure_ep; diff --git a/src/core/lib/security/transport/secure_endpoint.h b/src/core/lib/security/transport/secure_endpoint.h index cfa1d49d8f..4748c8809c 100644 --- a/src/core/lib/security/transport/secure_endpoint.h +++ b/src/core/lib/security/transport/secure_endpoint.h @@ -29,7 +29,7 @@ extern "C" { struct tsi_frame_protector; struct tsi_zero_copy_grpc_protector; -extern grpc_core::Tracer grpc_trace_secure_endpoint; +extern grpc_core::TraceFlag grpc_trace_secure_endpoint; /* Takes ownership of protector, zero_copy_protector, and to_wrap, and refs * leftover_slices. If zero_copy_protector is not NULL, protector will never be diff --git a/src/core/lib/security/transport/security_connector.cc b/src/core/lib/security/transport/security_connector.cc index 31e2fd0107..9c5c53e67e 100644 --- a/src/core/lib/security/transport/security_connector.cc +++ b/src/core/lib/security/transport/security_connector.cc @@ -44,7 +44,7 @@ #include "src/core/tsi/transport_security_adapter.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_security_connector_refcount( +grpc_core::TraceFlag grpc_trace_security_connector_refcount( false, "security_connector_refcount"); #endif diff --git a/src/core/lib/security/transport/security_connector.h b/src/core/lib/security/transport/security_connector.h index 38b53a2b8e..f401349fde 100644 --- a/src/core/lib/security/transport/security_connector.h +++ b/src/core/lib/security/transport/security_connector.h @@ -34,7 +34,7 @@ extern "C" { #endif #ifndef NDEBUG -extern grpc_core::Tracer grpc_trace_security_connector_refcount; +extern grpc_core::TraceFlag grpc_trace_security_connector_refcount; #endif /* --- status enum. --- */ diff --git a/src/core/lib/surface/alarm.cc b/src/core/lib/surface/alarm.cc index 6bab0be849..4ebdba71d9 100644 --- a/src/core/lib/surface/alarm.cc +++ b/src/core/lib/surface/alarm.cc @@ -28,7 +28,7 @@ #include "src/core/lib/surface/completion_queue.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_alarm_refcount(false, "alarm_refcount"); +grpc_core::TraceFlag grpc_trace_alarm_refcount(false, "alarm_refcount"); #endif struct grpc_alarm { diff --git a/src/core/lib/surface/alarm_internal.h b/src/core/lib/surface/alarm_internal.h index 85d5b85988..fa86815ed0 100644 --- a/src/core/lib/surface/alarm_internal.h +++ b/src/core/lib/surface/alarm_internal.h @@ -28,7 +28,7 @@ extern "C" { #ifndef NDEBUG -extern grpc_core::Tracer grpc_trace_alarm_refcount; +extern grpc_core::TraceFlag grpc_trace_alarm_refcount; #define GRPC_ALARM_REF(a, reason) alarm_ref_dbg(a, reason, __FILE__, __LINE__) #define GRPC_ALARM_UNREF(a, reason) \ diff --git a/src/core/lib/surface/api_trace.cc b/src/core/lib/surface/api_trace.cc index dfddbba178..7ab836a9ba 100644 --- a/src/core/lib/surface/api_trace.cc +++ b/src/core/lib/surface/api_trace.cc @@ -19,4 +19,4 @@ #include "src/core/lib/surface/api_trace.h" #include "src/core/lib/debug/trace.h" -grpc_core::Tracer grpc_api_trace(false, "api"); +grpc_core::TraceFlag grpc_api_trace(false, "api"); diff --git a/src/core/lib/surface/api_trace.h b/src/core/lib/surface/api_trace.h index 044ed9b6ec..9838bccacf 100644 --- a/src/core/lib/surface/api_trace.h +++ b/src/core/lib/surface/api_trace.h @@ -26,7 +26,7 @@ extern "C" { #endif -extern grpc_core::Tracer grpc_api_trace; +extern grpc_core::TraceFlag grpc_api_trace; /* Provide unwrapping macros because we're in C89 and variadic macros weren't introduced until C99... */ diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index 21a0285e1c..a003439da4 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -259,8 +259,8 @@ struct grpc_call { gpr_atm recv_state; }; -grpc_core::Tracer grpc_call_error_trace(false, "call_error"); -grpc_core::Tracer grpc_compression_trace(false, "compression"); +grpc_core::TraceFlag grpc_call_error_trace(false, "call_error"); +grpc_core::TraceFlag grpc_compression_trace(false, "compression"); #define CALL_STACK_FROM_CALL(call) ((grpc_call_stack *)((call) + 1)) #define CALL_FROM_CALL_STACK(call_stack) (((grpc_call *)(call_stack)) - 1) diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h index f00cf0503b..0fbdf9812b 100644 --- a/src/core/lib/surface/call.h +++ b/src/core/lib/surface/call.h @@ -111,8 +111,8 @@ uint8_t grpc_call_is_client(grpc_call *call); grpc_compression_algorithm grpc_call_compression_for_level( grpc_call *call, grpc_compression_level level); -extern grpc_core::Tracer grpc_call_error_trace; -extern grpc_core::Tracer grpc_compression_trace; +extern grpc_core::TraceFlag grpc_call_error_trace; +extern grpc_core::TraceFlag grpc_compression_trace; #ifdef __cplusplus } diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc index c0ef8a8a1c..5c35e44bcc 100644 --- a/src/core/lib/surface/completion_queue.cc +++ b/src/core/lib/surface/completion_queue.cc @@ -39,10 +39,10 @@ #include "src/core/lib/surface/call.h" #include "src/core/lib/surface/event_string.h" -grpc_core::Tracer grpc_trace_operation_failures(false, "op_failure"); +grpc_core::TraceFlag grpc_trace_operation_failures(false, "op_failure"); #ifndef NDEBUG -grpc_core::Tracer grpc_trace_pending_tags(false, "pending_tags"); -grpc_core::Tracer grpc_trace_cq_refcount(false, "cq_refcount"); +grpc_core::TraceFlag grpc_trace_pending_tags(false, "pending_tags"); +grpc_core::TraceFlag grpc_trace_cq_refcount(false, "cq_refcount"); #endif typedef struct { @@ -325,8 +325,8 @@ static const cq_vtable g_cq_vtable[] = { #define POLLSET_FROM_CQ(cq) \ ((grpc_pollset *)(cq->vtable->data_size + (char *)DATA_FROM_CQ(cq))) -grpc_core::Tracer grpc_cq_pluck_trace(true, "queue_pluck"); -grpc_core::Tracer grpc_cq_event_timeout_trace(true, "queue_timeout"); +grpc_core::TraceFlag grpc_cq_pluck_trace(true, "queue_pluck"); +grpc_core::TraceFlag grpc_cq_event_timeout_trace(true, "queue_timeout"); #define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \ if (grpc_api_trace.enabled() && (grpc_cq_pluck_trace.enabled() || \ diff --git a/src/core/lib/surface/completion_queue.h b/src/core/lib/surface/completion_queue.h index 3020091f21..cb390fe753 100644 --- a/src/core/lib/surface/completion_queue.h +++ b/src/core/lib/surface/completion_queue.h @@ -27,13 +27,13 @@ /* These trace flags default to 1. The corresponding lines are only traced if grpc_api_trace is also truthy */ -extern grpc_core::Tracer grpc_cq_pluck_trace; -extern grpc_core::Tracer grpc_cq_event_timeout_trace; -extern grpc_core::Tracer grpc_trace_operation_failures; +extern grpc_core::TraceFlag grpc_cq_pluck_trace; +extern grpc_core::TraceFlag grpc_cq_event_timeout_trace; +extern grpc_core::TraceFlag grpc_trace_operation_failures; #ifndef NDEBUG -extern grpc_core::Tracer grpc_trace_pending_tags; -extern grpc_core::Tracer grpc_trace_cq_refcount; +extern grpc_core::TraceFlag grpc_trace_pending_tags; +extern grpc_core::TraceFlag grpc_trace_cq_refcount; #endif #ifdef __cplusplus diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index 081fa54f16..97e00eed55 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -59,7 +59,7 @@ typedef struct registered_method registered_method; typedef enum { BATCH_CALL, REGISTERED_CALL } requested_call_type; -grpc_core::Tracer grpc_server_channel_trace(false, "server_channel"); +grpc_core::TraceFlag grpc_server_channel_trace(false, "server_channel"); typedef struct requested_call { requested_call_type type; diff --git a/src/core/lib/surface/server.h b/src/core/lib/surface/server.h index 20e6ec4eec..a7c3405288 100644 --- a/src/core/lib/surface/server.h +++ b/src/core/lib/surface/server.h @@ -31,7 +31,7 @@ extern "C" { extern const grpc_channel_filter grpc_server_top_filter; /** Lightweight tracing of server channel state */ -extern grpc_core::Tracer grpc_server_channel_trace; +extern grpc_core::TraceFlag grpc_server_channel_trace; /* Add a listener to the server: when the server starts, it will call start, and when it shuts down, it will call destroy */ diff --git a/src/core/lib/transport/bdp_estimator.cc b/src/core/lib/transport/bdp_estimator.cc index 36826f45ca..a9db572c5b 100644 --- a/src/core/lib/transport/bdp_estimator.cc +++ b/src/core/lib/transport/bdp_estimator.cc @@ -23,7 +23,7 @@ #include -grpc_core::Tracer grpc_bdp_estimator_trace(false, "bdp_estimator"); +grpc_core::TraceFlag grpc_bdp_estimator_trace(false, "bdp_estimator"); namespace grpc_core { diff --git a/src/core/lib/transport/bdp_estimator.h b/src/core/lib/transport/bdp_estimator.h index 3558eb49e7..872cfaad8c 100644 --- a/src/core/lib/transport/bdp_estimator.h +++ b/src/core/lib/transport/bdp_estimator.h @@ -31,7 +31,7 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/iomgr/exec_ctx.h" -extern grpc_core::Tracer grpc_bdp_estimator_trace; +extern grpc_core::TraceFlag grpc_bdp_estimator_trace; namespace grpc_core { diff --git a/src/core/lib/transport/connectivity_state.cc b/src/core/lib/transport/connectivity_state.cc index f9e8185555..eb3bbeb588 100644 --- a/src/core/lib/transport/connectivity_state.cc +++ b/src/core/lib/transport/connectivity_state.cc @@ -24,7 +24,7 @@ #include #include -grpc_core::Tracer grpc_connectivity_state_trace(false, "connectivity_state"); +grpc_core::TraceFlag grpc_connectivity_state_trace(false, "connectivity_state"); const char *grpc_connectivity_state_name(grpc_connectivity_state state) { switch (state) { diff --git a/src/core/lib/transport/connectivity_state.h b/src/core/lib/transport/connectivity_state.h index d70c9a8480..3127f56ec7 100644 --- a/src/core/lib/transport/connectivity_state.h +++ b/src/core/lib/transport/connectivity_state.h @@ -47,7 +47,7 @@ typedef struct { char *name; } grpc_connectivity_state_tracker; -extern grpc_core::Tracer grpc_connectivity_state_trace; +extern grpc_core::TraceFlag grpc_connectivity_state_trace; /** enum --> string conversion */ const char *grpc_connectivity_state_name(grpc_connectivity_state state); diff --git a/src/core/lib/transport/metadata.cc b/src/core/lib/transport/metadata.cc index 1eddb6f0d6..9adf43d019 100644 --- a/src/core/lib/transport/metadata.cc +++ b/src/core/lib/transport/metadata.cc @@ -49,7 +49,7 @@ */ #ifndef NDEBUG -grpc_core::Tracer grpc_trace_metadata(false, "metadata"); +grpc_core::TraceFlag grpc_trace_metadata(false, "metadata"); #define DEBUG_ARGS , const char *file, int line #define FWD_DEBUG_ARGS , file, line #define REF_MD_LOCKED(shard, s) ref_md_locked((shard), (s), __FILE__, __LINE__) diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h index 66780d925b..678c213be1 100644 --- a/src/core/lib/transport/metadata.h +++ b/src/core/lib/transport/metadata.h @@ -26,7 +26,7 @@ #include "src/core/lib/iomgr/exec_ctx.h" #ifndef NDEBUG -extern grpc_core::Tracer grpc_trace_metadata; +extern grpc_core::TraceFlag grpc_trace_metadata; #endif #ifdef __cplusplus diff --git a/src/core/lib/transport/transport.cc b/src/core/lib/transport/transport.cc index 4055e9c881..d0c4e04f85 100644 --- a/src/core/lib/transport/transport.cc +++ b/src/core/lib/transport/transport.cc @@ -32,7 +32,7 @@ #include "src/core/lib/transport/transport_impl.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_stream_refcount(false, "stream_refcount"); +grpc_core::TraceFlag grpc_trace_stream_refcount(false, "stream_refcount"); #endif #ifndef NDEBUG diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h index 8046402724..ae0dea362c 100644 --- a/src/core/lib/transport/transport.h +++ b/src/core/lib/transport/transport.h @@ -44,7 +44,7 @@ typedef struct grpc_transport grpc_transport; typedef struct grpc_stream grpc_stream; #ifndef NDEBUG -extern grpc_core::Tracer grpc_trace_stream_refcount; +extern grpc_core::TraceFlag grpc_trace_stream_refcount; #endif typedef struct grpc_stream_refcount { diff --git a/src/core/tsi/transport_security.cc b/src/core/tsi/transport_security.cc index c452a0f1bf..a2f45f5e0b 100644 --- a/src/core/tsi/transport_security.cc +++ b/src/core/tsi/transport_security.cc @@ -26,7 +26,7 @@ /* --- Tracing. --- */ -grpc_core::Tracer tsi_tracing_enabled(false, "tsi"); +grpc_core::TraceFlag tsi_tracing_enabled(false, "tsi"); /* --- tsi_result common implementation. --- */ diff --git a/src/core/tsi/transport_security.h b/src/core/tsi/transport_security.h index 0a3c45c474..c5fbba1522 100644 --- a/src/core/tsi/transport_security.h +++ b/src/core/tsi/transport_security.h @@ -28,7 +28,7 @@ extern "C" { #endif -extern grpc_core::Tracer tsi_tracing_enabled; +extern grpc_core::TraceFlag tsi_tracing_enabled; /* Base for tsi_frame_protector implementations. See transport_security_interface.h for documentation. */ diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h index ebf75f36fc..40a5a596d6 100644 --- a/src/core/tsi/transport_security_interface.h +++ b/src/core/tsi/transport_security_interface.h @@ -60,7 +60,7 @@ const char *tsi_result_to_string(tsi_result result); /* --- tsi tracing --- */ -extern grpc_core::Tracer tsi_tracing_enabled; +extern grpc_core::TraceFlag tsi_tracing_enabled; /* -- tsi_zero_copy_grpc_protector object -- -- cgit v1.2.3