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/surface/server.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/lib/surface/server.cc') diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index dd09cb91de..b2a35f9848 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -59,8 +59,8 @@ typedef struct registered_method registered_method; typedef enum { BATCH_CALL, REGISTERED_CALL } requested_call_type; -grpc_tracer_flag grpc_server_channel_trace = - GRPC_TRACER_INITIALIZER(false, "server_channel"); +grpc_core::Tracer grpc_server_channel_trace + (false, "server_channel"); typedef struct requested_call { requested_call_type type; @@ -445,7 +445,7 @@ static void destroy_channel(grpc_exec_ctx *exec_ctx, channel_data *chand, GRPC_CLOSURE_INIT(&chand->finish_destroy_channel_closure, finish_destroy_channel, chand, grpc_schedule_on_exec_ctx); - if (GRPC_TRACER_ON(grpc_server_channel_trace) && error != GRPC_ERROR_NONE) { + if (grpc_server_channel_trace.enabled() && error != GRPC_ERROR_NONE) { const char *msg = grpc_error_string(error); gpr_log(GPR_INFO, "Disconnected client: %s", msg); } -- cgit v1.2.3 From cdaf6d8e0660f83b708e4e73e90a4deaeab7ea2b Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 16 Oct 2017 13:51:45 -0700 Subject: clang-format --- .../ext/filters/client_channel/client_channel.cc | 3 +- .../client_channel/client_channel_plugin.cc | 4 +-- src/core/ext/filters/client_channel/lb_policy.cc | 3 +- .../client_channel/lb_policy/grpclb/grpclb.cc | 4 +-- .../lb_policy/pick_first/pick_first.cc | 4 +-- .../lb_policy/round_robin/round_robin.cc | 4 +-- src/core/ext/filters/client_channel/resolver.cc | 3 +- src/core/ext/filters/http/http_filters_plugin.cc | 1 - .../transport/chttp2/transport/chttp2_plugin.cc | 5 +-- .../transport/chttp2/transport/chttp2_transport.cc | 6 ++-- .../transport/chttp2/transport/frame_settings.cc | 3 +- src/core/ext/transport/chttp2/transport/internal.h | 16 ++++----- .../ext/transport/chttp2/transport/stream_lists.cc | 3 +- src/core/ext/transport/chttp2/transport/writing.cc | 12 +++---- src/core/ext/transport/inproc/inproc_transport.cc | 4 +-- src/core/lib/channel/channel_stack_builder.cc | 4 +-- src/core/lib/iomgr/call_combiner.cc | 3 +- src/core/lib/iomgr/combiner.cc | 13 ++++--- src/core/lib/iomgr/error.cc | 3 +- src/core/lib/iomgr/ev_epollsig_linux.cc | 4 +-- src/core/lib/iomgr/ev_posix.cc | 9 ++--- src/core/lib/iomgr/ev_windows.cc | 4 +-- src/core/lib/iomgr/executor.cc | 4 +-- src/core/lib/iomgr/iomgr_posix.cc | 1 - src/core/lib/iomgr/iomgr_uv.cc | 2 +- src/core/lib/iomgr/pollset_uv.cc | 3 +- src/core/lib/iomgr/pollset_windows.cc | 3 +- src/core/lib/iomgr/resource_quota.cc | 3 +- src/core/lib/iomgr/timer_generic.cc | 5 +-- src/core/lib/iomgr/timer_uv.cc | 3 +- src/core/lib/security/context/security_context.cc | 4 +-- .../credentials/plugin/plugin_credentials.cc | 3 +- src/core/lib/security/transport/secure_endpoint.cc | 3 +- .../lib/security/transport/security_connector.cc | 4 +-- src/core/lib/surface/alarm.cc | 3 +- src/core/lib/surface/api_trace.h | 2 +- src/core/lib/surface/call.cc | 6 ++-- src/core/lib/surface/call.h | 3 +- src/core/lib/surface/completion_queue.cc | 42 +++++++++------------- src/core/lib/surface/init.cc | 24 ++----------- src/core/lib/surface/init_secure.cc | 10 ++---- src/core/lib/surface/server.cc | 3 +- src/core/lib/transport/bdp_estimator.cc | 3 +- src/core/lib/transport/connectivity_state.cc | 3 +- src/core/lib/transport/metadata.cc | 3 +- src/core/lib/transport/transport.cc | 3 +- 46 files changed, 88 insertions(+), 170 deletions(-) (limited to 'src/core/lib/surface/server.cc') diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index 21ad3d9a26..8a8e76ff12 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -55,8 +55,7 @@ /* Client channel implementation */ -grpc_core::Tracer grpc_client_channel_trace - (false, "client_channel"); +grpc_core::Tracer grpc_client_channel_trace(false, "client_channel"); /************************************************************************* * METHOD-CONFIG TABLE diff --git a/src/core/ext/filters/client_channel/client_channel_plugin.cc b/src/core/ext/filters/client_channel/client_channel_plugin.cc index d67e11e976..407b8349d8 100644 --- a/src/core/ext/filters/client_channel/client_channel_plugin.cc +++ b/src/core/ext/filters/client_channel/client_channel_plugin.cc @@ -78,9 +78,9 @@ extern "C" void grpc_client_channel_init(void) { GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, append_filter, (void *)&grpc_client_channel_filter); grpc_http_connect_register_handshaker_factory(); - + #ifndef NDEBUG - + #endif } diff --git a/src/core/ext/filters/client_channel/lb_policy.cc b/src/core/ext/filters/client_channel/lb_policy.cc index 6ce49b17e9..738486adbb 100644 --- a/src/core/ext/filters/client_channel/lb_policy.cc +++ b/src/core/ext/filters/client_channel/lb_policy.cc @@ -22,8 +22,7 @@ #define WEAK_REF_BITS 16 #ifndef NDEBUG -grpc_core::Tracer grpc_trace_lb_policy_refcount - (false, "lb_policy_refcount"); +grpc_core::Tracer 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/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 1b9e72bd24..9ad54fabf5 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 @@ -1962,9 +1962,9 @@ static bool maybe_add_client_load_reporting_filter( extern "C" void grpc_lb_policy_grpclb_init() { grpc_register_lb_policy(grpc_glb_lb_factory_create()); - + #ifndef NDEBUG - + #endif grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, 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 8c5065cd9e..3454ff0cbd 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,8 +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::Tracer grpc_lb_pick_first_trace(false, "pick_first"); typedef struct pending_pick { struct pending_pick *next; @@ -708,7 +707,6 @@ static grpc_lb_policy_factory *pick_first_lb_factory_create() { extern "C" void grpc_lb_policy_pick_first_init() { grpc_register_lb_policy(pick_first_lb_factory_create()); - } extern "C" void grpc_lb_policy_pick_first_shutdown() {} 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 f8c6830792..e7cf8ce6f7 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,8 +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::Tracer grpc_lb_round_robin_trace(false, "round_robin"); /** List of entities waiting for a pick. * @@ -918,7 +917,6 @@ static grpc_lb_policy_factory *round_robin_lb_factory_create() { extern "C" void grpc_lb_policy_round_robin_init() { grpc_register_lb_policy(round_robin_lb_factory_create()); - } extern "C" void grpc_lb_policy_round_robin_shutdown() {} diff --git a/src/core/ext/filters/client_channel/resolver.cc b/src/core/ext/filters/client_channel/resolver.cc index 1863a94162..9ce4f80e63 100644 --- a/src/core/ext/filters/client_channel/resolver.cc +++ b/src/core/ext/filters/client_channel/resolver.cc @@ -20,8 +20,7 @@ #include "src/core/lib/iomgr/combiner.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_resolver_refcount - (false, "resolver_refcount"); +grpc_core::Tracer grpc_trace_resolver_refcount(false, "resolver_refcount"); #endif void grpc_resolver_init(grpc_resolver *resolver, diff --git a/src/core/ext/filters/http/http_filters_plugin.cc b/src/core/ext/filters/http/http_filters_plugin.cc index 24d46a60ae..cbcbca1efc 100644 --- a/src/core/ext/filters/http/http_filters_plugin.cc +++ b/src/core/ext/filters/http/http_filters_plugin.cc @@ -65,7 +65,6 @@ static bool maybe_add_required_filter(grpc_exec_ctx *exec_ctx, } extern "C" void grpc_http_filters_init(void) { - grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, maybe_add_optional_filter, &compress_filter); diff --git a/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc b/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc index 06059cb92a..13c3966762 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_plugin.cc @@ -21,11 +21,8 @@ #include "src/core/lib/transport/metadata.h" extern "C" void grpc_chttp2_plugin_init(void) { - - - #ifndef NDEBUG - + #endif } diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 664fb72e57..a103038893 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -95,8 +95,7 @@ grpc_core::Tracer grpc_http_trace(false, "http"); grpc_core::Tracer grpc_flowctl_trace(false, "flowctl"); #ifndef NDEBUG -grpc_core::Tracer grpc_trace_chttp2_refcount - (false, "chttp2_refcount"); +grpc_core::Tracer grpc_trace_chttp2_refcount(false, "chttp2_refcount"); #endif /* forward declarations of various callbacks that we'll build closures around */ @@ -3062,8 +3061,7 @@ static void benign_reclaimer_locked(grpc_exec_ctx *exec_ctx, void *arg, grpc_error_set_int( GRPC_ERROR_CREATE_FROM_STATIC_STRING("Buffers full"), GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_ENHANCE_YOUR_CALM)); - } else if (error == GRPC_ERROR_NONE && - grpc_resource_quota_trace.enabled()) { + } else if (error == GRPC_ERROR_NONE && grpc_resource_quota_trace.enabled()) { gpr_log(GPR_DEBUG, "HTTP2: %s - skip benign reclamation, there are still %" PRIdPTR " streams", diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.cc b/src/core/ext/transport/chttp2/transport/frame_settings.cc index b3fc08041f..8ee12aeceb 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.cc +++ b/src/core/ext/transport/chttp2/transport/frame_settings.cc @@ -204,8 +204,7 @@ grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx, void *p, parser->incoming_settings[id] != parser->value) { t->flow_control.initial_window_update += (int64_t)parser->value - parser->incoming_settings[id]; - if (grpc_http_trace.enabled() || - grpc_flowctl_trace.enabled()) { + if (grpc_http_trace.enabled() || grpc_flowctl_trace.enabled()) { gpr_log(GPR_DEBUG, "%p[%s] adding %d for initial_window change", t, t->is_client ? "cli" : "svr", (int)t->flow_control.initial_window_update); diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 07dc381e0a..55cb55de56 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -797,19 +797,19 @@ extern grpc_core::Tracer grpc_http_trace; extern grpc_core::Tracer grpc_flowctl_trace; #ifndef NDEBUG -#define GRPC_FLOW_CONTROL_IF_TRACING(stmt) \ - if (!(grpc_flowctl_trace.enabled())) \ - ; \ - else \ +#define GRPC_FLOW_CONTROL_IF_TRACING(stmt) \ + if (!(grpc_flowctl_trace.enabled())) \ + ; \ + else \ stmt #else #define GRPC_FLOW_CONTROL_IF_TRACING(stmt) #endif -#define GRPC_CHTTP2_IF_TRACING(stmt) \ - if (!(grpc_http_trace.enabled())) \ - ; \ - else \ +#define GRPC_CHTTP2_IF_TRACING(stmt) \ + if (!(grpc_http_trace.enabled())) \ + ; \ + else \ stmt void grpc_chttp2_fake_status(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, diff --git a/src/core/ext/transport/chttp2/transport/stream_lists.cc b/src/core/ext/transport/chttp2/transport/stream_lists.cc index 3595d09a8f..76538976b6 100644 --- a/src/core/ext/transport/chttp2/transport/stream_lists.cc +++ b/src/core/ext/transport/chttp2/transport/stream_lists.cc @@ -39,8 +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::Tracer grpc_trace_http2_stream_state(false, "http2_stream_state"); /* core list management */ diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index e3ee506e87..34c9bc334a 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -51,8 +51,7 @@ static void maybe_initiate_ping(grpc_exec_ctx *exec_ctx, } if (!grpc_closure_list_empty(pq->lists[GRPC_CHTTP2_PCL_INFLIGHT])) { /* ping already in-flight: wait */ - if (grpc_http_trace.enabled() || - grpc_bdp_estimator_trace.enabled()) { + if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) { gpr_log(GPR_DEBUG, "%s: Ping delayed [%p]: already pinging", t->is_client ? "CLIENT" : "SERVER", t->peer_string); } @@ -61,8 +60,7 @@ static void maybe_initiate_ping(grpc_exec_ctx *exec_ctx, if (t->ping_state.pings_before_data_required == 0 && t->ping_policy.max_pings_without_data != 0) { /* need to receive something of substance before sending a ping again */ - if (grpc_http_trace.enabled() || - grpc_bdp_estimator_trace.enabled()) { + if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) { gpr_log(GPR_DEBUG, "%s: Ping delayed [%p]: too many recent pings: %d/%d", t->is_client ? "CLIENT" : "SERVER", t->peer_string, t->ping_state.pings_before_data_required, @@ -81,8 +79,7 @@ static void maybe_initiate_ping(grpc_exec_ctx *exec_ctx, } if (next_allowed_ping > now) { /* not enough elapsed time between successive pings */ - if (grpc_http_trace.enabled() || - grpc_bdp_estimator_trace.enabled()) { + if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) { gpr_log(GPR_DEBUG, "%s: Ping delayed [%p]: not enough time elapsed since last ping", t->is_client ? "CLIENT" : "SERVER", t->peer_string); @@ -103,8 +100,7 @@ static void maybe_initiate_ping(grpc_exec_ctx *exec_ctx, grpc_chttp2_ping_create(false, pq->inflight_id)); GRPC_STATS_INC_HTTP2_PINGS_SENT(exec_ctx); t->ping_state.last_ping_sent_time = now; - if (grpc_http_trace.enabled() || - grpc_bdp_estimator_trace.enabled()) { + if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) { gpr_log(GPR_DEBUG, "%s: Ping sent [%p]: %d/%d", t->is_client ? "CLIENT" : "SERVER", t->peer_string, t->ping_state.pings_before_data_required, diff --git a/src/core/ext/transport/inproc/inproc_transport.cc b/src/core/ext/transport/inproc/inproc_transport.cc index 047a24c145..c2af5fb9cd 100644 --- a/src/core/ext/transport/inproc/inproc_transport.cc +++ b/src/core/ext/transport/inproc/inproc_transport.cc @@ -32,8 +32,8 @@ #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/transport_impl.h" -#define INPROC_LOG(...) \ - do { \ +#define INPROC_LOG(...) \ + do { \ if (grpc_inproc_trace.enabled()) gpr_log(__VA_ARGS__); \ } while (0) diff --git a/src/core/lib/channel/channel_stack_builder.cc b/src/core/lib/channel/channel_stack_builder.cc index 83f8113a35..3ee70a85be 100644 --- a/src/core/lib/channel/channel_stack_builder.cc +++ b/src/core/lib/channel/channel_stack_builder.cc @@ -23,8 +23,8 @@ #include #include -grpc_core::Tracer grpc_trace_channel_stack_builder - (false, "channel_stack_builder"); +grpc_core::Tracer grpc_trace_channel_stack_builder(false, + "channel_stack_builder"); typedef struct filter_node { struct filter_node *next; diff --git a/src/core/lib/iomgr/call_combiner.cc b/src/core/lib/iomgr/call_combiner.cc index d36e2c5bef..48122d6b55 100644 --- a/src/core/lib/iomgr/call_combiner.cc +++ b/src/core/lib/iomgr/call_combiner.cc @@ -24,8 +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::Tracer 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/combiner.cc b/src/core/lib/iomgr/combiner.cc index 2d1c652041..b77ddbffa1 100644 --- a/src/core/lib/iomgr/combiner.cc +++ b/src/core/lib/iomgr/combiner.cc @@ -29,14 +29,13 @@ #include "src/core/lib/iomgr/executor.h" #include "src/core/lib/profiling/timers.h" -grpc_core::Tracer grpc_combiner_trace - (false, "combiner"); +grpc_core::Tracer grpc_combiner_trace(false, "combiner"); -#define GRPC_COMBINER_TRACE(fn) \ - do { \ +#define GRPC_COMBINER_TRACE(fn) \ + do { \ if (grpc_combiner_trace.enabled()) { \ - fn; \ - } \ + fn; \ + } \ } while (0) #define STATE_UNORPHANED 1 @@ -106,7 +105,7 @@ static void start_destroy(grpc_exec_ctx *exec_ctx, grpc_combiner *lock) { #ifndef NDEBUG #define GRPC_COMBINER_DEBUG_SPAM(op, delta) \ - if (grpc_combiner_trace.enabled()) { \ + if (grpc_combiner_trace.enabled()) { \ gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, \ "C:%p %s %" PRIdPTR " --> %" PRIdPTR " %s", lock, (op), \ gpr_atm_no_barrier_load(&lock->refs.count), \ diff --git a/src/core/lib/iomgr/error.cc b/src/core/lib/iomgr/error.cc index cbb27f442e..578d35764f 100644 --- a/src/core/lib/iomgr/error.cc +++ b/src/core/lib/iomgr/error.cc @@ -38,8 +38,7 @@ #include "src/core/lib/slice/slice_internal.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_error_refcount - (false, "error_refcount"); +grpc_core::Tracer 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/ev_epollsig_linux.cc b/src/core/lib/iomgr/ev_epollsig_linux.cc index 648de4f7e1..ad7b27b279 100644 --- a/src/core/lib/iomgr/ev_epollsig_linux.cc +++ b/src/core/lib/iomgr/ev_epollsig_linux.cc @@ -53,9 +53,9 @@ #define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker *)1) -#define GRPC_POLLING_TRACE(...) \ +#define GRPC_POLLING_TRACE(...) \ if (grpc_polling_trace.enabled()) { \ - gpr_log(GPR_INFO, __VA_ARGS__); \ + gpr_log(GPR_INFO, __VA_ARGS__); \ } static int grpc_wakeup_signal = -1; diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc index 166801e229..45403c3037 100644 --- a/src/core/lib/iomgr/ev_posix.cc +++ b/src/core/lib/iomgr/ev_posix.cc @@ -36,12 +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, "polling"); /* Disabled by default */ +grpc_core::Tracer grpc_polling_trace(false, + "polling"); /* Disabled by default */ #ifndef NDEBUG -grpc_core::Tracer grpc_trace_fd_refcount - (false, "fd_refcount"); +grpc_core::Tracer grpc_trace_fd_refcount(false, "fd_refcount"); #endif /** Default poll() function - a pointer so that it can be overridden by some @@ -156,8 +155,6 @@ const grpc_event_engine_vtable *grpc_get_event_engine_test_only() { const char *grpc_get_poll_strategy_name() { return g_poll_strategy_name; } void grpc_event_engine_init(void) { - - char *s = gpr_getenv("GRPC_POLL_STRATEGY"); if (s == NULL) { s = gpr_strdup("all"); diff --git a/src/core/lib/iomgr/ev_windows.cc b/src/core/lib/iomgr/ev_windows.cc index c9d83c0949..c2e5d55df8 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, "polling"); /* Disabled by default */ +grpc_core::Tracer 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 bf233087d5..085c2127a1 100644 --- a/src/core/lib/iomgr/executor.cc +++ b/src/core/lib/iomgr/executor.cc @@ -51,8 +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::Tracer executor_trace(false, "executor"); static void executor_thread(void *arg); @@ -134,7 +133,6 @@ void grpc_executor_set_threading(grpc_exec_ctx *exec_ctx, bool threading) { } void grpc_executor_init(grpc_exec_ctx *exec_ctx) { - gpr_atm_no_barrier_store(&g_cur_threads, 0); grpc_executor_set_threading(exec_ctx, true); } diff --git a/src/core/lib/iomgr/iomgr_posix.cc b/src/core/lib/iomgr/iomgr_posix.cc index 3135b1d563..f8f6fe2353 100644 --- a/src/core/lib/iomgr/iomgr_posix.cc +++ b/src/core/lib/iomgr/iomgr_posix.cc @@ -28,7 +28,6 @@ void grpc_iomgr_platform_init(void) { grpc_wakeup_fd_global_init(); grpc_event_engine_init(); - } void grpc_iomgr_platform_flush(void) {} diff --git a/src/core/lib/iomgr/iomgr_uv.cc b/src/core/lib/iomgr/iomgr_uv.cc index d63829b8b1..b8a10f2ae8 100644 --- a/src/core/lib/iomgr/iomgr_uv.cc +++ b/src/core/lib/iomgr/iomgr_uv.cc @@ -31,7 +31,7 @@ gpr_thd_id g_init_thread; void grpc_iomgr_platform_init(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_pollset_global_init(); - + grpc_executor_set_threading(&exec_ctx, false); g_init_thread = gpr_thd_currentid(); grpc_exec_ctx_finish(&exec_ctx); diff --git a/src/core/lib/iomgr/pollset_uv.cc b/src/core/lib/iomgr/pollset_uv.cc index 336379b457..cf3566d08f 100644 --- a/src/core/lib/iomgr/pollset_uv.cc +++ b/src/core/lib/iomgr/pollset_uv.cc @@ -35,8 +35,7 @@ #include "src/core/lib/debug/trace.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_fd_refcount - (false, "fd_refcount"); +grpc_core::Tracer 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 a7df9f27bf..d0d299b6b7 100644 --- a/src/core/lib/iomgr/pollset_windows.cc +++ b/src/core/lib/iomgr/pollset_windows.cc @@ -31,8 +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::Tracer 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 966b05fd5b..d3ed87a1c0 100644 --- a/src/core/lib/iomgr/resource_quota.cc +++ b/src/core/lib/iomgr/resource_quota.cc @@ -31,8 +31,7 @@ #include "src/core/lib/iomgr/combiner.h" -grpc_core::Tracer grpc_resource_quota_trace - (false, "resource_quota"); +grpc_core::Tracer grpc_resource_quota_trace(false, "resource_quota"); #define MEMORY_USAGE_ESTIMATION_MAX 65536 diff --git a/src/core/lib/iomgr/timer_generic.cc b/src/core/lib/iomgr/timer_generic.cc index 05984c4f90..98b4ca22ab 100644 --- a/src/core/lib/iomgr/timer_generic.cc +++ b/src/core/lib/iomgr/timer_generic.cc @@ -45,8 +45,7 @@ extern "C" { grpc_core::Tracer grpc_timer_trace(false, "timer"); -grpc_core::Tracer grpc_timer_check_trace - (false, "timer_check"); +grpc_core::Tracer grpc_timer_check_trace(false, "timer_check"); } /* A "timer shard". Contains a 'heap' and a 'list' of timers. All timers with @@ -247,8 +246,6 @@ void grpc_timer_list_init(grpc_exec_ctx *exec_ctx) { g_shared_mutables.min_timer = grpc_exec_ctx_now(exec_ctx); gpr_tls_init(&g_last_seen_min_timer); gpr_tls_set(&g_last_seen_min_timer, 0); - - for (i = 0; i < NUM_SHARDS; i++) { timer_shard *shard = &g_shards[i]; diff --git a/src/core/lib/iomgr/timer_uv.cc b/src/core/lib/iomgr/timer_uv.cc index 7ddfafd002..a64269585c 100644 --- a/src/core/lib/iomgr/timer_uv.cc +++ b/src/core/lib/iomgr/timer_uv.cc @@ -31,8 +31,7 @@ extern "C" { grpc_core::Tracer grpc_timer_trace(false, "timer"); -grpc_core::Tracer grpc_timer_check_trace - (false, "timer_check"); +grpc_core::Tracer 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 96bec5a4c7..39f92fe595 100644 --- a/src/core/lib/security/context/security_context.cc +++ b/src/core/lib/security/context/security_context.cc @@ -30,8 +30,8 @@ #include #ifndef NDEBUG -grpc_core::Tracer grpc_trace_auth_context_refcount - (false, "auth_context_refcount"); +grpc_core::Tracer grpc_trace_auth_context_refcount(false, + "auth_context_refcount"); #endif /* --- grpc_call --- */ diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.cc b/src/core/lib/security/credentials/plugin/plugin_credentials.cc index acff5ae7d2..cf03241016 100644 --- a/src/core/lib/security/credentials/plugin/plugin_credentials.cc +++ b/src/core/lib/security/credentials/plugin/plugin_credentials.cc @@ -31,8 +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::Tracer 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/transport/secure_endpoint.cc b/src/core/lib/security/transport/secure_endpoint.cc index 901675f7a0..e2772980cd 100644 --- a/src/core/lib/security/transport/secure_endpoint.cc +++ b/src/core/lib/security/transport/secure_endpoint.cc @@ -61,8 +61,7 @@ typedef struct { gpr_refcount ref; } secure_endpoint; -grpc_core::Tracer grpc_trace_secure_endpoint - (false, "secure_endpoint"); +grpc_core::Tracer 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/security_connector.cc b/src/core/lib/security/transport/security_connector.cc index 3d205ddefe..3c19d5e60a 100644 --- a/src/core/lib/security/transport/security_connector.cc +++ b/src/core/lib/security/transport/security_connector.cc @@ -44,8 +44,8 @@ #include "src/core/tsi/transport_security_adapter.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_security_connector_refcount - (false, "security_connector_refcount"); +grpc_core::Tracer grpc_trace_security_connector_refcount( + false, "security_connector_refcount"); #endif /* -- Constants. -- */ diff --git a/src/core/lib/surface/alarm.cc b/src/core/lib/surface/alarm.cc index 721c2fcd1e..6bab0be849 100644 --- a/src/core/lib/surface/alarm.cc +++ b/src/core/lib/surface/alarm.cc @@ -28,8 +28,7 @@ #include "src/core/lib/surface/completion_queue.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_alarm_refcount - (false, "alarm_refcount"); +grpc_core::Tracer grpc_trace_alarm_refcount(false, "alarm_refcount"); #endif struct grpc_alarm { diff --git a/src/core/lib/surface/api_trace.h b/src/core/lib/surface/api_trace.h index 8433175f9b..044ed9b6ec 100644 --- a/src/core/lib/surface/api_trace.h +++ b/src/core/lib/surface/api_trace.h @@ -47,7 +47,7 @@ extern grpc_core::Tracer grpc_api_trace; /* Due to the limitations of C89's preprocessor, the arity of the var-arg list 'nargs' must be specified. */ #define GRPC_API_TRACE(fmt, nargs, args) \ - if (grpc_api_trace.enabled()) { \ + if (grpc_api_trace.enabled()) { \ gpr_log(GPR_INFO, fmt GRPC_API_TRACE_UNWRAP##nargs args); \ } diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index e2cf832c7f..21a0285e1c 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -259,10 +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::Tracer grpc_call_error_trace(false, "call_error"); +grpc_core::Tracer 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 ee7dc5cc16..f00cf0503b 100644 --- a/src/core/lib/surface/call.h +++ b/src/core/lib/surface/call.h @@ -102,8 +102,7 @@ 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_api_trace.enabled()) \ - grpc_call_log_batch(sev, call, ops, nops, tag) + if (grpc_api_trace.enabled()) grpc_call_log_batch(sev, call, ops, nops, tag) uint8_t grpc_call_is_client(grpc_call *call); diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc index 33378516ff..c0ef8a8a1c 100644 --- a/src/core/lib/surface/completion_queue.cc +++ b/src/core/lib/surface/completion_queue.cc @@ -39,13 +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::Tracer 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::Tracer grpc_trace_pending_tags(false, "pending_tags"); +grpc_core::Tracer grpc_trace_cq_refcount(false, "cq_refcount"); #endif typedef struct { @@ -328,18 +325,15 @@ 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"); - -#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \ - if (grpc_api_trace.enabled() && \ - (grpc_cq_pluck_trace.enabled() || \ - (event)->type != GRPC_QUEUE_TIMEOUT)) { \ - char *_ev = grpc_event_string(event); \ - gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, _ev); \ - gpr_free(_ev); \ +grpc_core::Tracer grpc_cq_pluck_trace(true, "queue_pluck"); +grpc_core::Tracer 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() || \ + (event)->type != GRPC_QUEUE_TIMEOUT)) { \ + char *_ev = grpc_event_string(event); \ + gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, _ev); \ + gpr_free(_ev); \ } static void on_pollset_shutdown_done(grpc_exec_ctx *exec_ctx, void *cq, @@ -605,15 +599,13 @@ static void cq_end_op_for_next(grpc_exec_ctx *exec_ctx, GPR_TIMER_BEGIN("cq_end_op_for_next", 0); if (grpc_api_trace.enabled() || - (grpc_trace_operation_failures.enabled() && - error != GRPC_ERROR_NONE)) { + (grpc_trace_operation_failures.enabled() && error != GRPC_ERROR_NONE)) { const char *errmsg = grpc_error_string(error); GRPC_API_TRACE( "cq_end_op_for_next(exec_ctx=%p, cq=%p, tag=%p, error=%s, " "done=%p, done_arg=%p, storage=%p)", 7, (exec_ctx, cq, tag, errmsg, done, done_arg, storage)); - if (grpc_trace_operation_failures.enabled() && - error != GRPC_ERROR_NONE) { + if (grpc_trace_operation_failures.enabled() && error != GRPC_ERROR_NONE) { gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag, errmsg); } } @@ -689,15 +681,13 @@ static void cq_end_op_for_pluck(grpc_exec_ctx *exec_ctx, GPR_TIMER_BEGIN("cq_end_op_for_pluck", 0); if (grpc_api_trace.enabled() || - (grpc_trace_operation_failures.enabled() && - error != GRPC_ERROR_NONE)) { + (grpc_trace_operation_failures.enabled() && error != GRPC_ERROR_NONE)) { const char *errmsg = grpc_error_string(error); GRPC_API_TRACE( "cq_end_op_for_pluck(exec_ctx=%p, cq=%p, tag=%p, error=%s, " "done=%p, done_arg=%p, storage=%p)", 7, (exec_ctx, cq, tag, errmsg, done, done_arg, storage)); - if (grpc_trace_operation_failures.enabled() && - error != GRPC_ERROR_NONE) { + if (grpc_trace_operation_failures.enabled() && error != GRPC_ERROR_NONE) { gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag, errmsg); } } diff --git a/src/core/lib/surface/init.cc b/src/core/lib/surface/init.cc index 9ad8214a18..2db761b4dc 100644 --- a/src/core/lib/surface/init.cc +++ b/src/core/lib/surface/init.cc @@ -125,29 +125,9 @@ void grpc_init(void) { grpc_slice_intern_init(); grpc_mdctx_global_init(); grpc_channel_init_init(); - - - - - - - - - - - - - - + #ifndef NDEBUG - - - - - - - - + #endif grpc_security_pre_init(); grpc_iomgr_init(&exec_ctx); diff --git a/src/core/lib/surface/init_secure.cc b/src/core/lib/surface/init_secure.cc index 97adc9fdda..80b1fe022f 100644 --- a/src/core/lib/surface/init_secure.cc +++ b/src/core/lib/surface/init_secure.cc @@ -38,11 +38,8 @@ #endif void grpc_security_pre_init(void) { - - #ifndef NDEBUG - - + #endif } @@ -85,7 +82,4 @@ void grpc_register_security_filters(void) { maybe_prepend_server_auth_filter, NULL); } -void grpc_security_init() { - grpc_security_register_handshaker_factories(); - -} +void grpc_security_init() { grpc_security_register_handshaker_factories(); } diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index b2a35f9848..081fa54f16 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -59,8 +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::Tracer grpc_server_channel_trace(false, "server_channel"); typedef struct requested_call { requested_call_type type; diff --git a/src/core/lib/transport/bdp_estimator.cc b/src/core/lib/transport/bdp_estimator.cc index 82fcb9e562..6eb2f54864 100644 --- a/src/core/lib/transport/bdp_estimator.cc +++ b/src/core/lib/transport/bdp_estimator.cc @@ -23,8 +23,7 @@ #include -grpc_core::Tracer grpc_bdp_estimator_trace - (false, "bdp_estimator"); +grpc_core::Tracer grpc_bdp_estimator_trace(false, "bdp_estimator"); namespace grpc_core { diff --git a/src/core/lib/transport/connectivity_state.cc b/src/core/lib/transport/connectivity_state.cc index cf95a3c469..f9e8185555 100644 --- a/src/core/lib/transport/connectivity_state.cc +++ b/src/core/lib/transport/connectivity_state.cc @@ -24,8 +24,7 @@ #include #include -grpc_core::Tracer grpc_connectivity_state_trace - (false, "connectivity_state"); +grpc_core::Tracer 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/metadata.cc b/src/core/lib/transport/metadata.cc index a138d59f9d..99eccba34e 100644 --- a/src/core/lib/transport/metadata.cc +++ b/src/core/lib/transport/metadata.cc @@ -49,8 +49,7 @@ */ #ifndef NDEBUG -grpc_core::Tracer grpc_trace_metadata - (false, "metadata"); +grpc_core::Tracer 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/transport.cc b/src/core/lib/transport/transport.cc index e75524d07d..4055e9c881 100644 --- a/src/core/lib/transport/transport.cc +++ b/src/core/lib/transport/transport.cc @@ -32,8 +32,7 @@ #include "src/core/lib/transport/transport_impl.h" #ifndef NDEBUG -grpc_core::Tracer grpc_trace_stream_refcount - (false, "stream_refcount"); +grpc_core::Tracer grpc_trace_stream_refcount(false, "stream_refcount"); #endif #ifndef NDEBUG -- 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/surface/server.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 From 24908a61e413cea9cf0edf953802fc9643420777 Mon Sep 17 00:00:00 2001 From: Ken Payson Date: Thu, 16 Nov 2017 12:35:43 -0800 Subject: Use lock when popping requests on server shutdown Doing this without a lock causes TSAN failures for quic. There isn't much need to be clever here because this only impacts shutdown performance, which doesn't really matter. --- src/core/lib/surface/server.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/core/lib/surface/server.cc') diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index b816439770..2e8609ee9e 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -350,14 +350,8 @@ static void request_matcher_kill_requests(grpc_exec_ctx* exec_ctx, grpc_error* error) { requested_call* rc; for (size_t i = 0; i < server->cq_count; i++) { - /* Here we know: - 1. no requests are being added (since the server is shut down) - 2. no other threads are pulling (since the shut down process is single - threaded) - So, we can ignore the queue lock and just pop, with the guarantee that a - NULL returned here truly means that the queue is empty */ - while ((rc = (requested_call*)gpr_mpscq_pop( - &rm->requests_per_cq[i].queue)) != nullptr) { + while ((rc = (requested_call*)gpr_locked_mpscq_pop( + &rm->requests_per_cq[i])) != nullptr) { fail_call(exec_ctx, server, i, rc, GRPC_ERROR_REF(error)); } } -- cgit v1.2.3