From 1dbfd4c9f21c4fcee21df1e7c42ba596ab39aec8 Mon Sep 17 00:00:00 2001 From: Tanvi Jagtap <139093547+tanvi-jagtap@users.noreply.github.com> Date: Fri, 7 Jun 2024 09:11:27 -0700 Subject: [PATCH 01/10] [grpc][Gpr_To_Absl_Logging] Deleting multiple instances of gpr_set_log_function (#36833) Deleting multiple instances of gpr_set_log_function . This function will be deleted soon. https://github.com/grpc/proposal/pull/425 Closes #36833 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36833 from tanvi-jagtap:remove_gpr_log_partial_code 17517efee4795eb6e5ff7670252e7329c9cf12d7 PiperOrigin-RevId: 641268299 --- CMakeLists.txt | 43 -------- build_autogenerated.yaml | 11 --- grpc.def | 1 + include/grpc/support/log.h | 3 + src/core/util/log.cc | 5 + src/ruby/ext/grpc/rb_grpc_imports.generated.c | 2 + src/ruby/ext/grpc/rb_grpc_imports.generated.h | 3 + test/core/call/yodel/fuzzer_main.cc | 3 +- test/core/end2end/end2end_test_fuzzer.cc | 3 +- test/core/end2end/fuzzers/api_fuzzer.cc | 4 +- test/core/end2end/fuzzers/client_fuzzer.cc | 4 +- test/core/end2end/fuzzers/server_fuzzer.cc | 4 +- .../resolver_fuzzer.cc | 5 +- test/core/nanopb/fuzzer_response.cc | 7 +- test/core/nanopb/fuzzer_serverlist.cc | 7 +- .../resource_quota/memory_quota_fuzzer.cc | 6 +- test/core/security/alts_credentials_fuzzer.cc | 4 +- test/core/security/ssl_server_fuzzer.cc | 6 +- .../binder/end2end/fuzzers/client_fuzzer.cc | 6 +- .../binder/end2end/fuzzers/server_fuzzer.cc | 6 +- .../chttp2/hpack_parser_fuzzer_test.cc | 6 +- .../transport/chttp2/hpack_sync_fuzzer.cc | 6 +- test/core/util/BUILD | 17 ---- test/core/util/log_test.cc | 99 ------------------- test/cpp/interop/BUILD | 2 + test/cpp/interop/metrics_client.cc | 5 +- test/cpp/interop/stress_test.cc | 58 ++++++----- tools/run_tests/generated/tests.json | 24 ----- 28 files changed, 83 insertions(+), 267 deletions(-) delete mode 100644 test/core/util/log_test.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index 10397373769..92d752bafb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1212,7 +1212,6 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx lock_free_event_test) endif() - add_dependencies(buildtests_cxx log_test) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx log_too_many_open_files_test) endif() @@ -19643,48 +19642,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX) endif() -endif() -if(gRPC_BUILD_TESTS) - -add_executable(log_test - test/core/util/log_test.cc -) -if(WIN32 AND MSVC) - if(BUILD_SHARED_LIBS) - target_compile_definitions(log_test - PRIVATE - "GPR_DLL_IMPORTS" - "GRPC_DLL_IMPORTS" - ) - endif() -endif() -target_compile_features(log_test PUBLIC cxx_std_14) -target_include_directories(log_test - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} - ${_gRPC_RE2_INCLUDE_DIR} - ${_gRPC_SSL_INCLUDE_DIR} - ${_gRPC_UPB_GENERATED_DIR} - ${_gRPC_UPB_GRPC_GENERATED_DIR} - ${_gRPC_UPB_INCLUDE_DIR} - ${_gRPC_XXHASH_INCLUDE_DIR} - ${_gRPC_ZLIB_INCLUDE_DIR} - third_party/googletest/googletest/include - third_party/googletest/googletest - third_party/googletest/googlemock/include - third_party/googletest/googlemock - ${_gRPC_PROTO_GENS_DIR} -) - -target_link_libraries(log_test - ${_gRPC_ALLTARGETS_LIBRARIES} - gtest - grpc_test_util -) - - endif() if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 06418da3336..25a4cf13493 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -13615,17 +13615,6 @@ targets: - linux - posix uses_polling: false -- name: log_test - gtest: true - build: test - language: c++ - headers: [] - src: - - test/core/util/log_test.cc - deps: - - gtest - - grpc_test_util - uses_polling: false - name: log_too_many_open_files_test gtest: true build: test diff --git a/grpc.def b/grpc.def index 154e8eee94d..acee3331a74 100644 --- a/grpc.def +++ b/grpc.def @@ -236,6 +236,7 @@ EXPORTS gpr_log_message gpr_set_log_verbosity gpr_log_verbosity_init + gpr_disable_all_logs gpr_set_log_function gpr_assertion_failed gpr_format_message diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h index 2cba30164ff..1d51ffd9b85 100644 --- a/include/grpc/support/log.h +++ b/include/grpc/support/log.h @@ -69,6 +69,8 @@ GPRAPI void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print); GPRAPI void gpr_log_verbosity_init(void); +GPRAPI void gpr_disable_all_logs(void); + /** Log overrides: applications can use this API to intercept logging calls and use their own implementations */ @@ -82,6 +84,7 @@ struct gpr_log_func_args { typedef struct gpr_log_func_args gpr_log_func_args; typedef void (*gpr_log_func)(gpr_log_func_args* args); + GPRAPI void gpr_set_log_function(gpr_log_func func); GPRAPI void gpr_assertion_failed(const char* filename, int line, diff --git a/src/core/util/log.cc b/src/core/util/log.cc index 58ba0562c00..484bb7feb03 100644 --- a/src/core/util/log.cc +++ b/src/core/util/log.cc @@ -187,3 +187,8 @@ void gpr_log_verbosity_init() { void gpr_set_log_function(gpr_log_func f) { gpr_atm_no_barrier_store(&g_log_func, (gpr_atm)(f ? f : gpr_default_log)); } + +void gpr_disable_all_logs() { + absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfinity); + absl::SetVLogLevel("*grpc*/*", -1); +} diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c index e4607ce6d00..664a8f01482 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c @@ -259,6 +259,7 @@ gpr_should_log_type gpr_should_log_import; gpr_log_message_type gpr_log_message_import; gpr_set_log_verbosity_type gpr_set_log_verbosity_import; gpr_log_verbosity_init_type gpr_log_verbosity_init_import; +gpr_disable_all_logs_type gpr_disable_all_logs_import; gpr_set_log_function_type gpr_set_log_function_import; gpr_assertion_failed_type gpr_assertion_failed_import; gpr_format_message_type gpr_format_message_import; @@ -549,6 +550,7 @@ void grpc_rb_load_imports(HMODULE library) { gpr_log_message_import = (gpr_log_message_type) GetProcAddress(library, "gpr_log_message"); gpr_set_log_verbosity_import = (gpr_set_log_verbosity_type) GetProcAddress(library, "gpr_set_log_verbosity"); gpr_log_verbosity_init_import = (gpr_log_verbosity_init_type) GetProcAddress(library, "gpr_log_verbosity_init"); + gpr_disable_all_logs_import = (gpr_disable_all_logs_type) GetProcAddress(library, "gpr_disable_all_logs"); gpr_set_log_function_import = (gpr_set_log_function_type) GetProcAddress(library, "gpr_set_log_function"); gpr_assertion_failed_import = (gpr_assertion_failed_type) GetProcAddress(library, "gpr_assertion_failed"); gpr_format_message_import = (gpr_format_message_type) GetProcAddress(library, "gpr_format_message"); diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h index 42fb67dface..3b3b401a257 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h @@ -753,6 +753,9 @@ extern gpr_set_log_verbosity_type gpr_set_log_verbosity_import; typedef void(*gpr_log_verbosity_init_type)(void); extern gpr_log_verbosity_init_type gpr_log_verbosity_init_import; #define gpr_log_verbosity_init gpr_log_verbosity_init_import +typedef void(*gpr_disable_all_logs_type)(void); +extern gpr_disable_all_logs_type gpr_disable_all_logs_import; +#define gpr_disable_all_logs gpr_disable_all_logs_import typedef void(*gpr_set_log_function_type)(gpr_log_func func); extern gpr_set_log_function_type gpr_set_log_function_import; #define gpr_set_log_function gpr_set_log_function_import diff --git a/test/core/call/yodel/fuzzer_main.cc b/test/core/call/yodel/fuzzer_main.cc index 8eb9502a963..96c3917a360 100644 --- a/test/core/call/yodel/fuzzer_main.cc +++ b/test/core/call/yodel/fuzzer_main.cc @@ -33,7 +33,6 @@ #include "test/core/test_util/proto_bit_gen.h" bool squelch = true; -static void dont_log(gpr_log_func_args* /*args*/) {} DEFINE_PROTO_FUZZER(const transport_test_suite::Msg& msg) { static const grpc_core::NoDestruct< @@ -43,7 +42,7 @@ DEFINE_PROTO_FUZZER(const transport_test_suite::Msg& msg) { const int test_id = msg.test_id() % tests->size(); if (squelch && !grpc_core::GetEnv("GRPC_TRACE_FUZZER").has_value()) { - gpr_set_log_function(dont_log); + gpr_disable_all_logs(); } grpc_core::ConfigVars::Overrides overrides = diff --git a/test/core/end2end/end2end_test_fuzzer.cc b/test/core/end2end/end2end_test_fuzzer.cc index 0df0feda71c..be79482d7e2 100644 --- a/test/core/end2end/end2end_test_fuzzer.cc +++ b/test/core/end2end/end2end_test_fuzzer.cc @@ -48,7 +48,6 @@ using ::grpc_event_engine::experimental::FuzzingEventEngine; using ::grpc_event_engine::experimental::GetDefaultEventEngine; bool squelch = true; -static void dont_log(gpr_log_func_args* /*args*/) {} namespace grpc_core { @@ -92,7 +91,7 @@ void RunEnd2endFuzzer(const core_end2end_test_fuzzer::Msg& msg) { const int test_id = msg.test_id() % tests.size(); if (squelch && !GetEnv("GRPC_TRACE_FUZZER").has_value()) { - gpr_set_log_function(dont_log); + gpr_disable_all_logs(); } // TODO(ctiller): make this per fixture? diff --git a/test/core/end2end/fuzzers/api_fuzzer.cc b/test/core/end2end/fuzzers/api_fuzzer.cc index b3fde2b9954..02f296ec19f 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.cc +++ b/test/core/end2end/fuzzers/api_fuzzer.cc @@ -78,8 +78,6 @@ bool squelch = true; bool leak_check = true; -static void dont_log(gpr_log_func_args* /*args*/) {} - //////////////////////////////////////////////////////////////////////////////// // dns resolution @@ -506,7 +504,7 @@ using grpc_core::testing::ApiFuzzer; DEFINE_PROTO_FUZZER(const api_fuzzer::Msg& msg) { if (squelch && !grpc_core::GetEnv("GRPC_TRACE_FUZZER").has_value()) { - gpr_set_log_function(dont_log); + gpr_disable_all_logs(); } grpc_core::ApplyFuzzConfigVars(msg.config_vars()); grpc_core::TestOnlyReloadExperimentsFromConfigVariables(); diff --git a/test/core/end2end/fuzzers/client_fuzzer.cc b/test/core/end2end/fuzzers/client_fuzzer.cc index defc274c1f3..eb20355a31a 100644 --- a/test/core/end2end/fuzzers/client_fuzzer.cc +++ b/test/core/end2end/fuzzers/client_fuzzer.cc @@ -49,8 +49,6 @@ bool leak_check = true; static void discard_write(grpc_slice /*slice*/) {} -static void dont_log(gpr_log_func_args* /*args*/) {} - namespace grpc_core { namespace testing { @@ -101,7 +99,7 @@ class ClientFuzzer final : public BasicFuzzer { DEFINE_PROTO_FUZZER(const fuzzer_input::Msg& msg) { if (squelch && !grpc_core::GetEnv("GRPC_TRACE_FUZZER").has_value()) { - gpr_set_log_function(dont_log); + gpr_disable_all_logs(); } if (msg.network_input().size() != 1) return; grpc_core::ApplyFuzzConfigVars(msg.config_vars()); diff --git a/test/core/end2end/fuzzers/server_fuzzer.cc b/test/core/end2end/fuzzers/server_fuzzer.cc index c151c8b30b8..3e310fa6cee 100644 --- a/test/core/end2end/fuzzers/server_fuzzer.cc +++ b/test/core/end2end/fuzzers/server_fuzzer.cc @@ -35,8 +35,6 @@ bool squelch = true; bool leak_check = true; -static void dont_log(gpr_log_func_args* /*args*/) {} - namespace grpc_core { namespace testing { @@ -97,7 +95,7 @@ void RunServerFuzzer( absl::FunctionRef server_setup) { if (squelch && !GetEnv("GRPC_TRACE_FUZZER").has_value()) { - gpr_set_log_function(dont_log); + gpr_disable_all_logs(); } static const int once = []() { ForceEnableExperiment("event_engine_client", true); diff --git a/test/core/ext/filters/event_engine_client_channel_resolver/resolver_fuzzer.cc b/test/core/ext/filters/event_engine_client_channel_resolver/resolver_fuzzer.cc index e0b3b3f7c56..ed7d60e3397 100644 --- a/test/core/ext/filters/event_engine_client_channel_resolver/resolver_fuzzer.cc +++ b/test/core/ext/filters/event_engine_client_channel_resolver/resolver_fuzzer.cc @@ -50,7 +50,6 @@ #include "test/core/test_util/fuzzing_channel_args.h" bool squelch = true; -static void dont_log(gpr_log_func_args* /*args*/) {} namespace { @@ -254,7 +253,9 @@ grpc_core::ResolverArgs ConstructResolverArgs( } // namespace DEFINE_PROTO_FUZZER(const event_engine_client_channel_resolver::Msg& msg) { - if (squelch) gpr_set_log_function(dont_log); + if (squelch) { + gpr_disable_all_logs(); + } bool done_resolving = false; grpc_core::ApplyFuzzConfigVars(msg.config_vars()); grpc_core::TestOnlyReloadExperimentsFromConfigVariables(); diff --git a/test/core/nanopb/fuzzer_response.cc b/test/core/nanopb/fuzzer_response.cc index 72d72039396..93537339e3a 100644 --- a/test/core/nanopb/fuzzer_response.cc +++ b/test/core/nanopb/fuzzer_response.cc @@ -25,12 +25,13 @@ bool squelch = true; bool leak_check = true; -static void dont_log(gpr_log_func_args* /*args*/) {} - extern "C" int LLVMFuzzerTestOneInput(const uint8_t* /*data*/, size_t /*size*/) { grpc_init(); - if (squelch) gpr_set_log_function(dont_log); + if (squelch) { + gpr_disable_all_logs(); + } + // TODO(veblush): Convert this to upb. // // grpc_slice slice = grpc_slice_from_copied_buffer((const char*)data, size); diff --git a/test/core/nanopb/fuzzer_serverlist.cc b/test/core/nanopb/fuzzer_serverlist.cc index 5d36655a972..8f83c0a32a1 100644 --- a/test/core/nanopb/fuzzer_serverlist.cc +++ b/test/core/nanopb/fuzzer_serverlist.cc @@ -25,12 +25,13 @@ bool squelch = true; bool leak_check = true; -static void dont_log(gpr_log_func_args* /*args*/) {} - extern "C" int LLVMFuzzerTestOneInput(const uint8_t* /*data*/, size_t /*size*/) { grpc_init(); - if (squelch) gpr_set_log_function(dont_log); + if (squelch) { + gpr_disable_all_logs(); + } + // TODO(veblush): Convert this to upb. // // grpc_slice slice = grpc_slice_from_copied_buffer((const char*)data, size); diff --git a/test/core/resource_quota/memory_quota_fuzzer.cc b/test/core/resource_quota/memory_quota_fuzzer.cc index 912e3508065..6c3a1f4badb 100644 --- a/test/core/resource_quota/memory_quota_fuzzer.cc +++ b/test/core/resource_quota/memory_quota_fuzzer.cc @@ -187,10 +187,10 @@ class Fuzzer { } // namespace testing } // namespace grpc_core -static void dont_log(gpr_log_func_args* /*args*/) {} - DEFINE_PROTO_FUZZER(const memory_quota_fuzzer::Msg& msg) { - if (squelch) gpr_set_log_function(dont_log); + if (squelch) { + gpr_disable_all_logs(); + } grpc_core::ApplyFuzzConfigVars(msg.config_vars()); grpc_core::TestOnlyReloadExperimentsFromConfigVariables(); gpr_log_verbosity_init(); diff --git a/test/core/security/alts_credentials_fuzzer.cc b/test/core/security/alts_credentials_fuzzer.cc index 4ad08a367ba..2d01d66012c 100644 --- a/test/core/security/alts_credentials_fuzzer.cc +++ b/test/core/security/alts_credentials_fuzzer.cc @@ -42,8 +42,6 @@ using grpc_core::testing::input_stream; bool squelch = true; bool leak_check = true; -static void dont_log(gpr_log_func_args* /*args*/) {} - // Add a random number of target service accounts to client options. static void read_target_service_accounts( input_stream* inp, grpc_alts_credentials_options* options) { @@ -65,7 +63,7 @@ static void read_target_service_accounts( extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (squelch && !grpc_core::GetEnv("GRPC_TRACE_FUZZER").has_value()) { - gpr_set_log_function(dont_log); + gpr_disable_all_logs(); } input_stream inp = {data, data + size}; grpc_init(); diff --git a/test/core/security/ssl_server_fuzzer.cc b/test/core/security/ssl_server_fuzzer.cc index d5310112c90..a7498f6d7cd 100644 --- a/test/core/security/ssl_server_fuzzer.cc +++ b/test/core/security/ssl_server_fuzzer.cc @@ -43,8 +43,6 @@ bool squelch = true; // Turning this on will fail the leak check. bool leak_check = false; -static void dont_log(gpr_log_func_args* /*args*/) {} - struct handshake_state { grpc_core::Notification done_signal; }; @@ -60,7 +58,9 @@ static void on_handshake_done(void* arg, grpc_error_handle error) { } extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - if (squelch) gpr_set_log_function(dont_log); + if (squelch) { + gpr_disable_all_logs(); + } grpc_init(); { grpc_core::ExecCtx exec_ctx; diff --git a/test/core/transport/binder/end2end/fuzzers/client_fuzzer.cc b/test/core/transport/binder/end2end/fuzzers/client_fuzzer.cc index fb194663f58..a5fa9905d81 100644 --- a/test/core/transport/binder/end2end/fuzzers/client_fuzzer.cc +++ b/test/core/transport/binder/end2end/fuzzers/client_fuzzer.cc @@ -35,10 +35,10 @@ bool leak_check = true; static void* tag(intptr_t t) { return reinterpret_cast(t); } -static void dont_log(gpr_log_func_args*) {} - DEFINE_PROTO_FUZZER(const binder_transport_fuzzer::Input& input) { - if (squelch) gpr_set_log_function(dont_log); + if (squelch) { + gpr_disable_all_logs(); + } grpc_init(); { // Copied and modified from grpc/test/core/end2end/fuzzers/client_fuzzer.cc diff --git a/test/core/transport/binder/end2end/fuzzers/server_fuzzer.cc b/test/core/transport/binder/end2end/fuzzers/server_fuzzer.cc index 68996f1020f..38bc3add000 100644 --- a/test/core/transport/binder/end2end/fuzzers/server_fuzzer.cc +++ b/test/core/transport/binder/end2end/fuzzers/server_fuzzer.cc @@ -30,10 +30,10 @@ bool leak_check = true; static void* tag(intptr_t t) { return reinterpret_cast(t); } -static void dont_log(gpr_log_func_args* /*args*/) {} - DEFINE_PROTO_FUZZER(const binder_transport_fuzzer::Input& input) { - if (squelch) gpr_set_log_function(dont_log); + if (squelch) { + gpr_disable_all_logs(); + } grpc_init(); { // Copied and modified from grpc/test/core/end2end/fuzzers/server_fuzzer.cc diff --git a/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc b/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc index 1b21b228935..61dfc6a43ad 100644 --- a/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc +++ b/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc @@ -50,10 +50,10 @@ bool squelch = true; bool leak_check = true; -static void dont_log(gpr_log_func_args* /*args*/) {} - DEFINE_PROTO_FUZZER(const hpack_parser_fuzzer::Msg& msg) { - if (squelch) gpr_set_log_function(dont_log); + if (squelch) { + gpr_disable_all_logs(); + } grpc_core::ProtoBitGen proto_bit_src(msg.random_numbers()); grpc_core::ApplyFuzzConfigVars(msg.config_vars()); grpc_core::TestOnlyReloadExperimentsFromConfigVariables(); diff --git a/test/core/transport/chttp2/hpack_sync_fuzzer.cc b/test/core/transport/chttp2/hpack_sync_fuzzer.cc index 230ddc8a5cb..b79953a7805 100644 --- a/test/core/transport/chttp2/hpack_sync_fuzzer.cc +++ b/test/core/transport/chttp2/hpack_sync_fuzzer.cc @@ -52,8 +52,6 @@ bool squelch = true; bool leak_check = true; -static void dont_log(gpr_log_func_args* /*args*/) {} - namespace grpc_core { namespace { @@ -170,7 +168,9 @@ void FuzzOneInput(const hpack_sync_fuzzer::Msg& msg) { } // namespace grpc_core DEFINE_PROTO_FUZZER(const hpack_sync_fuzzer::Msg& msg) { - if (squelch) gpr_set_log_function(dont_log); + if (squelch) { + gpr_disable_all_logs(); + } grpc_core::ApplyFuzzConfigVars(msg.config_vars()); grpc_core::TestOnlyReloadExperimentsFromConfigVariables(); grpc_core::FuzzOneInput(msg); diff --git a/test/core/util/BUILD b/test/core/util/BUILD index 728ef6bd167..8337de838eb 100644 --- a/test/core/util/BUILD +++ b/test/core/util/BUILD @@ -60,23 +60,6 @@ grpc_cc_test( ], ) -grpc_cc_test( - name = "log_test", - srcs = ["log_test.cc"], - external_deps = [ - "absl/log:check", - "absl/log:log", - "gtest", - ], - language = "C++", - uses_event_engine = False, - uses_polling = False, - deps = [ - "//:gpr", - "//test/core/test_util:grpc_test_util", - ], -) - grpc_cc_test( name = "spinlock_test", srcs = ["spinlock_test.cc"], diff --git a/test/core/util/log_test.cc b/test/core/util/log_test.cc deleted file mode 100644 index fa39d2c28ed..00000000000 --- a/test/core/util/log_test.cc +++ /dev/null @@ -1,99 +0,0 @@ -// -// -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// - -#include - -#include - -#include - -#include "absl/log/check.h" - -#include - -#include "src/core/lib/gprpp/crash.h" -#include "test/core/test_util/test_config.h" - -static bool log_func_reached = false; - -static void test_callback(gpr_log_func_args* args) { - CHECK_EQ(strcmp(__FILE__, args->file), 0); - CHECK(args->severity == GPR_LOG_SEVERITY_INFO); - CHECK_EQ(strcmp(args->message, "hello 1 2 3"), 0); -} - -static void test_should_log(gpr_log_func_args* /*args*/) { - log_func_reached = true; -} - -static void test_should_not_log(gpr_log_func_args* /*args*/) { - grpc_core::Crash("unreachable"); -} - -#define test_log_function_reached(SEVERITY) \ - gpr_set_log_function(test_should_log); \ - log_func_reached = false; \ - gpr_log_message(SEVERITY, "hello 1 2 3"); \ - CHECK(log_func_reached); \ - log_func_reached = false; \ - gpr_log(SEVERITY, "hello %d %d %d", 1, 2, 3); \ - CHECK(log_func_reached); \ - gpr_set_log_function(nullptr); - -#define test_log_function_unreached(SEVERITY) \ - gpr_set_log_function(test_should_not_log); \ - gpr_log_message(SEVERITY, "hello 1 2 3"); \ - gpr_log(SEVERITY, "hello %d %d %d", 1, 2, 3); \ - gpr_set_log_function(nullptr); - -TEST(LogTest, Basic) { - // test logging at various verbosity levels - gpr_log(GPR_DEBUG, "%s", "hello world"); - gpr_log(GPR_INFO, "%s", "hello world"); - gpr_log(GPR_ERROR, "%s", "hello world"); - // should succeed - CHECK(1); - gpr_set_log_function(test_callback); - gpr_log_message(GPR_INFO, "hello 1 2 3"); - gpr_log(GPR_INFO, "hello %d %d %d", 1, 2, 3); - gpr_set_log_function(nullptr); -} - -TEST(LogTest, LogVerbosity) { - gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG); - test_log_function_reached(GPR_ERROR); - test_log_function_reached(GPR_INFO); - test_log_function_reached(GPR_DEBUG); - - gpr_set_log_verbosity(GPR_LOG_SEVERITY_INFO); - test_log_function_reached(GPR_ERROR); - test_log_function_reached(GPR_INFO); - test_log_function_unreached(GPR_DEBUG); - - gpr_set_log_verbosity(GPR_LOG_SEVERITY_ERROR); - test_log_function_reached(GPR_ERROR); - test_log_function_unreached(GPR_INFO); - test_log_function_unreached(GPR_DEBUG); -} - -int main(int argc, char** argv) { - grpc::testing::TestEnvironment env(&argc, argv); - ::testing::InitGoogleTest(&argc, argv); - int ret = RUN_ALL_TESTS(); - return ret; -} diff --git a/test/cpp/interop/BUILD b/test/cpp/interop/BUILD index 21d86d04971..28624783556 100644 --- a/test/cpp/interop/BUILD +++ b/test/cpp/interop/BUILD @@ -206,6 +206,8 @@ grpc_cc_binary( external_deps = [ "absl/flags:flag", "absl/log:check", + "absl/log:globals", + "absl/log:log", ], deps = [ ":client_helper_lib", diff --git a/test/cpp/interop/metrics_client.cc b/test/cpp/interop/metrics_client.cc index 853c04a9c17..739764db17e 100644 --- a/test/cpp/interop/metrics_client.cc +++ b/test/cpp/interop/metrics_client.cc @@ -44,9 +44,6 @@ using grpc::testing::EmptyMessage; using grpc::testing::GaugeResponse; using grpc::testing::MetricsService; -// Do not log anything -void BlackholeLogger(gpr_log_func_args* /*args*/) {} - // Prints the values of all Gauges (unless total_only is set to 'true' in which // case this only prints the sum of all gauge values). bool PrintMetrics(std::unique_ptr stub, bool total_only, @@ -93,7 +90,7 @@ int main(int argc, char** argv) { // The output of metrics client is in some cases programmatically parsed (for // example by the stress test framework). So, we do not want any of the log // from the grpc library appearing on stdout. - gpr_set_log_function(BlackholeLogger); + gpr_disable_all_logs(); std::shared_ptr channel( grpc::CreateChannel(absl::GetFlag(FLAGS_metrics_server_address), diff --git a/test/cpp/interop/stress_test.cc b/test/cpp/interop/stress_test.cc index b37c608a369..9dc306cdba8 100644 --- a/test/cpp/interop/stress_test.cc +++ b/test/cpp/interop/stress_test.cc @@ -16,6 +16,8 @@ // is % allowed in string // +#include + #include #include #include @@ -24,6 +26,7 @@ #include "absl/flags/flag.h" #include "absl/log/check.h" +#include "absl/log/globals.h" #include "absl/log/log.h" #include @@ -93,11 +96,14 @@ ABSL_FLAG(std::string, test_cases, "", " 'large_unary', 10% of the time and 'empty_stream' the remaining" " 70% of the time"); -ABSL_FLAG(int32_t, log_level, GPR_LOG_SEVERITY_INFO, - "Severity level of messages that should be logged. Any messages " - "greater than or equal to the level set here will be logged. " - "The choices are: 0 (GPR_LOG_SEVERITY_DEBUG), 1 " - "(GPR_LOG_SEVERITY_INFO) and 2 (GPR_LOG_SEVERITY_ERROR)"); +ABSL_FLAG( + int32_t, absl_min_log_level, + static_cast(absl::LogSeverityAtLeast::kInfo), + "Severity level of messages that should be logged by absl::SetMinLogLevel"); + +ABSL_FLAG(int32_t, absl_vlog_level, -1, + "Severity level of messages that should be logged. Set using " + "absl::SetVLogLevel"); ABSL_FLAG(bool, do_not_abort_on_transient_failures, true, "If set to 'true', abort() is not called in case of transient " @@ -123,15 +129,9 @@ using grpc::testing::transport_security; using grpc::testing::UNKNOWN_TEST; using grpc::testing::WeightedRandomTestSelector; -static int log_level = GPR_LOG_SEVERITY_DEBUG; - -// A simple wrapper to grp_default_log() function. This only logs messages at or -// above the current log level (set in 'log_level' variable) -void TestLogFunction(gpr_log_func_args* args) { - if (args->severity >= log_level) { - gpr_default_log(args); - } -} +static int absl_vlog_level = -1; +static absl::LogSeverityAtLeast absl_min_log_level = + absl::LogSeverityAtLeast::kInfo; TestCaseType GetTestTypeFromName(const std::string& test_name) { TestCaseType test_case = UNKNOWN_TEST; @@ -208,7 +208,9 @@ void LogParameterInfo(const std::vector& addresses, << absl::GetFlag(FLAGS_num_channels_per_server); LOG(INFO) << "num_stubs_per_channel: " << absl::GetFlag(FLAGS_num_stubs_per_channel); - LOG(INFO) << "log_level: " << absl::GetFlag(FLAGS_log_level); + LOG(INFO) << "absl_vlog_level: " << absl::GetFlag(FLAGS_absl_vlog_level); + LOG(INFO) << "absl_min_log_level: " + << absl::GetFlag(FLAGS_absl_min_log_level); LOG(INFO) << "do_not_abort_on_transient_failures: " << (absl::GetFlag(FLAGS_do_not_abort_on_transient_failures) ? "true" @@ -228,21 +230,23 @@ void LogParameterInfo(const std::vector& addresses, } } +void SetLogLevels() { + absl_vlog_level = absl::GetFlag(FLAGS_absl_vlog_level); + CHECK_LE(-1, absl_vlog_level); + CHECK_LE(absl_vlog_level, (INT_MAX - 1)); + absl::SetVLogLevel("*grpc*/*", absl_vlog_level); + + absl_min_log_level = static_cast( + absl::GetFlag(FLAGS_absl_min_log_level)); + CHECK_LE(absl::LogSeverityAtLeast::kInfo, absl_min_log_level); + CHECK_LE(absl_min_log_level, absl::LogSeverityAtLeast::kInfinity); + absl::SetMinLogLevel(absl_min_log_level); +} + int main(int argc, char** argv) { grpc::testing::InitTest(&argc, &argv, true); - if (absl::GetFlag(FLAGS_log_level) > GPR_LOG_SEVERITY_ERROR || - absl::GetFlag(FLAGS_log_level) < GPR_LOG_SEVERITY_DEBUG) { - LOG(ERROR) << "log_level should be an integer between " - << GPR_LOG_SEVERITY_DEBUG << " and " << GPR_LOG_SEVERITY_ERROR; - return 1; - } - - // Change the default log function to TestLogFunction which respects the - // log_level setting. - log_level = absl::GetFlag(FLAGS_log_level); - gpr_set_log_function(TestLogFunction); - + SetLogLevels(); srand(time(nullptr)); // Parse the server addresses diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index 1be46fa624c..ff41de58ef8 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -5657,30 +5657,6 @@ ], "uses_polling": false }, - { - "args": [], - "benchmark": false, - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "gtest": true, - "language": "c++", - "name": "log_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "uses_polling": false - }, { "args": [], "benchmark": false, From d038e0ed1970d8808e0f1e81acbefeb2f75f5941 Mon Sep 17 00:00:00 2001 From: Arjan Singh Bal <46515553+arjan-bal@users.noreply.github.com> Date: Fri, 7 Jun 2024 09:28:47 -0700 Subject: [PATCH 02/10] [Interop] Test grpc-go 1.64 using go 1.22 runtime (#36755) Use the latest golang base image for Go interop tests. Presently the latest image points to Go 1.22. ## Commands run To render the Dockerfile from its template ```sh $ tools/buildgen/generate_projects.sh ``` To build and upload the base docker image. ```sh $ tools/dockerfile/push_testing_images.sh ``` To build and upload the interop docker image for grpc-go 1.64.0 ```sh $ tools/interop_matrix/create_matrix_images.py --git_checkout --release=v1.64.0 --upload_images --language go ``` To verify the image is uploaded ```sh $ gcloud container images list-tags gcr.io/grpc-testing/grpc_interop_go1.x DIGEST TAGS TIMESTAMP b36be4961ec4 infrastructure-public-image-v1.64.0,v1.64.0 2024-06-03T22:26:48 ``` Verify the backward compatability tests pass ```sh $ export docker_image=gcr.io/grpc-testing/grpc_interop_go1.x:v1.64.0 $ tools/interop_matrix/testcases/go__master Testing gcr.io/grpc-testing/grpc_interop_go1.x:v1.64.0 ``` Fixes: https://github.com/grpc/grpc/issues/36060 Closes #36755 PiperOrigin-RevId: 641272572 --- .../dockerfile/gcp_api_libraries_venv.include | 7 +++ .../grpc_interop_go1.x/Dockerfile.template | 23 ++++++++ .../build_interop.sh.template | 3 + .../run_tests_python_deps_venv.include | 33 +++++++++++ .../dockerimage_current_versions.bzl | 1 + .../grpc_interop_go1.x.current_version | 1 + .../interoptest/grpc_interop_go1.x/Dockerfile | 58 +++++++++++++++++++ .../grpc_interop_go1.x/build_interop.sh | 33 +++++++++++ tools/interop_matrix/client_matrix.py | 3 +- 9 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 templates/tools/dockerfile/gcp_api_libraries_venv.include create mode 100644 templates/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile.template create mode 100644 templates/tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh.template create mode 100644 templates/tools/dockerfile/run_tests_python_deps_venv.include create mode 100644 tools/dockerfile/interoptest/grpc_interop_go1.x.current_version create mode 100644 tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile create mode 100644 tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh diff --git a/templates/tools/dockerfile/gcp_api_libraries_venv.include b/templates/tools/dockerfile/gcp_api_libraries_venv.include new file mode 100644 index 00000000000..3cd4b48c44a --- /dev/null +++ b/templates/tools/dockerfile/gcp_api_libraries_venv.include @@ -0,0 +1,7 @@ +# Install Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +# This template is similar to gcp_api_libraries.include but installs the +# dependencies in a python virtual environment. This is required from pip 23.0 +# onwards as installation of system-wide packages is blocked by default. +RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && \ + python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0" diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile.template new file mode 100644 index 00000000000..3137796840f --- /dev/null +++ b/templates/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile.template @@ -0,0 +1,23 @@ +%YAML 1.2 +--- | + # Copyright 2024 The gRPC Authors + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + + FROM golang:latest + + <%include file="../../go_path.include"/> + <%include file="../../run_tests_python_deps_venv.include"/> + # Define the default command. + CMD ["bash"] + diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh.template b/templates/tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh.template new file mode 100644 index 00000000000..a08798b1d6b --- /dev/null +++ b/templates/tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh.template @@ -0,0 +1,3 @@ +%YAML 1.2 +--- | + <%include file="../../go_build_interop.sh.include"/> diff --git a/templates/tools/dockerfile/run_tests_python_deps_venv.include b/templates/tools/dockerfile/run_tests_python_deps_venv.include new file mode 100644 index 00000000000..920cc7ca2d6 --- /dev/null +++ b/templates/tools/dockerfile/run_tests_python_deps_venv.include @@ -0,0 +1,33 @@ +#==================== +# run_tests.py python dependencies + +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) +# This template is similar to run_tests_python_deps.include but installs the +# dependencies in a python virtual environment. This is required from pip 23.0 +# onwards as installation of system-wide packages is blocked by default. +RUN apt-get update && apt-get install -y ${'\\'} + python3 ${'\\'} + python3-pip ${'\\'} + python3-setuptools ${'\\'} + python3-yaml ${'\\'} + python3-venv ${'\\'} + && apt-get clean + +# Create a python virtual env for installing required dependencies. +ENV PYTHON_ENV="/opt/venv/grpc-interop" +RUN python3 -m venv "$PYTHON_ENV" +RUN echo "source $PYTHON_ENV/bin/activate" >> ~/.bashrc + +# Use bash explicitly as /bin/sh doesn't support the "source" command. +# use pinned version of pip to avoid sudden breakages +# TODO(#36814): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && \ + python3 -m pip install --upgrade pip==19.3.1 && \ + python3 -m pip install six==1.16.0 && \ + python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0" + + +<%include file="./gcp_api_libraries_venv.include"/> diff --git a/tools/bazelify_tests/dockerimage_current_versions.bzl b/tools/bazelify_tests/dockerimage_current_versions.bzl index 54b4f77977f..90306784754 100644 --- a/tools/bazelify_tests/dockerimage_current_versions.bzl +++ b/tools/bazelify_tests/dockerimage_current_versions.bzl @@ -78,6 +78,7 @@ DOCKERIMAGE_CURRENT_VERSIONS = { "tools/dockerfile/interoptest/grpc_interop_go1.16.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.16@sha256:3767f47c9d06584c6c07b7ab536e13f3e87550330e6c2652ad288d3a72b0de23", "tools/dockerfile/interoptest/grpc_interop_go1.19.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.19@sha256:889e7ff34399a5e16af87940d1eaa239e56da307f7faca3f8f1d28379c2e3df3", "tools/dockerfile/interoptest/grpc_interop_go1.8.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.8@sha256:7830a301b37539252c592b9cd7fa30a6142d0afc717a05fc8d2b82c74fb45efe", + "tools/dockerfile/interoptest/grpc_interop_go1.x.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.x@sha256:c1d1babd31ea7e635aa68d56803212f9e0091ff628288c18dc86d890f837303a", "tools/dockerfile/interoptest/grpc_interop_http2.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_http2@sha256:e3f247d8038374848fadf7215b841e3575c0b2a4217feb503a79b8004b164c5a", "tools/dockerfile/interoptest/grpc_interop_java.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_java@sha256:6c0319bbbf77d6c198f61adf92d205efd33cbd2cccaf914a1af8f2dcb61b16a1", "tools/dockerfile/interoptest/grpc_interop_node.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_node@sha256:549a7683cc024fb7ffee807eaa8acb6c2d5a5dd0184a2590f91852804eea39a4", diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.x.current_version b/tools/dockerfile/interoptest/grpc_interop_go1.x.current_version new file mode 100644 index 00000000000..1437c2993ad --- /dev/null +++ b/tools/dockerfile/interoptest/grpc_interop_go1.x.current_version @@ -0,0 +1 @@ +us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.x:9740f2234d8c996def3f0e09791328c39dac0ab1@sha256:c1d1babd31ea7e635aa68d56803212f9e0091ff628288c18dc86d890f837303a \ No newline at end of file diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile new file mode 100644 index 00000000000..d7b5ba18533 --- /dev/null +++ b/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile @@ -0,0 +1,58 @@ +# Copyright 2024 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM golang:latest + +# Using login shell removes Go from path, so we add it. +RUN ln -s /usr/local/go/bin/go /usr/local/bin + +#==================== +# run_tests.py python dependencies + +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) +# This template is similar to run_tests_python_deps.include but installs the +# dependencies in a python virtual environment. This is required from pip 23.0 +# onwards as installation of system-wide packages is blocked by default. +RUN apt-get update && apt-get install -y \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + python3-venv \ + && apt-get clean + +# Create a python virtual env for installing required dependencies. +ENV PYTHON_ENV="/opt/venv/grpc-interop" +RUN python3 -m venv "$PYTHON_ENV" +RUN echo "source $PYTHON_ENV/bin/activate" >> ~/.bashrc + +# Use bash explicitly as /bin/sh doesn't support the "source" command. +# use pinned version of pip to avoid sudden breakages +# TODO(#36814): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && python3 -m pip install --upgrade pip==19.3.1 && python3 -m pip install six==1.16.0 && python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0" + + +# Install Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +# This template is similar to gcp_api_libraries.include but installs the +# dependencies in a python virtual environment. This is required from pip 23.0 +# onwards as installation of system-wide packages is blocked by default. +RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0" + + +# Define the default command. +CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh new file mode 100644 index 00000000000..309340cb9ed --- /dev/null +++ b/tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2015 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Builds Go interop server and client in a base image. +set -e + +# Turn on support for Go modules. +export GO111MODULE=on + +# Clone just the grpc-go source code without any dependencies. +# We are cloning from a local git repo that contains the right revision +# to test instead of using "go get" to download from Github directly. +git clone --recursive /var/local/jenkins/grpc-go src/google.golang.org/grpc + +# copy service account keys if available +cp -r /var/local/jenkins/service_account $HOME || true + +# Build the interop client and server +(cd src/google.golang.org/grpc/interop/client && go install) +(cd src/google.golang.org/grpc/interop/server && go install) + diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index c22a8d59d0b..c2b990f7d01 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -53,7 +53,7 @@ def should_build_docker_interop_image_from_release_tag(lang): # Dictionary of default runtimes per language LANG_RUNTIME_MATRIX = { "cxx": ["cxx"], # This is actually debian8. - "go": ["go1.8", "go1.11", "go1.16", "go1.19"], + "go": ["go1.x"], "java": ["java"], "python": ["python", "pythonasyncio"], "node": ["node"], @@ -301,6 +301,7 @@ LANG_RELEASE_MATRIX = { ("v1.61.2", ReleaseInfo(runtimes=["go1.19"])), ("v1.62.2", ReleaseInfo(runtimes=["go1.19"])), ("v1.63.2", ReleaseInfo(runtimes=["go1.19"])), + ("v1.64.0", ReleaseInfo()), ] ), "java": OrderedDict( From 322ef0920299bb4869360e2a21c4d200fde50066 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 7 Jun 2024 09:58:41 -0700 Subject: [PATCH 03/10] Fix leak in server_call_test PiperOrigin-RevId: 641280869 --- test/core/call/corpus/server_call/testcase-6014505746497536 | 1 + test/core/call/server_call_test.cc | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 test/core/call/corpus/server_call/testcase-6014505746497536 diff --git a/test/core/call/corpus/server_call/testcase-6014505746497536 b/test/core/call/corpus/server_call/testcase-6014505746497536 new file mode 100644 index 00000000000..98668271989 --- /dev/null +++ b/test/core/call/corpus/server_call/testcase-6014505746497536 @@ -0,0 +1 @@ +test_id: 536870912 diff --git a/test/core/call/server_call_test.cc b/test/core/call/server_call_test.cc index 5407a559c9c..167e3306507 100644 --- a/test/core/call/server_call_test.cc +++ b/test/core/call/server_call_test.cc @@ -38,6 +38,8 @@ class ServerCallTest : public YodelTest { protected: using YodelTest::YodelTest; + ~ServerCallTest() { grpc_metadata_array_destroy(&publish_initial_metadata_); } + grpc_call* InitCall(ClientMetadataHandle client_initial_metadata) { CHECK_EQ(call_, nullptr); auto call = From b3de112b15db041c2b44a5b146e5d37bfaa1d92a Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 7 Jun 2024 09:59:38 -0700 Subject: [PATCH 04/10] [call] Fix fuzzer found bug in client_call_test (#36848) FuzzingEventEngine can add some big arbitrary delays -- account for that. Closes #36848 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36848 from ctiller:f-cc af18b7a0cdb9ce9605bf19ea9daeb3f424e03e30 PiperOrigin-RevId: 641281105 --- test/core/call/client_call_test.cc | 5 ++++- test/core/call/yodel/fuzzer_main.cc | 1 + test/core/call/yodel/test_main.cc | 1 + test/core/call/yodel/yodel_test.cc | 2 ++ test/core/call/yodel/yodel_test.h | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test/core/call/client_call_test.cc b/test/core/call/client_call_test.cc index 537e0b48db6..27ef9cee212 100644 --- a/test/core/call/client_call_test.cc +++ b/test/core/call/client_call_test.cc @@ -98,7 +98,10 @@ class ClientCallTest : public YodelTest { return; } expectations_ = 0; - cq_verifier_->Verify(timeout.value_or(Duration::Seconds(10)), whence); + cq_verifier_->Verify( + timeout.value_or(g_yodel_fuzzing ? Duration::Minutes(5) + : Duration::Seconds(10)), + whence); } CallHandler& handler() { diff --git a/test/core/call/yodel/fuzzer_main.cc b/test/core/call/yodel/fuzzer_main.cc index 96c3917a360..3cd0340c227 100644 --- a/test/core/call/yodel/fuzzer_main.cc +++ b/test/core/call/yodel/fuzzer_main.cc @@ -35,6 +35,7 @@ bool squelch = true; DEFINE_PROTO_FUZZER(const transport_test_suite::Msg& msg) { + grpc_core::g_yodel_fuzzing = true; static const grpc_core::NoDestruct< std::vector> tests{grpc_core::yodel_detail::TestRegistry::AllTests()}; diff --git a/test/core/call/yodel/test_main.cc b/test/core/call/yodel/test_main.cc index 40066c94851..22b1ff3d561 100644 --- a/test/core/call/yodel/test_main.cc +++ b/test/core/call/yodel/test_main.cc @@ -19,6 +19,7 @@ #include "test/core/test_util/test_config.h" int main(int argc, char** argv) { + grpc_core::g_yodel_fuzzing = false; grpc::testing::TestEnvironment env(&argc, argv); absl::BitGen bitgen; ::testing::InitGoogleTest(&argc, argv); diff --git a/test/core/call/yodel/yodel_test.cc b/test/core/call/yodel/yodel_test.cc index 5625aeefe54..e60b357625f 100644 --- a/test/core/call/yodel/yodel_test.cc +++ b/test/core/call/yodel/yodel_test.cc @@ -27,6 +27,8 @@ namespace grpc_core { +bool g_yodel_fuzzing; + namespace yodel_detail { TestRegistry* TestRegistry::root_ = nullptr; diff --git a/test/core/call/yodel/yodel_test.h b/test/core/call/yodel/yodel_test.h index a961ad41cb1..ef34757f986 100644 --- a/test/core/call/yodel/yodel_test.h +++ b/test/core/call/yodel/yodel_test.h @@ -37,6 +37,8 @@ namespace grpc_core { class YodelTest; +extern bool g_yodel_fuzzing; + namespace yodel_detail { // Capture the name and location of a test step. From d63dcc188bcdc3baf54a7da930efdea2b0f73dd6 Mon Sep 17 00:00:00 2001 From: Tanvi Jagtap <139093547+tanvi-jagtap@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:10:22 -0700 Subject: [PATCH 05/10] [Gpr_To_Absl_Logging] Adding comment (#36846) [Gpr_To_Absl_Logging] Adding comment Closes #36846 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36846 from tanvi-jagtap:add_comment_no_logging 4a584d0d1da7b0e0f96c22ca5f0185fcb0dc325f PiperOrigin-RevId: 641284644 --- test/core/end2end/tests/no_logging.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/core/end2end/tests/no_logging.cc b/test/core/end2end/tests/no_logging.cc index 4235b02a759..52a11825d14 100644 --- a/test/core/end2end/tests/no_logging.cc +++ b/test/core/end2end/tests/no_logging.cc @@ -140,6 +140,9 @@ void SimpleRequest(CoreEnd2endTest& test) { } CORE_END2END_TEST(NoLoggingTest, NoLoggingTest) { +// This test makes sure that we dont get spammy logs when making an rpc +// especially when rpcs are successful. + // TODO(hork): remove when the listener flake is identified #ifdef GPR_WINDOWS if (IsEventEngineListenerEnabled()) { From c9fdef1317e1b3eca4e5d8330796df0520e3eb9a Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Fri, 7 Jun 2024 10:45:05 -0700 Subject: [PATCH 06/10] [logging] Centralize configuration for trace flags (#36576) All TraceFlags are now configured in `src/core/lib/debug/trace_flags.yaml`. The format is: ``` my_flag: default: false # the default value; default=false description: Some Description debug_only: false # debug_only flags only work in debug builds; default=false internal: false # internal flags will not show up in documentation; default=false ``` To regenerate the trace flag source code, run `tools/codegen/core/gen_trace_flags.py` (requires mako). This script is also run when sanity checking. This PR also adds two new features: ### Glob-based flag configuration Trace flag configuration now supports `?` (single wildcard character) and `*` (one or more wildcard characters). For example, using `GRPC_TRACE='event_engine*'` will enable all flags that match that glob. It expands to: * event_engine * event_engine_client_channel_resolver * event_engine_dns * event_engine_endpoint * event_engine_endpoint_data * event_engine_poller ### A cleaner trace-logging macro in abseil logging format If your goal is only to add log statements when the `fault_injection_filter` trace flag is enabled, you can use the macro: ``` GRPC_TRACE_LOG(fault_injection, INFO) << "Filtered:" << 42; ``` When the trace flag is enabled, the the log will show something like this: ``` I0000 00:00:1715733657.430042 16 file.cc:174] Filtered:42 ``` ---- Note: just like with the gpr_log to abseil logging conversion, the pre-existing trace logging usages can be replaced with the new tracing macro across multiple PRs. Closes #36576 PiperOrigin-RevId: 641295215 --- .gitattributes | 4 + BUILD | 56 +- CMakeLists.txt | 334 ++- Makefile | 12 +- Package.swift | 21 +- build_autogenerated.yaml | 401 ++-- config.m4 | 12 +- config.w32 | 12 +- doc/environment_variables.md | 101 +- doc/trace_flags.md | 120 ++ gRPC-C++.podspec | 18 +- gRPC-Core.podspec | 30 +- grpc.gemspec | 21 +- package.xml | 21 +- src/core/BUILD | 98 +- src/core/client_channel/client_channel.cc | 226 +- .../client_channel/client_channel_filter.cc | 560 +++-- .../load_balanced_call_destination.cc | 49 +- src/core/client_channel/retry_filter.cc | 2 - src/core/client_channel/retry_filter.h | 3 - .../retry_filter_legacy_call_data.cc | 111 +- src/core/client_channel/subchannel.cc | 20 +- .../subchannel_pool_interface.cc | 2 - .../subchannel_pool_interface.h | 4 +- .../backend_metrics/backend_metric_filter.cc | 8 +- .../legacy_channel_idle_filter.cc | 3 +- .../fault_injection/fault_injection_filter.cc | 3 +- .../message_compress/compression_filter.cc | 9 +- .../filters/http/server/http_server_filter.cc | 3 +- .../message_size/message_size_filter.cc | 3 +- .../stateful_session_filter.cc | 1 - .../chaotic_good/chaotic_good_transport.cc | 21 - .../chaotic_good/chaotic_good_transport.h | 8 +- .../client/chaotic_good_connector.cc | 2 +- .../chaotic_good/client_transport.cc | 4 +- .../server/chaotic_good_server.cc | 18 +- .../chaotic_good/server_transport.cc | 12 +- .../chttp2/transport/chttp2_transport.cc | 61 +- .../chttp2/transport/chttp2_transport.h | 5 - .../chttp2/transport/flow_control.cc | 4 +- .../transport/chttp2/transport/flow_control.h | 2 - .../transport/chttp2/transport/frame_ping.cc | 10 +- .../chttp2/transport/frame_rst_stream.cc | 3 +- .../chttp2/transport/frame_settings.cc | 7 +- .../chttp2/transport/hpack_encoder.cc | 3 +- .../chttp2/transport/hpack_parser.cc | 6 +- .../chttp2/transport/hpack_parser_table.cc | 9 +- .../transport/chttp2/transport/http_trace.cc | 19 - .../transport/chttp2/transport/http_trace.h | 24 - .../ext/transport/chttp2/transport/internal.h | 13 +- .../ext/transport/chttp2/transport/parsing.cc | 24 +- .../chttp2/transport/ping_callbacks.cc | 2 - .../chttp2/transport/ping_callbacks.h | 2 - .../chttp2/transport/stream_lists.cc | 8 +- .../ext/transport/chttp2/transport/writing.cc | 33 +- .../cronet/transport/cronet_transport.cc | 7 +- .../ext/transport/inproc/inproc_plugin.cc | 23 - .../ext/transport/inproc/inproc_transport.h | 2 - .../inproc/legacy_inproc_transport.cc | 14 +- .../inproc/legacy_inproc_transport.h | 2 - src/core/handshaker/handshaker.cc | 15 +- .../handshaker/security/secure_endpoint.cc | 13 +- .../handshaker/security/secure_endpoint.h | 2 - src/core/lib/channel/channel_stack.cc | 5 +- src/core/lib/channel/channel_stack.h | 12 +- .../lib/channel/channel_stack_builder_impl.cc | 1 - src/core/lib/channel/channel_stack_trace.cc | 19 - src/core/lib/channel/channel_stack_trace.h | 24 - src/core/lib/channel/connected_channel.cc | 1 - src/core/lib/channel/promise_based_filter.cc | 80 +- src/core/lib/debug/trace.cc | 103 +- src/core/lib/debug/trace.h | 99 +- src/core/lib/debug/trace_flags.cc | 242 +++ src/core/lib/debug/trace_flags.h | 115 ++ src/core/lib/debug/trace_flags.yaml | 363 ++++ src/core/lib/debug/trace_impl.h | 115 ++ src/core/lib/event_engine/ares_resolver.cc | 7 +- src/core/lib/event_engine/ares_resolver.h | 4 +- .../lib/event_engine/cf_engine/cf_engine.cc | 2 +- .../cf_engine/dns_service_resolver.cc | 39 +- src/core/lib/event_engine/forkable.cc | 9 +- src/core/lib/event_engine/forkable.h | 11 - .../event_engine/posix_engine/posix_engine.cc | 10 +- .../posix_engine/timer_manager.cc | 10 +- src/core/lib/event_engine/trace.cc | 25 - src/core/lib/event_engine/trace.h | 17 +- .../event_engine/windows/windows_endpoint.cc | 4 +- .../event_engine/windows/windows_engine.cc | 8 +- src/core/lib/gprpp/glob.cc | 70 + .../xds_resolver_trace.h => lib/gprpp/glob.h} | 19 +- src/core/lib/gprpp/work_serializer.cc | 100 +- src/core/lib/iomgr/call_combiner.cc | 40 +- src/core/lib/iomgr/call_combiner.h | 4 +- src/core/lib/iomgr/cfstream_handle.cc | 10 +- src/core/lib/iomgr/closure.h | 6 +- src/core/lib/iomgr/combiner.cc | 14 +- src/core/lib/iomgr/combiner.h | 2 - src/core/lib/iomgr/endpoint.cc | 2 - src/core/lib/iomgr/endpoint_cfstream.cc | 27 +- src/core/lib/iomgr/error.cc | 4 - src/core/lib/iomgr/ev_apple.cc | 8 +- src/core/lib/iomgr/ev_epoll1_linux.cc | 52 +- src/core/lib/iomgr/ev_poll_posix.cc | 20 +- src/core/lib/iomgr/ev_posix.cc | 8 +- src/core/lib/iomgr/ev_posix.h | 5 +- src/core/lib/iomgr/ev_windows.cc | 30 - .../lib/iomgr/event_engine_shims/closure.cc | 4 +- .../lib/iomgr/event_engine_shims/endpoint.cc | 8 +- src/core/lib/iomgr/exec_ctx.cc | 4 +- src/core/lib/iomgr/executor.cc | 19 +- src/core/lib/iomgr/lockfree_event.cc | 8 +- src/core/lib/iomgr/pollset.h | 2 - src/core/lib/iomgr/pollset_windows.cc | 2 - .../lib/iomgr/socket_utils_common_posix.cc | 8 +- src/core/lib/iomgr/tcp_client_cfstream.cc | 8 +- src/core/lib/iomgr/tcp_client_posix.cc | 8 +- src/core/lib/iomgr/tcp_posix.cc | 61 +- src/core/lib/iomgr/tcp_posix.h | 2 - src/core/lib/iomgr/tcp_server_posix.cc | 6 +- src/core/lib/iomgr/tcp_windows.cc | 19 +- src/core/lib/iomgr/timer_generic.cc | 33 +- src/core/lib/iomgr/timer_manager.cc | 44 +- src/core/lib/promise/detail/join_state.h | 752 ++++--- src/core/lib/promise/detail/seq_state.h | 1839 +++++++++-------- src/core/lib/promise/for_each.h | 12 +- src/core/lib/promise/inter_activity_latch.h | 10 +- src/core/lib/promise/interceptor_list.h | 13 +- src/core/lib/promise/latch.h | 18 +- src/core/lib/promise/map_pipe.h | 9 +- src/core/lib/promise/party.cc | 9 +- src/core/lib/promise/party.h | 14 +- src/core/lib/promise/pipe.h | 50 +- src/core/lib/promise/trace.cc | 20 - src/core/lib/promise/trace.h | 24 - src/core/lib/resource_quota/memory_quota.cc | 17 +- src/core/lib/resource_quota/memory_quota.h | 3 +- src/core/lib/resource_quota/trace.cc | 19 - src/core/lib/resource_quota/trace.h | 24 - .../grpc_authorization_policy_provider.cc | 6 +- .../authorization/grpc_server_authz_filter.cc | 10 +- .../lib/security/context/security_context.cc | 4 +- .../lib/security/context/security_context.h | 4 +- .../credentials/jwt/jwt_credentials.cc | 2 +- .../credentials/oauth2/oauth2_credentials.cc | 2 +- .../credentials/plugin/plugin_credentials.cc | 10 +- .../credentials/plugin/plugin_credentials.h | 2 - .../security_connector/security_connector.cc | 3 - .../security_connector/security_connector.h | 4 +- .../security/transport/server_auth_filter.cc | 3 +- src/core/lib/slice/slice_refcount.cc | 20 - src/core/lib/slice/slice_refcount.h | 6 +- src/core/lib/surface/api_trace.cc | 25 - src/core/lib/surface/api_trace.h | 4 +- src/core/lib/surface/call.cc | 16 +- src/core/lib/surface/call.h | 13 +- src/core/lib/surface/call_trace.h | 24 - src/core/lib/surface/call_utils.cc | 40 +- src/core/lib/surface/call_utils.h | 26 +- src/core/lib/surface/channel_init.cc | 3 +- src/core/lib/surface/client_call.cc | 14 +- src/core/lib/surface/completion_queue.cc | 46 +- src/core/lib/surface/completion_queue.h | 8 - src/core/lib/surface/filter_stack_call.cc | 47 +- src/core/lib/surface/filter_stack_call.h | 11 +- src/core/lib/surface/legacy_channel.cc | 2 +- src/core/lib/surface/server_call.cc | 6 +- src/core/lib/transport/bdp_estimator.cc | 8 +- src/core/lib/transport/bdp_estimator.h | 6 +- src/core/lib/transport/call_filters.cc | 8 +- src/core/lib/transport/call_filters.h | 28 +- src/core/lib/transport/call_spine.h | 7 +- src/core/lib/transport/connectivity_state.cc | 18 +- src/core/lib/transport/connectivity_state.h | 2 - src/core/lib/transport/transport.cc | 7 +- src/core/lib/transport/transport.h | 6 +- .../load_balancing/child_policy_handler.cc | 16 +- src/core/load_balancing/endpoint_list.h | 2 +- src/core/load_balancing/grpclb/grpclb.cc | 42 +- .../load_balancing/health_check_client.cc | 23 +- src/core/load_balancing/lb_policy.cc | 13 +- src/core/load_balancing/lb_policy.h | 2 - src/core/load_balancing/oob_backend_metric.cc | 6 +- .../outlier_detection/outlier_detection.cc | 66 +- .../load_balancing/pick_first/pick_first.cc | 108 +- src/core/load_balancing/priority/priority.cc | 48 +- .../load_balancing/ring_hash/ring_hash.cc | 22 +- src/core/load_balancing/rls/rls.cc | 103 +- .../load_balancing/round_robin/round_robin.cc | 35 +- .../weighted_round_robin.cc | 54 +- .../weighted_target/weighted_target.cc | 39 +- src/core/load_balancing/xds/cds.cc | 22 +- .../load_balancing/xds/xds_cluster_impl.cc | 26 +- .../load_balancing/xds/xds_cluster_manager.cc | 26 +- .../load_balancing/xds/xds_override_host.cc | 68 +- .../load_balancing/xds/xds_wrr_locality.cc | 14 +- .../resolver/dns/c_ares/dns_resolver_ares.cc | 2 +- .../resolver/dns/c_ares/grpc_ares_wrapper.cc | 9 +- .../resolver/dns/c_ares/grpc_ares_wrapper.h | 6 +- .../event_engine_client_channel_resolver.cc | 10 +- src/core/resolver/dns/native/dns_resolver.cc | 12 +- src/core/resolver/resolver.cc | 8 +- src/core/resolver/resolver.h | 2 - .../resolver/xds/xds_dependency_manager.cc | 45 +- src/core/resolver/xds/xds_resolver.cc | 19 +- src/core/resolver/xds/xds_resolver_trace.cc | 25 - src/core/server/server.cc | 6 +- src/core/server/server.h | 2 - src/core/server/xds_server_config_fetcher.cc | 5 +- src/core/tsi/fake_transport_security.cc | 18 +- src/core/tsi/ssl_transport_security.cc | 2 +- src/core/tsi/transport_security.cc | 4 - src/core/tsi/transport_security.h | 2 - src/core/tsi/transport_security_interface.h | 4 - src/core/util/gcp_metadata_query.cc | 15 +- src/core/util/http_client/parser.cc | 4 +- src/core/util/http_client/parser.h | 2 - src/core/xds/grpc/xds_client_grpc.cc | 13 +- src/core/xds/grpc/xds_cluster.cc | 6 +- src/core/xds/grpc/xds_endpoint.cc | 6 +- src/core/xds/grpc/xds_listener.cc | 8 +- src/core/xds/grpc/xds_route_config.cc | 8 +- src/core/xds/xds_client/xds_api.cc | 8 +- src/core/xds/xds_client/xds_client.cc | 84 +- src/core/xds/xds_client/xds_client.h | 3 - src/core/xds/xds_client/xds_client_stats.cc | 12 +- src/cpp/ext/gcp/environment_autodetect.cc | 10 +- src/cpp/server/backend_metric_recorder.cc | 71 +- src/python/grpcio/grpc_core_dependencies.py | 12 +- .../observability_lib_deps.py | 3 +- .../fuzzing_event_engine.cc | 27 +- test/core/gprpp/BUILD | 14 + test/core/gprpp/glob_test.cc | 83 + test/core/handshake/client_ssl.cc | 11 +- test/core/iomgr/timer_list_test.cc | 15 +- test/core/telemetry/BUILD | 14 + test/core/telemetry/trace_flags_test.cc | 113 + .../core/transport/connectivity_state_test.cc | 2 +- .../xds/xds_cluster_resource_type_test.cc | 3 - test/core/xds/xds_common_types_test.cc | 2 - .../xds/xds_endpoint_resource_type_test.cc | 3 - .../xds/xds_listener_resource_type_test.cc | 3 - .../xds_route_config_resource_type_test.cc | 3 - tools/codegen/core/gen_join.py | 10 +- tools/codegen/core/gen_seq.py | 20 +- tools/codegen/core/gen_trace_flags.py | 79 + tools/codegen/core/gen_trace_flags_ci.sh | 21 + .../codegen/core/templates/trace_flags.h.mako | 3 +- .../check_redundant_namespace_qualifiers.py | 3 + tools/distrib/sanitize.sh | 1 + tools/doxygen/Doxyfile.c++ | 1 + tools/doxygen/Doxyfile.c++.internal | 22 +- tools/doxygen/Doxyfile.core | 1 + tools/doxygen/Doxyfile.core.internal | 22 +- tools/doxygen/Doxyfile.objc | 1 + tools/doxygen/Doxyfile.objc.internal | 1 + tools/doxygen/Doxyfile.php | 1 + tools/run_tests/generated/tests.json | 48 + tools/run_tests/sanity/sanity_tests.yaml | 2 + 258 files changed, 4768 insertions(+), 4854 deletions(-) create mode 100644 doc/trace_flags.md delete mode 100644 src/core/ext/transport/chaotic_good/chaotic_good_transport.cc delete mode 100644 src/core/ext/transport/chttp2/transport/http_trace.cc delete mode 100644 src/core/ext/transport/chttp2/transport/http_trace.h delete mode 100644 src/core/ext/transport/inproc/inproc_plugin.cc delete mode 100644 src/core/lib/channel/channel_stack_trace.cc delete mode 100644 src/core/lib/channel/channel_stack_trace.h create mode 100644 src/core/lib/debug/trace_impl.h delete mode 100644 src/core/lib/event_engine/trace.cc create mode 100644 src/core/lib/gprpp/glob.cc rename src/core/{resolver/xds/xds_resolver_trace.h => lib/gprpp/glob.h} (59%) delete mode 100644 src/core/lib/iomgr/ev_windows.cc delete mode 100644 src/core/lib/promise/trace.cc delete mode 100644 src/core/lib/promise/trace.h delete mode 100644 src/core/lib/resource_quota/trace.cc delete mode 100644 src/core/lib/resource_quota/trace.h delete mode 100644 src/core/lib/slice/slice_refcount.cc delete mode 100644 src/core/lib/surface/api_trace.cc delete mode 100644 src/core/lib/surface/call_trace.h delete mode 100644 src/core/resolver/xds/xds_resolver_trace.cc create mode 100644 test/core/gprpp/glob_test.cc create mode 100644 test/core/telemetry/trace_flags_test.cc create mode 100755 tools/codegen/core/gen_trace_flags.py create mode 100755 tools/codegen/core/gen_trace_flags_ci.sh diff --git a/.gitattributes b/.gitattributes index 2661229e94f..985d4fea97c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -35,3 +35,7 @@ src/core/lib/experiments/experiments.h linguist-generated=true src/core/lib/experiments/experiments.cc linguist-generated=true bazel/experiments.bzl linguist-generated=true test/cpp/microbenchmarks/huffman_geometries/** linguist-generated=true +doc/trace_flags.md linguist-generated=true +src/core/lib/debug/trace_flags.h linguist-generated=true +src/core/lib/debug/trace_flags.cc linguist-generated=true +src/python/grpcio_observability/observability_lib_deps.py linguist-generated=true diff --git a/BUILD b/BUILD index ae117911459..39ed4cea3bd 100644 --- a/BUILD +++ b/BUILD @@ -1408,17 +1408,6 @@ grpc_cc_library( ], ) -grpc_cc_library( - name = "call_trace", - hdrs = [ - "//src/core:lib/surface/call_trace.h", - ], - language = "c++", - deps = [ - "grpc_trace", - ], -) - grpc_cc_library( name = "dynamic_annotations", hdrs = [ @@ -1487,9 +1476,6 @@ grpc_cc_library( grpc_cc_library( name = "api_trace", - srcs = [ - "//src/core:lib/surface/api_trace.cc", - ], hdrs = [ "//src/core:lib/surface/api_trace.h", ], @@ -1536,7 +1522,6 @@ grpc_cc_library( "//src/core:lib/iomgr/ev_epoll1_linux.cc", "//src/core:lib/iomgr/ev_poll_posix.cc", "//src/core:lib/iomgr/ev_posix.cc", - "//src/core:lib/iomgr/ev_windows.cc", "//src/core:lib/iomgr/fork_posix.cc", "//src/core:lib/iomgr/fork_windows.cc", "//src/core:lib/iomgr/gethostname_fallback.cc", @@ -1714,7 +1699,6 @@ grpc_cc_library( "//src/core:posix_event_engine_endpoint", "//src/core:resolved_address", "//src/core:resource_quota", - "//src/core:resource_quota_trace", "//src/core:slice", "//src/core:slice_buffer", "//src/core:slice_cast", @@ -2049,7 +2033,6 @@ grpc_cc_library( deps = [ "api_trace", "call_combiner", - "call_trace", "call_tracer", "channel", "channel_arg_names", @@ -2086,7 +2069,6 @@ grpc_cc_library( "//src/core:channel_args_preconditioning", "//src/core:channel_fwd", "//src/core:channel_init", - "//src/core:channel_stack_trace", "//src/core:channel_stack_type", "//src/core:closure", "//src/core:compression", @@ -2116,7 +2098,6 @@ grpc_cc_library( "//src/core:pipe", "//src/core:poll", "//src/core:promise_status", - "//src/core:promise_trace", "//src/core:race", "//src/core:ref_counted", "//src/core:seq", @@ -2312,7 +2293,6 @@ grpc_cc_library( visibility = ["@grpc:public"], deps = [ "api_trace", - "call_trace", "channel_arg_names", "channelz", "config", @@ -2348,7 +2328,6 @@ grpc_cc_library( "//src/core:poll", "//src/core:ref_counted", "//src/core:resource_quota", - "//src/core:resource_quota_trace", "//src/core:seq", "//src/core:slice", "//src/core:slice_refcount", @@ -3006,11 +2985,19 @@ grpc_cc_library( grpc_cc_library( name = "grpc_trace", - srcs = ["//src/core:lib/debug/trace.cc"], - hdrs = ["//src/core:lib/debug/trace.h"], + srcs = [ + "//src/core:lib/debug/trace.cc", + "//src/core:lib/debug/trace_flags.cc", + ], + hdrs = [ + "//src/core:lib/debug/trace.h", + "//src/core:lib/debug/trace_flags.h", + "//src/core:lib/debug/trace_impl.h", + ], external_deps = [ - "absl/log:log", + "absl/log", "absl/strings", + "absl/container:flat_hash_map", ], language = "c++", visibility = ["@grpc:trace"], @@ -3018,6 +3005,8 @@ grpc_cc_library( "config_vars", "gpr", "grpc_public_hdrs", + "//src/core:glob", + "//src/core:no_destruct", ], ) @@ -4314,7 +4303,6 @@ grpc_cc_library( language = "c++", visibility = ["@grpc:http"], deps = [ - "call_trace", "call_tracer", "channel_arg_names", "config", @@ -4531,20 +4519,6 @@ grpc_cc_library( deps = ["gpr"], ) -grpc_cc_library( - name = "http_trace", - srcs = [ - "//src/core:ext/transport/chttp2/transport/http_trace.cc", - ], - hdrs = [ - "//src/core:ext/transport/chttp2/transport/http_trace.h", - ], - deps = [ - "gpr_platform", - "grpc_trace", - ], -) - grpc_cc_library( name = "hpack_parser_table", srcs = [ @@ -4565,7 +4539,6 @@ grpc_cc_library( "gpr_platform", "grpc_trace", "hpack_parse_result", - "http_trace", "//src/core:hpack_constants", "//src/core:metadata_batch", "//src/core:no_destruct", @@ -4668,7 +4641,6 @@ grpc_cc_library( "grpc_base", "grpc_public_hdrs", "grpc_trace", - "http_trace", "//src/core:hpack_constants", "//src/core:hpack_encoder_table", "//src/core:metadata_batch", @@ -4801,7 +4773,6 @@ grpc_cc_library( "hpack_encoder", "hpack_parser", "hpack_parser_table", - "http_trace", "httpcli", "iomgr", "iomgr_buffer_list", @@ -4838,7 +4809,6 @@ grpc_cc_library( "//src/core:random_early_detection", "//src/core:ref_counted", "//src/core:resource_quota", - "//src/core:resource_quota_trace", "//src/core:slice", "//src/core:slice_buffer", "//src/core:slice_refcount", diff --git a/CMakeLists.txt b/CMakeLists.txt index 92d752bafb2..d259292f9e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1117,6 +1117,7 @@ if(gRPC_BUILD_TESTS) endif() add_dependencies(buildtests_cxx fuzzing_event_engine_unittest) add_dependencies(buildtests_cxx generic_end2end_test) + add_dependencies(buildtests_cxx glob_test) add_dependencies(buildtests_cxx goaway_server_test) add_dependencies(buildtests_cxx google_c2p_resolver_test) add_dependencies(buildtests_cxx graceful_server_shutdown_test) @@ -1513,6 +1514,7 @@ if(gRPC_BUILD_TESTS) add_dependencies(buildtests_cxx tls_key_export_test) add_dependencies(buildtests_cxx tls_security_connector_test) add_dependencies(buildtests_cxx too_many_pings_test) + add_dependencies(buildtests_cxx trace_flags_test) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_dependencies(buildtests_cxx traced_buffer_list_test) endif() @@ -1900,7 +1902,6 @@ add_library(grpc src/core/ext/transport/chttp2/transport/hpack_parser.cc src/core/ext/transport/chttp2/transport/hpack_parser_table.cc src/core/ext/transport/chttp2/transport/http2_settings.cc - src/core/ext/transport/chttp2/transport/http_trace.cc src/core/ext/transport/chttp2/transport/huffsyms.cc src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc src/core/ext/transport/chttp2/transport/parsing.cc @@ -1911,7 +1912,6 @@ add_library(grpc src/core/ext/transport/chttp2/transport/varint.cc src/core/ext/transport/chttp2/transport/write_size_policy.cc src/core/ext/transport/chttp2/transport/writing.cc - src/core/ext/transport/inproc/inproc_plugin.cc src/core/ext/transport/inproc/inproc_transport.cc src/core/ext/transport/inproc/legacy_inproc_transport.cc src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.c @@ -2249,7 +2249,6 @@ add_library(grpc src/core/lib/channel/channel_stack.cc src/core/lib/channel/channel_stack_builder.cc src/core/lib/channel/channel_stack_builder_impl.cc - src/core/lib/channel/channel_stack_trace.cc src/core/lib/channel/connected_channel.cc src/core/lib/channel/promise_based_filter.cc src/core/lib/channel/status_util.cc @@ -2259,6 +2258,7 @@ add_library(grpc src/core/lib/config/core_configuration.cc src/core/lib/debug/event_log.cc src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc @@ -2296,7 +2296,6 @@ add_library(grpc src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc src/core/lib/event_engine/time_util.cc - src/core/lib/event_engine/trace.cc src/core/lib/event_engine/utils.cc src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc src/core/lib/event_engine/windows/iocp.cc @@ -2309,6 +2308,7 @@ add_library(grpc src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc src/core/lib/gprpp/dump_args.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/load_file.cc src/core/lib/gprpp/per_cpu.cc src/core/lib/gprpp/posix/directory_reader.cc @@ -2336,7 +2336,6 @@ add_library(grpc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_poll_posix.cc src/core/lib/iomgr/ev_posix.cc - src/core/lib/iomgr/ev_windows.cc src/core/lib/iomgr/event_engine_shims/closure.cc src/core/lib/iomgr/event_engine_shims/endpoint.cc src/core/lib/iomgr/event_engine_shims/tcp_client.cc @@ -2401,7 +2400,6 @@ add_library(grpc src/core/lib/promise/activity.cc src/core/lib/promise/party.cc src/core/lib/promise/sleep.cc - src/core/lib/promise/trace.cc src/core/lib/resource_quota/api.cc src/core/lib/resource_quota/arena.cc src/core/lib/resource_quota/connection_quota.cc @@ -2409,7 +2407,6 @@ add_library(grpc src/core/lib/resource_quota/periodic_update.cc src/core/lib/resource_quota/resource_quota.cc src/core/lib/resource_quota/thread_quota.cc - src/core/lib/resource_quota/trace.cc src/core/lib/security/authorization/audit_logging.cc src/core/lib/security/authorization/authorization_policy_provider_vtable.cc src/core/lib/security/authorization/evaluate_args.cc @@ -2475,9 +2472,7 @@ add_library(grpc src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc src/core/lib/slice/slice_buffer.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc - src/core/lib/surface/api_trace.cc src/core/lib/surface/byte_buffer.cc src/core/lib/surface/byte_buffer_reader.cc src/core/lib/surface/call.cc @@ -2568,7 +2563,6 @@ add_library(grpc src/core/resolver/sockaddr/sockaddr_resolver.cc src/core/resolver/xds/xds_dependency_manager.cc src/core/resolver/xds/xds_resolver.cc - src/core/resolver/xds/xds_resolver_trace.cc src/core/server/server.cc src/core/server/server_call_tracer_filter.cc src/core/server/server_config_selector_filter.cc @@ -2996,7 +2990,6 @@ add_library(grpc_unsecure src/core/ext/transport/chttp2/transport/hpack_parser.cc src/core/ext/transport/chttp2/transport/hpack_parser_table.cc src/core/ext/transport/chttp2/transport/http2_settings.cc - src/core/ext/transport/chttp2/transport/http_trace.cc src/core/ext/transport/chttp2/transport/huffsyms.cc src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc src/core/ext/transport/chttp2/transport/parsing.cc @@ -3007,7 +3000,6 @@ add_library(grpc_unsecure src/core/ext/transport/chttp2/transport/varint.cc src/core/ext/transport/chttp2/transport/write_size_policy.cc src/core/ext/transport/chttp2/transport/writing.cc - src/core/ext/transport/inproc/inproc_plugin.cc src/core/ext/transport/inproc/inproc_transport.cc src/core/ext/transport/inproc/legacy_inproc_transport.cc src/core/ext/upb-gen/google/api/annotations.upb_minitable.c @@ -3047,7 +3039,6 @@ add_library(grpc_unsecure src/core/lib/channel/channel_stack.cc src/core/lib/channel/channel_stack_builder.cc src/core/lib/channel/channel_stack_builder_impl.cc - src/core/lib/channel/channel_stack_trace.cc src/core/lib/channel/connected_channel.cc src/core/lib/channel/promise_based_filter.cc src/core/lib/channel/status_util.cc @@ -3057,6 +3048,7 @@ add_library(grpc_unsecure src/core/lib/config/core_configuration.cc src/core/lib/debug/event_log.cc src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc @@ -3094,7 +3086,6 @@ add_library(grpc_unsecure src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc src/core/lib/event_engine/time_util.cc - src/core/lib/event_engine/trace.cc src/core/lib/event_engine/utils.cc src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc src/core/lib/event_engine/windows/iocp.cc @@ -3107,6 +3098,7 @@ add_library(grpc_unsecure src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc src/core/lib/gprpp/dump_args.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/load_file.cc src/core/lib/gprpp/per_cpu.cc src/core/lib/gprpp/ref_counted_string.cc @@ -3132,7 +3124,6 @@ add_library(grpc_unsecure src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_poll_posix.cc src/core/lib/iomgr/ev_posix.cc - src/core/lib/iomgr/ev_windows.cc src/core/lib/iomgr/event_engine_shims/closure.cc src/core/lib/iomgr/event_engine_shims/endpoint.cc src/core/lib/iomgr/event_engine_shims/tcp_client.cc @@ -3196,7 +3187,6 @@ add_library(grpc_unsecure src/core/lib/promise/activity.cc src/core/lib/promise/party.cc src/core/lib/promise/sleep.cc - src/core/lib/promise/trace.cc src/core/lib/resource_quota/api.cc src/core/lib/resource_quota/arena.cc src/core/lib/resource_quota/connection_quota.cc @@ -3204,7 +3194,6 @@ add_library(grpc_unsecure src/core/lib/resource_quota/periodic_update.cc src/core/lib/resource_quota/resource_quota.cc src/core/lib/resource_quota/thread_quota.cc - src/core/lib/resource_quota/trace.cc src/core/lib/security/authorization/authorization_policy_provider_vtable.cc src/core/lib/security/authorization/evaluate_args.cc src/core/lib/security/authorization/grpc_server_authz_filter.cc @@ -3236,9 +3225,7 @@ add_library(grpc_unsecure src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc src/core/lib/slice/slice_buffer.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc - src/core/lib/surface/api_trace.cc src/core/lib/surface/byte_buffer.cc src/core/lib/surface/byte_buffer_reader.cc src/core/lib/surface/call.cc @@ -5171,7 +5158,6 @@ add_library(grpc_authorization_provider src/core/lib/channel/channel_stack.cc src/core/lib/channel/channel_stack_builder.cc src/core/lib/channel/channel_stack_builder_impl.cc - src/core/lib/channel/channel_stack_trace.cc src/core/lib/channel/connected_channel.cc src/core/lib/channel/promise_based_filter.cc src/core/lib/channel/status_util.cc @@ -5181,6 +5167,7 @@ add_library(grpc_authorization_provider src/core/lib/config/core_configuration.cc src/core/lib/debug/event_log.cc src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc @@ -5218,7 +5205,6 @@ add_library(grpc_authorization_provider src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc src/core/lib/event_engine/time_util.cc - src/core/lib/event_engine/trace.cc src/core/lib/event_engine/utils.cc src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc src/core/lib/event_engine/windows/iocp.cc @@ -5231,6 +5217,7 @@ add_library(grpc_authorization_provider src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc src/core/lib/gprpp/dump_args.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/load_file.cc src/core/lib/gprpp/per_cpu.cc src/core/lib/gprpp/ref_counted_string.cc @@ -5255,7 +5242,6 @@ add_library(grpc_authorization_provider src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_poll_posix.cc src/core/lib/iomgr/ev_posix.cc - src/core/lib/iomgr/ev_windows.cc src/core/lib/iomgr/event_engine_shims/closure.cc src/core/lib/iomgr/event_engine_shims/endpoint.cc src/core/lib/iomgr/event_engine_shims/tcp_client.cc @@ -5319,7 +5305,6 @@ add_library(grpc_authorization_provider src/core/lib/matchers/matchers.cc src/core/lib/promise/activity.cc src/core/lib/promise/party.cc - src/core/lib/promise/trace.cc src/core/lib/resource_quota/api.cc src/core/lib/resource_quota/arena.cc src/core/lib/resource_quota/connection_quota.cc @@ -5327,7 +5312,6 @@ add_library(grpc_authorization_provider src/core/lib/resource_quota/periodic_update.cc src/core/lib/resource_quota/resource_quota.cc src/core/lib/resource_quota/thread_quota.cc - src/core/lib/resource_quota/trace.cc src/core/lib/security/authorization/audit_logging.cc src/core/lib/security/authorization/authorization_policy_provider_vtable.cc src/core/lib/security/authorization/evaluate_args.cc @@ -5362,9 +5346,7 @@ add_library(grpc_authorization_provider src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc src/core/lib/slice/slice_buffer.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc - src/core/lib/surface/api_trace.cc src/core/lib/surface/byte_buffer.cc src/core/lib/surface/byte_buffer_reader.cc src/core/lib/surface/call.cc @@ -6025,8 +6007,9 @@ if(gRPC_BUILD_TESTS) add_executable(activity_test src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc + src/core/lib/gprpp/glob.cc src/core/lib/promise/activity.cc - src/core/lib/promise/trace.cc test/core/promise/activity_test.cc ) if(WIN32 AND MSVC) @@ -6061,6 +6044,7 @@ target_link_libraries(activity_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest absl::config + absl::flat_hash_map absl::hash absl::type_traits absl::statusor @@ -6298,7 +6282,8 @@ if(gRPC_BUILD_TESTS) add_executable(all_ok_test src/core/lib/debug/trace.cc - src/core/lib/promise/trace.cc + src/core/lib/debug/trace_flags.cc + src/core/lib/gprpp/glob.cc test/core/promise/all_ok_test.cc ) if(WIN32 AND MSVC) @@ -6332,6 +6317,7 @@ target_include_directories(all_ok_test target_link_libraries(all_ok_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::flat_hash_map absl::type_traits absl::statusor absl::utility @@ -7547,7 +7533,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(bad_ping_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -8024,7 +8009,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(binary_metadata_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -8469,7 +8453,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(call_creds_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -8539,9 +8522,11 @@ add_executable(call_filters_test src/core/lib/compression/compression.cc src/core/lib/compression/compression_internal.cc src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc src/core/lib/gprpp/dump_args.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/ref_counted_string.cc src/core/lib/gprpp/status_helper.cc src/core/lib/gprpp/time.cc @@ -8552,20 +8537,16 @@ add_executable(call_filters_test src/core/lib/iomgr/executor.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/promise/activity.cc - src/core/lib/promise/trace.cc src/core/lib/resource_quota/arena.cc src/core/lib/resource_quota/connection_quota.cc src/core/lib/resource_quota/memory_quota.cc src/core/lib/resource_quota/periodic_update.cc src/core/lib/resource_quota/resource_quota.cc src/core/lib/resource_quota/thread_quota.cc - src/core/lib/resource_quota/trace.cc src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc src/core/lib/slice/slice_buffer.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc - src/core/lib/surface/api_trace.cc src/core/lib/surface/channel_stack_type.cc src/core/lib/transport/call_filters.cc src/core/lib/transport/call_final_info.cc @@ -8623,6 +8604,7 @@ target_link_libraries(call_filters_test upb_message_lib absl::config absl::no_destructor + absl::flat_hash_map absl::inlined_vector absl::function_ref absl::hash @@ -8679,7 +8661,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(call_host_override_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -8804,7 +8785,6 @@ add_executable(call_utils_test src/core/lib/channel/channel_stack.cc src/core/lib/channel/channel_stack_builder.cc src/core/lib/channel/channel_stack_builder_impl.cc - src/core/lib/channel/channel_stack_trace.cc src/core/lib/channel/connected_channel.cc src/core/lib/channel/promise_based_filter.cc src/core/lib/channel/status_util.cc @@ -8814,6 +8794,7 @@ add_executable(call_utils_test src/core/lib/config/core_configuration.cc src/core/lib/debug/event_log.cc src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc @@ -8851,7 +8832,6 @@ add_executable(call_utils_test src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc src/core/lib/event_engine/time_util.cc - src/core/lib/event_engine/trace.cc src/core/lib/event_engine/utils.cc src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc src/core/lib/event_engine/windows/iocp.cc @@ -8864,6 +8844,7 @@ add_executable(call_utils_test src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc src/core/lib/gprpp/dump_args.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/load_file.cc src/core/lib/gprpp/per_cpu.cc src/core/lib/gprpp/ref_counted_string.cc @@ -8888,7 +8869,6 @@ add_executable(call_utils_test src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_poll_posix.cc src/core/lib/iomgr/ev_posix.cc - src/core/lib/iomgr/ev_windows.cc src/core/lib/iomgr/event_engine_shims/closure.cc src/core/lib/iomgr/event_engine_shims/endpoint.cc src/core/lib/iomgr/event_engine_shims/tcp_client.cc @@ -8951,7 +8931,6 @@ add_executable(call_utils_test src/core/lib/iomgr/wakeup_fd_posix.cc src/core/lib/promise/activity.cc src/core/lib/promise/party.cc - src/core/lib/promise/trace.cc src/core/lib/resource_quota/api.cc src/core/lib/resource_quota/arena.cc src/core/lib/resource_quota/connection_quota.cc @@ -8959,7 +8938,6 @@ add_executable(call_utils_test src/core/lib/resource_quota/periodic_update.cc src/core/lib/resource_quota/resource_quota.cc src/core/lib/resource_quota/thread_quota.cc - src/core/lib/resource_quota/trace.cc src/core/lib/security/certificate_provider/certificate_provider_registry.cc src/core/lib/security/credentials/alts/check_gcp_environment.cc src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc @@ -8971,9 +8949,7 @@ add_executable(call_utils_test src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc src/core/lib/slice/slice_buffer.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc - src/core/lib/surface/api_trace.cc src/core/lib/surface/byte_buffer.cc src/core/lib/surface/byte_buffer_reader.cc src/core/lib/surface/call.cc @@ -9090,7 +9066,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(cancel_after_accept_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -9154,7 +9129,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(cancel_after_client_done_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -9218,7 +9192,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(cancel_after_invoke_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -9282,7 +9255,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(cancel_after_round_trip_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -9393,7 +9365,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(cancel_before_invoke_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -9460,8 +9431,10 @@ add_executable(cancel_callback_test src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c src/core/ext/upb-gen/google/rpc/status.upb_minitable.c src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/status_helper.cc src/core/lib/gprpp/time.cc src/core/lib/iomgr/closure.cc @@ -9471,17 +9444,14 @@ add_executable(cancel_callback_test src/core/lib/iomgr/executor.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/promise/activity.cc - src/core/lib/promise/trace.cc src/core/lib/resource_quota/arena.cc src/core/lib/resource_quota/connection_quota.cc src/core/lib/resource_quota/memory_quota.cc src/core/lib/resource_quota/periodic_update.cc src/core/lib/resource_quota/resource_quota.cc src/core/lib/resource_quota/thread_quota.cc - src/core/lib/resource_quota/trace.cc src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc test/core/promise/cancel_callback_test.cc third_party/upb/upb/mini_descriptor/build_enum.c @@ -9529,6 +9499,7 @@ target_link_libraries(cancel_callback_test utf8_range_lib upb_message_lib absl::config + absl::flat_hash_map absl::function_ref absl::hash absl::type_traits @@ -9541,7 +9512,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(cancel_in_a_vacuum_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -9605,7 +9575,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(cancel_with_status_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -10569,8 +10538,10 @@ add_executable(chunked_vector_test src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c src/core/ext/upb-gen/google/rpc/status.upb_minitable.c src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/status_helper.cc src/core/lib/gprpp/time.cc src/core/lib/iomgr/closure.cc @@ -10580,17 +10551,14 @@ add_executable(chunked_vector_test src/core/lib/iomgr/executor.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/promise/activity.cc - src/core/lib/promise/trace.cc src/core/lib/resource_quota/arena.cc src/core/lib/resource_quota/connection_quota.cc src/core/lib/resource_quota/memory_quota.cc src/core/lib/resource_quota/periodic_update.cc src/core/lib/resource_quota/resource_quota.cc src/core/lib/resource_quota/thread_quota.cc - src/core/lib/resource_quota/trace.cc src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc test/core/gprpp/chunked_vector_test.cc third_party/upb/upb/mini_descriptor/build_enum.c @@ -10638,6 +10606,7 @@ target_link_libraries(chunked_vector_test utf8_range_lib upb_message_lib absl::config + absl::flat_hash_map absl::function_ref absl::hash absl::type_traits @@ -11317,7 +11286,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(client_streaming_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -11657,7 +11625,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(compressed_payload_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -11996,7 +11963,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(connectivity_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -12426,7 +12392,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(default_host_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -12635,7 +12600,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(disappearing_server_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -12991,7 +12955,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(empty_batch_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -13883,8 +13846,10 @@ add_executable(exec_ctx_wakeup_scheduler_test src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c src/core/ext/upb-gen/google/rpc/status.upb_minitable.c src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/status_helper.cc src/core/lib/gprpp/time.cc src/core/lib/iomgr/closure.cc @@ -13896,7 +13861,6 @@ add_executable(exec_ctx_wakeup_scheduler_test src/core/lib/promise/activity.cc src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc test/core/promise/exec_ctx_wakeup_scheduler_test.cc third_party/upb/upb/mini_descriptor/build_enum.c @@ -13944,6 +13908,7 @@ target_link_libraries(exec_ctx_wakeup_scheduler_test utf8_range_lib upb_message_lib absl::config + absl::flat_hash_map absl::hash absl::type_traits absl::statusor @@ -14376,7 +14341,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(filter_causes_close_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -14440,7 +14404,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(filter_init_fails_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -14554,7 +14517,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(filtered_metadata_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -14684,8 +14646,10 @@ add_executable(flow_control_test src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c src/core/ext/upb-gen/google/rpc/status.upb_minitable.c src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/status_helper.cc src/core/lib/gprpp/time.cc src/core/lib/iomgr/closure.cc @@ -14695,17 +14659,14 @@ add_executable(flow_control_test src/core/lib/iomgr/executor.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/promise/activity.cc - src/core/lib/promise/trace.cc src/core/lib/resource_quota/connection_quota.cc src/core/lib/resource_quota/memory_quota.cc src/core/lib/resource_quota/periodic_update.cc src/core/lib/resource_quota/resource_quota.cc src/core/lib/resource_quota/thread_quota.cc - src/core/lib/resource_quota/trace.cc src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc src/core/lib/slice/slice_buffer.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc src/core/lib/transport/bdp_estimator.cc test/core/transport/chttp2/flow_control_test.cc @@ -14754,6 +14715,7 @@ target_link_libraries(flow_control_test utf8_range_lib upb_message_lib absl::config + absl::flat_hash_map absl::function_ref absl::hash absl::type_traits @@ -14770,8 +14732,10 @@ add_executable(for_each_test src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c src/core/ext/upb-gen/google/rpc/status.upb_minitable.c src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/status_helper.cc src/core/lib/gprpp/time.cc src/core/lib/iomgr/closure.cc @@ -14781,17 +14745,14 @@ add_executable(for_each_test src/core/lib/iomgr/executor.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/promise/activity.cc - src/core/lib/promise/trace.cc src/core/lib/resource_quota/arena.cc src/core/lib/resource_quota/connection_quota.cc src/core/lib/resource_quota/memory_quota.cc src/core/lib/resource_quota/periodic_update.cc src/core/lib/resource_quota/resource_quota.cc src/core/lib/resource_quota/thread_quota.cc - src/core/lib/resource_quota/trace.cc src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc test/core/promise/for_each_test.cc third_party/upb/upb/mini_descriptor/build_enum.c @@ -14839,6 +14800,7 @@ target_link_libraries(for_each_test utf8_range_lib upb_message_lib absl::config + absl::flat_hash_map absl::function_ref absl::hash absl::type_traits @@ -14896,7 +14858,9 @@ if(gRPC_BUILD_TESTS) add_executable(forkable_test src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/event_engine/forkable.cc + src/core/lib/gprpp/glob.cc test/core/event_engine/forkable_test.cc ) if(WIN32 AND MSVC) @@ -14930,6 +14894,7 @@ target_include_directories(forkable_test target_link_libraries(forkable_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::flat_hash_map absl::statusor gpr ) @@ -15039,9 +15004,10 @@ if(gRPC_BUILD_TESTS) add_executable(frame_test src/core/ext/transport/chttp2/transport/frame.cc src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc + src/core/lib/gprpp/glob.cc src/core/lib/slice/slice.cc src/core/lib/slice/slice_buffer.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc test/core/transport/chttp2/frame_test.cc ) @@ -15076,6 +15042,7 @@ target_include_directories(frame_test target_link_libraries(frame_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::flat_hash_map absl::hash absl::statusor absl::span @@ -15249,6 +15216,48 @@ target_link_libraries(generic_end2end_test ) +endif() +if(gRPC_BUILD_TESTS) + +add_executable(glob_test + test/core/gprpp/glob_test.cc +) +if(WIN32 AND MSVC) + if(BUILD_SHARED_LIBS) + target_compile_definitions(glob_test + PRIVATE + "GPR_DLL_IMPORTS" + "GRPC_DLL_IMPORTS" + ) + endif() +endif() +target_compile_features(glob_test PUBLIC cxx_std_14) +target_include_directories(glob_test + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + ${_gRPC_RE2_INCLUDE_DIR} + ${_gRPC_SSL_INCLUDE_DIR} + ${_gRPC_UPB_GENERATED_DIR} + ${_gRPC_UPB_GRPC_GENERATED_DIR} + ${_gRPC_UPB_INCLUDE_DIR} + ${_gRPC_XXHASH_INCLUDE_DIR} + ${_gRPC_ZLIB_INCLUDE_DIR} + third_party/googletest/googletest/include + third_party/googletest/googletest + third_party/googletest/googlemock/include + third_party/googletest/googlemock + ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(glob_test + ${_gRPC_ALLTARGETS_LIBRARIES} + gtest + grpc_test_util +) + + endif() if(gRPC_BUILD_TESTS) @@ -15340,7 +15349,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(graceful_server_shutdown_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -15707,7 +15715,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(grpc_authz_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -17100,7 +17107,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(high_initial_seqno_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -17410,7 +17416,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(hpack_size_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -17567,7 +17572,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(http2_stats_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -18177,8 +18181,9 @@ if(gRPC_BUILD_TESTS) add_executable(inter_activity_pipe_test src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc + src/core/lib/gprpp/glob.cc src/core/lib/promise/activity.cc - src/core/lib/promise/trace.cc test/core/promise/inter_activity_pipe_test.cc ) if(WIN32 AND MSVC) @@ -18213,6 +18218,7 @@ target_link_libraries(inter_activity_pipe_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest absl::config + absl::flat_hash_map absl::hash absl::type_traits absl::statusor @@ -18242,7 +18248,6 @@ add_executable(interception_chain_test src/core/lib/channel/channel_stack.cc src/core/lib/channel/channel_stack_builder.cc src/core/lib/channel/channel_stack_builder_impl.cc - src/core/lib/channel/channel_stack_trace.cc src/core/lib/channel/connected_channel.cc src/core/lib/channel/promise_based_filter.cc src/core/lib/channel/status_util.cc @@ -18252,6 +18257,7 @@ add_executable(interception_chain_test src/core/lib/config/core_configuration.cc src/core/lib/debug/event_log.cc src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/event_engine/ares_resolver.cc src/core/lib/event_engine/cf_engine/cf_engine.cc src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc @@ -18289,7 +18295,6 @@ add_executable(interception_chain_test src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc src/core/lib/event_engine/time_util.cc - src/core/lib/event_engine/trace.cc src/core/lib/event_engine/utils.cc src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc src/core/lib/event_engine/windows/iocp.cc @@ -18302,6 +18307,7 @@ add_executable(interception_chain_test src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc src/core/lib/gprpp/dump_args.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/load_file.cc src/core/lib/gprpp/per_cpu.cc src/core/lib/gprpp/ref_counted_string.cc @@ -18326,7 +18332,6 @@ add_executable(interception_chain_test src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_poll_posix.cc src/core/lib/iomgr/ev_posix.cc - src/core/lib/iomgr/ev_windows.cc src/core/lib/iomgr/event_engine_shims/closure.cc src/core/lib/iomgr/event_engine_shims/endpoint.cc src/core/lib/iomgr/event_engine_shims/tcp_client.cc @@ -18389,7 +18394,6 @@ add_executable(interception_chain_test src/core/lib/iomgr/wakeup_fd_posix.cc src/core/lib/promise/activity.cc src/core/lib/promise/party.cc - src/core/lib/promise/trace.cc src/core/lib/resource_quota/api.cc src/core/lib/resource_quota/arena.cc src/core/lib/resource_quota/connection_quota.cc @@ -18397,7 +18401,6 @@ add_executable(interception_chain_test src/core/lib/resource_quota/periodic_update.cc src/core/lib/resource_quota/resource_quota.cc src/core/lib/resource_quota/thread_quota.cc - src/core/lib/resource_quota/trace.cc src/core/lib/security/certificate_provider/certificate_provider_registry.cc src/core/lib/security/credentials/alts/check_gcp_environment.cc src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc @@ -18409,9 +18412,7 @@ add_executable(interception_chain_test src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc src/core/lib/slice/slice_buffer.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc - src/core/lib/surface/api_trace.cc src/core/lib/surface/byte_buffer.cc src/core/lib/surface/byte_buffer_reader.cc src/core/lib/surface/call.cc @@ -18531,8 +18532,10 @@ add_executable(interceptor_list_test src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c src/core/ext/upb-gen/google/rpc/status.upb_minitable.c src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/status_helper.cc src/core/lib/gprpp/time.cc src/core/lib/iomgr/closure.cc @@ -18542,17 +18545,14 @@ add_executable(interceptor_list_test src/core/lib/iomgr/executor.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/promise/activity.cc - src/core/lib/promise/trace.cc src/core/lib/resource_quota/arena.cc src/core/lib/resource_quota/connection_quota.cc src/core/lib/resource_quota/memory_quota.cc src/core/lib/resource_quota/periodic_update.cc src/core/lib/resource_quota/resource_quota.cc src/core/lib/resource_quota/thread_quota.cc - src/core/lib/resource_quota/trace.cc src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc test/core/promise/interceptor_list_test.cc third_party/upb/upb/mini_descriptor/build_enum.c @@ -18600,6 +18600,7 @@ target_link_libraries(interceptor_list_test utf8_range_lib upb_message_lib absl::config + absl::flat_hash_map absl::function_ref absl::hash absl::type_traits @@ -18764,7 +18765,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(invoke_large_request_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -18924,7 +18924,8 @@ if(gRPC_BUILD_TESTS) add_executable(join_test src/core/lib/debug/trace.cc - src/core/lib/promise/trace.cc + src/core/lib/debug/trace_flags.cc + src/core/lib/gprpp/glob.cc test/core/promise/join_test.cc ) if(WIN32 AND MSVC) @@ -18958,6 +18959,7 @@ target_include_directories(join_test target_link_libraries(join_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::flat_hash_map absl::type_traits absl::statusor gpr @@ -19154,7 +19156,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(keepalive_timeout_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -19261,7 +19262,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(large_metadata_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -19326,8 +19326,9 @@ if(gRPC_BUILD_TESTS) add_executable(latch_test src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc + src/core/lib/gprpp/glob.cc src/core/lib/promise/activity.cc - src/core/lib/promise/trace.cc test/core/promise/latch_test.cc ) if(WIN32 AND MSVC) @@ -19362,6 +19363,7 @@ target_link_libraries(latch_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest absl::config + absl::flat_hash_map absl::hash absl::type_traits absl::statusor @@ -19691,7 +19693,8 @@ if(gRPC_BUILD_TESTS) add_executable(loop_test src/core/lib/debug/trace.cc - src/core/lib/promise/trace.cc + src/core/lib/debug/trace_flags.cc + src/core/lib/gprpp/glob.cc test/core/promise/loop_test.cc ) if(WIN32 AND MSVC) @@ -19725,6 +19728,7 @@ target_include_directories(loop_test target_link_libraries(loop_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::flat_hash_map absl::type_traits absl::statusor gpr @@ -19738,8 +19742,10 @@ add_executable(map_pipe_test src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c src/core/ext/upb-gen/google/rpc/status.upb_minitable.c src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/status_helper.cc src/core/lib/gprpp/time.cc src/core/lib/iomgr/closure.cc @@ -19749,17 +19755,14 @@ add_executable(map_pipe_test src/core/lib/iomgr/executor.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/promise/activity.cc - src/core/lib/promise/trace.cc src/core/lib/resource_quota/arena.cc src/core/lib/resource_quota/connection_quota.cc src/core/lib/resource_quota/memory_quota.cc src/core/lib/resource_quota/periodic_update.cc src/core/lib/resource_quota/resource_quota.cc src/core/lib/resource_quota/thread_quota.cc - src/core/lib/resource_quota/trace.cc src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc test/core/promise/map_pipe_test.cc third_party/upb/upb/mini_descriptor/build_enum.c @@ -19807,6 +19810,7 @@ target_link_libraries(map_pipe_test utf8_range_lib upb_message_lib absl::config + absl::flat_hash_map absl::function_ref absl::hash absl::type_traits @@ -19944,7 +19948,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(max_concurrent_streams_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -20008,7 +20011,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(max_connection_age_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -20072,7 +20074,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(max_connection_idle_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -20136,7 +20137,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(max_message_length_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -20819,7 +20819,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(negative_deadline_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -20915,7 +20914,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(no_logging_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -20979,7 +20977,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(no_op_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -21909,7 +21906,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(payload_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -22018,8 +22014,10 @@ add_executable(periodic_update_test src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c src/core/ext/upb-gen/google/rpc/status.upb_minitable.c src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/experiments/config.cc src/core/lib/experiments/experiments.cc + src/core/lib/gprpp/glob.cc src/core/lib/gprpp/status_helper.cc src/core/lib/gprpp/time.cc src/core/lib/iomgr/closure.cc @@ -22031,7 +22029,6 @@ add_executable(periodic_update_test src/core/lib/resource_quota/periodic_update.cc src/core/lib/slice/percent_encoding.cc src/core/lib/slice/slice.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc test/core/resource_quota/periodic_update_test.cc third_party/upb/upb/mini_descriptor/build_enum.c @@ -22078,6 +22075,7 @@ target_link_libraries(periodic_update_test gtest utf8_range_lib upb_message_lib + absl::flat_hash_map absl::function_ref absl::hash absl::statusor @@ -22283,7 +22281,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(ping_pong_streaming_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -22398,7 +22395,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(ping_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -23108,8 +23104,9 @@ if(gRPC_BUILD_TESTS) add_executable(promise_mutex_test src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc + src/core/lib/gprpp/glob.cc src/core/lib/promise/activity.cc - src/core/lib/promise/trace.cc test/core/promise/promise_mutex_test.cc ) if(WIN32 AND MSVC) @@ -23144,6 +23141,7 @@ target_link_libraries(promise_mutex_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest absl::config + absl::flat_hash_map absl::hash absl::type_traits absl::statusor @@ -23393,7 +23391,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(proxy_auth_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -23970,7 +23967,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(registered_call_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -24078,7 +24074,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(request_with_flags_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -24142,7 +24137,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(request_with_payload_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -24477,7 +24471,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(resource_quota_server_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -24583,7 +24576,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_cancel_after_first_attempt_starts_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -24647,7 +24639,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_cancel_during_delay_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -24711,7 +24702,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_cancel_with_multiple_send_batches_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -24775,7 +24765,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_cancellation_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -24839,7 +24828,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_disabled_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -24903,7 +24891,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_exceeds_buffer_size_in_delay_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -24967,7 +24954,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_exceeds_buffer_size_in_initial_batch_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25031,7 +25017,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_exceeds_buffer_size_in_subsequent_batch_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25095,7 +25080,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_lb_drop_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25159,7 +25143,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_lb_fail_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25223,7 +25206,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_non_retriable_status_before_trailers_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25287,7 +25269,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_non_retriable_status_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25351,7 +25332,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_per_attempt_recv_timeout_on_last_attempt_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25415,7 +25395,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_per_attempt_recv_timeout_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25479,7 +25458,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_recv_initial_metadata_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25543,7 +25521,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_recv_message_replay_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25607,7 +25584,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_recv_message_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25671,7 +25647,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_recv_trailing_metadata_error_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25735,7 +25710,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_send_initial_metadata_refs_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25799,7 +25773,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_send_op_fails_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25863,7 +25836,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_send_recv_batch_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25927,7 +25899,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_server_pushback_delay_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -25991,7 +25962,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_server_pushback_disabled_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -26097,7 +26067,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_streaming_after_commit_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -26161,7 +26130,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_streaming_succeeds_before_replay_finished_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -26225,7 +26193,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_streaming_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -26289,7 +26256,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -26395,7 +26361,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_throttled_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -26459,7 +26424,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_too_many_attempts_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -26523,7 +26487,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_transparent_goaway_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -26587,7 +26550,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_transparent_max_concurrent_streams_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -26651,7 +26613,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_transparent_not_sent_on_wire_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -26715,7 +26676,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_unref_before_finish_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -26779,7 +26739,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(retry_unref_before_recv_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -27245,7 +27204,8 @@ if(gRPC_BUILD_TESTS) add_executable(seq_test src/core/lib/debug/trace.cc - src/core/lib/promise/trace.cc + src/core/lib/debug/trace_flags.cc + src/core/lib/gprpp/glob.cc test/core/promise/seq_test.cc ) if(WIN32 AND MSVC) @@ -27279,6 +27239,7 @@ target_include_directories(seq_test target_link_libraries(seq_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::flat_hash_map absl::type_traits absl::statusor gpr @@ -27821,7 +27782,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(server_finishes_request_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -28106,7 +28066,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(server_streaming_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -28369,7 +28328,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(shutdown_finishes_calls_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -28433,7 +28391,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(shutdown_finishes_tags_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -28560,7 +28517,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(simple_delayed_request_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -28624,7 +28580,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(simple_metadata_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -28732,7 +28687,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(simple_request_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -28880,8 +28834,9 @@ if(gRPC_BUILD_TESTS) add_executable(slice_string_helpers_test src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc + src/core/lib/gprpp/glob.cc src/core/lib/slice/slice.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc test/core/slice/slice_string_helpers_test.cc ) @@ -28916,6 +28871,7 @@ target_include_directories(slice_string_helpers_test target_link_libraries(slice_string_helpers_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::flat_hash_map absl::hash absl::statusor gpr @@ -29659,7 +29615,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(streaming_error_response_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -30434,7 +30389,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(test_core_end2end_channelz_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -30591,13 +30545,14 @@ if(gRPC_BUILD_TESTS) add_executable(test_core_event_engine_slice_buffer_test src/core/lib/debug/trace.cc + src/core/lib/debug/trace_flags.cc src/core/lib/event_engine/event_engine.cc src/core/lib/event_engine/resolved_address.cc src/core/lib/event_engine/slice.cc src/core/lib/event_engine/slice_buffer.cc + src/core/lib/gprpp/glob.cc src/core/lib/slice/slice.cc src/core/lib/slice/slice_buffer.cc - src/core/lib/slice/slice_refcount.cc src/core/lib/slice/slice_string_helpers.cc test/core/event_engine/slice_buffer_test.cc ) @@ -30632,6 +30587,7 @@ target_include_directories(test_core_event_engine_slice_buffer_test target_link_libraries(test_core_event_engine_slice_buffer_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::flat_hash_map absl::hash absl::statusor absl::utility @@ -30929,7 +30885,6 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_POSIX) ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.cc ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h ${_gRPC_PROTO_GENS_DIR}/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.grpc.pb.h - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc src/core/ext/transport/chaotic_good/frame_header.cc @@ -31135,7 +31090,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(test_cpp_ext_chaotic_good_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -31696,7 +31650,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(timeout_before_request_call_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -32153,6 +32106,48 @@ target_link_libraries(too_many_pings_test ) +endif() +if(gRPC_BUILD_TESTS) + +add_executable(trace_flags_test + test/core/telemetry/trace_flags_test.cc +) +if(WIN32 AND MSVC) + if(BUILD_SHARED_LIBS) + target_compile_definitions(trace_flags_test + PRIVATE + "GPR_DLL_IMPORTS" + "GRPC_DLL_IMPORTS" + ) + endif() +endif() +target_compile_features(trace_flags_test PUBLIC cxx_std_14) +target_include_directories(trace_flags_test + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${_gRPC_ADDRESS_SORTING_INCLUDE_DIR} + ${_gRPC_RE2_INCLUDE_DIR} + ${_gRPC_SSL_INCLUDE_DIR} + ${_gRPC_UPB_GENERATED_DIR} + ${_gRPC_UPB_GRPC_GENERATED_DIR} + ${_gRPC_UPB_INCLUDE_DIR} + ${_gRPC_XXHASH_INCLUDE_DIR} + ${_gRPC_ZLIB_INCLUDE_DIR} + third_party/googletest/googletest/include + third_party/googletest/googletest + third_party/googletest/googlemock/include + third_party/googletest/googlemock + ${_gRPC_PROTO_GENS_DIR} +) + +target_link_libraries(trace_flags_test + ${_gRPC_ALLTARGETS_LIBRARIES} + gtest + grpc_test_util +) + + endif() if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) @@ -32201,7 +32196,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(trailing_metadata_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -32459,7 +32453,8 @@ if(gRPC_BUILD_TESTS) add_executable(try_join_test src/core/lib/debug/trace.cc - src/core/lib/promise/trace.cc + src/core/lib/debug/trace_flags.cc + src/core/lib/gprpp/glob.cc test/core/promise/try_join_test.cc ) if(WIN32 AND MSVC) @@ -32493,6 +32488,7 @@ target_include_directories(try_join_test target_link_libraries(try_join_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::flat_hash_map absl::type_traits absl::statusor absl::utility @@ -32547,7 +32543,8 @@ if(gRPC_BUILD_TESTS) add_executable(try_seq_test src/core/lib/debug/trace.cc - src/core/lib/promise/trace.cc + src/core/lib/debug/trace_flags.cc + src/core/lib/gprpp/glob.cc test/core/promise/try_seq_test.cc ) if(WIN32 AND MSVC) @@ -32581,6 +32578,7 @@ target_include_directories(try_seq_test target_link_libraries(try_seq_test ${_gRPC_ALLTARGETS_LIBRARIES} gtest + absl::flat_hash_map absl::type_traits absl::statusor gpr @@ -33450,7 +33448,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(write_buffering_at_end_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc @@ -33514,7 +33511,6 @@ endif() if(gRPC_BUILD_TESTS) add_executable(write_buffering_test - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc src/core/ext/transport/chaotic_good/client_transport.cc src/core/ext/transport/chaotic_good/frame.cc diff --git a/Makefile b/Makefile index 27c9f67b979..ccf8810741f 100644 --- a/Makefile +++ b/Makefile @@ -724,7 +724,6 @@ LIBGRPC_SRC = \ src/core/ext/transport/chttp2/transport/hpack_parser.cc \ src/core/ext/transport/chttp2/transport/hpack_parser_table.cc \ src/core/ext/transport/chttp2/transport/http2_settings.cc \ - src/core/ext/transport/chttp2/transport/http_trace.cc \ src/core/ext/transport/chttp2/transport/huffsyms.cc \ src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc \ src/core/ext/transport/chttp2/transport/parsing.cc \ @@ -735,7 +734,6 @@ LIBGRPC_SRC = \ src/core/ext/transport/chttp2/transport/varint.cc \ src/core/ext/transport/chttp2/transport/write_size_policy.cc \ src/core/ext/transport/chttp2/transport/writing.cc \ - src/core/ext/transport/inproc/inproc_plugin.cc \ src/core/ext/transport/inproc/inproc_transport.cc \ src/core/ext/transport/inproc/legacy_inproc_transport.cc \ src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.c \ @@ -1073,7 +1071,6 @@ LIBGRPC_SRC = \ src/core/lib/channel/channel_stack.cc \ src/core/lib/channel/channel_stack_builder.cc \ src/core/lib/channel/channel_stack_builder_impl.cc \ - src/core/lib/channel/channel_stack_trace.cc \ src/core/lib/channel/connected_channel.cc \ src/core/lib/channel/promise_based_filter.cc \ src/core/lib/channel/status_util.cc \ @@ -1086,6 +1083,7 @@ LIBGRPC_SRC = \ src/core/lib/config/load_config.cc \ src/core/lib/debug/event_log.cc \ src/core/lib/debug/trace.cc \ + src/core/lib/debug/trace_flags.cc \ src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ @@ -1124,7 +1122,6 @@ LIBGRPC_SRC = \ src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc \ src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc \ src/core/lib/event_engine/time_util.cc \ - src/core/lib/event_engine/trace.cc \ src/core/lib/event_engine/utils.cc \ src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc \ src/core/lib/event_engine/windows/iocp.cc \ @@ -1140,6 +1137,7 @@ LIBGRPC_SRC = \ src/core/lib/gprpp/dump_args.cc \ src/core/lib/gprpp/examine_stack.cc \ src/core/lib/gprpp/fork.cc \ + src/core/lib/gprpp/glob.cc \ src/core/lib/gprpp/host_port.cc \ src/core/lib/gprpp/linux/env.cc \ src/core/lib/gprpp/load_file.cc \ @@ -1179,7 +1177,6 @@ LIBGRPC_SRC = \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_poll_posix.cc \ src/core/lib/iomgr/ev_posix.cc \ - src/core/lib/iomgr/ev_windows.cc \ src/core/lib/iomgr/event_engine_shims/closure.cc \ src/core/lib/iomgr/event_engine_shims/endpoint.cc \ src/core/lib/iomgr/event_engine_shims/tcp_client.cc \ @@ -1244,7 +1241,6 @@ LIBGRPC_SRC = \ src/core/lib/promise/activity.cc \ src/core/lib/promise/party.cc \ src/core/lib/promise/sleep.cc \ - src/core/lib/promise/trace.cc \ src/core/lib/resource_quota/api.cc \ src/core/lib/resource_quota/arena.cc \ src/core/lib/resource_quota/connection_quota.cc \ @@ -1252,7 +1248,6 @@ LIBGRPC_SRC = \ src/core/lib/resource_quota/periodic_update.cc \ src/core/lib/resource_quota/resource_quota.cc \ src/core/lib/resource_quota/thread_quota.cc \ - src/core/lib/resource_quota/trace.cc \ src/core/lib/security/authorization/audit_logging.cc \ src/core/lib/security/authorization/authorization_policy_provider_vtable.cc \ src/core/lib/security/authorization/evaluate_args.cc \ @@ -1318,9 +1313,7 @@ LIBGRPC_SRC = \ src/core/lib/slice/percent_encoding.cc \ src/core/lib/slice/slice.cc \ src/core/lib/slice/slice_buffer.cc \ - src/core/lib/slice/slice_refcount.cc \ src/core/lib/slice/slice_string_helpers.cc \ - src/core/lib/surface/api_trace.cc \ src/core/lib/surface/byte_buffer.cc \ src/core/lib/surface/byte_buffer_reader.cc \ src/core/lib/surface/call.cc \ @@ -1411,7 +1404,6 @@ LIBGRPC_SRC = \ src/core/resolver/sockaddr/sockaddr_resolver.cc \ src/core/resolver/xds/xds_dependency_manager.cc \ src/core/resolver/xds/xds_resolver.cc \ - src/core/resolver/xds/xds_resolver_trace.cc \ src/core/server/server.cc \ src/core/server/server_call_tracer_filter.cc \ src/core/server/server_config_selector_filter.cc \ diff --git a/Package.swift b/Package.swift index 333123a6fcd..706e261a442 100644 --- a/Package.swift +++ b/Package.swift @@ -237,8 +237,6 @@ let package = Package( "src/core/ext/transport/chttp2/transport/hpack_parser_table.h", "src/core/ext/transport/chttp2/transport/http2_settings.cc", "src/core/ext/transport/chttp2/transport/http2_settings.h", - "src/core/ext/transport/chttp2/transport/http_trace.cc", - "src/core/ext/transport/chttp2/transport/http_trace.h", "src/core/ext/transport/chttp2/transport/huffsyms.cc", "src/core/ext/transport/chttp2/transport/huffsyms.h", "src/core/ext/transport/chttp2/transport/internal.h", @@ -258,7 +256,6 @@ let package = Package( "src/core/ext/transport/chttp2/transport/write_size_policy.cc", "src/core/ext/transport/chttp2/transport/write_size_policy.h", "src/core/ext/transport/chttp2/transport/writing.cc", - "src/core/ext/transport/inproc/inproc_plugin.cc", "src/core/ext/transport/inproc/inproc_transport.cc", "src/core/ext/transport/inproc/inproc_transport.h", "src/core/ext/transport/inproc/legacy_inproc_transport.cc", @@ -1103,8 +1100,6 @@ let package = Package( "src/core/lib/channel/channel_stack_builder.h", "src/core/lib/channel/channel_stack_builder_impl.cc", "src/core/lib/channel/channel_stack_builder_impl.h", - "src/core/lib/channel/channel_stack_trace.cc", - "src/core/lib/channel/channel_stack_trace.h", "src/core/lib/channel/connected_channel.cc", "src/core/lib/channel/connected_channel.h", "src/core/lib/channel/promise_based_filter.cc", @@ -1127,6 +1122,9 @@ let package = Package( "src/core/lib/debug/event_log.h", "src/core/lib/debug/trace.cc", "src/core/lib/debug/trace.h", + "src/core/lib/debug/trace_flags.cc", + "src/core/lib/debug/trace_flags.h", + "src/core/lib/debug/trace_impl.h", "src/core/lib/event_engine/ares_resolver.cc", "src/core/lib/event_engine/ares_resolver.h", "src/core/lib/event_engine/cf_engine/cf_engine.cc", @@ -1219,7 +1217,6 @@ let package = Package( "src/core/lib/event_engine/thready_event_engine/thready_event_engine.h", "src/core/lib/event_engine/time_util.cc", "src/core/lib/event_engine/time_util.h", - "src/core/lib/event_engine/trace.cc", "src/core/lib/event_engine/trace.h", "src/core/lib/event_engine/utils.cc", "src/core/lib/event_engine/utils.h", @@ -1262,6 +1259,8 @@ let package = Package( "src/core/lib/gprpp/examine_stack.h", "src/core/lib/gprpp/fork.cc", "src/core/lib/gprpp/fork.h", + "src/core/lib/gprpp/glob.cc", + "src/core/lib/gprpp/glob.h", "src/core/lib/gprpp/host_port.cc", "src/core/lib/gprpp/host_port.h", "src/core/lib/gprpp/if_list.h", @@ -1351,7 +1350,6 @@ let package = Package( "src/core/lib/iomgr/ev_poll_posix.h", "src/core/lib/iomgr/ev_posix.cc", "src/core/lib/iomgr/ev_posix.h", - "src/core/lib/iomgr/ev_windows.cc", "src/core/lib/iomgr/event_engine_shims/closure.cc", "src/core/lib/iomgr/event_engine_shims/closure.h", "src/core/lib/iomgr/event_engine_shims/endpoint.cc", @@ -1494,8 +1492,6 @@ let package = Package( "src/core/lib/promise/sleep.cc", "src/core/lib/promise/sleep.h", "src/core/lib/promise/status_flag.h", - "src/core/lib/promise/trace.cc", - "src/core/lib/promise/trace.h", "src/core/lib/promise/try_join.h", "src/core/lib/promise/try_seq.h", "src/core/lib/resource_quota/api.cc", @@ -1512,8 +1508,6 @@ let package = Package( "src/core/lib/resource_quota/resource_quota.h", "src/core/lib/resource_quota/thread_quota.cc", "src/core/lib/resource_quota/thread_quota.h", - "src/core/lib/resource_quota/trace.cc", - "src/core/lib/resource_quota/trace.h", "src/core/lib/security/authorization/audit_logging.cc", "src/core/lib/security/authorization/audit_logging.h", "src/core/lib/security/authorization/authorization_engine.h", @@ -1642,11 +1636,9 @@ let package = Package( "src/core/lib/slice/slice_buffer.cc", "src/core/lib/slice/slice_buffer.h", "src/core/lib/slice/slice_internal.h", - "src/core/lib/slice/slice_refcount.cc", "src/core/lib/slice/slice_refcount.h", "src/core/lib/slice/slice_string_helpers.cc", "src/core/lib/slice/slice_string_helpers.h", - "src/core/lib/surface/api_trace.cc", "src/core/lib/surface/api_trace.h", "src/core/lib/surface/byte_buffer.cc", "src/core/lib/surface/byte_buffer_reader.cc", @@ -1655,7 +1647,6 @@ let package = Package( "src/core/lib/surface/call_details.cc", "src/core/lib/surface/call_log_batch.cc", "src/core/lib/surface/call_test_only.h", - "src/core/lib/surface/call_trace.h", "src/core/lib/surface/call_utils.cc", "src/core/lib/surface/call_utils.h", "src/core/lib/surface/channel.cc", @@ -1823,8 +1814,6 @@ let package = Package( "src/core/resolver/xds/xds_dependency_manager.h", "src/core/resolver/xds/xds_resolver.cc", "src/core/resolver/xds/xds_resolver_attributes.h", - "src/core/resolver/xds/xds_resolver_trace.cc", - "src/core/resolver/xds/xds_resolver_trace.h", "src/core/server/server.cc", "src/core/server/server.h", "src/core/server/server_call_tracer_filter.cc", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 25a4cf13493..fa157a9fbae 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -284,7 +284,6 @@ libs: - src/core/ext/transport/chttp2/transport/hpack_parser.h - src/core/ext/transport/chttp2/transport/hpack_parser_table.h - src/core/ext/transport/chttp2/transport/http2_settings.h - - src/core/ext/transport/chttp2/transport/http_trace.h - src/core/ext/transport/chttp2/transport/huffsyms.h - src/core/ext/transport/chttp2/transport/internal.h - src/core/ext/transport/chttp2/transport/legacy_frame.h @@ -801,7 +800,6 @@ libs: - src/core/lib/channel/channel_stack.h - src/core/lib/channel/channel_stack_builder.h - src/core/lib/channel/channel_stack_builder_impl.h - - src/core/lib/channel/channel_stack_trace.h - src/core/lib/channel/connected_channel.h - src/core/lib/channel/promise_based_filter.h - src/core/lib/channel/status_util.h @@ -810,6 +808,8 @@ libs: - src/core/lib/config/core_configuration.h - src/core/lib/debug/event_log.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/ares_resolver.h - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h @@ -884,6 +884,7 @@ libs: - src/core/lib/gprpp/down_cast.h - src/core/lib/gprpp/dual_ref_counted.h - src/core/lib/gprpp/dump_args.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/if_list.h - src/core/lib/gprpp/load_file.h - src/core/lib/gprpp/manual_constructor.h @@ -1002,7 +1003,6 @@ libs: - src/core/lib/promise/seq.h - src/core/lib/promise/sleep.h - src/core/lib/promise/status_flag.h - - src/core/lib/promise/trace.h - src/core/lib/promise/try_join.h - src/core/lib/promise/try_seq.h - src/core/lib/resource_quota/api.h @@ -1012,7 +1012,6 @@ libs: - src/core/lib/resource_quota/periodic_update.h - src/core/lib/resource_quota/resource_quota.h - src/core/lib/resource_quota/thread_quota.h - - src/core/lib/resource_quota/trace.h - src/core/lib/security/authorization/audit_logging.h - src/core/lib/security/authorization/authorization_engine.h - src/core/lib/security/authorization/authorization_policy_provider.h @@ -1077,7 +1076,6 @@ libs: - src/core/lib/surface/api_trace.h - src/core/lib/surface/call.h - src/core/lib/surface/call_test_only.h - - src/core/lib/surface/call_trace.h - src/core/lib/surface/call_utils.h - src/core/lib/surface/channel.h - src/core/lib/surface/channel_create.h @@ -1160,7 +1158,6 @@ libs: - src/core/resolver/server_address.h - src/core/resolver/xds/xds_dependency_manager.h - src/core/resolver/xds/xds_resolver_attributes.h - - src/core/resolver/xds/xds_resolver_trace.h - src/core/server/server.h - src/core/server/server_call_tracer_filter.h - src/core/server/server_config_selector.h @@ -1310,7 +1307,6 @@ libs: - src/core/ext/transport/chttp2/transport/hpack_parser.cc - src/core/ext/transport/chttp2/transport/hpack_parser_table.cc - src/core/ext/transport/chttp2/transport/http2_settings.cc - - src/core/ext/transport/chttp2/transport/http_trace.cc - src/core/ext/transport/chttp2/transport/huffsyms.cc - src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc - src/core/ext/transport/chttp2/transport/parsing.cc @@ -1321,7 +1317,6 @@ libs: - src/core/ext/transport/chttp2/transport/varint.cc - src/core/ext/transport/chttp2/transport/write_size_policy.cc - src/core/ext/transport/chttp2/transport/writing.cc - - src/core/ext/transport/inproc/inproc_plugin.cc - src/core/ext/transport/inproc/inproc_transport.cc - src/core/ext/transport/inproc/legacy_inproc_transport.cc - src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.c @@ -1659,7 +1654,6 @@ libs: - src/core/lib/channel/channel_stack.cc - src/core/lib/channel/channel_stack_builder.cc - src/core/lib/channel/channel_stack_builder_impl.cc - - src/core/lib/channel/channel_stack_trace.cc - src/core/lib/channel/connected_channel.cc - src/core/lib/channel/promise_based_filter.cc - src/core/lib/channel/status_util.cc @@ -1669,6 +1663,7 @@ libs: - src/core/lib/config/core_configuration.cc - src/core/lib/debug/event_log.cc - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc @@ -1706,7 +1701,6 @@ libs: - src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc - src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc - src/core/lib/event_engine/time_util.cc - - src/core/lib/event_engine/trace.cc - src/core/lib/event_engine/utils.cc - src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc - src/core/lib/event_engine/windows/iocp.cc @@ -1719,6 +1713,7 @@ libs: - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc - src/core/lib/gprpp/dump_args.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/load_file.cc - src/core/lib/gprpp/per_cpu.cc - src/core/lib/gprpp/posix/directory_reader.cc @@ -1746,7 +1741,6 @@ libs: - src/core/lib/iomgr/ev_epoll1_linux.cc - src/core/lib/iomgr/ev_poll_posix.cc - src/core/lib/iomgr/ev_posix.cc - - src/core/lib/iomgr/ev_windows.cc - src/core/lib/iomgr/event_engine_shims/closure.cc - src/core/lib/iomgr/event_engine_shims/endpoint.cc - src/core/lib/iomgr/event_engine_shims/tcp_client.cc @@ -1811,7 +1805,6 @@ libs: - src/core/lib/promise/activity.cc - src/core/lib/promise/party.cc - src/core/lib/promise/sleep.cc - - src/core/lib/promise/trace.cc - src/core/lib/resource_quota/api.cc - src/core/lib/resource_quota/arena.cc - src/core/lib/resource_quota/connection_quota.cc @@ -1819,7 +1812,6 @@ libs: - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/resource_quota/resource_quota.cc - src/core/lib/resource_quota/thread_quota.cc - - src/core/lib/resource_quota/trace.cc - src/core/lib/security/authorization/audit_logging.cc - src/core/lib/security/authorization/authorization_policy_provider_vtable.cc - src/core/lib/security/authorization/evaluate_args.cc @@ -1885,9 +1877,7 @@ libs: - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - src/core/lib/slice/slice_buffer.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - - src/core/lib/surface/api_trace.cc - src/core/lib/surface/byte_buffer.cc - src/core/lib/surface/byte_buffer_reader.cc - src/core/lib/surface/call.cc @@ -1978,7 +1968,6 @@ libs: - src/core/resolver/sockaddr/sockaddr_resolver.cc - src/core/resolver/xds/xds_dependency_manager.cc - src/core/resolver/xds/xds_resolver.cc - - src/core/resolver/xds/xds_resolver_trace.cc - src/core/server/server.cc - src/core/server/server_call_tracer_filter.cc - src/core/server/server_config_selector_filter.cc @@ -2276,7 +2265,6 @@ libs: - src/core/ext/transport/chttp2/transport/hpack_parser.h - src/core/ext/transport/chttp2/transport/hpack_parser_table.h - src/core/ext/transport/chttp2/transport/http2_settings.h - - src/core/ext/transport/chttp2/transport/http_trace.h - src/core/ext/transport/chttp2/transport/huffsyms.h - src/core/ext/transport/chttp2/transport/internal.h - src/core/ext/transport/chttp2/transport/legacy_frame.h @@ -2349,7 +2337,6 @@ libs: - src/core/lib/channel/channel_stack.h - src/core/lib/channel/channel_stack_builder.h - src/core/lib/channel/channel_stack_builder_impl.h - - src/core/lib/channel/channel_stack_trace.h - src/core/lib/channel/connected_channel.h - src/core/lib/channel/promise_based_filter.h - src/core/lib/channel/status_util.h @@ -2358,6 +2345,8 @@ libs: - src/core/lib/config/core_configuration.h - src/core/lib/debug/event_log.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/ares_resolver.h - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h @@ -2431,6 +2420,7 @@ libs: - src/core/lib/gprpp/down_cast.h - src/core/lib/gprpp/dual_ref_counted.h - src/core/lib/gprpp/dump_args.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/if_list.h - src/core/lib/gprpp/load_file.h - src/core/lib/gprpp/manual_constructor.h @@ -2547,7 +2537,6 @@ libs: - src/core/lib/promise/seq.h - src/core/lib/promise/sleep.h - src/core/lib/promise/status_flag.h - - src/core/lib/promise/trace.h - src/core/lib/promise/try_join.h - src/core/lib/promise/try_seq.h - src/core/lib/resource_quota/api.h @@ -2557,7 +2546,6 @@ libs: - src/core/lib/resource_quota/periodic_update.h - src/core/lib/resource_quota/resource_quota.h - src/core/lib/resource_quota/thread_quota.h - - src/core/lib/resource_quota/trace.h - src/core/lib/security/authorization/authorization_engine.h - src/core/lib/security/authorization/authorization_policy_provider.h - src/core/lib/security/authorization/evaluate_args.h @@ -2591,7 +2579,6 @@ libs: - src/core/lib/surface/api_trace.h - src/core/lib/surface/call.h - src/core/lib/surface/call_test_only.h - - src/core/lib/surface/call_trace.h - src/core/lib/surface/call_utils.h - src/core/lib/surface/channel.h - src/core/lib/surface/channel_create.h @@ -2771,7 +2758,6 @@ libs: - src/core/ext/transport/chttp2/transport/hpack_parser.cc - src/core/ext/transport/chttp2/transport/hpack_parser_table.cc - src/core/ext/transport/chttp2/transport/http2_settings.cc - - src/core/ext/transport/chttp2/transport/http_trace.cc - src/core/ext/transport/chttp2/transport/huffsyms.cc - src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc - src/core/ext/transport/chttp2/transport/parsing.cc @@ -2782,7 +2768,6 @@ libs: - src/core/ext/transport/chttp2/transport/varint.cc - src/core/ext/transport/chttp2/transport/write_size_policy.cc - src/core/ext/transport/chttp2/transport/writing.cc - - src/core/ext/transport/inproc/inproc_plugin.cc - src/core/ext/transport/inproc/inproc_transport.cc - src/core/ext/transport/inproc/legacy_inproc_transport.cc - src/core/ext/upb-gen/google/api/annotations.upb_minitable.c @@ -2822,7 +2807,6 @@ libs: - src/core/lib/channel/channel_stack.cc - src/core/lib/channel/channel_stack_builder.cc - src/core/lib/channel/channel_stack_builder_impl.cc - - src/core/lib/channel/channel_stack_trace.cc - src/core/lib/channel/connected_channel.cc - src/core/lib/channel/promise_based_filter.cc - src/core/lib/channel/status_util.cc @@ -2832,6 +2816,7 @@ libs: - src/core/lib/config/core_configuration.cc - src/core/lib/debug/event_log.cc - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc @@ -2869,7 +2854,6 @@ libs: - src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc - src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc - src/core/lib/event_engine/time_util.cc - - src/core/lib/event_engine/trace.cc - src/core/lib/event_engine/utils.cc - src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc - src/core/lib/event_engine/windows/iocp.cc @@ -2882,6 +2866,7 @@ libs: - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc - src/core/lib/gprpp/dump_args.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/load_file.cc - src/core/lib/gprpp/per_cpu.cc - src/core/lib/gprpp/ref_counted_string.cc @@ -2907,7 +2892,6 @@ libs: - src/core/lib/iomgr/ev_epoll1_linux.cc - src/core/lib/iomgr/ev_poll_posix.cc - src/core/lib/iomgr/ev_posix.cc - - src/core/lib/iomgr/ev_windows.cc - src/core/lib/iomgr/event_engine_shims/closure.cc - src/core/lib/iomgr/event_engine_shims/endpoint.cc - src/core/lib/iomgr/event_engine_shims/tcp_client.cc @@ -2971,7 +2955,6 @@ libs: - src/core/lib/promise/activity.cc - src/core/lib/promise/party.cc - src/core/lib/promise/sleep.cc - - src/core/lib/promise/trace.cc - src/core/lib/resource_quota/api.cc - src/core/lib/resource_quota/arena.cc - src/core/lib/resource_quota/connection_quota.cc @@ -2979,7 +2962,6 @@ libs: - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/resource_quota/resource_quota.cc - src/core/lib/resource_quota/thread_quota.cc - - src/core/lib/resource_quota/trace.cc - src/core/lib/security/authorization/authorization_policy_provider_vtable.cc - src/core/lib/security/authorization/evaluate_args.cc - src/core/lib/security/authorization/grpc_server_authz_filter.cc @@ -3011,9 +2993,7 @@ libs: - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - src/core/lib/slice/slice_buffer.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - - src/core/lib/surface/api_trace.cc - src/core/lib/surface/byte_buffer.cc - src/core/lib/surface/byte_buffer_reader.cc - src/core/lib/surface/call.cc @@ -4450,7 +4430,6 @@ libs: - src/core/lib/channel/channel_stack.h - src/core/lib/channel/channel_stack_builder.h - src/core/lib/channel/channel_stack_builder_impl.h - - src/core/lib/channel/channel_stack_trace.h - src/core/lib/channel/connected_channel.h - src/core/lib/channel/promise_based_filter.h - src/core/lib/channel/status_util.h @@ -4459,6 +4438,8 @@ libs: - src/core/lib/config/core_configuration.h - src/core/lib/debug/event_log.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/ares_resolver.h - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h @@ -4532,6 +4513,7 @@ libs: - src/core/lib/gprpp/down_cast.h - src/core/lib/gprpp/dual_ref_counted.h - src/core/lib/gprpp/dump_args.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/if_list.h - src/core/lib/gprpp/load_file.h - src/core/lib/gprpp/manual_constructor.h @@ -4646,7 +4628,6 @@ libs: - src/core/lib/promise/race.h - src/core/lib/promise/seq.h - src/core/lib/promise/status_flag.h - - src/core/lib/promise/trace.h - src/core/lib/promise/try_seq.h - src/core/lib/resource_quota/api.h - src/core/lib/resource_quota/arena.h @@ -4655,7 +4636,6 @@ libs: - src/core/lib/resource_quota/periodic_update.h - src/core/lib/resource_quota/resource_quota.h - src/core/lib/resource_quota/thread_quota.h - - src/core/lib/resource_quota/trace.h - src/core/lib/security/authorization/audit_logging.h - src/core/lib/security/authorization/authorization_engine.h - src/core/lib/security/authorization/authorization_policy_provider.h @@ -4692,7 +4672,6 @@ libs: - src/core/lib/surface/api_trace.h - src/core/lib/surface/call.h - src/core/lib/surface/call_test_only.h - - src/core/lib/surface/call_trace.h - src/core/lib/surface/call_utils.h - src/core/lib/surface/channel.h - src/core/lib/surface/channel_init.h @@ -4799,7 +4778,6 @@ libs: - src/core/lib/channel/channel_stack.cc - src/core/lib/channel/channel_stack_builder.cc - src/core/lib/channel/channel_stack_builder_impl.cc - - src/core/lib/channel/channel_stack_trace.cc - src/core/lib/channel/connected_channel.cc - src/core/lib/channel/promise_based_filter.cc - src/core/lib/channel/status_util.cc @@ -4809,6 +4787,7 @@ libs: - src/core/lib/config/core_configuration.cc - src/core/lib/debug/event_log.cc - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc @@ -4846,7 +4825,6 @@ libs: - src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc - src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc - src/core/lib/event_engine/time_util.cc - - src/core/lib/event_engine/trace.cc - src/core/lib/event_engine/utils.cc - src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc - src/core/lib/event_engine/windows/iocp.cc @@ -4859,6 +4837,7 @@ libs: - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc - src/core/lib/gprpp/dump_args.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/load_file.cc - src/core/lib/gprpp/per_cpu.cc - src/core/lib/gprpp/ref_counted_string.cc @@ -4883,7 +4862,6 @@ libs: - src/core/lib/iomgr/ev_epoll1_linux.cc - src/core/lib/iomgr/ev_poll_posix.cc - src/core/lib/iomgr/ev_posix.cc - - src/core/lib/iomgr/ev_windows.cc - src/core/lib/iomgr/event_engine_shims/closure.cc - src/core/lib/iomgr/event_engine_shims/endpoint.cc - src/core/lib/iomgr/event_engine_shims/tcp_client.cc @@ -4947,7 +4925,6 @@ libs: - src/core/lib/matchers/matchers.cc - src/core/lib/promise/activity.cc - src/core/lib/promise/party.cc - - src/core/lib/promise/trace.cc - src/core/lib/resource_quota/api.cc - src/core/lib/resource_quota/arena.cc - src/core/lib/resource_quota/connection_quota.cc @@ -4955,7 +4932,6 @@ libs: - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/resource_quota/resource_quota.cc - src/core/lib/resource_quota/thread_quota.cc - - src/core/lib/resource_quota/trace.cc - src/core/lib/security/authorization/audit_logging.cc - src/core/lib/security/authorization/authorization_policy_provider_vtable.cc - src/core/lib/security/authorization/evaluate_args.cc @@ -4990,9 +4966,7 @@ libs: - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - src/core/lib/slice/slice_buffer.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - - src/core/lib/surface/api_trace.cc - src/core/lib/surface/byte_buffer.cc - src/core/lib/surface/byte_buffer_reader.cc - src/core/lib/surface/call.cc @@ -5254,10 +5228,13 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/event_engine_context.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/down_cast.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted_ptr.h @@ -5274,17 +5251,18 @@ targets: - src/core/lib/promise/poll.h - src/core/lib/promise/promise.h - src/core/lib/promise/seq.h - - src/core/lib/promise/trace.h - src/core/lib/promise/wait_set.h - test/core/promise/test_wakeup_schedulers.h src: - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/promise/activity.cc - - src/core/lib/promise/trace.cc - test/core/promise/activity_test.cc deps: - gtest - absl/base:config + - absl/container:flat_hash_map - absl/hash:hash - absl/meta:type_traits - absl/status:statusor @@ -5409,7 +5387,10 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/gprpp/bitset.h + - src/core/lib/gprpp/glob.h - src/core/lib/promise/all_ok.h - src/core/lib/promise/detail/join_state.h - src/core/lib/promise/detail/promise_like.h @@ -5417,13 +5398,14 @@ targets: - src/core/lib/promise/map.h - src/core/lib/promise/poll.h - src/core/lib/promise/status_flag.h - - src/core/lib/promise/trace.h src: - src/core/lib/debug/trace.cc - - src/core/lib/promise/trace.cc + - src/core/lib/debug/trace_flags.cc + - src/core/lib/gprpp/glob.cc - test/core/promise/all_ok_test.cc deps: - gtest + - absl/container:flat_hash_map - absl/meta:type_traits - absl/status:statusor - absl/utility:utility @@ -5872,7 +5854,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -6100,7 +6081,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -6367,7 +6347,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -6406,6 +6385,8 @@ targets: - src/core/lib/channel/channel_args.h - src/core/lib/compression/compression_internal.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h @@ -6416,6 +6397,7 @@ targets: - src/core/lib/gprpp/down_cast.h - src/core/lib/gprpp/dual_ref_counted.h - src/core/lib/gprpp/dump_args.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/if_list.h - src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/orphanable.h @@ -6450,14 +6432,12 @@ targets: - src/core/lib/promise/race.h - src/core/lib/promise/seq.h - src/core/lib/promise/status_flag.h - - src/core/lib/promise/trace.h - src/core/lib/resource_quota/arena.h - src/core/lib/resource_quota/connection_quota.h - src/core/lib/resource_quota/memory_quota.h - src/core/lib/resource_quota/periodic_update.h - src/core/lib/resource_quota/resource_quota.h - src/core/lib/resource_quota/thread_quota.h - - src/core/lib/resource_quota/trace.h - src/core/lib/slice/percent_encoding.h - src/core/lib/slice/slice.h - src/core/lib/slice/slice_buffer.h @@ -6507,9 +6487,11 @@ targets: - src/core/lib/compression/compression.cc - src/core/lib/compression/compression_internal.cc - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc - src/core/lib/gprpp/dump_args.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/ref_counted_string.cc - src/core/lib/gprpp/status_helper.cc - src/core/lib/gprpp/time.cc @@ -6520,20 +6502,16 @@ targets: - src/core/lib/iomgr/executor.cc - src/core/lib/iomgr/iomgr_internal.cc - src/core/lib/promise/activity.cc - - src/core/lib/promise/trace.cc - src/core/lib/resource_quota/arena.cc - src/core/lib/resource_quota/connection_quota.cc - src/core/lib/resource_quota/memory_quota.cc - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/resource_quota/resource_quota.cc - src/core/lib/resource_quota/thread_quota.cc - - src/core/lib/resource_quota/trace.cc - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - src/core/lib/slice/slice_buffer.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - - src/core/lib/surface/api_trace.cc - src/core/lib/surface/channel_stack_type.cc - src/core/lib/transport/call_filters.cc - src/core/lib/transport/call_final_info.cc @@ -6561,6 +6539,7 @@ targets: - upb_message_lib - absl/base:config - absl/base:no_destructor + - absl/container:flat_hash_map - absl/container:inlined_vector - absl/functional:function_ref - absl/hash:hash @@ -6619,7 +6598,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -6691,7 +6669,6 @@ targets: - src/core/lib/channel/channel_stack.h - src/core/lib/channel/channel_stack_builder.h - src/core/lib/channel/channel_stack_builder_impl.h - - src/core/lib/channel/channel_stack_trace.h - src/core/lib/channel/connected_channel.h - src/core/lib/channel/promise_based_filter.h - src/core/lib/channel/status_util.h @@ -6700,6 +6677,8 @@ targets: - src/core/lib/config/core_configuration.h - src/core/lib/debug/event_log.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/ares_resolver.h - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h @@ -6773,6 +6752,7 @@ targets: - src/core/lib/gprpp/down_cast.h - src/core/lib/gprpp/dual_ref_counted.h - src/core/lib/gprpp/dump_args.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/if_list.h - src/core/lib/gprpp/load_file.h - src/core/lib/gprpp/manual_constructor.h @@ -6886,7 +6866,6 @@ targets: - src/core/lib/promise/race.h - src/core/lib/promise/seq.h - src/core/lib/promise/status_flag.h - - src/core/lib/promise/trace.h - src/core/lib/promise/try_seq.h - src/core/lib/resource_quota/api.h - src/core/lib/resource_quota/arena.h @@ -6895,7 +6874,6 @@ targets: - src/core/lib/resource_quota/periodic_update.h - src/core/lib/resource_quota/resource_quota.h - src/core/lib/resource_quota/thread_quota.h - - src/core/lib/resource_quota/trace.h - src/core/lib/security/certificate_provider/certificate_provider_factory.h - src/core/lib/security/certificate_provider/certificate_provider_registry.h - src/core/lib/security/credentials/alts/check_gcp_environment.h @@ -6910,7 +6888,6 @@ targets: - src/core/lib/surface/api_trace.h - src/core/lib/surface/call.h - src/core/lib/surface/call_test_only.h - - src/core/lib/surface/call_trace.h - src/core/lib/surface/call_utils.h - src/core/lib/surface/channel.h - src/core/lib/surface/channel_init.h @@ -7009,7 +6986,6 @@ targets: - src/core/lib/channel/channel_stack.cc - src/core/lib/channel/channel_stack_builder.cc - src/core/lib/channel/channel_stack_builder_impl.cc - - src/core/lib/channel/channel_stack_trace.cc - src/core/lib/channel/connected_channel.cc - src/core/lib/channel/promise_based_filter.cc - src/core/lib/channel/status_util.cc @@ -7019,6 +6995,7 @@ targets: - src/core/lib/config/core_configuration.cc - src/core/lib/debug/event_log.cc - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc @@ -7056,7 +7033,6 @@ targets: - src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc - src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc - src/core/lib/event_engine/time_util.cc - - src/core/lib/event_engine/trace.cc - src/core/lib/event_engine/utils.cc - src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc - src/core/lib/event_engine/windows/iocp.cc @@ -7069,6 +7045,7 @@ targets: - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc - src/core/lib/gprpp/dump_args.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/load_file.cc - src/core/lib/gprpp/per_cpu.cc - src/core/lib/gprpp/ref_counted_string.cc @@ -7093,7 +7070,6 @@ targets: - src/core/lib/iomgr/ev_epoll1_linux.cc - src/core/lib/iomgr/ev_poll_posix.cc - src/core/lib/iomgr/ev_posix.cc - - src/core/lib/iomgr/ev_windows.cc - src/core/lib/iomgr/event_engine_shims/closure.cc - src/core/lib/iomgr/event_engine_shims/endpoint.cc - src/core/lib/iomgr/event_engine_shims/tcp_client.cc @@ -7156,7 +7132,6 @@ targets: - src/core/lib/iomgr/wakeup_fd_posix.cc - src/core/lib/promise/activity.cc - src/core/lib/promise/party.cc - - src/core/lib/promise/trace.cc - src/core/lib/resource_quota/api.cc - src/core/lib/resource_quota/arena.cc - src/core/lib/resource_quota/connection_quota.cc @@ -7164,7 +7139,6 @@ targets: - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/resource_quota/resource_quota.cc - src/core/lib/resource_quota/thread_quota.cc - - src/core/lib/resource_quota/trace.cc - src/core/lib/security/certificate_provider/certificate_provider_registry.cc - src/core/lib/security/credentials/alts/check_gcp_environment.cc - src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc @@ -7176,9 +7150,7 @@ targets: - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - src/core/lib/slice/slice_buffer.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - - src/core/lib/surface/api_trace.cc - src/core/lib/surface/byte_buffer.cc - src/core/lib/surface/byte_buffer_reader.cc - src/core/lib/surface/call.cc @@ -7297,7 +7269,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -7362,7 +7333,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -7427,7 +7397,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -7492,7 +7461,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -7574,7 +7542,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -7610,6 +7577,8 @@ targets: - src/core/ext/upb-gen/google/rpc/status.upb.h - src/core/ext/upb-gen/google/rpc/status.upb_minitable.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h @@ -7617,6 +7586,7 @@ targets: - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/down_cast.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/ref_counted.h @@ -7643,14 +7613,12 @@ targets: - src/core/lib/promise/poll.h - src/core/lib/promise/race.h - src/core/lib/promise/seq.h - - src/core/lib/promise/trace.h - src/core/lib/resource_quota/arena.h - src/core/lib/resource_quota/connection_quota.h - src/core/lib/resource_quota/memory_quota.h - src/core/lib/resource_quota/periodic_update.h - src/core/lib/resource_quota/resource_quota.h - src/core/lib/resource_quota/thread_quota.h - - src/core/lib/resource_quota/trace.h - src/core/lib/slice/percent_encoding.h - src/core/lib/slice/slice.h - src/core/lib/slice/slice_internal.h @@ -7680,8 +7648,10 @@ targets: - src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c - src/core/ext/upb-gen/google/rpc/status.upb_minitable.c - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/status_helper.cc - src/core/lib/gprpp/time.cc - src/core/lib/iomgr/closure.cc @@ -7691,17 +7661,14 @@ targets: - src/core/lib/iomgr/executor.cc - src/core/lib/iomgr/iomgr_internal.cc - src/core/lib/promise/activity.cc - - src/core/lib/promise/trace.cc - src/core/lib/resource_quota/arena.cc - src/core/lib/resource_quota/connection_quota.cc - src/core/lib/resource_quota/memory_quota.cc - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/resource_quota/resource_quota.cc - src/core/lib/resource_quota/thread_quota.cc - - src/core/lib/resource_quota/trace.cc - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - test/core/promise/cancel_callback_test.cc - third_party/upb/upb/mini_descriptor/build_enum.c @@ -7719,6 +7686,7 @@ targets: - utf8_range_lib - upb_message_lib - absl/base:config + - absl/container:flat_hash_map - absl/functional:function_ref - absl/hash:hash - absl/meta:type_traits @@ -7764,7 +7732,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -7829,7 +7796,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -8429,6 +8395,8 @@ targets: - src/core/ext/upb-gen/google/rpc/status.upb.h - src/core/ext/upb-gen/google/rpc/status.upb_minitable.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h @@ -8437,6 +8405,7 @@ targets: - src/core/lib/gprpp/chunked_vector.h - src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/down_cast.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/ref_counted.h @@ -8462,14 +8431,12 @@ targets: - src/core/lib/promise/poll.h - src/core/lib/promise/race.h - src/core/lib/promise/seq.h - - src/core/lib/promise/trace.h - src/core/lib/resource_quota/arena.h - src/core/lib/resource_quota/connection_quota.h - src/core/lib/resource_quota/memory_quota.h - src/core/lib/resource_quota/periodic_update.h - src/core/lib/resource_quota/resource_quota.h - src/core/lib/resource_quota/thread_quota.h - - src/core/lib/resource_quota/trace.h - src/core/lib/slice/percent_encoding.h - src/core/lib/slice/slice.h - src/core/lib/slice/slice_internal.h @@ -8499,8 +8466,10 @@ targets: - src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c - src/core/ext/upb-gen/google/rpc/status.upb_minitable.c - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/status_helper.cc - src/core/lib/gprpp/time.cc - src/core/lib/iomgr/closure.cc @@ -8510,17 +8479,14 @@ targets: - src/core/lib/iomgr/executor.cc - src/core/lib/iomgr/iomgr_internal.cc - src/core/lib/promise/activity.cc - - src/core/lib/promise/trace.cc - src/core/lib/resource_quota/arena.cc - src/core/lib/resource_quota/connection_quota.cc - src/core/lib/resource_quota/memory_quota.cc - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/resource_quota/resource_quota.cc - src/core/lib/resource_quota/thread_quota.cc - - src/core/lib/resource_quota/trace.cc - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - test/core/gprpp/chunked_vector_test.cc - third_party/upb/upb/mini_descriptor/build_enum.c @@ -8538,6 +8504,7 @@ targets: - utf8_range_lib - upb_message_lib - absl/base:config + - absl/container:flat_hash_map - absl/functional:function_ref - absl/hash:hash - absl/meta:type_traits @@ -8816,7 +8783,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -8992,7 +8958,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -9156,7 +9121,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -9327,7 +9291,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -9429,7 +9392,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -9581,7 +9543,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -10018,12 +9979,15 @@ targets: - src/core/ext/upb-gen/google/rpc/status.upb.h - src/core/ext/upb-gen/google/rpc/status.upb_minitable.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/down_cast.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/ref_counted.h @@ -10072,8 +10036,10 @@ targets: - src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c - src/core/ext/upb-gen/google/rpc/status.upb_minitable.c - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/status_helper.cc - src/core/lib/gprpp/time.cc - src/core/lib/iomgr/closure.cc @@ -10085,7 +10051,6 @@ targets: - src/core/lib/promise/activity.cc - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - test/core/promise/exec_ctx_wakeup_scheduler_test.cc - third_party/upb/upb/mini_descriptor/build_enum.c @@ -10103,6 +10068,7 @@ targets: - utf8_range_lib - upb_message_lib - absl/base:config + - absl/container:flat_hash_map - absl/hash:hash - absl/meta:type_traits - absl/status:statusor @@ -10370,7 +10336,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -10435,7 +10400,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -10518,7 +10482,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -10574,6 +10537,8 @@ targets: - src/core/ext/upb-gen/google/rpc/status.upb.h - src/core/ext/upb-gen/google/rpc/status.upb_minitable.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h @@ -10581,6 +10546,7 @@ targets: - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/down_cast.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/ref_counted.h @@ -10606,13 +10572,11 @@ targets: - src/core/lib/promise/poll.h - src/core/lib/promise/race.h - src/core/lib/promise/seq.h - - src/core/lib/promise/trace.h - src/core/lib/resource_quota/connection_quota.h - src/core/lib/resource_quota/memory_quota.h - src/core/lib/resource_quota/periodic_update.h - src/core/lib/resource_quota/resource_quota.h - src/core/lib/resource_quota/thread_quota.h - - src/core/lib/resource_quota/trace.h - src/core/lib/slice/percent_encoding.h - src/core/lib/slice/slice.h - src/core/lib/slice/slice_buffer.h @@ -10648,8 +10612,10 @@ targets: - src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c - src/core/ext/upb-gen/google/rpc/status.upb_minitable.c - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/status_helper.cc - src/core/lib/gprpp/time.cc - src/core/lib/iomgr/closure.cc @@ -10659,17 +10625,14 @@ targets: - src/core/lib/iomgr/executor.cc - src/core/lib/iomgr/iomgr_internal.cc - src/core/lib/promise/activity.cc - - src/core/lib/promise/trace.cc - src/core/lib/resource_quota/connection_quota.cc - src/core/lib/resource_quota/memory_quota.cc - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/resource_quota/resource_quota.cc - src/core/lib/resource_quota/thread_quota.cc - - src/core/lib/resource_quota/trace.cc - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - src/core/lib/slice/slice_buffer.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - src/core/lib/transport/bdp_estimator.cc - test/core/transport/chttp2/flow_control_test.cc @@ -10688,6 +10651,7 @@ targets: - utf8_range_lib - upb_message_lib - absl/base:config + - absl/container:flat_hash_map - absl/functional:function_ref - absl/hash:hash - absl/meta:type_traits @@ -10705,6 +10669,8 @@ targets: - src/core/ext/upb-gen/google/rpc/status.upb.h - src/core/ext/upb-gen/google/rpc/status.upb_minitable.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h @@ -10712,6 +10678,7 @@ targets: - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/down_cast.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/ref_counted.h @@ -10745,7 +10712,6 @@ targets: - src/core/lib/promise/race.h - src/core/lib/promise/seq.h - src/core/lib/promise/status_flag.h - - src/core/lib/promise/trace.h - src/core/lib/promise/try_seq.h - src/core/lib/resource_quota/arena.h - src/core/lib/resource_quota/connection_quota.h @@ -10753,7 +10719,6 @@ targets: - src/core/lib/resource_quota/periodic_update.h - src/core/lib/resource_quota/resource_quota.h - src/core/lib/resource_quota/thread_quota.h - - src/core/lib/resource_quota/trace.h - src/core/lib/slice/percent_encoding.h - src/core/lib/slice/slice.h - src/core/lib/slice/slice_internal.h @@ -10784,8 +10749,10 @@ targets: - src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c - src/core/ext/upb-gen/google/rpc/status.upb_minitable.c - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/status_helper.cc - src/core/lib/gprpp/time.cc - src/core/lib/iomgr/closure.cc @@ -10795,17 +10762,14 @@ targets: - src/core/lib/iomgr/executor.cc - src/core/lib/iomgr/iomgr_internal.cc - src/core/lib/promise/activity.cc - - src/core/lib/promise/trace.cc - src/core/lib/resource_quota/arena.cc - src/core/lib/resource_quota/connection_quota.cc - src/core/lib/resource_quota/memory_quota.cc - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/resource_quota/resource_quota.cc - src/core/lib/resource_quota/thread_quota.cc - - src/core/lib/resource_quota/trace.cc - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - test/core/promise/for_each_test.cc - third_party/upb/upb/mini_descriptor/build_enum.c @@ -10823,6 +10787,7 @@ targets: - utf8_range_lib - upb_message_lib - absl/base:config + - absl/container:flat_hash_map - absl/functional:function_ref - absl/hash:hash - absl/meta:type_traits @@ -10850,13 +10815,19 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/forkable.h + - src/core/lib/gprpp/glob.h src: - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/event_engine/forkable.cc + - src/core/lib/gprpp/glob.cc - test/core/event_engine/forkable_test.cc deps: - gtest + - absl/container:flat_hash_map - absl/status:statusor - gpr - name: format_request_test @@ -10912,6 +10883,9 @@ targets: headers: - src/core/ext/transport/chttp2/transport/frame.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h + - src/core/lib/gprpp/glob.h - src/core/lib/slice/slice.h - src/core/lib/slice/slice_buffer.h - src/core/lib/slice/slice_internal.h @@ -10921,13 +10895,15 @@ targets: src: - src/core/ext/transport/chttp2/transport/frame.cc - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/slice/slice.cc - src/core/lib/slice/slice_buffer.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - test/core/transport/chttp2/frame_test.cc deps: - gtest + - absl/container:flat_hash_map - absl/hash:hash - absl/status:statusor - absl/types:span @@ -10990,6 +10966,17 @@ targets: deps: - gtest - grpc++_test_util +- name: glob_test + gtest: true + build: test + language: c++ + headers: [] + src: + - test/core/gprpp/glob_test.cc + deps: + - gtest + - grpc_test_util + uses_polling: false - name: goaway_server_test gtest: true build: test @@ -11053,7 +11040,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -11250,7 +11236,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -11811,7 +11796,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -12007,7 +11991,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -12096,7 +12079,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -12330,9 +12312,12 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/event_engine_context.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/down_cast.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted_ptr.h @@ -12346,16 +12331,17 @@ targets: - src/core/lib/promise/inter_activity_pipe.h - src/core/lib/promise/poll.h - src/core/lib/promise/seq.h - - src/core/lib/promise/trace.h - test/core/promise/test_wakeup_schedulers.h src: - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/promise/activity.cc - - src/core/lib/promise/trace.cc - test/core/promise/inter_activity_pipe_test.cc deps: - gtest - absl/base:config + - absl/container:flat_hash_map - absl/hash:hash - absl/meta:type_traits - absl/status:statusor @@ -12394,7 +12380,6 @@ targets: - src/core/lib/channel/channel_stack.h - src/core/lib/channel/channel_stack_builder.h - src/core/lib/channel/channel_stack_builder_impl.h - - src/core/lib/channel/channel_stack_trace.h - src/core/lib/channel/connected_channel.h - src/core/lib/channel/promise_based_filter.h - src/core/lib/channel/status_util.h @@ -12403,6 +12388,8 @@ targets: - src/core/lib/config/core_configuration.h - src/core/lib/debug/event_log.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/ares_resolver.h - src/core/lib/event_engine/cf_engine/cf_engine.h - src/core/lib/event_engine/cf_engine/cfstream_endpoint.h @@ -12476,6 +12463,7 @@ targets: - src/core/lib/gprpp/down_cast.h - src/core/lib/gprpp/dual_ref_counted.h - src/core/lib/gprpp/dump_args.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/if_list.h - src/core/lib/gprpp/load_file.h - src/core/lib/gprpp/manual_constructor.h @@ -12589,7 +12577,6 @@ targets: - src/core/lib/promise/race.h - src/core/lib/promise/seq.h - src/core/lib/promise/status_flag.h - - src/core/lib/promise/trace.h - src/core/lib/promise/try_seq.h - src/core/lib/resource_quota/api.h - src/core/lib/resource_quota/arena.h @@ -12598,7 +12585,6 @@ targets: - src/core/lib/resource_quota/periodic_update.h - src/core/lib/resource_quota/resource_quota.h - src/core/lib/resource_quota/thread_quota.h - - src/core/lib/resource_quota/trace.h - src/core/lib/security/certificate_provider/certificate_provider_factory.h - src/core/lib/security/certificate_provider/certificate_provider_registry.h - src/core/lib/security/credentials/alts/check_gcp_environment.h @@ -12613,7 +12599,6 @@ targets: - src/core/lib/surface/api_trace.h - src/core/lib/surface/call.h - src/core/lib/surface/call_test_only.h - - src/core/lib/surface/call_trace.h - src/core/lib/surface/call_utils.h - src/core/lib/surface/channel.h - src/core/lib/surface/channel_init.h @@ -12713,7 +12698,6 @@ targets: - src/core/lib/channel/channel_stack.cc - src/core/lib/channel/channel_stack_builder.cc - src/core/lib/channel/channel_stack_builder_impl.cc - - src/core/lib/channel/channel_stack_trace.cc - src/core/lib/channel/connected_channel.cc - src/core/lib/channel/promise_based_filter.cc - src/core/lib/channel/status_util.cc @@ -12723,6 +12707,7 @@ targets: - src/core/lib/config/core_configuration.cc - src/core/lib/debug/event_log.cc - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/event_engine/ares_resolver.cc - src/core/lib/event_engine/cf_engine/cf_engine.cc - src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc @@ -12760,7 +12745,6 @@ targets: - src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc - src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc - src/core/lib/event_engine/time_util.cc - - src/core/lib/event_engine/trace.cc - src/core/lib/event_engine/utils.cc - src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc - src/core/lib/event_engine/windows/iocp.cc @@ -12773,6 +12757,7 @@ targets: - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc - src/core/lib/gprpp/dump_args.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/load_file.cc - src/core/lib/gprpp/per_cpu.cc - src/core/lib/gprpp/ref_counted_string.cc @@ -12797,7 +12782,6 @@ targets: - src/core/lib/iomgr/ev_epoll1_linux.cc - src/core/lib/iomgr/ev_poll_posix.cc - src/core/lib/iomgr/ev_posix.cc - - src/core/lib/iomgr/ev_windows.cc - src/core/lib/iomgr/event_engine_shims/closure.cc - src/core/lib/iomgr/event_engine_shims/endpoint.cc - src/core/lib/iomgr/event_engine_shims/tcp_client.cc @@ -12860,7 +12844,6 @@ targets: - src/core/lib/iomgr/wakeup_fd_posix.cc - src/core/lib/promise/activity.cc - src/core/lib/promise/party.cc - - src/core/lib/promise/trace.cc - src/core/lib/resource_quota/api.cc - src/core/lib/resource_quota/arena.cc - src/core/lib/resource_quota/connection_quota.cc @@ -12868,7 +12851,6 @@ targets: - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/resource_quota/resource_quota.cc - src/core/lib/resource_quota/thread_quota.cc - - src/core/lib/resource_quota/trace.cc - src/core/lib/security/certificate_provider/certificate_provider_registry.cc - src/core/lib/security/credentials/alts/check_gcp_environment.cc - src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc @@ -12880,9 +12862,7 @@ targets: - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - src/core/lib/slice/slice_buffer.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - - src/core/lib/surface/api_trace.cc - src/core/lib/surface/byte_buffer.cc - src/core/lib/surface/byte_buffer_reader.cc - src/core/lib/surface/call.cc @@ -12973,6 +12953,8 @@ targets: - src/core/ext/upb-gen/google/rpc/status.upb.h - src/core/ext/upb-gen/google/rpc/status.upb_minitable.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h @@ -12980,6 +12962,7 @@ targets: - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/down_cast.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/ref_counted.h @@ -13006,14 +12989,12 @@ targets: - src/core/lib/promise/poll.h - src/core/lib/promise/race.h - src/core/lib/promise/seq.h - - src/core/lib/promise/trace.h - src/core/lib/resource_quota/arena.h - src/core/lib/resource_quota/connection_quota.h - src/core/lib/resource_quota/memory_quota.h - src/core/lib/resource_quota/periodic_update.h - src/core/lib/resource_quota/resource_quota.h - src/core/lib/resource_quota/thread_quota.h - - src/core/lib/resource_quota/trace.h - src/core/lib/slice/percent_encoding.h - src/core/lib/slice/slice.h - src/core/lib/slice/slice_internal.h @@ -13044,8 +13025,10 @@ targets: - src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c - src/core/ext/upb-gen/google/rpc/status.upb_minitable.c - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/status_helper.cc - src/core/lib/gprpp/time.cc - src/core/lib/iomgr/closure.cc @@ -13055,17 +13038,14 @@ targets: - src/core/lib/iomgr/executor.cc - src/core/lib/iomgr/iomgr_internal.cc - src/core/lib/promise/activity.cc - - src/core/lib/promise/trace.cc - src/core/lib/resource_quota/arena.cc - src/core/lib/resource_quota/connection_quota.cc - src/core/lib/resource_quota/memory_quota.cc - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/resource_quota/resource_quota.cc - src/core/lib/resource_quota/thread_quota.cc - - src/core/lib/resource_quota/trace.cc - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - test/core/promise/interceptor_list_test.cc - third_party/upb/upb/mini_descriptor/build_enum.c @@ -13083,6 +13063,7 @@ targets: - utf8_range_lib - upb_message_lib - absl/base:config + - absl/container:flat_hash_map - absl/functional:function_ref - absl/hash:hash - absl/meta:type_traits @@ -13178,7 +13159,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -13242,19 +13222,23 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/gprpp/bitset.h + - src/core/lib/gprpp/glob.h - src/core/lib/promise/detail/join_state.h - src/core/lib/promise/detail/promise_like.h - src/core/lib/promise/join.h - src/core/lib/promise/map.h - src/core/lib/promise/poll.h - - src/core/lib/promise/trace.h src: - src/core/lib/debug/trace.cc - - src/core/lib/promise/trace.cc + - src/core/lib/debug/trace_flags.cc + - src/core/lib/gprpp/glob.cc - test/core/promise/join_test.cc deps: - gtest + - absl/container:flat_hash_map - absl/meta:type_traits - absl/status:statusor - gpr @@ -13380,7 +13364,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -13457,7 +13440,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -13489,10 +13471,13 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/event_engine_context.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/down_cast.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted_ptr.h @@ -13509,16 +13494,17 @@ targets: - src/core/lib/promise/map.h - src/core/lib/promise/poll.h - src/core/lib/promise/seq.h - - src/core/lib/promise/trace.h - test/core/promise/test_wakeup_schedulers.h src: - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/promise/activity.cc - - src/core/lib/promise/trace.cc - test/core/promise/latch_test.cc deps: - gtest - absl/base:config + - absl/container:flat_hash_map - absl/hash:hash - absl/meta:type_traits - absl/status:statusor @@ -13636,6 +13622,9 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h + - src/core/lib/gprpp/glob.h - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h @@ -13643,13 +13632,14 @@ targets: - src/core/lib/promise/loop.h - src/core/lib/promise/poll.h - src/core/lib/promise/seq.h - - src/core/lib/promise/trace.h src: - src/core/lib/debug/trace.cc - - src/core/lib/promise/trace.cc + - src/core/lib/debug/trace_flags.cc + - src/core/lib/gprpp/glob.cc - test/core/promise/loop_test.cc deps: - gtest + - absl/container:flat_hash_map - absl/meta:type_traits - absl/status:statusor - gpr @@ -13664,6 +13654,8 @@ targets: - src/core/ext/upb-gen/google/rpc/status.upb.h - src/core/ext/upb-gen/google/rpc/status.upb_minitable.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h @@ -13671,6 +13663,7 @@ targets: - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/down_cast.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/ref_counted.h @@ -13704,7 +13697,6 @@ targets: - src/core/lib/promise/race.h - src/core/lib/promise/seq.h - src/core/lib/promise/status_flag.h - - src/core/lib/promise/trace.h - src/core/lib/promise/try_seq.h - src/core/lib/resource_quota/arena.h - src/core/lib/resource_quota/connection_quota.h @@ -13712,7 +13704,6 @@ targets: - src/core/lib/resource_quota/periodic_update.h - src/core/lib/resource_quota/resource_quota.h - src/core/lib/resource_quota/thread_quota.h - - src/core/lib/resource_quota/trace.h - src/core/lib/slice/percent_encoding.h - src/core/lib/slice/slice.h - src/core/lib/slice/slice_internal.h @@ -13743,8 +13734,10 @@ targets: - src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c - src/core/ext/upb-gen/google/rpc/status.upb_minitable.c - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/status_helper.cc - src/core/lib/gprpp/time.cc - src/core/lib/iomgr/closure.cc @@ -13754,17 +13747,14 @@ targets: - src/core/lib/iomgr/executor.cc - src/core/lib/iomgr/iomgr_internal.cc - src/core/lib/promise/activity.cc - - src/core/lib/promise/trace.cc - src/core/lib/resource_quota/arena.cc - src/core/lib/resource_quota/connection_quota.cc - src/core/lib/resource_quota/memory_quota.cc - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/resource_quota/resource_quota.cc - src/core/lib/resource_quota/thread_quota.cc - - src/core/lib/resource_quota/trace.cc - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - test/core/promise/map_pipe_test.cc - third_party/upb/upb/mini_descriptor/build_enum.c @@ -13782,6 +13772,7 @@ targets: - utf8_range_lib - upb_message_lib - absl/base:config + - absl/container:flat_hash_map - absl/functional:function_ref - absl/hash:hash - absl/meta:type_traits @@ -13880,7 +13871,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -13945,7 +13935,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -14010,7 +13999,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -14075,7 +14063,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -14360,7 +14347,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -14437,7 +14423,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -14502,7 +14487,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -14874,7 +14858,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -14922,9 +14905,12 @@ targets: - src/core/ext/upb-gen/google/rpc/status.upb.h - src/core/ext/upb-gen/google/rpc/status.upb_minitable.h - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - src/core/lib/gprpp/bitset.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/status_helper.h - src/core/lib/gprpp/time.h @@ -14964,8 +14950,10 @@ targets: - src/core/ext/upb-gen/google/protobuf/any.upb_minitable.c - src/core/ext/upb-gen/google/rpc/status.upb_minitable.c - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/experiments/config.cc - src/core/lib/experiments/experiments.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/gprpp/status_helper.cc - src/core/lib/gprpp/time.cc - src/core/lib/iomgr/closure.cc @@ -14977,7 +14965,6 @@ targets: - src/core/lib/resource_quota/periodic_update.cc - src/core/lib/slice/percent_encoding.cc - src/core/lib/slice/slice.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - test/core/resource_quota/periodic_update_test.cc - third_party/upb/upb/mini_descriptor/build_enum.c @@ -14994,6 +14981,7 @@ targets: - gtest - utf8_range_lib - upb_message_lib + - absl/container:flat_hash_map - absl/functional:function_ref - absl/hash:hash - absl/status:statusor @@ -15131,7 +15119,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -15226,7 +15213,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -15505,10 +15491,13 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/event_engine_context.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/down_cast.h + - src/core/lib/gprpp/glob.h - src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted_ptr.h @@ -15526,16 +15515,17 @@ targets: - src/core/lib/promise/promise.h - src/core/lib/promise/promise_mutex.h - src/core/lib/promise/seq.h - - src/core/lib/promise/trace.h - test/core/promise/test_wakeup_schedulers.h src: - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/promise/activity.cc - - src/core/lib/promise/trace.cc - test/core/promise/promise_mutex_test.cc deps: - gtest - absl/base:config + - absl/container:flat_hash_map - absl/hash:hash - absl/meta:type_traits - absl/status:statusor @@ -15648,7 +15638,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -15907,7 +15896,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -15986,7 +15974,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16051,7 +16038,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16264,7 +16250,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16340,7 +16325,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16405,7 +16389,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16470,7 +16453,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16535,7 +16517,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16600,7 +16581,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16665,7 +16645,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16730,7 +16709,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16795,7 +16773,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16860,7 +16837,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16925,7 +16901,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -16990,7 +16965,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17055,7 +17029,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17120,7 +17093,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17185,7 +17157,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17250,7 +17221,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17315,7 +17285,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17380,7 +17349,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17445,7 +17413,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17510,7 +17477,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17575,7 +17541,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17640,7 +17605,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17705,7 +17669,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17770,7 +17733,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17846,7 +17808,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17911,7 +17872,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -17976,7 +17936,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -18041,7 +18000,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -18117,7 +18075,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -18182,7 +18139,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -18247,7 +18203,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -18312,7 +18267,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -18377,7 +18331,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -18442,7 +18395,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -18507,7 +18459,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -18696,19 +18647,23 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h + - src/core/lib/gprpp/glob.h - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h - src/core/lib/promise/detail/seq_state.h - src/core/lib/promise/poll.h - src/core/lib/promise/seq.h - - src/core/lib/promise/trace.h src: - src/core/lib/debug/trace.cc - - src/core/lib/promise/trace.cc + - src/core/lib/debug/trace_flags.cc + - src/core/lib/gprpp/glob.cc - test/core/promise/seq_test.cc deps: - gtest + - absl/container:flat_hash_map - absl/meta:type_traits - absl/status:statusor - gpr @@ -18940,7 +18895,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -19091,7 +19045,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -19222,7 +19175,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -19287,7 +19239,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -19367,7 +19318,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -19432,7 +19382,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -19511,7 +19460,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -19568,18 +19516,23 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h + - src/core/lib/gprpp/glob.h - src/core/lib/slice/slice.h - src/core/lib/slice/slice_internal.h - src/core/lib/slice/slice_refcount.h - src/core/lib/slice/slice_string_helpers.h src: - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/slice/slice.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - test/core/slice/slice_string_helpers_test.cc deps: - gtest + - absl/container:flat_hash_map - absl/hash:hash - absl/status:statusor - gpr @@ -19868,7 +19821,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -20232,7 +20184,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -20305,9 +20256,12 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/event_engine/extensions/can_track_errors.h - src/core/lib/event_engine/handle_containers.h - src/core/lib/event_engine/resolved_address_internal.h + - src/core/lib/gprpp/glob.h - src/core/lib/iomgr/port.h - src/core/lib/iomgr/resolved_address.h - src/core/lib/slice/slice.h @@ -20317,17 +20271,19 @@ targets: - src/core/lib/slice/slice_string_helpers.h src: - src/core/lib/debug/trace.cc + - src/core/lib/debug/trace_flags.cc - src/core/lib/event_engine/event_engine.cc - src/core/lib/event_engine/resolved_address.cc - src/core/lib/event_engine/slice.cc - src/core/lib/event_engine/slice_buffer.cc + - src/core/lib/gprpp/glob.cc - src/core/lib/slice/slice.cc - src/core/lib/slice/slice_buffer.cc - - src/core/lib/slice/slice_refcount.cc - src/core/lib/slice/slice_string_helpers.cc - test/core/event_engine/slice_buffer_test.cc deps: - gtest + - absl/container:flat_hash_map - absl/hash:hash - absl/status:statusor - absl/utility:utility @@ -20481,7 +20437,6 @@ targets: - test/core/transport/test_suite/transport_test.h src: - test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc - src/core/ext/transport/chaotic_good/frame_header.cc @@ -20568,7 +20523,6 @@ targets: - src/core/lib/transport/promise_endpoint.h - src/cpp/ext/chaotic_good.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -20781,7 +20735,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -20946,6 +20899,17 @@ targets: - gtest - grpc++_test_config - grpc++_test_util +- name: trace_flags_test + gtest: true + build: test + language: c++ + headers: [] + src: + - test/core/telemetry/trace_flags_test.cc + deps: + - gtest + - grpc_test_util + uses_polling: false - name: traced_buffer_list_test gtest: true build: test @@ -21000,7 +20964,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -21161,21 +21124,25 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h - src/core/lib/gprpp/bitset.h + - src/core/lib/gprpp/glob.h - src/core/lib/promise/detail/join_state.h - src/core/lib/promise/detail/promise_like.h - src/core/lib/promise/detail/status.h - src/core/lib/promise/map.h - src/core/lib/promise/poll.h - src/core/lib/promise/status_flag.h - - src/core/lib/promise/trace.h - src/core/lib/promise/try_join.h src: - src/core/lib/debug/trace.cc - - src/core/lib/promise/trace.cc + - src/core/lib/debug/trace_flags.cc + - src/core/lib/gprpp/glob.cc - test/core/promise/try_join_test.cc deps: - gtest + - absl/container:flat_hash_map - absl/meta:type_traits - absl/status:statusor - absl/utility:utility @@ -21198,6 +21165,9 @@ targets: language: c++ headers: - src/core/lib/debug/trace.h + - src/core/lib/debug/trace_flags.h + - src/core/lib/debug/trace_impl.h + - src/core/lib/gprpp/glob.h - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/promise_factory.h - src/core/lib/promise/detail/promise_like.h @@ -21205,14 +21175,15 @@ targets: - src/core/lib/promise/detail/status.h - src/core/lib/promise/poll.h - src/core/lib/promise/status_flag.h - - src/core/lib/promise/trace.h - src/core/lib/promise/try_seq.h src: - src/core/lib/debug/trace.cc - - src/core/lib/promise/trace.cc + - src/core/lib/debug/trace_flags.cc + - src/core/lib/gprpp/glob.cc - test/core/promise/try_seq_test.cc deps: - gtest + - absl/container:flat_hash_map - absl/meta:type_traits - absl/status:statusor - gpr @@ -21702,7 +21673,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc @@ -21767,7 +21737,6 @@ targets: - test/core/test_util/fake_stats_plugin.h - test/core/test_util/test_lb_policies.h src: - - src/core/ext/transport/chaotic_good/chaotic_good_transport.cc - src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc - src/core/ext/transport/chaotic_good/client_transport.cc - src/core/ext/transport/chaotic_good/frame.cc diff --git a/config.m4 b/config.m4 index 2b0ac51b569..7a6ce84d3d7 100644 --- a/config.m4 +++ b/config.m4 @@ -99,7 +99,6 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/transport/chttp2/transport/hpack_parser.cc \ src/core/ext/transport/chttp2/transport/hpack_parser_table.cc \ src/core/ext/transport/chttp2/transport/http2_settings.cc \ - src/core/ext/transport/chttp2/transport/http_trace.cc \ src/core/ext/transport/chttp2/transport/huffsyms.cc \ src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc \ src/core/ext/transport/chttp2/transport/parsing.cc \ @@ -110,7 +109,6 @@ if test "$PHP_GRPC" != "no"; then src/core/ext/transport/chttp2/transport/varint.cc \ src/core/ext/transport/chttp2/transport/write_size_policy.cc \ src/core/ext/transport/chttp2/transport/writing.cc \ - src/core/ext/transport/inproc/inproc_plugin.cc \ src/core/ext/transport/inproc/inproc_transport.cc \ src/core/ext/transport/inproc/legacy_inproc_transport.cc \ src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.c \ @@ -448,7 +446,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/channel/channel_stack.cc \ src/core/lib/channel/channel_stack_builder.cc \ src/core/lib/channel/channel_stack_builder_impl.cc \ - src/core/lib/channel/channel_stack_trace.cc \ src/core/lib/channel/connected_channel.cc \ src/core/lib/channel/promise_based_filter.cc \ src/core/lib/channel/status_util.cc \ @@ -461,6 +458,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/config/load_config.cc \ src/core/lib/debug/event_log.cc \ src/core/lib/debug/trace.cc \ + src/core/lib/debug/trace_flags.cc \ src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc \ @@ -499,7 +497,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc \ src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc \ src/core/lib/event_engine/time_util.cc \ - src/core/lib/event_engine/trace.cc \ src/core/lib/event_engine/utils.cc \ src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc \ src/core/lib/event_engine/windows/iocp.cc \ @@ -515,6 +512,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/gprpp/dump_args.cc \ src/core/lib/gprpp/examine_stack.cc \ src/core/lib/gprpp/fork.cc \ + src/core/lib/gprpp/glob.cc \ src/core/lib/gprpp/host_port.cc \ src/core/lib/gprpp/linux/env.cc \ src/core/lib/gprpp/load_file.cc \ @@ -554,7 +552,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_poll_posix.cc \ src/core/lib/iomgr/ev_posix.cc \ - src/core/lib/iomgr/ev_windows.cc \ src/core/lib/iomgr/event_engine_shims/closure.cc \ src/core/lib/iomgr/event_engine_shims/endpoint.cc \ src/core/lib/iomgr/event_engine_shims/tcp_client.cc \ @@ -619,7 +616,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/promise/activity.cc \ src/core/lib/promise/party.cc \ src/core/lib/promise/sleep.cc \ - src/core/lib/promise/trace.cc \ src/core/lib/resource_quota/api.cc \ src/core/lib/resource_quota/arena.cc \ src/core/lib/resource_quota/connection_quota.cc \ @@ -627,7 +623,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/resource_quota/periodic_update.cc \ src/core/lib/resource_quota/resource_quota.cc \ src/core/lib/resource_quota/thread_quota.cc \ - src/core/lib/resource_quota/trace.cc \ src/core/lib/security/authorization/audit_logging.cc \ src/core/lib/security/authorization/authorization_policy_provider_vtable.cc \ src/core/lib/security/authorization/evaluate_args.cc \ @@ -693,9 +688,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/slice/percent_encoding.cc \ src/core/lib/slice/slice.cc \ src/core/lib/slice/slice_buffer.cc \ - src/core/lib/slice/slice_refcount.cc \ src/core/lib/slice/slice_string_helpers.cc \ - src/core/lib/surface/api_trace.cc \ src/core/lib/surface/byte_buffer.cc \ src/core/lib/surface/byte_buffer_reader.cc \ src/core/lib/surface/call.cc \ @@ -786,7 +779,6 @@ if test "$PHP_GRPC" != "no"; then src/core/resolver/sockaddr/sockaddr_resolver.cc \ src/core/resolver/xds/xds_dependency_manager.cc \ src/core/resolver/xds/xds_resolver.cc \ - src/core/resolver/xds/xds_resolver_trace.cc \ src/core/server/server.cc \ src/core/server/server_call_tracer_filter.cc \ src/core/server/server_config_selector_filter.cc \ diff --git a/config.w32 b/config.w32 index 86e7fb6ddba..657bdf0b37f 100644 --- a/config.w32 +++ b/config.w32 @@ -64,7 +64,6 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\transport\\chttp2\\transport\\hpack_parser.cc " + "src\\core\\ext\\transport\\chttp2\\transport\\hpack_parser_table.cc " + "src\\core\\ext\\transport\\chttp2\\transport\\http2_settings.cc " + - "src\\core\\ext\\transport\\chttp2\\transport\\http_trace.cc " + "src\\core\\ext\\transport\\chttp2\\transport\\huffsyms.cc " + "src\\core\\ext\\transport\\chttp2\\transport\\max_concurrent_streams_policy.cc " + "src\\core\\ext\\transport\\chttp2\\transport\\parsing.cc " + @@ -75,7 +74,6 @@ if (PHP_GRPC != "no") { "src\\core\\ext\\transport\\chttp2\\transport\\varint.cc " + "src\\core\\ext\\transport\\chttp2\\transport\\write_size_policy.cc " + "src\\core\\ext\\transport\\chttp2\\transport\\writing.cc " + - "src\\core\\ext\\transport\\inproc\\inproc_plugin.cc " + "src\\core\\ext\\transport\\inproc\\inproc_transport.cc " + "src\\core\\ext\\transport\\inproc\\legacy_inproc_transport.cc " + "src\\core\\ext\\upb-gen\\envoy\\admin\\v3\\certs.upb_minitable.c " + @@ -413,7 +411,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\channel\\channel_stack.cc " + "src\\core\\lib\\channel\\channel_stack_builder.cc " + "src\\core\\lib\\channel\\channel_stack_builder_impl.cc " + - "src\\core\\lib\\channel\\channel_stack_trace.cc " + "src\\core\\lib\\channel\\connected_channel.cc " + "src\\core\\lib\\channel\\promise_based_filter.cc " + "src\\core\\lib\\channel\\status_util.cc " + @@ -426,6 +423,7 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\config\\load_config.cc " + "src\\core\\lib\\debug\\event_log.cc " + "src\\core\\lib\\debug\\trace.cc " + + "src\\core\\lib\\debug\\trace_flags.cc " + "src\\core\\lib\\event_engine\\ares_resolver.cc " + "src\\core\\lib\\event_engine\\cf_engine\\cf_engine.cc " + "src\\core\\lib\\event_engine\\cf_engine\\cfstream_endpoint.cc " + @@ -464,7 +462,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\event_engine\\thread_pool\\work_stealing_thread_pool.cc " + "src\\core\\lib\\event_engine\\thready_event_engine\\thready_event_engine.cc " + "src\\core\\lib\\event_engine\\time_util.cc " + - "src\\core\\lib\\event_engine\\trace.cc " + "src\\core\\lib\\event_engine\\utils.cc " + "src\\core\\lib\\event_engine\\windows\\grpc_polled_fd_windows.cc " + "src\\core\\lib\\event_engine\\windows\\iocp.cc " + @@ -480,6 +477,7 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\gprpp\\dump_args.cc " + "src\\core\\lib\\gprpp\\examine_stack.cc " + "src\\core\\lib\\gprpp\\fork.cc " + + "src\\core\\lib\\gprpp\\glob.cc " + "src\\core\\lib\\gprpp\\host_port.cc " + "src\\core\\lib\\gprpp\\linux\\env.cc " + "src\\core\\lib\\gprpp\\load_file.cc " + @@ -519,7 +517,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\iomgr\\ev_epoll1_linux.cc " + "src\\core\\lib\\iomgr\\ev_poll_posix.cc " + "src\\core\\lib\\iomgr\\ev_posix.cc " + - "src\\core\\lib\\iomgr\\ev_windows.cc " + "src\\core\\lib\\iomgr\\event_engine_shims\\closure.cc " + "src\\core\\lib\\iomgr\\event_engine_shims\\endpoint.cc " + "src\\core\\lib\\iomgr\\event_engine_shims\\tcp_client.cc " + @@ -584,7 +581,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\promise\\activity.cc " + "src\\core\\lib\\promise\\party.cc " + "src\\core\\lib\\promise\\sleep.cc " + - "src\\core\\lib\\promise\\trace.cc " + "src\\core\\lib\\resource_quota\\api.cc " + "src\\core\\lib\\resource_quota\\arena.cc " + "src\\core\\lib\\resource_quota\\connection_quota.cc " + @@ -592,7 +588,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\resource_quota\\periodic_update.cc " + "src\\core\\lib\\resource_quota\\resource_quota.cc " + "src\\core\\lib\\resource_quota\\thread_quota.cc " + - "src\\core\\lib\\resource_quota\\trace.cc " + "src\\core\\lib\\security\\authorization\\audit_logging.cc " + "src\\core\\lib\\security\\authorization\\authorization_policy_provider_vtable.cc " + "src\\core\\lib\\security\\authorization\\evaluate_args.cc " + @@ -658,9 +653,7 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\slice\\percent_encoding.cc " + "src\\core\\lib\\slice\\slice.cc " + "src\\core\\lib\\slice\\slice_buffer.cc " + - "src\\core\\lib\\slice\\slice_refcount.cc " + "src\\core\\lib\\slice\\slice_string_helpers.cc " + - "src\\core\\lib\\surface\\api_trace.cc " + "src\\core\\lib\\surface\\byte_buffer.cc " + "src\\core\\lib\\surface\\byte_buffer_reader.cc " + "src\\core\\lib\\surface\\call.cc " + @@ -751,7 +744,6 @@ if (PHP_GRPC != "no") { "src\\core\\resolver\\sockaddr\\sockaddr_resolver.cc " + "src\\core\\resolver\\xds\\xds_dependency_manager.cc " + "src\\core\\resolver\\xds\\xds_resolver.cc " + - "src\\core\\resolver\\xds\\xds_resolver_trace.cc " + "src\\core\\server\\server.cc " + "src\\core\\server\\server_call_tracer_filter.cc " + "src\\core\\server\\server_config_selector_filter.cc " + diff --git a/doc/environment_variables.md b/doc/environment_variables.md index f5324b71653..bce55266ee7 100644 --- a/doc/environment_variables.md +++ b/doc/environment_variables.md @@ -41,103 +41,10 @@ some configuration as environment variables that can be set. - legacy - the (deprecated) original polling engine for gRPC * GRPC_TRACE - A comma separated list of tracers that provide additional insight into how - gRPC C core is processing requests via debug logs. Available tracers include: - - api - traces api calls to the C core - - bdp_estimator - traces behavior of bdp estimation logic - - call_error - traces the possible errors contributing to final call status - - cares_resolver - traces operations of the c-ares based DNS resolver - - cares_address_sorting - traces operations of the c-ares based DNS - resolver's resolved address sorter - - cds_lb - traces cds LB policy - - channel - traces operations on the C core channel stack - - channel_stack - traces the set of filters in a channel stack upon - construction - - client_channel - traces client channel control plane activity, including - resolver and load balancing policy interaction - - client_channel_call - traces client channel call activity related to name - resolution - - client_channel_lb_call - traces client channel call activity related - to load balancing picking - - compression - traces compression operations - - connectivity_state - traces connectivity state changes to channels - - cronet - traces state in the cronet transport engine - - dns_resolver - traces state in the native DNS resolver - - executor - traces grpc's internal thread pool ('the executor') - - glb - traces the grpclb load balancer - - handshaker - traces handshaking state - - health_check_client - traces health checking client code - - http - traces state in the http2 transport engine - - http2_stream_state - traces all http2 stream state mutations. - - http2_ping - traces pings/ping acks/antagonist writes in http2 stack. - - http1 - traces HTTP/1.x operations performed by gRPC - - inproc - traces the in-process transport - - http_keepalive - traces gRPC keepalive pings - - flowctl - traces http2 flow control - - op_failure - traces error information when failure is pushed onto a - completion queue - - pick_first - traces the pick first load balancing policy - - plugin_credentials - traces plugin credentials - - pollable_refcount - traces reference counting of 'pollable' objects (only - in DEBUG) - - priority_lb - traces priority LB policy - - resource_quota - trace resource quota objects internals - - ring_hash_lb - traces the ring hash load balancing policy - - rls_lb - traces the RLS load balancing policy - - round_robin - traces the round_robin load balancing policy - - weighted_round_robin_lb - traces the weighted_round_robin load balancing - policy - - queue_pluck - - grpc_authz_api - traces gRPC authorization - - server_channel - lightweight trace of significant server channel events - - secure_endpoint - traces bytes flowing through encrypted channels - - subchannel - traces the connectivity state of subchannel - - subchannel_pool - traces subchannel pool - - timer - timers (alarms) in the grpc internals - - timer_check - more detailed trace of timer logic in grpc internals - - transport_security - traces metadata about secure channel establishment - - tcp - traces bytes in and out of a channel - - tsi - traces tsi transport security - - weighted_target_lb - traces weighted_target LB policy - - xds_client - traces xds client - - xds_cluster_manager_lb - traces cluster manager LB policy - - xds_cluster_impl_lb - traces cluster impl LB policy - - xds_resolver - traces xds resolver - - The following tracers will only run in binaries built in DEBUG mode. This is - accomplished by invoking `CONFIG=dbg make ` - - metadata - tracks creation and mutation of metadata - - combiner - traces combiner lock state - - call_combiner - traces call combiner state - - closure - tracks closure creation, scheduling, and completion - - fd_trace - traces fd create(), shutdown() and close() calls for channel fds. - - pending_tags - traces still-in-progress tags on completion queues - - polling - traces the selected polling engine - - polling_api - traces the api calls to polling engine - - subchannel_refcount - - queue_refcount - - error_refcount - - stream_refcount - - slice_refcount - - workqueue_refcount - - fd_refcount - - cq_refcount - - auth_context_refcount - - security_connector_refcount - - resolver_refcount - - lb_policy_refcount - - chttp2_refcount - - 'all' can additionally be used to turn all traces on. - Individual traces can be disabled by prefixing them with '-'. - - 'refcount' will turn on all of the tracers for refcount debugging. - - if 'list_tracers' is present, then all of the available tracers will be - printed when the program starts up. - - Example: - export GRPC_TRACE=all,-pending_tags + A comma-separated list of tracer names or glob patterns that provide + additional insight into how gRPC C core is processing requests via debug logs. + Available tracers and their usage can be found in + [gRPC Trace Flags](trace_flags.md) * GRPC_VERBOSITY + +gRPC Trace Flags +---------------- + +The `GRPC_TRACE` environment variable supports a comma-separated list of tracer +names or glob patterns that provide additional insight into how gRPC C core is +processing requests via debug logs. Available tracers include: + + - api - API calls to the C core. + - backend_metric - C++ backend metric recorder APIs. + - backend_metric_filter - Filter that populates backend metric data in server trailing metadata. + - bdp_estimator - Behavior of bdp estimation logic. + - call - Traces operations on a call through the gRPC stack. + - call_error - Possible errors contributing to final call statuses. + - cares_address_sorting - Operations of the c-ares based DNS resolver's address sorter. + - cares_resolver - Operations of the c-ares based DNS resolver. + - cds_lb - CDS LB policy. + - channel - Operations on the C core channel stack. + - channel_stack - Construction of the set of filters in a channel stack. + - chaotic_good - Chaotic good transport. + - chttp2_hpack_parser - HTTP/2 HPACK parser. + - chttp2_new_stream - HTTP/2 incoming stream creation. + - client_channel - Client channel control plane activity, including resolver and load balancing policy interaction. + - client_channel_call - Client channel call activity related to name resolution. + - client_channel_lb_call - Client channel call activity related to load balancing picking. + - client_idle_filter - Client idleness filter. + - compression - Compression operations. + - connectivity_state - Connectivity state changes to channels. + - cronet - Cronet transport engine. + - dns_resolver - The active DNS resolver. + - environment_autodetect - GCP environment auto-detection. + - event_engine - High-level EventEngine operations. + - event_engine_client_channel_resolver - EventEngine-based client channel resolver state and events. + - event_engine_dns - EventEngine DNS resolver. + - event_engine_endpoint - EventEngine Endpoint operations. + - event_engine_endpoint_data - Detailed dump of EventEngine endpoint TCP data. + - event_engine_poller - EventEngine Poller events. + - executor - gRPC's legacy thread pool ('the executor'). + - fault_injection_filter - Fault injection. + - flowctl - Http2 flow control. + - fork - Fork support. + - glb - gRPClb load balancer. + - grpc_authz_api - gRPC authorization. + - handshaker - Handshaking state. + - health_check_client - Health checking client code. + - http - Http2 transport engine. + - http1 - HTTP/1.x operations performed by gRPC. + - http2_ping - Pings/ping acks/antagonist writes in http2 stack. + - http2_stream_state - Http2 stream state mutations. + - http_keepalive - gRPC keepalive pings. + - inproc - In-process transport. + - metadata_query - GCP metadata queries. + - op_failure - Error information when failure is pushed onto a completion queue. The `api` tracer must be enabled for this flag to have any effect. + - orca_client - Out-of-band backend metric reporting client. + - outlier_detection_lb - Outlier detection. + - pick_first - Pick first load balancing policy. + - plugin_credentials - Plugin credentials. + - priority_lb - Priority LB policy. + - queue_pluck - Completion queue plucking. The `api` tracer must be enabled for this flag to have any effect. + - resource_quota - Resource quota objects internals. + - retry - Call retries. + - ring_hash_lb - Ring hash load balancing policy. + - rls_lb - RLS load balancing policy. + - round_robin - Round robin load balancing policy. + - secure_endpoint - Bytes flowing through encrypted channels. + - server_channel - Lightweight trace of significant server channel events. + - stateful_session_filter - Stateful session affinity. + - subchannel - Connectivity state of subchannels. + - subchannel_pool - Subchannel pool. + - tcp - Bytes in and out of a channel. + - timer - Timers (alarms) in the grpc internals. + - timer_check - more detailed trace of timer logic in grpc internals. + - tsi - TSI transport security. + - weighted_round_robin_lb - Weighted round robin load balancing policy. + - weighted_target_lb - Weighted target LB policy. + - xds_client - XDS client. + - xds_client_refcount - Refcount of XDS client. + - xds_cluster_impl_lb - XDS Cluster impl LB policy. + - xds_cluster_manager_lb - XDS Cluster manager LB policy. + - xds_override_host_lb - XDS Override host LB. + - xds_resolver - XDS Resolver. + - xds_server_config_fetcher - XDS Server config fetcher. + - xds_wrr_locality_lb - XDS WRR locality LB policy. + +The following tracers will only run in binaries built in DEBUG mode. This is +accomplished by invoking `bazel build --config=dbg ` + - auth_context_refcount - Auth context refcounting. + - call_combiner - Call combiner state. + - call_refcount - Refcount on call. + - closure - Legacy closure creation, scheduling, and completion. + - combiner - Combiner lock state. + - cq_refcount - Completion queue refcounting. + - error_refcount - Error refcounting. + - fd_refcount - File descriptor refcounting. + - fd_trace - Legacy file descriptor create(), shutdown() and close() calls for channel fds. + - lb_policy_refcount - LB policy refcounting. + - party_state - Coordination of activities related to a call. + - pending_tags - Still-in-progress tags on completion queues. The `api` tracer must be enabled for this flag to have any effect. + - polling - The active polling engine. + - polling_api - API calls to polling engine. + - promise_primitives - Low-level primitives in the promise library. + - resolver_refcount - Resolver refcouting. + - security_connector_refcount - Refcounting for security connectors (part of channel credentials). + - slice_refcount - Slice refcounting. + - stream_refcount - Stream refcounting. + - subchannel_refcount - Subchannel refcounting. + - work_serializer - A synchronization mechanism used to ensure that only one thread is executing at a given time. + +Glob patterns and special cases: + - `*` can be used to turn all traces on. + - Individual traces can be disabled by prefixing them with `-`. + - `*refcount*` will turn on all of the tracers for refcount debugging. + - if `list_tracers` is present, then all of the available tracers will be + printed when the program starts up. + +Example: +export GRPC_TRACE=*,-pending_tags diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 896971c662b..dcbb22b52a1 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -365,7 +365,6 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/transport/hpack_parser.h', 'src/core/ext/transport/chttp2/transport/hpack_parser_table.h', 'src/core/ext/transport/chttp2/transport/http2_settings.h', - 'src/core/ext/transport/chttp2/transport/http_trace.h', 'src/core/ext/transport/chttp2/transport/huffsyms.h', 'src/core/ext/transport/chttp2/transport/internal.h', 'src/core/ext/transport/chttp2/transport/legacy_frame.h', @@ -882,7 +881,6 @@ Pod::Spec.new do |s| 'src/core/lib/channel/channel_stack.h', 'src/core/lib/channel/channel_stack_builder.h', 'src/core/lib/channel/channel_stack_builder_impl.h', - 'src/core/lib/channel/channel_stack_trace.h', 'src/core/lib/channel/connected_channel.h', 'src/core/lib/channel/promise_based_filter.h', 'src/core/lib/channel/status_util.h', @@ -893,6 +891,8 @@ Pod::Spec.new do |s| 'src/core/lib/config/load_config.h', 'src/core/lib/debug/event_log.h', 'src/core/lib/debug/trace.h', + 'src/core/lib/debug/trace_flags.h', + 'src/core/lib/debug/trace_impl.h', 'src/core/lib/event_engine/ares_resolver.h', 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', @@ -974,6 +974,7 @@ Pod::Spec.new do |s| 'src/core/lib/gprpp/env.h', 'src/core/lib/gprpp/examine_stack.h', 'src/core/lib/gprpp/fork.h', + 'src/core/lib/gprpp/glob.h', 'src/core/lib/gprpp/host_port.h', 'src/core/lib/gprpp/if_list.h', 'src/core/lib/gprpp/load_file.h', @@ -1102,7 +1103,6 @@ Pod::Spec.new do |s| 'src/core/lib/promise/seq.h', 'src/core/lib/promise/sleep.h', 'src/core/lib/promise/status_flag.h', - 'src/core/lib/promise/trace.h', 'src/core/lib/promise/try_join.h', 'src/core/lib/promise/try_seq.h', 'src/core/lib/resource_quota/api.h', @@ -1112,7 +1112,6 @@ Pod::Spec.new do |s| 'src/core/lib/resource_quota/periodic_update.h', 'src/core/lib/resource_quota/resource_quota.h', 'src/core/lib/resource_quota/thread_quota.h', - 'src/core/lib/resource_quota/trace.h', 'src/core/lib/security/authorization/audit_logging.h', 'src/core/lib/security/authorization/authorization_engine.h', 'src/core/lib/security/authorization/authorization_policy_provider.h', @@ -1177,7 +1176,6 @@ Pod::Spec.new do |s| 'src/core/lib/surface/api_trace.h', 'src/core/lib/surface/call.h', 'src/core/lib/surface/call_test_only.h', - 'src/core/lib/surface/call_trace.h', 'src/core/lib/surface/call_utils.h', 'src/core/lib/surface/channel.h', 'src/core/lib/surface/channel_create.h', @@ -1260,7 +1258,6 @@ Pod::Spec.new do |s| 'src/core/resolver/server_address.h', 'src/core/resolver/xds/xds_dependency_manager.h', 'src/core/resolver/xds/xds_resolver_attributes.h', - 'src/core/resolver/xds/xds_resolver_trace.h', 'src/core/server/server.h', 'src/core/server/server_call_tracer_filter.h', 'src/core/server/server_config_selector.h', @@ -1641,7 +1638,6 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/transport/hpack_parser.h', 'src/core/ext/transport/chttp2/transport/hpack_parser_table.h', 'src/core/ext/transport/chttp2/transport/http2_settings.h', - 'src/core/ext/transport/chttp2/transport/http_trace.h', 'src/core/ext/transport/chttp2/transport/huffsyms.h', 'src/core/ext/transport/chttp2/transport/internal.h', 'src/core/ext/transport/chttp2/transport/legacy_frame.h', @@ -2158,7 +2154,6 @@ Pod::Spec.new do |s| 'src/core/lib/channel/channel_stack.h', 'src/core/lib/channel/channel_stack_builder.h', 'src/core/lib/channel/channel_stack_builder_impl.h', - 'src/core/lib/channel/channel_stack_trace.h', 'src/core/lib/channel/connected_channel.h', 'src/core/lib/channel/promise_based_filter.h', 'src/core/lib/channel/status_util.h', @@ -2169,6 +2164,8 @@ Pod::Spec.new do |s| 'src/core/lib/config/load_config.h', 'src/core/lib/debug/event_log.h', 'src/core/lib/debug/trace.h', + 'src/core/lib/debug/trace_flags.h', + 'src/core/lib/debug/trace_impl.h', 'src/core/lib/event_engine/ares_resolver.h', 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', @@ -2250,6 +2247,7 @@ Pod::Spec.new do |s| 'src/core/lib/gprpp/env.h', 'src/core/lib/gprpp/examine_stack.h', 'src/core/lib/gprpp/fork.h', + 'src/core/lib/gprpp/glob.h', 'src/core/lib/gprpp/host_port.h', 'src/core/lib/gprpp/if_list.h', 'src/core/lib/gprpp/load_file.h', @@ -2378,7 +2376,6 @@ Pod::Spec.new do |s| 'src/core/lib/promise/seq.h', 'src/core/lib/promise/sleep.h', 'src/core/lib/promise/status_flag.h', - 'src/core/lib/promise/trace.h', 'src/core/lib/promise/try_join.h', 'src/core/lib/promise/try_seq.h', 'src/core/lib/resource_quota/api.h', @@ -2388,7 +2385,6 @@ Pod::Spec.new do |s| 'src/core/lib/resource_quota/periodic_update.h', 'src/core/lib/resource_quota/resource_quota.h', 'src/core/lib/resource_quota/thread_quota.h', - 'src/core/lib/resource_quota/trace.h', 'src/core/lib/security/authorization/audit_logging.h', 'src/core/lib/security/authorization/authorization_engine.h', 'src/core/lib/security/authorization/authorization_policy_provider.h', @@ -2453,7 +2449,6 @@ Pod::Spec.new do |s| 'src/core/lib/surface/api_trace.h', 'src/core/lib/surface/call.h', 'src/core/lib/surface/call_test_only.h', - 'src/core/lib/surface/call_trace.h', 'src/core/lib/surface/call_utils.h', 'src/core/lib/surface/channel.h', 'src/core/lib/surface/channel_create.h', @@ -2536,7 +2531,6 @@ Pod::Spec.new do |s| 'src/core/resolver/server_address.h', 'src/core/resolver/xds/xds_dependency_manager.h', 'src/core/resolver/xds/xds_resolver_attributes.h', - 'src/core/resolver/xds/xds_resolver_trace.h', 'src/core/server/server.h', 'src/core/server/server_call_tracer_filter.h', 'src/core/server/server_config_selector.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 6e6c7a57244..1116516edbd 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -356,8 +356,6 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/transport/hpack_parser_table.h', 'src/core/ext/transport/chttp2/transport/http2_settings.cc', 'src/core/ext/transport/chttp2/transport/http2_settings.h', - 'src/core/ext/transport/chttp2/transport/http_trace.cc', - 'src/core/ext/transport/chttp2/transport/http_trace.h', 'src/core/ext/transport/chttp2/transport/huffsyms.cc', 'src/core/ext/transport/chttp2/transport/huffsyms.h', 'src/core/ext/transport/chttp2/transport/internal.h', @@ -377,7 +375,6 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/transport/write_size_policy.cc', 'src/core/ext/transport/chttp2/transport/write_size_policy.h', 'src/core/ext/transport/chttp2/transport/writing.cc', - 'src/core/ext/transport/inproc/inproc_plugin.cc', 'src/core/ext/transport/inproc/inproc_transport.cc', 'src/core/ext/transport/inproc/inproc_transport.h', 'src/core/ext/transport/inproc/legacy_inproc_transport.cc', @@ -1222,8 +1219,6 @@ Pod::Spec.new do |s| 'src/core/lib/channel/channel_stack_builder.h', 'src/core/lib/channel/channel_stack_builder_impl.cc', 'src/core/lib/channel/channel_stack_builder_impl.h', - 'src/core/lib/channel/channel_stack_trace.cc', - 'src/core/lib/channel/channel_stack_trace.h', 'src/core/lib/channel/connected_channel.cc', 'src/core/lib/channel/connected_channel.h', 'src/core/lib/channel/promise_based_filter.cc', @@ -1246,6 +1241,9 @@ Pod::Spec.new do |s| 'src/core/lib/debug/event_log.h', 'src/core/lib/debug/trace.cc', 'src/core/lib/debug/trace.h', + 'src/core/lib/debug/trace_flags.cc', + 'src/core/lib/debug/trace_flags.h', + 'src/core/lib/debug/trace_impl.h', 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/ares_resolver.h', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', @@ -1338,7 +1336,6 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/thready_event_engine/thready_event_engine.h', 'src/core/lib/event_engine/time_util.cc', 'src/core/lib/event_engine/time_util.h', - 'src/core/lib/event_engine/trace.cc', 'src/core/lib/event_engine/trace.h', 'src/core/lib/event_engine/utils.cc', 'src/core/lib/event_engine/utils.h', @@ -1381,6 +1378,8 @@ Pod::Spec.new do |s| 'src/core/lib/gprpp/examine_stack.h', 'src/core/lib/gprpp/fork.cc', 'src/core/lib/gprpp/fork.h', + 'src/core/lib/gprpp/glob.cc', + 'src/core/lib/gprpp/glob.h', 'src/core/lib/gprpp/host_port.cc', 'src/core/lib/gprpp/host_port.h', 'src/core/lib/gprpp/if_list.h', @@ -1470,7 +1469,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/ev_poll_posix.h', 'src/core/lib/iomgr/ev_posix.cc', 'src/core/lib/iomgr/ev_posix.h', - 'src/core/lib/iomgr/ev_windows.cc', 'src/core/lib/iomgr/event_engine_shims/closure.cc', 'src/core/lib/iomgr/event_engine_shims/closure.h', 'src/core/lib/iomgr/event_engine_shims/endpoint.cc', @@ -1613,8 +1611,6 @@ Pod::Spec.new do |s| 'src/core/lib/promise/sleep.cc', 'src/core/lib/promise/sleep.h', 'src/core/lib/promise/status_flag.h', - 'src/core/lib/promise/trace.cc', - 'src/core/lib/promise/trace.h', 'src/core/lib/promise/try_join.h', 'src/core/lib/promise/try_seq.h', 'src/core/lib/resource_quota/api.cc', @@ -1631,8 +1627,6 @@ Pod::Spec.new do |s| 'src/core/lib/resource_quota/resource_quota.h', 'src/core/lib/resource_quota/thread_quota.cc', 'src/core/lib/resource_quota/thread_quota.h', - 'src/core/lib/resource_quota/trace.cc', - 'src/core/lib/resource_quota/trace.h', 'src/core/lib/security/authorization/audit_logging.cc', 'src/core/lib/security/authorization/audit_logging.h', 'src/core/lib/security/authorization/authorization_engine.h', @@ -1757,11 +1751,9 @@ Pod::Spec.new do |s| 'src/core/lib/slice/slice_buffer.cc', 'src/core/lib/slice/slice_buffer.h', 'src/core/lib/slice/slice_internal.h', - 'src/core/lib/slice/slice_refcount.cc', 'src/core/lib/slice/slice_refcount.h', 'src/core/lib/slice/slice_string_helpers.cc', 'src/core/lib/slice/slice_string_helpers.h', - 'src/core/lib/surface/api_trace.cc', 'src/core/lib/surface/api_trace.h', 'src/core/lib/surface/byte_buffer.cc', 'src/core/lib/surface/byte_buffer_reader.cc', @@ -1770,7 +1762,6 @@ Pod::Spec.new do |s| 'src/core/lib/surface/call_details.cc', 'src/core/lib/surface/call_log_batch.cc', 'src/core/lib/surface/call_test_only.h', - 'src/core/lib/surface/call_trace.h', 'src/core/lib/surface/call_utils.cc', 'src/core/lib/surface/call_utils.h', 'src/core/lib/surface/channel.cc', @@ -1938,8 +1929,6 @@ Pod::Spec.new do |s| 'src/core/resolver/xds/xds_dependency_manager.h', 'src/core/resolver/xds/xds_resolver.cc', 'src/core/resolver/xds/xds_resolver_attributes.h', - 'src/core/resolver/xds/xds_resolver_trace.cc', - 'src/core/resolver/xds/xds_resolver_trace.h', 'src/core/server/server.cc', 'src/core/server/server.h', 'src/core/server/server_call_tracer_filter.cc', @@ -2423,7 +2412,6 @@ Pod::Spec.new do |s| 'src/core/ext/transport/chttp2/transport/hpack_parser.h', 'src/core/ext/transport/chttp2/transport/hpack_parser_table.h', 'src/core/ext/transport/chttp2/transport/http2_settings.h', - 'src/core/ext/transport/chttp2/transport/http_trace.h', 'src/core/ext/transport/chttp2/transport/huffsyms.h', 'src/core/ext/transport/chttp2/transport/internal.h', 'src/core/ext/transport/chttp2/transport/legacy_frame.h', @@ -2940,7 +2928,6 @@ Pod::Spec.new do |s| 'src/core/lib/channel/channel_stack.h', 'src/core/lib/channel/channel_stack_builder.h', 'src/core/lib/channel/channel_stack_builder_impl.h', - 'src/core/lib/channel/channel_stack_trace.h', 'src/core/lib/channel/connected_channel.h', 'src/core/lib/channel/promise_based_filter.h', 'src/core/lib/channel/status_util.h', @@ -2951,6 +2938,8 @@ Pod::Spec.new do |s| 'src/core/lib/config/load_config.h', 'src/core/lib/debug/event_log.h', 'src/core/lib/debug/trace.h', + 'src/core/lib/debug/trace_flags.h', + 'src/core/lib/debug/trace_impl.h', 'src/core/lib/event_engine/ares_resolver.h', 'src/core/lib/event_engine/cf_engine/cf_engine.h', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.h', @@ -3032,6 +3021,7 @@ Pod::Spec.new do |s| 'src/core/lib/gprpp/env.h', 'src/core/lib/gprpp/examine_stack.h', 'src/core/lib/gprpp/fork.h', + 'src/core/lib/gprpp/glob.h', 'src/core/lib/gprpp/host_port.h', 'src/core/lib/gprpp/if_list.h', 'src/core/lib/gprpp/load_file.h', @@ -3160,7 +3150,6 @@ Pod::Spec.new do |s| 'src/core/lib/promise/seq.h', 'src/core/lib/promise/sleep.h', 'src/core/lib/promise/status_flag.h', - 'src/core/lib/promise/trace.h', 'src/core/lib/promise/try_join.h', 'src/core/lib/promise/try_seq.h', 'src/core/lib/resource_quota/api.h', @@ -3170,7 +3159,6 @@ Pod::Spec.new do |s| 'src/core/lib/resource_quota/periodic_update.h', 'src/core/lib/resource_quota/resource_quota.h', 'src/core/lib/resource_quota/thread_quota.h', - 'src/core/lib/resource_quota/trace.h', 'src/core/lib/security/authorization/audit_logging.h', 'src/core/lib/security/authorization/authorization_engine.h', 'src/core/lib/security/authorization/authorization_policy_provider.h', @@ -3235,7 +3223,6 @@ Pod::Spec.new do |s| 'src/core/lib/surface/api_trace.h', 'src/core/lib/surface/call.h', 'src/core/lib/surface/call_test_only.h', - 'src/core/lib/surface/call_trace.h', 'src/core/lib/surface/call_utils.h', 'src/core/lib/surface/channel.h', 'src/core/lib/surface/channel_create.h', @@ -3318,7 +3305,6 @@ Pod::Spec.new do |s| 'src/core/resolver/server_address.h', 'src/core/resolver/xds/xds_dependency_manager.h', 'src/core/resolver/xds/xds_resolver_attributes.h', - 'src/core/resolver/xds/xds_resolver_trace.h', 'src/core/server/server.h', 'src/core/server/server_call_tracer_filter.h', 'src/core/server/server_config_selector.h', diff --git a/grpc.gemspec b/grpc.gemspec index e5921c9ca75..91416b2ac1f 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -243,8 +243,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser_table.h ) s.files += %w( src/core/ext/transport/chttp2/transport/http2_settings.cc ) s.files += %w( src/core/ext/transport/chttp2/transport/http2_settings.h ) - s.files += %w( src/core/ext/transport/chttp2/transport/http_trace.cc ) - s.files += %w( src/core/ext/transport/chttp2/transport/http_trace.h ) s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.cc ) s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.h ) s.files += %w( src/core/ext/transport/chttp2/transport/internal.h ) @@ -264,7 +262,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/ext/transport/chttp2/transport/write_size_policy.cc ) s.files += %w( src/core/ext/transport/chttp2/transport/write_size_policy.h ) s.files += %w( src/core/ext/transport/chttp2/transport/writing.cc ) - s.files += %w( src/core/ext/transport/inproc/inproc_plugin.cc ) s.files += %w( src/core/ext/transport/inproc/inproc_transport.cc ) s.files += %w( src/core/ext/transport/inproc/inproc_transport.h ) s.files += %w( src/core/ext/transport/inproc/legacy_inproc_transport.cc ) @@ -1109,8 +1106,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/channel/channel_stack_builder.h ) s.files += %w( src/core/lib/channel/channel_stack_builder_impl.cc ) s.files += %w( src/core/lib/channel/channel_stack_builder_impl.h ) - s.files += %w( src/core/lib/channel/channel_stack_trace.cc ) - s.files += %w( src/core/lib/channel/channel_stack_trace.h ) s.files += %w( src/core/lib/channel/connected_channel.cc ) s.files += %w( src/core/lib/channel/connected_channel.h ) s.files += %w( src/core/lib/channel/promise_based_filter.cc ) @@ -1133,6 +1128,9 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/debug/event_log.h ) s.files += %w( src/core/lib/debug/trace.cc ) s.files += %w( src/core/lib/debug/trace.h ) + s.files += %w( src/core/lib/debug/trace_flags.cc ) + s.files += %w( src/core/lib/debug/trace_flags.h ) + s.files += %w( src/core/lib/debug/trace_impl.h ) s.files += %w( src/core/lib/event_engine/ares_resolver.cc ) s.files += %w( src/core/lib/event_engine/ares_resolver.h ) s.files += %w( src/core/lib/event_engine/cf_engine/cf_engine.cc ) @@ -1225,7 +1223,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/event_engine/thready_event_engine/thready_event_engine.h ) s.files += %w( src/core/lib/event_engine/time_util.cc ) s.files += %w( src/core/lib/event_engine/time_util.h ) - s.files += %w( src/core/lib/event_engine/trace.cc ) s.files += %w( src/core/lib/event_engine/trace.h ) s.files += %w( src/core/lib/event_engine/utils.cc ) s.files += %w( src/core/lib/event_engine/utils.h ) @@ -1268,6 +1265,8 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/gprpp/examine_stack.h ) s.files += %w( src/core/lib/gprpp/fork.cc ) s.files += %w( src/core/lib/gprpp/fork.h ) + s.files += %w( src/core/lib/gprpp/glob.cc ) + s.files += %w( src/core/lib/gprpp/glob.h ) s.files += %w( src/core/lib/gprpp/host_port.cc ) s.files += %w( src/core/lib/gprpp/host_port.h ) s.files += %w( src/core/lib/gprpp/if_list.h ) @@ -1357,7 +1356,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/ev_poll_posix.h ) s.files += %w( src/core/lib/iomgr/ev_posix.cc ) s.files += %w( src/core/lib/iomgr/ev_posix.h ) - s.files += %w( src/core/lib/iomgr/ev_windows.cc ) s.files += %w( src/core/lib/iomgr/event_engine_shims/closure.cc ) s.files += %w( src/core/lib/iomgr/event_engine_shims/closure.h ) s.files += %w( src/core/lib/iomgr/event_engine_shims/endpoint.cc ) @@ -1500,8 +1498,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/promise/sleep.cc ) s.files += %w( src/core/lib/promise/sleep.h ) s.files += %w( src/core/lib/promise/status_flag.h ) - s.files += %w( src/core/lib/promise/trace.cc ) - s.files += %w( src/core/lib/promise/trace.h ) s.files += %w( src/core/lib/promise/try_join.h ) s.files += %w( src/core/lib/promise/try_seq.h ) s.files += %w( src/core/lib/resource_quota/api.cc ) @@ -1518,8 +1514,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/resource_quota/resource_quota.h ) s.files += %w( src/core/lib/resource_quota/thread_quota.cc ) s.files += %w( src/core/lib/resource_quota/thread_quota.h ) - s.files += %w( src/core/lib/resource_quota/trace.cc ) - s.files += %w( src/core/lib/resource_quota/trace.h ) s.files += %w( src/core/lib/security/authorization/audit_logging.cc ) s.files += %w( src/core/lib/security/authorization/audit_logging.h ) s.files += %w( src/core/lib/security/authorization/authorization_engine.h ) @@ -1644,11 +1638,9 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/slice/slice_buffer.cc ) s.files += %w( src/core/lib/slice/slice_buffer.h ) s.files += %w( src/core/lib/slice/slice_internal.h ) - s.files += %w( src/core/lib/slice/slice_refcount.cc ) s.files += %w( src/core/lib/slice/slice_refcount.h ) s.files += %w( src/core/lib/slice/slice_string_helpers.cc ) s.files += %w( src/core/lib/slice/slice_string_helpers.h ) - s.files += %w( src/core/lib/surface/api_trace.cc ) s.files += %w( src/core/lib/surface/api_trace.h ) s.files += %w( src/core/lib/surface/byte_buffer.cc ) s.files += %w( src/core/lib/surface/byte_buffer_reader.cc ) @@ -1657,7 +1649,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/surface/call_details.cc ) s.files += %w( src/core/lib/surface/call_log_batch.cc ) s.files += %w( src/core/lib/surface/call_test_only.h ) - s.files += %w( src/core/lib/surface/call_trace.h ) s.files += %w( src/core/lib/surface/call_utils.cc ) s.files += %w( src/core/lib/surface/call_utils.h ) s.files += %w( src/core/lib/surface/channel.cc ) @@ -1825,8 +1816,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/resolver/xds/xds_dependency_manager.h ) s.files += %w( src/core/resolver/xds/xds_resolver.cc ) s.files += %w( src/core/resolver/xds/xds_resolver_attributes.h ) - s.files += %w( src/core/resolver/xds/xds_resolver_trace.cc ) - s.files += %w( src/core/resolver/xds/xds_resolver_trace.h ) s.files += %w( src/core/server/server.cc ) s.files += %w( src/core/server/server.h ) s.files += %w( src/core/server/server_call_tracer_filter.cc ) diff --git a/package.xml b/package.xml index 00ea6281269..523bc3aa67b 100644 --- a/package.xml +++ b/package.xml @@ -225,8 +225,6 @@ - - @@ -246,7 +244,6 @@ - @@ -1091,8 +1088,6 @@ - - @@ -1115,6 +1110,9 @@ + + + @@ -1207,7 +1205,6 @@ - @@ -1250,6 +1247,8 @@ + + @@ -1339,7 +1338,6 @@ - @@ -1482,8 +1480,6 @@ - - @@ -1500,8 +1496,6 @@ - - @@ -1626,11 +1620,9 @@ - - @@ -1639,7 +1631,6 @@ - @@ -1807,8 +1798,6 @@ - - diff --git a/src/core/BUILD b/src/core/BUILD index b80a69b5a2a..3f29d96f28d 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -547,7 +547,6 @@ grpc_cc_library( "pipe", "poll", "promise_factory", - "promise_trace", "try_seq", "//:gpr", "//:gpr_platform", @@ -577,11 +576,11 @@ grpc_cc_library( "context", "poll", "promise_factory", - "promise_trace", "ref_counted", "//:event_engine_base_hdrs", "//:exec_ctx", "//:gpr", + "//:grpc_trace", "//:ref_counted_ptr", ], ) @@ -796,9 +795,8 @@ grpc_cc_library( "construct_destruct", "poll", "promise_like", - "promise_trace", "//:gpr", - "//:gpr_platform", + "//:grpc_trace", ], ) @@ -887,9 +885,9 @@ grpc_cc_library( "poll", "promise_factory", "promise_like", - "promise_trace", "//:debug_location", "//:gpr", + "//:grpc_trace", ], ) @@ -1025,8 +1023,8 @@ grpc_cc_library( deps = [ "activity", "poll", - "promise_trace", "//:gpr", + "//:grpc_trace", ], ) @@ -1044,9 +1042,9 @@ grpc_cc_library( deps = [ "activity", "poll", - "promise_trace", "wait_set", "//:gpr", + "//:grpc_trace", ], ) @@ -1068,7 +1066,6 @@ grpc_cc_library( "context", "poll", "promise_factory", - "promise_trace", "//:debug_location", "//:gpr", ], @@ -1095,7 +1092,6 @@ grpc_cc_library( "interceptor_list", "map", "poll", - "promise_trace", "seq", "//:debug_location", "//:gpr", @@ -1136,21 +1132,6 @@ grpc_cc_library( ], ) -grpc_cc_library( - name = "promise_trace", - srcs = [ - "lib/promise/trace.cc", - ], - hdrs = [ - "lib/promise/trace.h", - ], - language = "c++", - deps = [ - "//:gpr_platform", - "//:grpc_trace", - ], -) - grpc_cc_library( name = "mpsc", hdrs = [ @@ -1205,10 +1186,10 @@ grpc_cc_library( "poll", "promise_factory", "promise_status", - "promise_trace", "status_flag", "//:gpr", "//:gpr_platform", + "//:grpc_trace", ], ) @@ -1445,7 +1426,6 @@ grpc_cc_library( "periodic_update", "poll", "race", - "resource_quota_trace", "seq", "slice_refcount", "time", @@ -1536,20 +1516,6 @@ grpc_cc_library( ], ) -grpc_cc_library( - name = "resource_quota_trace", - srcs = [ - "lib/resource_quota/trace.cc", - ], - hdrs = [ - "lib/resource_quota/trace.h", - ], - deps = [ - "//:gpr_platform", - "//:grpc_trace", - ], -) - grpc_cc_library( name = "resource_quota", srcs = [ @@ -1578,9 +1544,6 @@ grpc_cc_library( grpc_cc_library( name = "slice_refcount", - srcs = [ - "lib/slice/slice_refcount.cc", - ], hdrs = [ "lib/slice/slice_refcount.h", ], @@ -2688,11 +2651,9 @@ grpc_cc_library( ], ) +# TODO(hork): delete this target when refactoring to GRPC_TRACE_LOG(flag, level) grpc_cc_library( name = "event_engine_trace", - srcs = [ - "lib/event_engine/trace.cc", - ], hdrs = [ "lib/event_engine/trace.h", ], @@ -3107,21 +3068,6 @@ grpc_cc_library( deps = ["//:gpr_platform"], ) -grpc_cc_library( - name = "channel_stack_trace", - srcs = [ - "lib/channel/channel_stack_trace.cc", - ], - hdrs = [ - "lib/channel/channel_stack_trace.h", - ], - language = "c++", - deps = [ - "//:gpr_platform", - "//:grpc_trace", - ], -) - grpc_cc_library( name = "channel_init", srcs = [ @@ -3142,7 +3088,6 @@ grpc_cc_library( "call_filters", "channel_args", "channel_fwd", - "channel_stack_trace", "channel_stack_type", "interception_chain", "//:channel_stack_builder", @@ -4767,7 +4712,6 @@ grpc_cc_library( "slice", "slice_buffer", "validation_errors", - "//:call_trace", "//:channel_arg_names", "//:config", "//:gpr", @@ -5805,6 +5749,13 @@ grpc_cc_library( deps = ["//:gpr"], ) +grpc_cc_library( + name = "glob", + srcs = ["lib/gprpp/glob.cc"], + hdrs = ["lib/gprpp/glob.h"], + external_deps = ["absl/strings"], +) + grpc_cc_library( name = "status_conversion", srcs = ["lib/transport/status_conversion.cc"], @@ -6581,21 +6532,6 @@ grpc_cc_library( ], ) -grpc_cc_library( - name = "grpc_resolver_xds_trace", - srcs = [ - "resolver/xds/xds_resolver_trace.cc", - ], - hdrs = [ - "resolver/xds/xds_resolver_trace.h", - ], - language = "c++", - deps = [ - "//:gpr_platform", - "//:grpc_trace", - ], -) - grpc_cc_library( name = "xds_dependency_manager", srcs = [ @@ -6614,7 +6550,6 @@ grpc_cc_library( language = "c++", deps = [ "grpc_lb_xds_channel_args", - "grpc_resolver_xds_trace", "grpc_xds_client", "match", "ref_counted", @@ -6656,7 +6591,6 @@ grpc_cc_library( "experiments", "grpc_lb_policy_ring_hash", "grpc_resolver_xds_attributes", - "grpc_resolver_xds_trace", "grpc_service_config", "grpc_xds_client", "iomgr_fwd", @@ -7066,7 +7000,6 @@ grpc_cc_library( grpc_cc_library( name = "grpc_transport_inproc", srcs = [ - "ext/transport/inproc/inproc_plugin.cc", "ext/transport/inproc/inproc_transport.cc", "ext/transport/inproc/legacy_inproc_transport.cc", ], @@ -7329,9 +7262,6 @@ grpc_cc_library( grpc_cc_library( name = "chaotic_good_transport", - srcs = [ - "ext/transport/chaotic_good/chaotic_good_transport.cc", - ], hdrs = [ "ext/transport/chaotic_good/chaotic_good_transport.h", ], diff --git a/src/core/client_channel/client_channel.cc b/src/core/client_channel/client_channel.cc index 1fadc90c226..004f87bbba0 100644 --- a/src/core/client_channel/client_channel.cc +++ b/src/core/client_channel/client_channel.cc @@ -100,12 +100,6 @@ using grpc_event_engine::experimental::EventEngine; using internal::ClientChannelMethodParsedConfig; -// Defined in legacy client channel filter. -// TODO(roth): Move these here when we remove the legacy filter. -extern TraceFlag grpc_client_channel_trace; -extern TraceFlag grpc_client_channel_call_trace; -extern TraceFlag grpc_client_channel_lb_call_trace; - // // ClientChannel::ResolverResultHandler // @@ -117,10 +111,9 @@ class ClientChannel::ResolverResultHandler : public Resolver::ResultHandler { : client_channel_(std::move(client_channel)) {} ~ResolverResultHandler() override { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: resolver shutdown complete", - client_channel_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << client_channel_.get() + << ": resolver shutdown complete"; } void ReportResult(Resolver::Result result) override @@ -236,14 +229,12 @@ class ClientChannel::SubchannelWrapper::WatcherWrapper void OnConnectivityStateChange( RefCountedPtr self, grpc_connectivity_state state, const absl::Status& status) override { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "client_channel=%p: connectivity change for subchannel " - "wrapper %p subchannel %p; hopping into work_serializer", - subchannel_wrapper_->client_channel_.get(), - subchannel_wrapper_.get(), - subchannel_wrapper_->subchannel_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << subchannel_wrapper_->client_channel_.get() + << ": connectivity change for subchannel wrapper " + << subchannel_wrapper_.get() << " subchannel " + << subchannel_wrapper_->subchannel_.get() + << "; hopping into work_serializer"; self.release(); // Held by callback. subchannel_wrapper_->client_channel_->work_serializer_->Run( [this, state, status]() ABSL_EXCLUSIVE_LOCKS_REQUIRED( @@ -261,16 +252,14 @@ class ClientChannel::SubchannelWrapper::WatcherWrapper const absl::Status& status) ABSL_EXCLUSIVE_LOCKS_REQUIRED( *subchannel_wrapper_->client_channel_->work_serializer_) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "client_channel=%p: processing connectivity change in work " - "serializer for subchannel wrapper %p subchannel %p watcher=%p " - "state=%s status=%s", - subchannel_wrapper_->client_channel_.get(), - subchannel_wrapper_.get(), subchannel_wrapper_->subchannel_.get(), - watcher_.get(), ConnectivityStateName(state), - status.ToString().c_str()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << subchannel_wrapper_->client_channel_.get() + << ": processing connectivity change in work serializer for subchannel " + "wrapper " + << subchannel_wrapper_.get() << " subchannel " + << subchannel_wrapper_->subchannel_.get() + << " watcher=" << watcher_.get() + << "state=" << ConnectivityStateName(state) << " status=" << status; absl::optional keepalive_throttling = status.GetPayload(kKeepaliveThrottlingKey); if (keepalive_throttling.has_value()) { @@ -281,12 +270,10 @@ class ClientChannel::SubchannelWrapper::WatcherWrapper subchannel_wrapper_->client_channel_->keepalive_time_) { subchannel_wrapper_->client_channel_->keepalive_time_ = new_keepalive_time; - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "client_channel=%p: throttling keepalive time to %d", - subchannel_wrapper_->client_channel_.get(), - subchannel_wrapper_->client_channel_->keepalive_time_); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << subchannel_wrapper_->client_channel_.get() + << ": throttling keepalive time to " + << subchannel_wrapper_->client_channel_->keepalive_time_; // Propagate the new keepalive time to all subchannels. This is so // that new transports created by any subchannel (and not just the // subchannel that received the GOAWAY), use the new keepalive time. @@ -320,17 +307,14 @@ ClientChannel::SubchannelWrapper::SubchannelWrapper( WeakRefCountedPtr client_channel, RefCountedPtr subchannel) : SubchannelInterfaceWithCallDestination( - GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace) - ? "SubchannelWrapper" - : nullptr), + GRPC_TRACE_FLAG_ENABLED(client_channel) ? "SubchannelWrapper" + : nullptr), client_channel_(std::move(client_channel)), subchannel_(std::move(subchannel)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log( - GPR_INFO, - "client_channel=%p: creating subchannel wrapper %p for subchannel %p", - client_channel_.get(), this, subchannel_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << client_channel_.get() + << ": creating subchannel wrapper " << this << " for subchannel " + << subchannel_.get(); #ifndef NDEBUG DCHECK(client_channel_->work_serializer_->RunningInWorkSerializer()); #endif @@ -353,12 +337,10 @@ ClientChannel::SubchannelWrapper::SubchannelWrapper( } ClientChannel::SubchannelWrapper::~SubchannelWrapper() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "client_channel=%p: destroying subchannel wrapper %p " - "for subchannel %p", - client_channel_.get(), this, subchannel_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << client_channel_.get() + << ": destroying subchannel wrapper " << this << " for subchannel " + << subchannel_.get(); } void ClientChannel::SubchannelWrapper::Orphaned() { @@ -467,7 +449,7 @@ class ClientChannel::ClientChannelControlHelper RefCountedPtr picker) override ABSL_EXCLUSIVE_LOCKS_REQUIRED(*client_channel_->work_serializer_) { if (client_channel_->resolver_ == nullptr) return; // Shutting down. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(client_channel)) { const char* extra = client_channel_->disconnect_error_.ok() ? "" : " (ignoring -- channel shutting down)"; @@ -486,10 +468,9 @@ class ClientChannel::ClientChannelControlHelper void RequestReresolution() override ABSL_EXCLUSIVE_LOCKS_REQUIRED(*client_channel_->work_serializer_) { if (client_channel_->resolver_ == nullptr) return; // Shutting down. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: started name re-resolving", - client_channel_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << client_channel_.get() + << ": started name re-resolving"; client_channel_->resolver_->RequestReresolutionLocked(); } @@ -644,9 +625,8 @@ ClientChannel::ClientChannel( work_serializer_(std::make_shared(event_engine_)), state_tracker_("client_channel", GRPC_CHANNEL_IDLE), subchannel_pool_(GetSubchannelPool(channel_args_)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: creating client_channel", this); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": creating client_channel"; // Set initial keepalive time. auto keepalive_arg = channel_args_.GetInt(GRPC_ARG_KEEPALIVE_TIME_MS); if (keepalive_arg.has_value()) { @@ -662,15 +642,13 @@ ClientChannel::ClientChannel( } ClientChannel::~ClientChannel() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: destroying", this); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": destroying"; } void ClientChannel::Orphaned() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: shutting down", this); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": shutting down"; // Weird capture then copy needed to satisfy thread safety analysis, // otherwise it seems to fail to recognize the correct lock is taken in the // lambda. @@ -858,10 +836,9 @@ void ClientChannel::StartCall(UnstartedCallHandler unstarted_handler) { } void ClientChannel::CreateResolverLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: starting name resolution for %s", - this, uri_to_resolve_.c_str()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": starting name resolution for " + << uri_to_resolve_; resolver_ = CoreConfiguration::Get().resolver_registry().CreateResolver( uri_to_resolve_, channel_args_, nullptr, work_serializer_, std::make_unique( @@ -872,28 +849,24 @@ void ClientChannel::CreateResolverLocked() { UpdateStateLocked(GRPC_CHANNEL_CONNECTING, absl::Status(), "started resolving"); resolver_->StartLocked(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: created resolver=%p", this, - resolver_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": created resolver=" << resolver_.get(); } void ClientChannel::DestroyResolverAndLbPolicyLocked() { if (resolver_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: shutting down resolver=%p", this, - resolver_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this + << ": shutting down resolver=" << resolver_.get(); resolver_.reset(); saved_service_config_.reset(); saved_config_selector_.reset(); resolver_data_for_calls_.Set(ResolverDataForCalls{nullptr, nullptr}); // Clear LB policy if set. if (lb_policy_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: shutting down lb_policy=%p", this, - lb_policy_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this + << ": shutting down lb_policy=" << lb_policy_.get(); lb_policy_.reset(); picker_.Set(MakeRefCounted( absl::UnavailableError("Channel shutdown"))); @@ -975,9 +948,8 @@ RefCountedPtr ChooseLbPolicy( void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) { // Handle race conditions. if (resolver_ == nullptr) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: got resolver result", this); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": got resolver result"; // Grab resolver result health callback. auto resolver_callback = std::move(result.result_health_callback); absl::Status resolver_result_status; @@ -1011,20 +983,17 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) { RefCountedPtr service_config; RefCountedPtr config_selector; if (!result.service_config.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "client_channel=%p: resolver returned service config error: %s", - this, result.service_config.status().ToString().c_str()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this + << ": resolver returned service config error: " + << result.service_config.status(); // If the service config was invalid, then fallback to the // previously returned service config, if any. if (saved_service_config_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "client_channel=%p: resolver returned invalid service config; " - "continuing to use previous service config", - this); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this + << ": resolver returned invalid service config; " + "continuing to use previous service config"; service_config = saved_service_config_; config_selector = saved_config_selector_; } else { @@ -1038,12 +1007,10 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) { } } else if (*result.service_config == nullptr) { // Resolver did not return any service config. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "client_channel=%p: resolver returned no service config; " - "using default service config for channel", - this); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this + << ": resolver returned no service config; using default service " + "config for channel"; service_config = default_service_config_; } else { // Use ServiceConfig and ConfigSelector returned by resolver. @@ -1078,8 +1045,9 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) { // TODO(ncteisen): might be worth somehow including a snippet of the // config in the trace, at the risk of bloating the trace logs. trace_strings.push_back("Service config changed"); - } else if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: service config not changed", this); + } else { + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": service config not changed"; } // Create or update LB policy, as needed. resolver_result_status = CreateOrUpdateLbPolicyLocked( @@ -1110,10 +1078,9 @@ void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) { void ClientChannel::OnResolverErrorLocked(absl::Status status) { if (resolver_ == nullptr) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: resolver transient failure: %s", this, - status.ToString().c_str()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this + << ": resolver transient failure: " << status; // If we already have an LB policy from a previous resolution // result, then we continue to let it set the connectivity state. // Otherwise, we go into TRANSIENT_FAILURE. @@ -1155,10 +1122,9 @@ absl::Status ClientChannel::CreateOrUpdateLbPolicyLocked( lb_policy_ = CreateLbPolicyLocked(update_args.args); } // Update the policy. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: Updating child policy %p", this, - lb_policy_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": Updating child policy " + << lb_policy_.get(); return lb_policy_->UpdateLocked(std::move(update_args)); } @@ -1181,11 +1147,10 @@ OrphanablePtr ClientChannel::CreateLbPolicyLocked( lb_policy_args.args = args; OrphanablePtr lb_policy = MakeOrphanable(std::move(lb_policy_args), - &grpc_client_channel_trace); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: created new LB policy %p", this, - lb_policy.get()); - } + &client_channel_trace); + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": created new LB policy " + << lb_policy.get(); return lb_policy; } @@ -1194,16 +1159,14 @@ void ClientChannel::UpdateServiceConfigInControlPlaneLocked( RefCountedPtr config_selector, std::string lb_policy_name) { std::string service_config_json(service_config->json_string()); // Update service config. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: using service config: \"%s\"", this, - service_config_json.c_str()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": using service config: \"" + << service_config_json << "\""; saved_service_config_ = std::move(service_config); // Update config selector. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: using ConfigSelector %p", this, - config_selector.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": using ConfigSelector " + << config_selector.get(); saved_config_selector_ = std::move(config_selector); // Update the data used by GetChannelInfo(). { @@ -1214,10 +1177,9 @@ void ClientChannel::UpdateServiceConfigInControlPlaneLocked( } void ClientChannel::UpdateServiceConfigInDataPlaneLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: switching to ConfigSelector %p", this, - saved_config_selector_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": switching to ConfigSelector " + << saved_config_selector_.get(); // Use default config selector if resolver didn't supply one. RefCountedPtr config_selector = saved_config_selector_; if (config_selector == nullptr) { @@ -1279,9 +1241,8 @@ void ClientChannel::UpdateStateAndPickerLocked( } void ClientChannel::StartIdleTimer() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: idle timer started", this); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "client_channel=" << this << ": idle timer started"; auto self = WeakRefAsSubclass(); auto promise = Loop([self]() { return TrySeq(Sleep(Timestamp::Now() + self->idle_timeout_), @@ -1316,10 +1277,9 @@ void ClientChannel::StartIdleTimer() { absl::Status ClientChannel::ApplyServiceConfigToCall( ConfigSelector& config_selector, ClientMetadata& client_initial_metadata) const { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, "client_channel=%p: %sapplying service config to call", - this, GetContext()->DebugTag().c_str()); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "client_channel=" << this << ": " << GetContext()->DebugTag() + << " service config to call"; // Create a ClientChannelServiceConfigCallData for the call. This stores // a ref to the ServiceConfig and caches the right set of parsed configs // to use for the call. The ClientChannelServiceConfigCallData will store diff --git a/src/core/client_channel/client_channel_filter.cc b/src/core/client_channel/client_channel_filter.cc index c9ada909d07..84724d63df6 100644 --- a/src/core/client_channel/client_channel_filter.cc +++ b/src/core/client_channel/client_channel_filter.cc @@ -113,10 +113,6 @@ namespace grpc_core { using internal::ClientChannelMethodParsedConfig; -TraceFlag grpc_client_channel_trace(false, "client_channel"); -TraceFlag grpc_client_channel_call_trace(false, "client_channel_call"); -TraceFlag grpc_client_channel_lb_call_trace(false, "client_channel_lb_call"); - // // ClientChannelFilter::CallData definition // @@ -411,11 +407,9 @@ class DynamicTerminationFilter::CallData final { args, pollent, nullptr, [service_config_call_data]() { service_config_call_data->Commit(); }, /*is_transparent_retry=*/false); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p dynamic_termination_calld=%p: create lb_call=%p", chand, - client_channel, calld->lb_call_.get()); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand << " dynamic_termination_calld=" << client_channel + << ": create lb_call=" << calld->lb_call_.get(); } private: @@ -466,9 +460,8 @@ class ClientChannelFilter::ResolverResultHandler final } ~ResolverResultHandler() override { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: resolver shutdown complete", chand_); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << chand_ << ": resolver shutdown complete"; GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "ResolverResultHandler"); } @@ -498,16 +491,14 @@ class ClientChannelFilter::SubchannelWrapper final public: SubchannelWrapper(ClientChannelFilter* chand, RefCountedPtr subchannel) - : SubchannelInterface(GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace) + : SubchannelInterface(GRPC_TRACE_FLAG_ENABLED(client_channel) ? "SubchannelWrapper" : nullptr), chand_(chand), subchannel_(std::move(subchannel)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "chand=%p: creating subchannel wrapper %p for subchannel %p", - chand, this, subchannel_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << chand << ": creating subchannel wrapper " << this + << " for subchannel " << subchannel_.get(); GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "SubchannelWrapper"); #ifndef NDEBUG DCHECK(chand_->work_serializer_->RunningInWorkSerializer()); @@ -528,11 +519,9 @@ class ClientChannelFilter::SubchannelWrapper final } ~SubchannelWrapper() override { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "chand=%p: destroying subchannel wrapper %p for subchannel %p", - chand_, this, subchannel_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << chand_ << ": destroying subchannel wrapper " << this + << "for subchannel " << subchannel_.get(); if (!IsWorkSerializerDispatchEnabled()) { chand_->subchannel_wrappers_.erase(this); if (chand_->channelz_node_ != nullptr) { @@ -665,12 +654,11 @@ class ClientChannelFilter::SubchannelWrapper final void OnConnectivityStateChange( RefCountedPtr self, grpc_connectivity_state state, const absl::Status& status) override { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "chand=%p: connectivity change for subchannel wrapper %p " - "subchannel %p; hopping into work_serializer", - parent_->chand_, parent_.get(), parent_->subchannel_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << parent_->chand_ + << ": connectivity change for subchannel wrapper " << parent_.get() + << " subchannel " << parent_->subchannel_.get() + << "hopping into work_serializer"; self.release(); // Held by callback. parent_->chand_->work_serializer_->Run( [this, state, status]() ABSL_EXCLUSIVE_LOCKS_REQUIRED( @@ -689,15 +677,13 @@ class ClientChannelFilter::SubchannelWrapper final void ApplyUpdateInControlPlaneWorkSerializer(grpc_connectivity_state state, const absl::Status& status) ABSL_EXCLUSIVE_LOCKS_REQUIRED(*parent_->chand_->work_serializer_) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "chand=%p: processing connectivity change in work serializer " - "for subchannel wrapper %p subchannel %p watcher=%p " - "state=%s status=%s", - parent_->chand_, parent_.get(), parent_->subchannel_.get(), - watcher_.get(), ConnectivityStateName(state), - status.ToString().c_str()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << parent_->chand_ + << ": processing connectivity change in work serializer for " + "subchannel wrapper " + << parent_.get() << " subchannel " << parent_->subchannel_.get() + << " watcher=" << watcher_.get() + << " state=" << ConnectivityStateName(state) << " status=" << status; absl::optional keepalive_throttling = status.GetPayload(kKeepaliveThrottlingKey); if (keepalive_throttling.has_value()) { @@ -706,10 +692,10 @@ class ClientChannelFilter::SubchannelWrapper final &new_keepalive_time)) { if (new_keepalive_time > parent_->chand_->keepalive_time_) { parent_->chand_->keepalive_time_ = new_keepalive_time; - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: throttling keepalive time to %d", - parent_->chand_, parent_->chand_->keepalive_time_); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << parent_->chand_ + << ": throttling keepalive time to " + << parent_->chand_->keepalive_time_; // Propagate the new keepalive time to all subchannels. This is so // that new transports created by any subchannel (and not just the // subchannel that received the GOAWAY), use the new keepalive time. @@ -992,14 +978,13 @@ class ClientChannelFilter::ClientChannelControlHelper final RefCountedPtr picker) override ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) { if (chand_->resolver_ == nullptr) return; // Shutting down. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - const char* extra = chand_->disconnect_error_.ok() - ? "" - : " (ignoring -- channel shutting down)"; - gpr_log(GPR_INFO, "chand=%p: update: state=%s status=(%s) picker=%p%s", - chand_, ConnectivityStateName(state), status.ToString().c_str(), - picker.get(), extra); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << chand_ + << ": update: state=" << ConnectivityStateName(state) << " status=(" + << status << ") picker=" << picker.get() + << (chand_->disconnect_error_.ok() + ? "" + : " (ignoring -- channel shutting down)"); // Do update only if not shutting down. if (chand_->disconnect_error_.ok()) { chand_->UpdateStateAndPickerLocked(state, status, "helper", @@ -1010,9 +995,8 @@ class ClientChannelFilter::ClientChannelControlHelper final void RequestReresolution() override ABSL_EXCLUSIVE_LOCKS_REQUIRED(*chand_->work_serializer_) { if (chand_->resolver_ == nullptr) return; // Shutting down. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: started name re-resolving", chand_); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << chand_ << ": started name re-resolving"; chand_->resolver_->RequestReresolutionLocked(); } @@ -1104,10 +1088,9 @@ ClientChannelFilter::ClientChannelFilter(grpc_channel_element_args* args, std::make_shared(*args->channel_stack->event_engine)), state_tracker_("client_channel", GRPC_CHANNEL_IDLE), subchannel_pool_(GetSubchannelPool(channel_args_)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: creating client_channel for channel stack %p", - this, owning_stack_); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": creating client_channel for channel stack " + << owning_stack_; // Start backup polling. grpc_client_channel_start_backup_polling(interested_parties_); // Check client channel factory. @@ -1176,9 +1159,8 @@ ClientChannelFilter::ClientChannelFilter(grpc_channel_element_args* args, } ClientChannelFilter::~ClientChannelFilter() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: destroying channel", this); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": destroying channel"; DestroyResolverAndLbPolicyLocked(); // Stop backup polling. grpc_client_channel_stop_backup_polling(interested_parties_); @@ -1270,9 +1252,8 @@ void ClientChannelFilter::OnResolverResultChangedLocked( Resolver::Result result) { // Handle race conditions. if (resolver_ == nullptr) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: got resolver result", this); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": got resolver result"; // Grab resolver result health callback. auto resolver_callback = std::move(result.result_health_callback); absl::Status resolver_result_status; @@ -1306,19 +1287,16 @@ void ClientChannelFilter::OnResolverResultChangedLocked( RefCountedPtr service_config; RefCountedPtr config_selector; if (!result.service_config.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: resolver returned service config error: %s", - this, result.service_config.status().ToString().c_str()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": resolver returned service config error: " + << result.service_config.status(); // If the service config was invalid, then fallback to the // previously returned service config. if (saved_service_config_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "chand=%p: resolver returned invalid service config. " - "Continuing to use previous service config.", - this); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this + << ": resolver returned invalid service config. " + "Continuing to use previous service config."; service_config = saved_service_config_; config_selector = saved_config_selector_; } else { @@ -1332,12 +1310,10 @@ void ClientChannelFilter::OnResolverResultChangedLocked( } } else if (*result.service_config == nullptr) { // Resolver did not return any service config. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, - "chand=%p: resolver returned no service config. Using default " - "service config for channel.", - this); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this + << ": resolver returned no service config. Using default service " + "config for channel."; service_config = default_service_config_; } else { // Use ServiceConfig and ConfigSelector returned by resolver. @@ -1369,8 +1345,9 @@ void ClientChannelFilter::OnResolverResultChangedLocked( UpdateServiceConfigInControlPlaneLocked( std::move(service_config), std::move(config_selector), std::string(lb_policy_config->name())); - } else if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: service config not changed", this); + } else { + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": service config not changed"; } // Create or update LB policy, as needed. resolver_result_status = CreateOrUpdateLbPolicyLocked( @@ -1404,10 +1381,8 @@ void ClientChannelFilter::OnResolverResultChangedLocked( void ClientChannelFilter::OnResolverErrorLocked(absl::Status status) { if (resolver_ == nullptr) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: resolver transient failure: %s", this, - status.ToString().c_str()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": resolver transient failure: " << status; // If we already have an LB policy from a previous resolution // result, then we continue to let it set the connectivity state. // Otherwise, we go into TRANSIENT_FAILURE. @@ -1453,10 +1428,8 @@ absl::Status ClientChannelFilter::CreateOrUpdateLbPolicyLocked( lb_policy_ = CreateLbPolicyLocked(update_args.args); } // Update the policy. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: Updating child policy %p", this, - lb_policy_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": Updating child policy " << lb_policy_.get(); return lb_policy_->UpdateLocked(std::move(update_args)); } @@ -1478,11 +1451,9 @@ OrphanablePtr ClientChannelFilter::CreateLbPolicyLocked( lb_policy_args.args = args; OrphanablePtr lb_policy = MakeOrphanable(std::move(lb_policy_args), - &grpc_client_channel_trace); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: created new LB policy %p", this, - lb_policy.get()); - } + &client_channel_trace); + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": created new LB policy " << lb_policy.get(); grpc_pollset_set_add_pollset_set(lb_policy->interested_parties(), interested_parties_); return lb_policy; @@ -1492,10 +1463,9 @@ void ClientChannelFilter::UpdateServiceConfigInControlPlaneLocked( RefCountedPtr service_config, RefCountedPtr config_selector, std::string lb_policy_name) { std::string service_config_json(service_config->json_string()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: using service config: \"%s\"", this, - service_config_json.c_str()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": using service config: \"" << service_config_json + << "\""; // Save service config. saved_service_config_ = std::move(service_config); // Swap out the data used by GetChannelInfo(). @@ -1506,10 +1476,9 @@ void ClientChannelFilter::UpdateServiceConfigInControlPlaneLocked( } // Save config selector. saved_config_selector_ = std::move(config_selector); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: using ConfigSelector %p", this, - saved_config_selector_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": using ConfigSelector " + << saved_config_selector_.get(); } void ClientChannelFilter::UpdateServiceConfigInDataPlaneLocked() { @@ -1517,10 +1486,9 @@ void ClientChannelFilter::UpdateServiceConfigInDataPlaneLocked() { RefCountedPtr service_config = saved_service_config_; // Grab ref to config selector. Use default if resolver didn't supply one. RefCountedPtr config_selector = saved_config_selector_; - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: switching to ConfigSelector %p", this, - saved_config_selector_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": switching to ConfigSelector " + << saved_config_selector_.get(); if (config_selector == nullptr) { config_selector = MakeRefCounted(saved_service_config_); @@ -1562,10 +1530,9 @@ void ClientChannelFilter::UpdateServiceConfigInDataPlaneLocked() { } void ClientChannelFilter::CreateResolverLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: starting name resolution for %s", this, - uri_to_resolve_.c_str()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": starting name resolution for " + << uri_to_resolve_; resolver_ = CoreConfiguration::Get().resolver_registry().CreateResolver( uri_to_resolve_, channel_args_, interested_parties_, work_serializer_, std::make_unique(this)); @@ -1575,17 +1542,14 @@ void ClientChannelFilter::CreateResolverLocked() { UpdateStateLocked(GRPC_CHANNEL_CONNECTING, absl::Status(), "started resolving"); resolver_->StartLocked(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: created resolver=%p", this, resolver_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": created resolver=" << resolver_.get(); } void ClientChannelFilter::DestroyResolverAndLbPolicyLocked() { if (resolver_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: shutting down resolver=%p", this, - resolver_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": shutting down resolver=" << resolver_.get(); resolver_.reset(); // Clear resolution state. saved_service_config_.reset(); @@ -1605,10 +1569,9 @@ void ClientChannelFilter::DestroyResolverAndLbPolicyLocked() { } // Clear LB policy if set. if (lb_policy_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: shutting down lb_policy=%p", this, - lb_policy_.get()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this + << ": shutting down lb_policy=" << lb_policy_.get(); grpc_pollset_set_del_pollset_set(lb_policy_->interested_parties(), interested_parties_); lb_policy_.reset(); @@ -1754,10 +1717,9 @@ void ClientChannelFilter::StartTransportOpLocked(grpc_transport_op* op) { } // Disconnect or enter IDLE. if (!op->disconnect_with_error.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_trace)) { - gpr_log(GPR_INFO, "chand=%p: disconnect_with_error: %s", this, - StatusToString(op->disconnect_with_error).c_str()); - } + GRPC_TRACE_LOG(client_channel, INFO) + << "chand=" << this << ": disconnect_with_error: " + << StatusToString(op->disconnect_with_error); DestroyResolverAndLbPolicyLocked(); intptr_t value; if (grpc_error_get_int(op->disconnect_with_error, @@ -1862,11 +1824,9 @@ void ClientChannelFilter::RemoveConnectivityWatcher( // void ClientChannelFilter::CallData::RemoveCallFromResolverQueuedCallsLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p calld=%p: removing from resolver queued picks list", - chand(), this); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand() << " calld=" << this + << ": removing from resolver queued picks list"; // Remove call's pollent from channel's interested_parties. grpc_polling_entity_del_from_pollset_set(pollent(), chand()->interested_parties_); @@ -1877,12 +1837,10 @@ void ClientChannelFilter::CallData::RemoveCallFromResolverQueuedCallsLocked() { } void ClientChannelFilter::CallData::AddCallToResolverQueuedCallsLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log( - GPR_INFO, - "chand=%p calld=%p: adding to resolver queued picks list; pollent=%s", - chand(), this, grpc_polling_entity_string(pollent()).c_str()); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand() << " calld=" << this + << ": adding to resolver queued picks list; pollent=" + << grpc_polling_entity_string(pollent()); // Add call's pollent to channel's interested_parties, so that I/O // can be done under the call's CQ. grpc_polling_entity_add_to_pollset_set(pollent(), @@ -1894,10 +1852,9 @@ void ClientChannelFilter::CallData::AddCallToResolverQueuedCallsLocked() { grpc_error_handle ClientChannelFilter::CallData::ApplyServiceConfigToCallLocked( const absl::StatusOr>& config_selector) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, "chand=%p calld=%p: applying service config to call", - chand(), this); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand() << " calld=" << this + << ": applying service config to call"; if (!config_selector.ok()) return config_selector.status(); // Create a ClientChannelServiceConfigCallData for the call. This stores // a ref to the ServiceConfig and caches the right set of parsed configs @@ -1962,11 +1919,9 @@ absl::optional ClientChannelFilter::CallData::CheckResolution( } // Handle errors. if (!error.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p calld=%p: error applying config to call: error=%s", - chand(), this, StatusToString(error).c_str()); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand() << " calld=" << this + << ": error applying config to call: error=" << StatusToString(error); return error; } // If the call was queued, add trace annotation. @@ -1989,20 +1944,18 @@ bool ClientChannelFilter::CallData::CheckResolutionLocked( absl::Status resolver_error = chand()->resolver_transient_failure_error_; if (!resolver_error.ok() && !send_initial_metadata()->GetOrCreatePointer(WaitForReady())->value) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, "chand=%p calld=%p: resolution failed, failing call", - chand(), this); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand() << " calld=" << this + << ": resolution failed, failing call"; *config_selector = absl_status_to_grpc_error(resolver_error); return true; } // Either the resolver has not yet returned a result, or it has // returned transient failure but the call is wait_for_ready. In // either case, queue the call. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, "chand=%p calld=%p: no resolver result yet", chand(), - this); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand() << " calld=" << this + << ": no resolver result yet"; return false; } // Result found. @@ -2024,9 +1977,8 @@ ClientChannelFilter::FilterBasedCallData::FilterBasedCallData( elem_(elem), owning_call_(args.call_stack), call_combiner_(args.call_combiner) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, "chand=%p calld=%p: created call", chand(), this); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand() << " calld=" << this << ": created call"; } ClientChannelFilter::FilterBasedCallData::~FilterBasedCallData() { @@ -2062,8 +2014,8 @@ void ClientChannelFilter::FilterBasedCallData::StartTransportStreamOpBatch( grpc_call_element* elem, grpc_transport_stream_op_batch* batch) { auto* calld = static_cast(elem->call_data); auto* chand = static_cast(elem->channel_data); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace) && - !GRPC_TRACE_FLAG_ENABLED(grpc_trace_channel)) { + if (GRPC_TRACE_FLAG_ENABLED(client_channel_call) && + !GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "chand=%p calld=%p: batch started from above: %s", chand, calld, grpc_transport_stream_op_batch_string(batch, false).c_str()); } @@ -2082,10 +2034,9 @@ void ClientChannelFilter::FilterBasedCallData::StartTransportStreamOpBatch( // Note that once we have done so, we do not need to acquire the channel's // resolution mutex, which is more efficient (especially for streaming calls). if (calld->dynamic_call_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, "chand=%p calld=%p: starting batch on dynamic_call=%p", - chand, calld, calld->dynamic_call_.get()); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand << " calld=" << calld + << ": starting batch on dynamic_call=" << calld->dynamic_call_.get(); calld->dynamic_call_->StartTransportStreamOpBatch(batch); return; } @@ -2093,10 +2044,10 @@ void ClientChannelFilter::FilterBasedCallData::StartTransportStreamOpBatch( // // If we've previously been cancelled, immediately fail any new batches. if (GPR_UNLIKELY(!calld->cancel_error_.ok())) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, "chand=%p calld=%p: failing batch with error: %s", - chand, calld, StatusToString(calld->cancel_error_).c_str()); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand << " calld=" << calld + << ": failing batch with error: " + << StatusToString(calld->cancel_error_); // Note: This will release the call combiner. grpc_transport_stream_op_batch_finish_with_failure( batch, calld->cancel_error_, calld->call_combiner()); @@ -2110,10 +2061,9 @@ void ClientChannelFilter::FilterBasedCallData::StartTransportStreamOpBatch( // is in the past when the call starts), we can return the right // error to the caller when the first batch does get passed down. calld->cancel_error_ = batch->payload->cancel_stream.cancel_error; - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, "chand=%p calld=%p: recording cancel_error=%s", chand, - calld, StatusToString(calld->cancel_error_).c_str()); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand << " calld=" << calld + << ": recording cancel_error=" << StatusToString(calld->cancel_error_); // Fail all pending batches. calld->PendingBatchesFail(calld->cancel_error_, NoYieldCallCombiner); // Note: This will release the call combiner. @@ -2127,19 +2077,15 @@ void ClientChannelFilter::FilterBasedCallData::StartTransportStreamOpBatch( // channel's resolution mutex to apply the service config to the call, // after which we will create a dynamic call. if (GPR_LIKELY(batch->send_initial_metadata)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p calld=%p: grabbing resolution mutex to apply service " - "config", - chand, calld); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand << " calld=" << calld + << ": grabbing resolution mutex to apply service "; // If we're still in IDLE, we need to start resolving. if (GPR_UNLIKELY(chand->CheckConnectivityState(false) == GRPC_CHANNEL_IDLE)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, "chand=%p calld=%p: triggering exit idle", chand, - calld); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand << " calld=" << calld + << ": triggering exit idle"; // Bounce into the control plane work serializer to start resolving. GRPC_CHANNEL_STACK_REF(chand->owning_stack_, "ExitIdle"); chand->work_serializer_->Run( @@ -2152,11 +2098,9 @@ void ClientChannelFilter::FilterBasedCallData::StartTransportStreamOpBatch( calld->TryCheckResolution(/*was_queued=*/false); } else { // For all other batches, release the call combiner. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p calld=%p: saved batch, yielding call combiner", chand, - calld); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand << " calld=" << calld + << ": saved batch, yielding call combiner"; GRPC_CALL_COMBINER_STOP(calld->call_combiner(), "batch does not include send_initial_metadata"); } @@ -2185,11 +2129,9 @@ size_t ClientChannelFilter::FilterBasedCallData::GetBatchIndex( void ClientChannelFilter::FilterBasedCallData::PendingBatchesAdd( grpc_transport_stream_op_batch* batch) { const size_t idx = GetBatchIndex(batch); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p calld=%p: adding pending batch at index %" PRIuPTR, - chand(), this, idx); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand() << " calld=" << this + << ": adding pending batch at index " << idx; grpc_transport_stream_op_batch*& pending = pending_batches_[idx]; CHECK_EQ(pending, nullptr); pending = batch; @@ -2212,7 +2154,7 @@ void ClientChannelFilter::FilterBasedCallData::PendingBatchesFail( grpc_error_handle error, YieldCallCombinerPredicate yield_call_combiner_predicate) { CHECK(!error.ok()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(client_channel_call)) { size_t num_batches = 0; for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) { if (pending_batches_[i] != nullptr) ++num_batches; @@ -2255,7 +2197,7 @@ void ClientChannelFilter::FilterBasedCallData::ResumePendingBatchInCallCombiner( // This is called via the call combiner, so access to calld is synchronized. void ClientChannelFilter::FilterBasedCallData::PendingBatchesResume() { // Retries not enabled; send down batches as-is. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(client_channel_call)) { size_t num_batches = 0; for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) { if (pending_batches_[i] != nullptr) ++num_batches; @@ -2301,13 +2243,13 @@ class ClientChannelFilter::FilterBasedCallData::ResolverQueuedCallCanceller auto* chand = calld->chand(); { MutexLock lock(&chand->resolution_mu_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p calld=%p: cancelling resolver queued pick: " - "error=%s self=%p calld->resolver_pick_canceller=%p", - chand, calld, StatusToString(error).c_str(), self, - calld->resolver_call_canceller_); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand << " calld=" << calld + << ": cancelling resolver queued pick: " + "error=" + << StatusToString(error) << " self=" << self + << " calld->resolver_pick_canceller=" + << calld->resolver_call_canceller_; if (calld->resolver_call_canceller_ == self && !error.ok()) { // Remove pick from list of queued picks. calld->RemoveCallFromResolverQueuedCallsLocked(); @@ -2360,19 +2302,14 @@ void ClientChannelFilter::FilterBasedCallData::CreateDynamicCall() { call_combiner()}; grpc_error_handle error; DynamicFilters* channel_stack = args.channel_stack.get(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log( - GPR_INFO, - "chand=%p calld=%p: creating dynamic call stack on channel_stack=%p", - chand(), this, channel_stack); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand() << " calld=" << this + << ": creating dynamic call stack on channel_stack=" << channel_stack; dynamic_call_ = channel_stack->CreateCall(std::move(args), &error); if (!error.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p calld=%p: failed to create dynamic call: error=%s", - chand(), this, StatusToString(error).c_str()); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand() << " calld=" << this + << ": failed to create dynamic call: error=" << StatusToString(error); PendingBatchesFail(error, YieldCallCombiner); return; } @@ -2385,13 +2322,10 @@ void ClientChannelFilter::FilterBasedCallData:: auto* calld = static_cast(arg); auto* chand = calld->chand(); auto* service_config_call_data = GetServiceConfigCallData(calld->arena()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p calld=%p: got recv_trailing_metadata_ready: error=%s " - "service_config_call_data=%p", - chand, calld, StatusToString(error).c_str(), - service_config_call_data); - } + GRPC_TRACE_LOG(client_channel_call, INFO) + << "chand=" << chand << " calld=" << calld + << ": got recv_trailing_metadata_ready: error=" << StatusToString(error) + << " service_config_call_data=" << service_config_call_data; if (service_config_call_data != nullptr) { service_config_call_data->Commit(); } @@ -2578,17 +2512,15 @@ void CreateCallAttemptTracer(Arena* arena, bool is_transparent_retry) { ClientChannelFilter::LoadBalancedCall::LoadBalancedCall( ClientChannelFilter* chand, Arena* arena, absl::AnyInvocable on_commit, bool is_transparent_retry) - : InternallyRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace) - ? "LoadBalancedCall" - : nullptr), + : InternallyRefCounted(GRPC_TRACE_FLAG_ENABLED(client_channel_lb_call) + ? "LoadBalancedCall" + : nullptr), chand_(chand), on_commit_(std::move(on_commit)), arena_(arena) { CreateCallAttemptTracer(arena, is_transparent_retry); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "chand=%p lb_call=%p: created", chand_, this); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this << ": created"; } ClientChannelFilter::LoadBalancedCall::~LoadBalancedCall() { @@ -2629,10 +2561,9 @@ void ClientChannelFilter::LoadBalancedCall::RecordLatency() { void ClientChannelFilter::LoadBalancedCall:: RemoveCallFromLbQueuedCallsLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "chand=%p lb_call=%p: removing from queued picks list", - chand_, this); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this + << ": removing from queued picks list"; // Remove pollset_set linkage. grpc_polling_entity_del_from_pollset_set(pollent(), chand_->interested_parties_); @@ -2643,10 +2574,9 @@ void ClientChannelFilter::LoadBalancedCall:: } void ClientChannelFilter::LoadBalancedCall::AddCallToLbQueuedCallsLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "chand=%p lb_call=%p: adding to queued picks list", - chand_, this); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this + << ": adding to queued picks list"; // Add call's pollent to channel's interested_parties, so that I/O // can be done under the call's CQ. grpc_polling_entity_add_to_pollset_set(pollent(), @@ -2688,10 +2618,9 @@ ClientChannelFilter::LoadBalancedCall::PickSubchannel(bool was_queued) { }; } // Grab mutex and take a ref to the picker. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "chand=%p lb_call=%p: grabbing LB mutex to get picker", - chand_, this); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this + << ": grabbing LB mutex to get picker"; RefCountedPtr picker; { MutexLock lock(&chand_->lb_mu_); @@ -2701,17 +2630,15 @@ ClientChannelFilter::LoadBalancedCall::PickSubchannel(bool was_queued) { // TODO(roth): Fix race condition in channel_idle filter and any // other possible causes of this. if (pickers.back() == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_ERROR, "chand=%p lb_call=%p: picker is null, failing call", - chand_, this); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this + << ": picker is null, failing call"; return absl::InternalError("picker is null -- shouldn't happen"); } // Do pick. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "chand=%p lb_call=%p: performing pick with picker=%p", - chand_, this, pickers.back().get()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this + << ": performing pick with picker=" << pickers.back().get(); grpc_error_handle error; bool pick_complete = PickSubchannelImpl(pickers.back().get(), &error); if (!pick_complete) { @@ -2719,11 +2646,9 @@ ClientChannelFilter::LoadBalancedCall::PickSubchannel(bool was_queued) { MutexLock lock(&chand_->lb_mu_); // If picker has been swapped out since we grabbed it, try again. if (pickers.back() != chand_->picker_) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p lb_call=%p: pick not complete, but picker changed", - chand_, this); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this + << ": pick not complete, but picker changed"; if (IsWorkSerializerDispatchEnabled()) { // Don't unref until after we release the mutex. old_picker = std::move(pickers.back()); @@ -2742,11 +2667,9 @@ ClientChannelFilter::LoadBalancedCall::PickSubchannel(bool was_queued) { } // If the pick failed, fail the call. if (!error.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p lb_call=%p: failed to pick subchannel: error=%s", - chand_, this, StatusToString(error).c_str()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this + << ": failed to pick subchannel: error=" << StatusToString(error); return error; } // Pick succeeded. @@ -2772,11 +2695,10 @@ bool ClientChannelFilter::LoadBalancedCall::PickSubchannelImpl( &result, // CompletePick [this](LoadBalancingPolicy::PickResult::Complete* complete_pick) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p lb_call=%p: LB pick succeeded: subchannel=%p", - chand_, this, complete_pick->subchannel.get()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this + << ": LB pick succeeded: subchannel=" + << complete_pick->subchannel.get(); CHECK(complete_pick->subchannel != nullptr); // Grab a ref to the connected subchannel while we're still // holding the data plane mutex. @@ -2788,12 +2710,10 @@ bool ClientChannelFilter::LoadBalancedCall::PickSubchannelImpl( // yet seen that change and given us a new picker), then just // queue the pick. We'll try again as soon as we get a new picker. if (connected_subchannel_ == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p lb_call=%p: subchannel returned by LB picker " - "has no connected subchannel; queueing pick", - chand_, this); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this + << ": subchannel returned by LB picker " + "has no connected subchannel; queueing pick"; return false; } lb_subchannel_call_tracker_ = @@ -2805,18 +2725,15 @@ bool ClientChannelFilter::LoadBalancedCall::PickSubchannelImpl( }, // QueuePick [this](LoadBalancingPolicy::PickResult::Queue* /*queue_pick*/) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick queued", chand_, - this); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this << ": LB pick queued"; return false; }, // FailPick [this, &error](LoadBalancingPolicy::PickResult::Fail* fail_pick) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick failed: %s", chand_, - this, fail_pick->status.ToString().c_str()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this + << ": LB pick failed: " << fail_pick->status; // If wait_for_ready is false, then the error indicates the RPC // attempt's final status. if (!send_initial_metadata() @@ -2832,10 +2749,9 @@ bool ClientChannelFilter::LoadBalancedCall::PickSubchannelImpl( }, // DropPick [this, &error](LoadBalancingPolicy::PickResult::Drop* drop_pick) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick dropped: %s", chand_, - this, drop_pick->status.ToString().c_str()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand_ << " lb_call=" << this + << ": LB pick dropped: " << drop_pick->status; *error = grpc_error_set_int( absl_status_to_grpc_error(MaybeRewriteIllegalStatusCode( std::move(drop_pick->status), "LB drop")), @@ -2901,11 +2817,9 @@ size_t ClientChannelFilter::FilterBasedLoadBalancedCall::GetBatchIndex( void ClientChannelFilter::FilterBasedLoadBalancedCall::PendingBatchesAdd( grpc_transport_stream_op_batch* batch) { const size_t idx = GetBatchIndex(batch); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p lb_call=%p: adding pending batch at index %" PRIuPTR, - chand(), this, idx); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand() << " lb_call=" << this + << ": adding pending batch at index " << idx; CHECK_EQ(pending_batches_[idx], nullptr); pending_batches_[idx] = batch; } @@ -2928,7 +2842,7 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall::PendingBatchesFail( YieldCallCombinerPredicate yield_call_combiner_predicate) { CHECK(!error.ok()); failure_error_ = error; - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(client_channel_lb_call)) { size_t num_batches = 0; for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) { if (pending_batches_[i] != nullptr) ++num_batches; @@ -2970,7 +2884,7 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall:: // This is called via the call combiner, so access to calld is synchronized. void ClientChannelFilter::FilterBasedLoadBalancedCall::PendingBatchesResume() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(client_channel_lb_call)) { size_t num_batches = 0; for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) { if (pending_batches_[i] != nullptr) ++num_batches; @@ -2999,8 +2913,8 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall::PendingBatchesResume() { void ClientChannelFilter::FilterBasedLoadBalancedCall:: StartTransportStreamOpBatch(grpc_transport_stream_op_batch* batch) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_trace_channel)) { + if (GRPC_TRACE_FLAG_ENABLED(client_channel_lb_call) || + GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "chand=%p lb_call=%p: batch started from above: %s, " "call_attempt_tracer()=%p", @@ -3054,11 +2968,9 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall:: // the channel's data plane mutex, which is more efficient (especially for // streaming calls). if (subchannel_call_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p lb_call=%p: starting batch on subchannel_call=%p", - chand(), this, subchannel_call_.get()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand() << " lb_call=" << this + << ": starting batch on subchannel_call=" << subchannel_call_.get(); subchannel_call_->StartTransportStreamOpBatch(batch); return; } @@ -3066,10 +2978,9 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall:: // // If we've previously been cancelled, immediately fail any new batches. if (GPR_UNLIKELY(!cancel_error_.ok())) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "chand=%p lb_call=%p: failing batch with error: %s", - chand(), this, StatusToString(cancel_error_).c_str()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand() << " lb_call=" << this + << ": failing batch with error: " << StatusToString(cancel_error_); // Note: This will release the call combiner. grpc_transport_stream_op_batch_finish_with_failure(batch, cancel_error_, call_combiner_); @@ -3083,10 +2994,9 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall:: // is in the past when the call starts), we can return the right // error to the caller when the first batch does get passed down. cancel_error_ = batch->payload->cancel_stream.cancel_error; - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "chand=%p lb_call=%p: recording cancel_error=%s", - chand(), this, StatusToString(cancel_error_).c_str()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand() << " lb_call=" << this + << ": recording cancel_error=" << StatusToString(cancel_error_).c_str(); // Fail all pending batches. PendingBatchesFail(cancel_error_, NoYieldCallCombiner); // Note: This will release the call combiner. @@ -3102,11 +3012,9 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall:: TryPick(/*was_queued=*/false); } else { // For all other batches, release the call combiner. - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p lb_call=%p: saved batch, yielding call combiner", - chand(), this); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand() << " lb_call=" << this + << ": saved batch, yielding call combiner"; GRPC_CALL_COMBINER_STOP(call_combiner_, "batch does not include send_initial_metadata"); } @@ -3115,11 +3023,9 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall:: void ClientChannelFilter::FilterBasedLoadBalancedCall::RecvInitialMetadataReady( void* arg, grpc_error_handle error) { auto* self = static_cast(arg); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p lb_call=%p: got recv_initial_metadata_ready: error=%s", - self->chand(), self, StatusToString(error).c_str()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << self->chand() << " lb_call=" << self + << ": got recv_initial_metadata_ready: error=" << StatusToString(error); if (error.ok()) { // recv_initial_metadata_flags is not populated for clients self->call_attempt_tracer()->RecordReceivedInitialMetadata( @@ -3134,15 +3040,12 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall::RecvInitialMetadataReady( void ClientChannelFilter::FilterBasedLoadBalancedCall:: RecvTrailingMetadataReady(void* arg, grpc_error_handle error) { auto* self = static_cast(arg); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p lb_call=%p: got recv_trailing_metadata_ready: error=%s " - "call_attempt_tracer()=%p lb_subchannel_call_tracker_=%p " - "failure_error_=%s", - self->chand(), self, StatusToString(error).c_str(), - self->call_attempt_tracer(), self->lb_subchannel_call_tracker(), - StatusToString(self->failure_error_).c_str()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << self->chand() << " lb_call=" << self + << ": got recv_trailing_metadata_ready: error=" << StatusToString(error) + << " call_attempt_tracer()=" << self->call_attempt_tracer() + << " lb_subchannel_call_tracker_=" << self->lb_subchannel_call_tracker() + << " failure_error_=" << StatusToString(self->failure_error_); // Check if we have a tracer or an LB callback to invoke. if (self->call_attempt_tracer() != nullptr || self->lb_subchannel_call_tracker() != nullptr) { @@ -3210,13 +3113,11 @@ class ClientChannelFilter::FilterBasedLoadBalancedCall::LbQueuedCallCanceller auto* chand = lb_call->chand(); { MutexLock lock(&chand->lb_mu_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p lb_call=%p: cancelling queued pick: " - "error=%s self=%p calld->pick_canceller=%p", - chand, lb_call, StatusToString(error).c_str(), self, - lb_call->lb_call_canceller_); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand << " lb_call=" << lb_call + << ": cancelling queued pick: error=" << StatusToString(error) + << " self=" << self + << " calld->pick_canceller=" << lb_call->lb_call_canceller_; if (lb_call->lb_call_canceller_ == self && !error.ok()) { lb_call->Commit(); // Remove pick from list of queued picks. @@ -3298,11 +3199,10 @@ void ClientChannelFilter::FilterBasedLoadBalancedCall::CreateSubchannelCall() { arena(), call_combiner_}; grpc_error_handle error; subchannel_call_ = SubchannelCall::Create(std::move(call_args), &error); - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "chand=%p lb_call=%p: create subchannel_call=%p: error=%s", chand(), - this, subchannel_call_.get(), StatusToString(error).c_str()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "chand=" << chand() << " lb_call=" << this + << ": create subchannel_call=" << subchannel_call_.get() + << ": error=" << StatusToString(error); if (on_call_destruction_complete_ != nullptr) { subchannel_call_->SetAfterCallStackDestroy(on_call_destruction_complete_); on_call_destruction_complete_ = nullptr; diff --git a/src/core/client_channel/load_balanced_call_destination.cc b/src/core/client_channel/load_balanced_call_destination.cc index dfa2d62108b..51c93289196 100644 --- a/src/core/client_channel/load_balanced_call_destination.cc +++ b/src/core/client_channel/load_balanced_call_destination.cc @@ -24,12 +24,6 @@ namespace grpc_core { -// Defined in legacy client channel filter. -// TODO(roth): Move these here when we remove the legacy filter. -extern TraceFlag grpc_client_channel_trace; -extern TraceFlag grpc_client_channel_call_trace; -extern TraceFlag grpc_client_channel_lb_call_trace; - namespace { class LbMetadata : public LoadBalancingPolicy::MetadataInterface { @@ -185,12 +179,10 @@ LoopCtl>> PickSubchannel( // CompletePick [&](LoadBalancingPolicy::PickResult::Complete* complete_pick) -> LoopCtl>> { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "client_channel: %sLB pick succeeded: subchannel=%p", - GetContext()->DebugTag().c_str(), - complete_pick->subchannel.get()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "client_channel: " << GetContext()->DebugTag() + << " pick succeeded: subchannel=" + << complete_pick->subchannel.get(); CHECK(complete_pick->subchannel != nullptr); // Grab a ref to the call destination while we're still // holding the data plane mutex. @@ -203,12 +195,10 @@ LoopCtl>> PickSubchannel( // yet seen that change and given us a new picker), then just // queue the pick. We'll try again as soon as we get a new picker. if (call_destination == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, - "client_channel: %ssubchannel returned by LB picker " - "has no connected subchannel; queueing pick", - GetContext()->DebugTag().c_str()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "client_channel: " << GetContext()->DebugTag() + << " returned by LB picker has no connected subchannel; queueing " + "pick"; return Continue{}; } // If the LB policy returned a call tracker, inform it that the @@ -223,20 +213,17 @@ LoopCtl>> PickSubchannel( }, // QueuePick [&](LoadBalancingPolicy::PickResult::Queue* /*queue_pick*/) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "client_channel: %sLB pick queued", - GetContext()->DebugTag().c_str()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "client_channel: " << GetContext()->DebugTag() + << " pick queued"; return Continue{}; }, // FailPick [&](LoadBalancingPolicy::PickResult::Fail* fail_pick) -> LoopCtl>> { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "client_channel: %sLB pick failed: %s", - GetContext()->DebugTag().c_str(), - fail_pick->status.ToString().c_str()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "client_channel: " << GetContext()->DebugTag() + << " pick failed: " << fail_pick->status; // If wait_for_ready is false, then the error indicates the RPC // attempt's final status. if (!unstarted_handler.UnprocessedClientInitialMetadata() @@ -252,11 +239,9 @@ LoopCtl>> PickSubchannel( // DropPick [&](LoadBalancingPolicy::PickResult::Drop* drop_pick) -> LoopCtl>> { - if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) { - gpr_log(GPR_INFO, "client_channel: %sLB pick dropped: %s", - GetContext()->DebugTag().c_str(), - drop_pick->status.ToString().c_str()); - } + GRPC_TRACE_LOG(client_channel_lb_call, INFO) + << "client_channel: " << GetContext()->DebugTag() + << " pick dropped: " << drop_pick->status; return grpc_error_set_int(MaybeRewriteIllegalStatusCode( std::move(drop_pick->status), "LB drop"), StatusIntProperty::kLbPolicyDrop, 1); diff --git a/src/core/client_channel/retry_filter.cc b/src/core/client_channel/retry_filter.cc index 3a93872282c..f09d06d0e28 100644 --- a/src/core/client_channel/retry_filter.cc +++ b/src/core/client_channel/retry_filter.cc @@ -89,8 +89,6 @@ using grpc_core::internal::RetryMethodConfig; using grpc_core::internal::RetryServiceConfigParser; using grpc_event_engine::experimental::EventEngine; -grpc_core::TraceFlag grpc_retry_trace(false, "retry"); - namespace grpc_core { // diff --git a/src/core/client_channel/retry_filter.h b/src/core/client_channel/retry_filter.h index 731b4c3ad69..153e2f1f004 100644 --- a/src/core/client_channel/retry_filter.h +++ b/src/core/client_channel/retry_filter.h @@ -38,14 +38,11 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_fwd.h" #include "src/core/lib/channel/channel_stack.h" -#include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/transport/transport.h" #include "src/core/util/useful.h" -extern grpc_core::TraceFlag grpc_retry_trace; - namespace grpc_core { class RetryFilter final { diff --git a/src/core/client_channel/retry_filter_legacy_call_data.cc b/src/core/client_channel/retry_filter_legacy_call_data.cc index 00bbc87c70e..563795a365a 100644 --- a/src/core/client_channel/retry_filter_legacy_call_data.cc +++ b/src/core/client_channel/retry_filter_legacy_call_data.cc @@ -116,8 +116,7 @@ class RetryFilter::LegacyCallData::CallStackDestructionBarrier final RetryFilter::LegacyCallData::CallAttempt::CallAttempt( RetryFilter::LegacyCallData* calld, bool is_transparent_retry) - : RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace) ? "CallAttempt" - : nullptr), + : RefCounted(GRPC_TRACE_FLAG_ENABLED(retry) ? "CallAttempt" : nullptr), calld_(calld), started_send_initial_metadata_(false), completed_send_initial_metadata_(false), @@ -141,7 +140,7 @@ RetryFilter::LegacyCallData::CallAttempt::CallAttempt( } }, is_transparent_retry); - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: created attempt, lb_call=%p", calld->chand_, calld, this, lb_call_.get()); @@ -151,7 +150,7 @@ RetryFilter::LegacyCallData::CallAttempt::CallAttempt( calld->retry_policy_->per_attempt_recv_timeout().has_value()) { const Duration per_attempt_recv_timeout = *calld->retry_policy_->per_attempt_recv_timeout(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: per-attempt timeout in %" PRId64 " ms", @@ -170,7 +169,7 @@ RetryFilter::LegacyCallData::CallAttempt::CallAttempt( } RetryFilter::LegacyCallData::CallAttempt::~CallAttempt() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: destroying call attempt", calld_->chand_, calld_, this); } @@ -237,7 +236,7 @@ void RetryFilter::LegacyCallData::CallAttempt::MaybeSwitchToFastPath() { // yet seen that op from the surface, we can't switch yet. if (recv_trailing_metadata_internal_batch_ != nullptr) return; // Switch to fast path. - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: retry state no longer needed; " "moving LB call to parent and unreffing the call attempt", @@ -256,7 +255,7 @@ RetryFilter::LegacyCallData::CallAttempt::MaybeCreateBatchForReplay() { // send_initial_metadata. if (calld_->seen_send_initial_metadata_ && !started_send_initial_metadata_ && !calld_->pending_send_initial_metadata_) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: replaying previously completed " "send_initial_metadata op", @@ -270,7 +269,7 @@ RetryFilter::LegacyCallData::CallAttempt::MaybeCreateBatchForReplay() { if (started_send_message_count_ < calld_->send_messages_.size() && started_send_message_count_ == completed_send_message_count_ && !calld_->pending_send_message_) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: replaying previously completed " "send_message op", @@ -289,7 +288,7 @@ RetryFilter::LegacyCallData::CallAttempt::MaybeCreateBatchForReplay() { started_send_message_count_ == calld_->send_messages_.size() && !started_send_trailing_metadata_ && !calld_->pending_send_trailing_metadata_) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: replaying previously completed " "send_trailing_metadata op", @@ -320,7 +319,7 @@ void StartBatchInCallCombiner(void* arg, grpc_error_handle /*ignored*/) { void RetryFilter::LegacyCallData::CallAttempt::AddClosureForBatch( grpc_transport_stream_op_batch* batch, const char* reason, CallCombinerClosureList* closures) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: adding batch (%s): %s", calld_->chand_, calld_, this, reason, grpc_transport_stream_op_batch_string(batch, false).c_str()); @@ -333,7 +332,7 @@ void RetryFilter::LegacyCallData::CallAttempt::AddClosureForBatch( void RetryFilter::LegacyCallData::CallAttempt:: AddBatchForInternalRecvTrailingMetadata(CallCombinerClosureList* closures) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: call failed but " "recv_trailing_metadata not started; starting it internally", @@ -523,7 +522,7 @@ void RetryFilter::LegacyCallData::CallAttempt::AddRetriableBatches( } void RetryFilter::LegacyCallData::CallAttempt::StartRetriableBatches() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: constructing retriable batches", calld_->chand_, calld_, this); @@ -533,7 +532,7 @@ void RetryFilter::LegacyCallData::CallAttempt::StartRetriableBatches() { AddRetriableBatches(&closures); // Note: This will yield the call combiner. // Start batches on LB call. - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: starting %" PRIuPTR " retriable batches on lb_call=%p", @@ -561,7 +560,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry( if (calld_->retry_throttle_data_ != nullptr) { calld_->retry_throttle_data_->RecordSuccess(); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: call succeeded", calld_->chand_, calld_, this); } @@ -569,7 +568,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry( } // Status is not OK. Check whether the status is retryable. if (!calld_->retry_policy_->retryable_status_codes().Contains(*status)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: status %s not configured as " "retryable", @@ -588,7 +587,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry( // checks, so that we don't fail to record failures due to other factors. if (calld_->retry_throttle_data_ != nullptr && !calld_->retry_throttle_data_->RecordFailure()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: retries throttled", calld_->chand_, calld_, this); } @@ -596,7 +595,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry( } // Check whether the call is committed. if (calld_->retry_committed_) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: retries already committed", calld_->chand_, calld_, this); @@ -607,7 +606,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry( ++calld_->num_attempts_completed_; if (calld_->num_attempts_completed_ >= calld_->retry_policy_->max_attempts()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log( GPR_INFO, "chand=%p calld=%p attempt=%p: exceeded %d retry attempts", calld_->chand_, calld_, this, calld_->retry_policy_->max_attempts()); @@ -617,7 +616,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry( // Check server push-back. if (server_pushback.has_value()) { if (*server_pushback < Duration::Zero()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: not retrying due to server " "push-back", @@ -625,7 +624,7 @@ bool RetryFilter::LegacyCallData::CallAttempt::ShouldRetry( } return false; } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log( GPR_INFO, "chand=%p calld=%p attempt=%p: server push-back: retry in %" PRIu64 @@ -675,7 +674,7 @@ void RetryFilter::LegacyCallData::CallAttempt::OnPerAttemptRecvTimerLocked( void* arg, grpc_error_handle error) { auto* call_attempt = static_cast(arg); auto* calld = call_attempt->calld_; - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: perAttemptRecvTimeout timer fired: " "error=%s, per_attempt_recv_timer_handle_.has_value()=%d", @@ -714,7 +713,7 @@ void RetryFilter::LegacyCallData::CallAttempt::OnPerAttemptRecvTimerLocked( void RetryFilter::LegacyCallData::CallAttempt:: MaybeCancelPerAttemptRecvTimer() { if (per_attempt_recv_timer_handle_.has_value()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: cancelling " "perAttemptRecvTimeout timer", @@ -735,11 +734,10 @@ void RetryFilter::LegacyCallData::CallAttempt:: RetryFilter::LegacyCallData::CallAttempt::BatchData::BatchData( RefCountedPtr attempt, int refcount, bool set_on_complete) - : RefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace) ? "BatchData" : nullptr, - refcount), + : RefCounted(GRPC_TRACE_FLAG_ENABLED(retry) ? "BatchData" : nullptr, + refcount), call_attempt_(attempt.release()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: creating batch %p", call_attempt_->calld_->chand_, call_attempt_->calld_, call_attempt_, this); @@ -760,7 +758,7 @@ RetryFilter::LegacyCallData::CallAttempt::BatchData::BatchData( } RetryFilter::LegacyCallData::CallAttempt::BatchData::~BatchData() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: destroying batch %p", call_attempt_->calld_->chand_, call_attempt_->calld_, call_attempt_, this); @@ -833,7 +831,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData:: RefCountedPtr batch_data(static_cast(arg)); CallAttempt* call_attempt = batch_data->call_attempt_; RetryFilter::LegacyCallData* calld = call_attempt->calld_; - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p batch_data=%p: " "got recv_initial_metadata_ready, error=%s", @@ -860,7 +858,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData:: if (GPR_UNLIKELY( (call_attempt->trailing_metadata_available_ || !error.ok()) && !call_attempt->completed_recv_trailing_metadata_)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: deferring " "recv_initial_metadata_ready (Trailers-Only)", @@ -932,7 +930,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::RecvMessageReady( RefCountedPtr batch_data(static_cast(arg)); CallAttempt* call_attempt = batch_data->call_attempt_; RetryFilter::LegacyCallData* calld = call_attempt->calld_; - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p batch_data=%p: " "got recv_message_ready, error=%s", @@ -962,7 +960,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::RecvMessageReady( if (GPR_UNLIKELY( (!call_attempt->recv_message_.has_value() || !error.ok()) && !call_attempt->completed_recv_trailing_metadata_)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: deferring recv_message_ready " "(nullptr message and recv_trailing_metadata pending)", @@ -1126,7 +1124,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData:: RefCountedPtr batch_data(static_cast(arg)); CallAttempt* call_attempt = batch_data->call_attempt_; RetryFilter::LegacyCallData* calld = call_attempt->calld_; - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p batch_data=%p: " "got recv_trailing_metadata_ready, error=%s", @@ -1153,7 +1151,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData:: batch_data->batch_.payload->recv_trailing_metadata.recv_trailing_metadata; GetCallStatus(calld->deadline_, md_batch, error, &status, &server_pushback, &is_lb_drop, &stream_network_state); - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: call finished, status=%s " "server_pushback=%s is_lb_drop=%d stream_network_state=%s", @@ -1274,7 +1272,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData:: } } if (have_pending_send_ops) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: starting next batch for pending " "send op(s)", @@ -1289,7 +1287,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::OnComplete( RefCountedPtr batch_data(static_cast(arg)); CallAttempt* call_attempt = batch_data->call_attempt_; RetryFilter::LegacyCallData* calld = call_attempt->calld_; - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p batch_data=%p: " "got on_complete, error=%s, batch=%s", @@ -1311,7 +1309,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::OnComplete( // recv_trailing_metadata comes back. if (GPR_UNLIKELY(!calld->retry_committed_ && !error.ok() && !call_attempt->completed_recv_trailing_metadata_)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: deferring on_complete", calld->chand_, calld, call_attempt); } @@ -1365,7 +1363,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData::OnCompleteForCancelOp( RefCountedPtr batch_data(static_cast(arg)); CallAttempt* call_attempt = batch_data->call_attempt_; RetryFilter::LegacyCallData* calld = call_attempt->calld_; - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p batch_data=%p: " "got on_complete for cancel_stream batch, error=%s, batch=%s", @@ -1409,7 +1407,7 @@ void RetryFilter::LegacyCallData::CallAttempt::BatchData:: void RetryFilter::LegacyCallData::CallAttempt::BatchData:: AddRetriableSendMessageOp() { auto* calld = call_attempt_->calld_; - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log( GPR_INFO, "chand=%p calld=%p attempt=%p: starting calld->send_messages[%" PRIuPTR @@ -1498,7 +1496,7 @@ grpc_error_handle RetryFilter::LegacyCallData::Init( grpc_call_element* elem, const grpc_call_element_args* args) { auto* chand = static_cast(elem->channel_data); new (elem->call_data) RetryFilter::LegacyCallData(chand, *args); - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: created call", chand, elem->call_data); } @@ -1580,8 +1578,7 @@ RetryFilter::LegacyCallData::~LegacyCallData() { void RetryFilter::LegacyCallData::StartTransportStreamOpBatch( grpc_transport_stream_op_batch* batch) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace) && - !GRPC_TRACE_FLAG_ENABLED(grpc_trace_channel)) { + if (GRPC_TRACE_FLAG_ENABLED(retry) && !GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "chand=%p calld=%p: batch started from surface: %s", chand_, this, grpc_transport_stream_op_batch_string(batch, false).c_str()); @@ -1604,7 +1601,7 @@ void RetryFilter::LegacyCallData::StartTransportStreamOpBatch( if (GPR_UNLIKELY(batch->cancel_stream)) { // Save cancel_error in case subsequent batches are started. cancelled_from_surface_ = batch->payload->cancel_stream.cancel_error; - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: cancelled from surface: %s", chand_, this, StatusToString(cancelled_from_surface_).c_str()); } @@ -1627,7 +1624,7 @@ void RetryFilter::LegacyCallData::StartTransportStreamOpBatch( } // Cancel retry timer if needed. if (retry_timer_handle_.has_value()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: cancelling retry timer", chand_, this); } @@ -1673,7 +1670,7 @@ void RetryFilter::LegacyCallData::StartTransportStreamOpBatch( if (!retry_codepath_started_ && retry_committed_ && (retry_policy_ == nullptr || !retry_policy_->per_attempt_recv_timeout().has_value())) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: retry committed before first attempt; " "creating LB call", @@ -1692,7 +1689,7 @@ void RetryFilter::LegacyCallData::StartTransportStreamOpBatch( // Otherwise, create a call attempt. // The attempt will automatically start any necessary replays or // pending batches. - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: creating call attempt", chand_, this); } @@ -1701,7 +1698,7 @@ void RetryFilter::LegacyCallData::StartTransportStreamOpBatch( return; } // Send batches to call attempt. - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: starting batch on attempt=%p", chand_, this, call_attempt_.get()); } @@ -1759,7 +1756,7 @@ void RetryFilter::LegacyCallData::MaybeCacheSendOpsForBatch( } void RetryFilter::LegacyCallData::FreeCachedSendInitialMetadata() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: destroying send_initial_metadata", chand_, this); } @@ -1768,7 +1765,7 @@ void RetryFilter::LegacyCallData::FreeCachedSendInitialMetadata() { void RetryFilter::LegacyCallData::FreeCachedSendMessage(size_t idx) { if (send_messages_[idx].slices != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: destroying send_messages[%" PRIuPTR "]", chand_, this, idx); @@ -1778,7 +1775,7 @@ void RetryFilter::LegacyCallData::FreeCachedSendMessage(size_t idx) { } void RetryFilter::LegacyCallData::FreeCachedSendTrailingMetadata() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: destroying send_trailing_metadata", chand_, this); } @@ -1817,7 +1814,7 @@ RetryFilter::LegacyCallData::PendingBatch* RetryFilter::LegacyCallData::PendingBatchesAdd( grpc_transport_stream_op_batch* batch) { const size_t idx = GetBatchIndex(batch); - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: adding pending batch at index %" PRIuPTR, chand_, this, idx); @@ -1848,7 +1845,7 @@ RetryFilter::LegacyCallData::PendingBatchesAdd( // ops have already been sent, and we commit to that attempt. if (GPR_UNLIKELY(bytes_buffered_for_retry_ > chand_->per_rpc_retry_buffer_size())) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: exceeded retry buffer size, committing", chand_, this); @@ -1885,7 +1882,7 @@ void RetryFilter::LegacyCallData::MaybeClearPendingBatch( (!batch->recv_trailing_metadata || batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready == nullptr)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: clearing pending batch", chand_, this); } @@ -1908,7 +1905,7 @@ void RetryFilter::LegacyCallData::FailPendingBatchInCallCombiner( // This is called via the call combiner, so access to calld is synchronized. void RetryFilter::LegacyCallData::PendingBatchesFail(grpc_error_handle error) { CHECK(!error.ok()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { size_t num_batches = 0; for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) { if (pending_batches_[i].batch != nullptr) ++num_batches; @@ -1942,7 +1939,7 @@ RetryFilter::LegacyCallData::PendingBatchFind(const char* log_message, PendingBatch* pending = &pending_batches_[i]; grpc_transport_stream_op_batch* batch = pending->batch; if (batch != nullptr && predicate(batch)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: %s pending batch at index %" PRIuPTR, chand_, this, log_message, i); @@ -1960,7 +1957,7 @@ RetryFilter::LegacyCallData::PendingBatchFind(const char* log_message, void RetryFilter::LegacyCallData::RetryCommit(CallAttempt* call_attempt) { if (retry_committed_) return; retry_committed_ = true; - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: committing retries", chand_, this); } if (call_attempt != nullptr) { @@ -1994,7 +1991,7 @@ void RetryFilter::LegacyCallData::StartRetryTimer( } else { next_attempt_timeout = retry_backoff_.NextAttemptTime() - Timestamp::Now(); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: retrying failed call in %" PRId64 " ms", chand_, this, next_attempt_timeout.millis()); @@ -2027,7 +2024,7 @@ void RetryFilter::LegacyCallData::OnRetryTimerLocked( void RetryFilter::LegacyCallData::AddClosureToStartTransparentRetry( CallCombinerClosureList* closures) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(retry)) { gpr_log(GPR_INFO, "chand=%p calld=%p: scheduling transparent retry", chand_, this); } diff --git a/src/core/client_channel/subchannel.cc b/src/core/client_channel/subchannel.cc index 82d97c56f47..836ae9ee015 100644 --- a/src/core/client_channel/subchannel.cc +++ b/src/core/client_channel/subchannel.cc @@ -94,9 +94,6 @@ namespace grpc_core { using ::grpc_event_engine::experimental::EventEngine; -TraceFlag grpc_trace_subchannel(false, "subchannel"); -DebugOnlyTraceFlag grpc_trace_subchannel_refcount(false, "subchannel_refcount"); - // // ConnectedSubchannel // @@ -105,9 +102,8 @@ ConnectedSubchannel::ConnectedSubchannel( const ChannelArgs& args, RefCountedPtr channelz_subchannel) : RefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel_refcount) - ? "ConnectedSubchannel" - : nullptr), + GRPC_TRACE_FLAG_ENABLED(subchannel_refcount) ? "ConnectedSubchannel" + : nullptr), args_(args), channelz_subchannel_(std::move(channelz_subchannel)) {} @@ -421,7 +417,7 @@ class Subchannel::ConnectedSubchannelStateWatcher final if (c->connected_subchannel_ == nullptr) return; if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE || new_state == GRPC_CHANNEL_SHUTDOWN) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) { + if (GRPC_TRACE_FLAG_ENABLED(subchannel)) { gpr_log(GPR_INFO, "subchannel %p %s: Connected subchannel %p reports %s: %s", c, c->key_.ToString().c_str(), c->connected_subchannel_.get(), @@ -520,9 +516,9 @@ BackOff::Options ParseArgsForBackoffValues(const ChannelArgs& args, Subchannel::Subchannel(SubchannelKey key, OrphanablePtr connector, const ChannelArgs& args) - : DualRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel_refcount) ? "Subchannel" - : nullptr), + : DualRefCounted(GRPC_TRACE_FLAG_ENABLED(subchannel_refcount) + ? "Subchannel" + : nullptr), key_(std::move(key)), args_(args), pollset_set_(grpc_pollset_set_create()), @@ -606,7 +602,7 @@ void Subchannel::ThrottleKeepaliveTime(int new_keepalive_time) { // Only update the value if the new keepalive time is larger. if (new_keepalive_time > keepalive_time_) { keepalive_time_ = new_keepalive_time; - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) { + if (GRPC_TRACE_FLAG_ENABLED(subchannel)) { gpr_log(GPR_INFO, "subchannel %p %s: throttling keepalive time to %d", this, key_.ToString().c_str(), new_keepalive_time); } @@ -881,7 +877,7 @@ bool Subchannel::PublishTransportLocked() { } connecting_result_.Reset(); // Publish. - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) { + if (GRPC_TRACE_FLAG_ENABLED(subchannel)) { gpr_log(GPR_INFO, "subchannel %p %s: new connected subchannel at %p", this, key_.ToString().c_str(), connected_subchannel_.get()); } diff --git a/src/core/client_channel/subchannel_pool_interface.cc b/src/core/client_channel/subchannel_pool_interface.cc index 82c7841d133..7b083a8b47a 100644 --- a/src/core/client_channel/subchannel_pool_interface.cc +++ b/src/core/client_channel/subchannel_pool_interface.cc @@ -36,8 +36,6 @@ namespace grpc_core { -TraceFlag grpc_subchannel_pool_trace(false, "subchannel_pool"); - SubchannelKey::SubchannelKey(const grpc_resolved_address& address, const ChannelArgs& args) : address_(address), args_(args) {} diff --git a/src/core/client_channel/subchannel_pool_interface.h b/src/core/client_channel/subchannel_pool_interface.h index 6c02214ccdc..6a073ed9cb5 100644 --- a/src/core/client_channel/subchannel_pool_interface.h +++ b/src/core/client_channel/subchannel_pool_interface.h @@ -36,8 +36,6 @@ namespace grpc_core { class Subchannel; -extern TraceFlag grpc_subchannel_pool_trace; - // A key that can uniquely identify a subchannel. class SubchannelKey final { public: @@ -68,7 +66,7 @@ class SubchannelKey final { class SubchannelPoolInterface : public RefCounted { public: SubchannelPoolInterface() - : RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_subchannel_pool_trace) + : RefCounted(GRPC_TRACE_FLAG_ENABLED(subchannel_pool) ? "SubchannelPoolInterface" : nullptr) {} ~SubchannelPoolInterface() override {} diff --git a/src/core/ext/filters/backend_metrics/backend_metric_filter.cc b/src/core/ext/filters/backend_metrics/backend_metric_filter.cc index b274dd5c5d1..082efb9716e 100644 --- a/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +++ b/src/core/ext/filters/backend_metrics/backend_metric_filter.cc @@ -46,8 +46,6 @@ namespace grpc_core { -TraceFlag grpc_backend_metric_filter_trace(false, "backend_metric_filter"); - const NoInterceptor BackendMetricFilter::Call::OnClientInitialMetadata; const NoInterceptor BackendMetricFilter::Call::OnServerInitialMetadata; const NoInterceptor BackendMetricFilter::Call::OnClientToServerMessage; @@ -131,20 +129,20 @@ void BackendMetricFilter::Call::OnServerTrailingMetadata(ServerMetadata& md) { if (md.get(GrpcCallWasCancelled()).value_or(false)) return; auto* ctx = MaybeGetContext(); if (ctx == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_filter_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric_filter)) { gpr_log(GPR_INFO, "[%p] No BackendMetricProvider.", this); } return; } absl::optional serialized = MaybeSerializeBackendMetrics(ctx); if (serialized.has_value() && !serialized->empty()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_filter_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric_filter)) { gpr_log(GPR_INFO, "[%p] Backend metrics serialized. size: %" PRIuPTR, this, serialized->size()); } md.Set(EndpointLoadMetricsBinMetadata(), Slice::FromCopiedString(std::move(*serialized))); - } else if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_filter_trace)) { + } else if (GRPC_TRACE_FLAG_ENABLED(backend_metric_filter)) { gpr_log(GPR_INFO, "[%p] No backend metrics.", this); } } diff --git a/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc b/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc index 59a0b66776f..c2e82de4490 100644 --- a/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc +++ b/src/core/ext/filters/channel_idle/legacy_channel_idle_filter.cc @@ -68,12 +68,11 @@ const auto kDefaultMaxConnectionAgeGrace = Duration::Infinity(); const auto kDefaultMaxConnectionIdle = Duration::Infinity(); const auto kMaxConnectionAgeJitter = 0.1; -TraceFlag grpc_trace_client_idle_filter(false, "client_idle_filter"); } // namespace #define GRPC_IDLE_FILTER_LOG(format, ...) \ do { \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_client_idle_filter)) { \ + if (GRPC_TRACE_FLAG_ENABLED(client_idle_filter)) { \ gpr_log(GPR_INFO, "(client idle filter) " format, ##__VA_ARGS__); \ } \ } while (0) diff --git a/src/core/ext/filters/fault_injection/fault_injection_filter.cc b/src/core/ext/filters/fault_injection/fault_injection_filter.cc index 71258dd8bf2..6190ad40084 100644 --- a/src/core/ext/filters/fault_injection/fault_injection_filter.cc +++ b/src/core/ext/filters/fault_injection/fault_injection_filter.cc @@ -53,7 +53,6 @@ namespace grpc_core { -TraceFlag grpc_fault_injection_filter_trace(false, "fault_injection_filter"); const NoInterceptor FaultInjectionFilter::Call::OnServerInitialMetadata; const NoInterceptor FaultInjectionFilter::Call::OnServerTrailingMetadata; const NoInterceptor FaultInjectionFilter::Call::OnClientToServerMessage; @@ -151,7 +150,7 @@ FaultInjectionFilter::FaultInjectionFilter(ChannelFilter::Args filter_args) ArenaPromise FaultInjectionFilter::Call::OnClientInitialMetadata( ClientMetadata& md, FaultInjectionFilter* filter) { auto decision = filter->MakeInjectionDecision(md); - if (GRPC_TRACE_FLAG_ENABLED(grpc_fault_injection_filter_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(fault_injection_filter)) { gpr_log(GPR_INFO, "chand=%p: Fault injection triggered %s", this, decision.ToString().c_str()); } diff --git a/src/core/ext/filters/http/message_compress/compression_filter.cc b/src/core/ext/filters/http/message_compress/compression_filter.cc index 7bb264479cd..e3d0a61cd01 100644 --- a/src/core/ext/filters/http/message_compress/compression_filter.cc +++ b/src/core/ext/filters/http/message_compress/compression_filter.cc @@ -49,7 +49,6 @@ #include "src/core/lib/resource_quota/arena.h" #include "src/core/lib/slice/slice_buffer.h" #include "src/core/lib/surface/call.h" -#include "src/core/lib/surface/call_trace.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" #include "src/core/telemetry/call_tracer.h" @@ -114,7 +113,7 @@ ChannelCompression::ChannelCompression(const ChannelArgs& args) MessageHandle ChannelCompression::CompressMessage( MessageHandle message, grpc_compression_algorithm algorithm) const { - if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(compression)) { gpr_log(GPR_INFO, "CompressMessage: len=%" PRIdPTR " alg=%d flags=%d", message->payload()->Length(), algorithm, message->flags()); } @@ -138,7 +137,7 @@ MessageHandle ChannelCompression::CompressMessage( // If we achieved compression send it as compressed, otherwise send it as (to // avoid spending cycles on the receiver decompressing). if (did_compress) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(compression)) { const char* algo_name; const size_t before_size = payload->Length(); const size_t after_size = tmp.Length(); @@ -156,7 +155,7 @@ MessageHandle ChannelCompression::CompressMessage( call_tracer->RecordSendCompressedMessage(*message->payload()); } } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(compression)) { const char* algo_name; CHECK(grpc_compression_algorithm_name(algorithm, &algo_name)); gpr_log(GPR_INFO, @@ -170,7 +169,7 @@ MessageHandle ChannelCompression::CompressMessage( absl::StatusOr ChannelCompression::DecompressMessage( bool is_client, MessageHandle message, DecompressArgs args) const { - if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(compression)) { gpr_log(GPR_INFO, "DecompressMessage: len=%" PRIdPTR " max=%d alg=%d", message->payload()->Length(), args.max_recv_message_length.value_or(-1), args.algorithm); diff --git a/src/core/ext/filters/http/server/http_server_filter.cc b/src/core/ext/filters/http/server/http_server_filter.cc index 4d92cef6eaa..8d4b71d5108 100644 --- a/src/core/ext/filters/http/server/http_server_filter.cc +++ b/src/core/ext/filters/http/server/http_server_filter.cc @@ -44,7 +44,6 @@ #include "src/core/lib/resource_quota/arena.h" #include "src/core/lib/slice/percent_encoding.h" #include "src/core/lib/slice/slice.h" -#include "src/core/lib/surface/call_trace.h" #include "src/core/lib/transport/metadata_batch.h" namespace grpc_core { @@ -140,7 +139,7 @@ ServerMetadataHandle HttpServerFilter::Call::OnClientInitialMetadata( } void HttpServerFilter::Call::OnServerInitialMetadata(ServerMetadata& md) { - if (grpc_call_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(call)) { gpr_log(GPR_INFO, "%s[http-server] Write metadata", GetContext()->DebugTag().c_str()); } diff --git a/src/core/ext/filters/message_size/message_size_filter.cc b/src/core/ext/filters/message_size/message_size_filter.cc index bf79c4dae93..3a8a3659a43 100644 --- a/src/core/ext/filters/message_size/message_size_filter.cc +++ b/src/core/ext/filters/message_size/message_size_filter.cc @@ -40,7 +40,6 @@ #include "src/core/lib/resource_quota/arena.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_buffer.h" -#include "src/core/lib/surface/call_trace.h" #include "src/core/lib/surface/channel_stack_type.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" @@ -160,7 +159,7 @@ ServerMetadataHandle CheckPayload(const Message& msg, absl::optional max_length, bool is_client, bool is_send) { if (!max_length.has_value()) return nullptr; - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(call)) { gpr_log(GPR_INFO, "%s[message_size] %s len:%" PRIdPTR " max:%d", GetContext()->DebugTag().c_str(), is_send ? "send" : "recv", msg.payload()->Length(), *max_length); diff --git a/src/core/ext/filters/stateful_session/stateful_session_filter.cc b/src/core/ext/filters/stateful_session/stateful_session_filter.cc index fc8af43200e..246605a490b 100644 --- a/src/core/ext/filters/stateful_session/stateful_session_filter.cc +++ b/src/core/ext/filters/stateful_session/stateful_session_filter.cc @@ -57,7 +57,6 @@ namespace grpc_core { -TraceFlag grpc_stateful_session_filter_trace(false, "stateful_session_filter"); const NoInterceptor StatefulSessionFilter::Call::OnClientToServerMessage; const NoInterceptor StatefulSessionFilter::Call::OnClientToServerHalfClose; const NoInterceptor StatefulSessionFilter::Call::OnServerToClientMessage; diff --git a/src/core/ext/transport/chaotic_good/chaotic_good_transport.cc b/src/core/ext/transport/chaotic_good/chaotic_good_transport.cc deleted file mode 100644 index 214907cf2f2..00000000000 --- a/src/core/ext/transport/chaotic_good/chaotic_good_transport.cc +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2023 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "src/core/ext/transport/chaotic_good/chaotic_good_transport.h" - -#include - -grpc_core::TraceFlag grpc_chaotic_good_trace(false, "chaotic_good"); - -namespace grpc_core {} // namespace grpc_core diff --git a/src/core/ext/transport/chaotic_good/chaotic_good_transport.h b/src/core/ext/transport/chaotic_good/chaotic_good_transport.h index f89d2d66282..b42724d40b7 100644 --- a/src/core/ext/transport/chaotic_good/chaotic_good_transport.h +++ b/src/core/ext/transport/chaotic_good/chaotic_good_transport.h @@ -33,8 +33,6 @@ #include "src/core/lib/promise/try_seq.h" #include "src/core/lib/transport/promise_endpoint.h" -extern grpc_core::TraceFlag grpc_chaotic_good_trace; - namespace grpc_core { namespace chaotic_good { @@ -55,7 +53,7 @@ class ChaoticGoodTransport : public RefCounted { auto WriteFrame(const FrameInterface& frame) { auto buffers = frame.Serialize(&encoder_); - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log(GPR_INFO, "CHAOTIC_GOOD: WriteFrame to:%s %s", ResolvedAddressToString(control_endpoint_.GetPeerAddress()) .value_or("<>") @@ -76,7 +74,7 @@ class ChaoticGoodTransport : public RefCounted { auto frame_header = FrameHeader::Parse(reinterpret_cast( GRPC_SLICE_START_PTR(read_buffer.c_slice()))); - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log(GPR_INFO, "CHAOTIC_GOOD: ReadHeader from:%s %s", ResolvedAddressToString(control_endpoint_.GetPeerAddress()) .value_or("<>") @@ -125,7 +123,7 @@ class ChaoticGoodTransport : public RefCounted { FrameLimits limits) { auto s = frame.Deserialize(&parser_, header, bitgen_, arena, std::move(buffers), limits); - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log(GPR_INFO, "CHAOTIC_GOOD: DeserializeFrame %s", s.ok() ? frame.ToString().c_str() : s.ToString().c_str()); } diff --git a/src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc b/src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc index 9c681703b1a..57e92d9131b 100644 --- a/src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc +++ b/src/core/ext/transport/chaotic_good/client/chaotic_good_connector.cc @@ -313,7 +313,7 @@ void ChaoticGoodConnector::OnHandshakeDone(void* arg, grpc_error_handle error) { }, EventEngineWakeupScheduler(self->event_engine_), [self](absl::Status status) { - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log(GPR_INFO, "ChaoticGoodConnector::OnHandshakeDone: %s", status.ToString().c_str()); } diff --git a/src/core/ext/transport/chaotic_good/client_transport.cc b/src/core/ext/transport/chaotic_good/client_transport.cc index 511d04f6ed1..ddcdaa12ead 100644 --- a/src/core/ext/transport/chaotic_good/client_transport.cc +++ b/src/core/ext/transport/chaotic_good/client_transport.cc @@ -259,7 +259,7 @@ auto ChaoticGoodClientTransport::CallOutboundLoop(uint32_t stream_id, // Wait for initial metadata then send it out. call_handler.PullClientInitialMetadata(), [send_fragment](ClientMetadataHandle md) mutable { - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log(GPR_INFO, "CHAOTIC_GOOD: Sending initial metadata: %s", md->DebugString().c_str()); } @@ -298,7 +298,7 @@ void ChaoticGoodClientTransport::StartCall(CallHandler call_handler) { const uint32_t stream_id = MakeStream(call_handler); return Map(CallOutboundLoop(stream_id, call_handler), [stream_id, this](absl::Status result) { - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log(GPR_INFO, "CHAOTIC_GOOD: Call %d finished with %s", stream_id, result.ToString().c_str()); } diff --git a/src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc b/src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc index 98885e3bfc7..31f51a837cf 100644 --- a/src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc +++ b/src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc @@ -98,7 +98,7 @@ ChaoticGoodServerListener::~ChaoticGoodServerListener() { absl::StatusOr ChaoticGoodServerListener::Bind( grpc_event_engine::experimental::EventEngine::ResolvedAddress addr) { - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { auto str = grpc_event_engine::experimental::ResolvedAddressToString(addr); LOG(INFO) << "CHAOTIC_GOOD: Listen on " << (str.ok() ? str->c_str() : str.status().ToString()); @@ -139,9 +139,9 @@ absl::Status ChaoticGoodServerListener::StartListening() { CHECK(ee_listener_ != nullptr); auto status = ee_listener_->Start(); if (!status.ok()) { - LOG(ERROR) << "Start listening failed: " << status.ToString(); - } else if (grpc_chaotic_good_trace.enabled()) { - LOG(INFO) << "CHAOTIC_GOOD: Started listening"; + LOG(ERROR) << "Start listening failed: " << status; + } else { + GRPC_TRACE_LOG(chaotic_good, INFO) << "CHAOTIC_GOOD: Started listening"; } return status; } @@ -159,9 +159,7 @@ ChaoticGoodServerListener::ActiveConnection::~ActiveConnection() { } void ChaoticGoodServerListener::ActiveConnection::Orphan() { - if (grpc_chaotic_good_trace.enabled()) { - LOG(INFO) << "ActiveConnection::Orphan() " << this; - } + GRPC_TRACE_LOG(chaotic_good, INFO) << "ActiveConnection::Orphan() " << this; if (handshaking_state_ != nullptr) { handshaking_state_->Shutdown(); handshaking_state_.reset(); @@ -299,7 +297,7 @@ auto ChaoticGoodServerListener::ActiveConnection::HandshakingState:: }, [self](PromiseEndpoint ret) -> absl::Status { MutexLock lock(&self->connection_->listener_->mu_); - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log( GPR_INFO, "%p Data endpoint setup done: shutdown=%s", self->connection_.get(), @@ -455,9 +453,7 @@ Timestamp ChaoticGoodServerListener::ActiveConnection::HandshakingState:: } void ChaoticGoodServerListener::Orphan() { - if (grpc_chaotic_good_trace.enabled()) { - LOG(INFO) << "ChaoticGoodServerListener::Orphan()"; - } + GRPC_TRACE_LOG(chaotic_good, INFO) << "ChaoticGoodServerListener::Orphan()"; { absl::flat_hash_set> connection_list; MutexLock lock(&mu_); diff --git a/src/core/ext/transport/chaotic_good/server_transport.cc b/src/core/ext/transport/chaotic_good/server_transport.cc index cd8371c3a61..90d80641ecb 100644 --- a/src/core/ext/transport/chaotic_good/server_transport.cc +++ b/src/core/ext/transport/chaotic_good/server_transport.cc @@ -74,7 +74,7 @@ auto ChaoticGoodServerTransport::PushFragmentIntoCall( CallInitiator call_initiator, ClientFragmentFrame frame, uint32_t stream_id) { DCHECK(frame.headers == nullptr); - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log(GPR_INFO, "CHAOTIC_GOOD: PushFragmentIntoCall: frame=%s", frame.ToString().c_str()); } @@ -87,7 +87,7 @@ auto ChaoticGoodServerTransport::PushFragmentIntoCall( []() -> StatusFlag { return Success{}; }), [this, call_initiator, end_of_stream = frame.end_of_stream, stream_id](StatusFlag status) mutable -> StatusFlag { - if (!status.ok() && grpc_chaotic_good_trace.enabled()) { + if (!status.ok() && GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log(GPR_INFO, "CHAOTIC_GOOD: Failed PushFragmentIntoCall"); } if (end_of_stream || !status.ok()) { @@ -135,7 +135,7 @@ auto ChaoticGoodServerTransport::MaybePushFragmentIntoCall( auto ChaoticGoodServerTransport::SendFragment( ServerFragmentFrame frame, MpscSender outgoing_frames, CallInitiator call_initiator) { - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log(GPR_INFO, "CHAOTIC_GOOD: SendFragment: frame=%s", frame.ToString().c_str()); } @@ -187,7 +187,7 @@ auto ChaoticGoodServerTransport::SendCallInitialMetadataAndBody( call_initiator.PullServerInitialMetadata(), [stream_id, outgoing_frames, call_initiator, this](absl::optional md) mutable { - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log(GPR_INFO, "CHAOTIC_GOOD: SendCallInitialMetadataAndBody: md=%s", md.has_value() ? (*md)->DebugString().c_str() : "null"); @@ -213,7 +213,7 @@ auto ChaoticGoodServerTransport::CallOutboundLoop( return Seq(Map(SendCallInitialMetadataAndBody(stream_id, outgoing_frames, call_initiator), [stream_id](absl::Status main_body_result) { - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log(GPR_DEBUG, "CHAOTIC_GOOD: CallOutboundLoop: stream_id=%d " "main_body_result=%s", @@ -345,7 +345,7 @@ auto ChaoticGoodServerTransport::OnTransportActivityDone( absl::string_view activity) { return [self = RefAsSubclass(), activity](absl::Status status) { - if (grpc_chaotic_good_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(chaotic_good)) { gpr_log(GPR_INFO, "CHAOTIC_GOOD: OnTransportActivityDone: activity=%s status=%s", std::string(activity).c_str(), status.ToString().c_str()); diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 27d4a54d7bd..56158de1f80 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -64,7 +64,6 @@ #include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h" #include "src/core/ext/transport/chttp2/transport/hpack_encoder.h" #include "src/core/ext/transport/chttp2/transport/http2_settings.h" -#include "src/core/ext/transport/chttp2/transport/http_trace.h" #include "src/core/ext/transport/chttp2/transport/internal.h" #include "src/core/ext/transport/chttp2/transport/legacy_frame.h" #include "src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.h" @@ -95,7 +94,6 @@ #include "src/core/lib/resource_quota/arena.h" #include "src/core/lib/resource_quota/memory_quota.h" #include "src/core/lib/resource_quota/resource_quota.h" -#include "src/core/lib/resource_quota/trace.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_buffer.h" #include "src/core/lib/slice/slice_internal.h" @@ -143,7 +141,6 @@ static bool g_default_server_keepalive_permit_without_calls = false; #define GRPC_ARG_HTTP_TARPIT_MAX_DURATION_MS "grpc.http.tarpit_max_duration_ms" #define MAX_CLIENT_STREAM_ID 0x7fffffffu -grpc_core::TraceFlag grpc_keepalive_trace(false, "http_keepalive"); // forward declarations of various callbacks that we'll build closures around static void write_action_begin_locked( @@ -827,10 +824,9 @@ grpc_chttp2_stream::grpc_chttp2_stream(grpc_chttp2_transport* t, t->streams_allocated.fetch_add(1, std::memory_order_relaxed); if (server_data) { id = static_cast(reinterpret_cast(server_data)); - if (grpc_http_trace.enabled()) { - VLOG(2) << "HTTP:" << t << "/" << this << " creating accept stream " << id - << " [from " << server_data << "]"; - } + GRPC_TRACE_VLOG(http, 2) + << "HTTP:" << t << "/" << this << " creating accept stream " << id + << " [from " << server_data << "]"; *t->accepting_stream = this; t->stream_map.emplace(id, this); post_destructive_reclaimer(t); @@ -1061,10 +1057,9 @@ static void write_action(grpc_chttp2_transport* t) { if (max_frame_size == 0) { max_frame_size = INT_MAX; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_ping_trace)) { - LOG(INFO) << (t->is_client ? "CLIENT" : "SERVER") << "[" << t << "]: Write " - << t->outbuf.Length() << " bytes"; - } + GRPC_TRACE_LOG(http2_ping, INFO) + << (t->is_client ? "CLIENT" : "SERVER") << "[" << t << "]: Write " + << t->outbuf.Length() << " bytes"; t->write_size_policy.BeginWrite(t->outbuf.Length()); grpc_endpoint_write(t->ep, t->outbuf.c_slice_buffer(), grpc_core::InitTransportClosure( @@ -1075,10 +1070,8 @@ static void write_action(grpc_chttp2_transport* t) { static void write_action_end(grpc_core::RefCountedPtr t, grpc_error_handle error) { auto* tp = t.get(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_ping_trace)) { - LOG(INFO) << (t->is_client ? "CLIENT" : "SERVER") << "[" << t.get() - << "]: Finish write"; - } + GRPC_TRACE_LOG(http2_ping, INFO) << (t->is_client ? "CLIENT" : "SERVER") + << "[" << t.get() << "]: Finish write"; tp->combiner->Run(grpc_core::InitTransportClosure( std::move(t), &tp->write_action_end_locked), error); @@ -1295,7 +1288,7 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t, return; } closure->next_data.scratch -= CLOSURE_BARRIER_FIRST_REF_BIT; - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log( GPR_INFO, "complete_closure_step: t=%p %p refs=%d flags=0x%04x desc=%s err=%s " @@ -1365,7 +1358,7 @@ static void perform_stream_op_locked(void* stream_op, s->traced = op->is_traced; s->call_tracer = CallTracerIfSampled(s); s->tcp_tracer = TcpTracerIfSampled(s); - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_INFO, "perform_stream_op_locked[s=%p; op=%p]: %s; on_complete = %p", s, op, grpc_transport_stream_op_batch_string(op, false).c_str(), @@ -1632,7 +1625,7 @@ void grpc_chttp2_transport::PerformStreamOp( } } - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_INFO, "perform_stream_op[s=%p; op=%p]: %s", s, op, grpc_transport_stream_op_batch_string(op, false).c_str()); } @@ -1976,7 +1969,7 @@ static void perform_transport_op_locked(void* stream_op, } void grpc_chttp2_transport::PerformOp(grpc_transport_op* op) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_INFO, "perform_transport_op[t=%p]: %s", this, grpc_transport_op_string(op).c_str()); } @@ -2029,7 +2022,7 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t, // Lambda is immediately invoked as a big scoped section that can be // exited out of at any point by returning. [&]() { - if (grpc_http_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_DEBUG, "maybe_complete_recv_message %p final_metadata_requested=%d " "seen_error=%d", @@ -2045,7 +2038,7 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t, int64_t min_progress_size; auto r = grpc_deframe_unprocessed_incoming_frames( s, &min_progress_size, &**s->recv_message, s->recv_message_flags); - if (grpc_http_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_DEBUG, "Deframe data frame: %s", grpc_core::PollToString(r, [](absl::Status r) { return r.ToString(); @@ -2101,7 +2094,7 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t, void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t, grpc_chttp2_stream* s) { grpc_chttp2_maybe_complete_recv_message(t, s); - if (grpc_http_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_DEBUG, "maybe_complete_recv_trailing_metadata cli=%d s=%p closure=%p " "read_closed=%d " @@ -2312,7 +2305,7 @@ grpc_chttp2_transport::RemovedStreamHandle grpc_chttp2_mark_stream_closed( grpc_chttp2_transport* t, grpc_chttp2_stream* s, int close_reads, int close_writes, grpc_error_handle error) { grpc_chttp2_transport::RemovedStreamHandle rsh; - if (grpc_http_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log( GPR_DEBUG, "MARK_STREAM_CLOSED: t=%p s=%p(id=%d) %s [%s]", t, s, s->id, (close_reads && close_writes) @@ -2743,8 +2736,8 @@ static void read_action_locked( // got an incoming read, cancel any pending keepalive timers t->keepalive_incoming_data_wanted = false; if (t->keepalive_ping_timeout_handle != TaskHandle::kInvalid) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_ping_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http2_ping) || + GRPC_TRACE_FLAG_ENABLED(http_keepalive)) { gpr_log(GPR_INFO, "%s[%p]: Clear keepalive timer because data was received", t->is_client ? "CLIENT" : "SERVER", t.get()); @@ -2797,7 +2790,7 @@ static void start_bdp_ping(grpc_core::RefCountedPtr t, static void start_bdp_ping_locked( grpc_core::RefCountedPtr t, grpc_error_handle error) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_INFO, "%s: Start BDP ping err=%s", std::string(t->peer_string.as_string_view()).c_str(), grpc_core::StatusToString(error).c_str()); @@ -2824,7 +2817,7 @@ static void finish_bdp_ping(grpc_core::RefCountedPtr t, static void finish_bdp_ping_locked( grpc_core::RefCountedPtr t, grpc_error_handle error) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_INFO, "%s: Complete BDP ping err=%s", std::string(t->peer_string.as_string_view()).c_str(), grpc_core::StatusToString(error).c_str()); @@ -2968,8 +2961,8 @@ static void finish_keepalive_ping_locked( grpc_error_handle error) { if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) { if (error.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http) || + GRPC_TRACE_FLAG_ENABLED(http_keepalive)) { gpr_log(GPR_INFO, "%s: Finish keepalive ping", std::string(t->peer_string.as_string_view()).c_str()); } @@ -2990,8 +2983,8 @@ static void maybe_reset_keepalive_ping_timer_locked(grpc_chttp2_transport* t) { t->event_engine->Cancel(t->keepalive_ping_timer_handle)) { // Cancel succeeds, resets the keepalive ping timer. Note that we don't // need to Ref or Unref here since we still hold the Ref. - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http) || + GRPC_TRACE_FLAG_ENABLED(http_keepalive)) { gpr_log(GPR_INFO, "%s: Keepalive ping cancelled. Resetting timer.", std::string(t->peer_string.as_string_view()).c_str()); } @@ -3090,7 +3083,7 @@ static void benign_reclaimer_locked( if (error.ok() && t->stream_map.empty()) { // Channel with no active streams: send a goaway to try and make it // disconnect cleanly - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { gpr_log(GPR_INFO, "HTTP2: %s - send goaway to free memory", std::string(t->peer_string.as_string_view()).c_str()); } @@ -3099,7 +3092,7 @@ static void benign_reclaimer_locked( grpc_core::StatusIntProperty::kHttp2Error, GRPC_HTTP2_ENHANCE_YOUR_CALM), /*immediate_disconnect_hint=*/true); - } else if (error.ok() && GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + } else if (error.ok() && GRPC_TRACE_FLAG_ENABLED(resource_quota)) { gpr_log(GPR_INFO, "HTTP2: %s - skip benign reclamation, there are still %" PRIdPTR " streams", @@ -3119,7 +3112,7 @@ static void destructive_reclaimer_locked( if (error.ok() && !t->stream_map.empty()) { // As stream_map is a hash map, this selects effectively a random stream. grpc_chttp2_stream* s = t->stream_map.begin()->second; - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { gpr_log(GPR_INFO, "HTTP2: %s - abandon stream id %d", std::string(t->peer_string.as_string_view()).c_str(), s->id); } diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/src/core/ext/transport/chttp2/transport/chttp2_transport.h index 719c7795c16..1bcb8a9ae10 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.h +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.h @@ -40,11 +40,6 @@ #include "src/core/lib/transport/transport.h" #include "src/core/telemetry/call_tracer.h" -extern grpc_core::TraceFlag grpc_keepalive_trace; -extern grpc_core::TraceFlag grpc_trace_http2_stream_state; -extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount; -extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_hpack_parser; - /// Creates a CHTTP2 Transport. This takes ownership of a \a resource_user ref /// from the caller; if the caller still needs the resource_user after creating /// a transport, the caller must take another ref. diff --git a/src/core/ext/transport/chttp2/transport/flow_control.cc b/src/core/ext/transport/chttp2/transport/flow_control.cc index ea633e03a88..9e4138ea50b 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.cc +++ b/src/core/ext/transport/chttp2/transport/flow_control.cc @@ -40,8 +40,6 @@ #include "src/core/lib/resource_quota/memory_quota.h" #include "src/core/util/useful.h" -grpc_core::TraceFlag grpc_flowctl_trace(false, "flowctl"); - namespace grpc_core { namespace chttp2 { @@ -235,7 +233,7 @@ void TransportFlowControl::UpdateSetting( FlowControlAction& (FlowControlAction::*set)(FlowControlAction::Urgency, uint32_t)) { if (new_desired_value != *desired_value) { - if (grpc_flowctl_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(flowctl)) { gpr_log(GPR_INFO, "[flowctl] UPDATE SETTING %s from %" PRId64 " to %d", std::string(name).c_str(), *desired_value, new_desired_value); } diff --git a/src/core/ext/transport/chttp2/transport/flow_control.h b/src/core/ext/transport/chttp2/transport/flow_control.h index 3891845a4bd..a0bd6323b0e 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.h +++ b/src/core/ext/transport/chttp2/transport/flow_control.h @@ -41,8 +41,6 @@ #include "src/core/lib/resource_quota/memory_quota.h" #include "src/core/lib/transport/bdp_estimator.h" -extern grpc_core::TraceFlag grpc_flowctl_trace; - namespace grpc { namespace testing { class TrickledCHTTP2; // to make this a friend diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.cc b/src/core/ext/transport/chttp2/transport/frame_ping.cc index e57f9f02622..9a455c0baf1 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.cc +++ b/src/core/ext/transport/chttp2/transport/frame_ping.cc @@ -37,9 +37,6 @@ #include "src/core/ext/transport/chttp2/transport/ping_callbacks.h" #include "src/core/lib/debug/trace.h" -extern grpc_core::TraceFlag grpc_keepalive_trace; -extern grpc_core::TraceFlag grpc_http_trace; - grpc_slice grpc_chttp2_ping_create(uint8_t ack, uint64_t opaque_8bytes) { grpc_slice slice = GRPC_SLICE_MALLOC(9 + 8); uint8_t* p = GRPC_SLICE_START_PTR(slice); @@ -96,7 +93,7 @@ grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser, if (p->byte == 8) { CHECK(is_last); if (p->is_ack) { - if (grpc_ping_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(http2_ping)) { gpr_log(GPR_INFO, "%s[%p]: received ping ack %" PRIx64, t->is_client ? "CLIENT" : "SERVER", t, p->opaque_8bytes); } @@ -105,7 +102,8 @@ grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser, if (!t->is_client) { const bool transport_idle = t->keepalive_permit_without_calls == 0 && t->stream_map.empty(); - if (grpc_keepalive_trace.enabled() || grpc_http_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(http_keepalive) || + GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_INFO, "SERVER[%p]: received ping %" PRIx64 ": %s", t, p->opaque_8bytes, t->ping_abuse_policy.GetDebugString(transport_idle).c_str()); @@ -113,7 +111,7 @@ grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser, if (t->ping_abuse_policy.ReceivedOnePing(transport_idle)) { grpc_chttp2_exceeded_ping_strikes(t); } - } else if (grpc_ping_trace.enabled()) { + } else if (GRPC_TRACE_FLAG_ENABLED(http2_ping)) { gpr_log(GPR_INFO, "CLIENT[%p]: received ping %" PRIx64, t, p->opaque_8bytes); } diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc b/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc index 22563924a07..dd570650362 100644 --- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc @@ -30,7 +30,6 @@ #include #include -#include "src/core/ext/transport/chttp2/transport/http_trace.h" #include "src/core/ext/transport/chttp2/transport/internal.h" #include "src/core/ext/transport/chttp2/transport/legacy_frame.h" #include "src/core/ext/transport/chttp2/transport/ping_callbacks.h" @@ -111,7 +110,7 @@ grpc_error_handle grpc_chttp2_rst_stream_parser_parse(void* parser, ((static_cast(p->reason_bytes[1])) << 16) | ((static_cast(p->reason_bytes[2])) << 8) | ((static_cast(p->reason_bytes[3]))); - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_INFO, "[chttp2 transport=%p stream=%p] received RST_STREAM(reason=%d)", t, s, reason); diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.cc b/src/core/ext/transport/chttp2/transport/frame_settings.cc index 526c6515c57..bea244c8187 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.cc +++ b/src/core/ext/transport/chttp2/transport/frame_settings.cc @@ -33,7 +33,6 @@ #include "src/core/ext/transport/chttp2/transport/flow_control.h" #include "src/core/ext/transport/chttp2/transport/frame_goaway.h" #include "src/core/ext/transport/chttp2/transport/http2_settings.h" -#include "src/core/ext/transport/chttp2/transport/http_trace.h" #include "src/core/ext/transport/chttp2/transport/internal.h" #include "src/core/ext/transport/chttp2/transport/legacy_frame.h" #include "src/core/lib/debug/trace.h" @@ -171,8 +170,8 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p, t->initial_window_update += static_cast(parser->value) - parser->incoming_settings->initial_window_size(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_flowctl_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http) || + GRPC_TRACE_FLAG_ENABLED(flowctl)) { gpr_log(GPR_INFO, "%p[%s] adding %d for initial_window change", t, t->is_client ? "cli" : "svr", static_cast(t->initial_window_update)); @@ -188,7 +187,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p, "invalid value %u passed for %s", parser->value, grpc_core::Http2Settings::WireIdToName(parser->id).c_str())); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_INFO, "CHTTP2:%s:%s: got setting %s = %d", t->is_client ? "CLI" : "SVR", std::string(t->peer_string.as_string_view()).c_str(), diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc index 1d7ece76303..f8d07dba1e7 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc @@ -31,7 +31,6 @@ #include "src/core/ext/transport/chttp2/transport/bin_encoder.h" #include "src/core/ext/transport/chttp2/transport/hpack_constants.h" #include "src/core/ext/transport/chttp2/transport/hpack_encoder_table.h" -#include "src/core/ext/transport/chttp2/transport/http_trace.h" #include "src/core/ext/transport/chttp2/transport/legacy_frame.h" #include "src/core/ext/transport/chttp2/transport/varint.h" #include "src/core/lib/debug/trace.h" @@ -118,7 +117,7 @@ void HPackCompressor::SetMaxUsableSize(uint32_t max_table_size) { void HPackCompressor::SetMaxTableSize(uint32_t max_table_size) { if (table_.SetMaxSize(std::min(max_usable_size_, max_table_size))) { advertise_table_size_change_ = true; - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_INFO, "set max table size from encoder to %d", max_table_size); } diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/src/core/ext/transport/chttp2/transport/hpack_parser.cc index 44ae22ea475..84b4e862799 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.cc @@ -59,8 +59,6 @@ namespace grpc_core { -TraceFlag grpc_trace_chttp2_hpack_parser(false, "chttp2_hpack_parser"); - namespace { // The alphabet used for base64 encoding binary metadata. constexpr char kBase64Alphabet[] = @@ -733,7 +731,7 @@ class HPackParser::Parser { bool FinishHeaderAndAddToTable(HPackTable::Memento md) { // Log if desired - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_hpack_parser)) { + if (GRPC_TRACE_FLAG_ENABLED(chttp2_hpack_parser)) { LogHeader(md); } // Emit whilst we own the metadata. @@ -758,7 +756,7 @@ class HPackParser::Parser { void FinishHeaderOmitFromTable(const HPackTable::Memento& md) { // Log if desired - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_hpack_parser)) { + if (GRPC_TRACE_FLAG_ENABLED(chttp2_hpack_parser)) { LogHeader(md); } EmitHeader(md); diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc b/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc index 41d7d27c343..f27f7a1019d 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc @@ -35,7 +35,6 @@ #include "src/core/ext/transport/chttp2/transport/hpack_constants.h" #include "src/core/ext/transport/chttp2/transport/hpack_parse_result.h" -#include "src/core/ext/transport/chttp2/transport/http_trace.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/slice/slice.h" @@ -99,9 +98,7 @@ void HPackTable::SetMaxBytes(uint32_t max_bytes) { if (max_bytes_ == max_bytes) { return; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { - LOG(INFO) << "Update hpack parser max size to " << max_bytes; - } + GRPC_TRACE_LOG(http, INFO) << "Update hpack parser max size to " << max_bytes; while (mem_used_ > max_bytes) { EvictOne(); } @@ -111,9 +108,7 @@ void HPackTable::SetMaxBytes(uint32_t max_bytes) { bool HPackTable::SetCurrentTableSize(uint32_t bytes) { if (current_table_bytes_ == bytes) return true; if (bytes > max_bytes_) return false; - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { - LOG(INFO) << "Update hpack parser table size to " << bytes; - } + GRPC_TRACE_LOG(http, INFO) << "Update hpack parser table size to " << bytes; while (mem_used_ > bytes) { EvictOne(); } diff --git a/src/core/ext/transport/chttp2/transport/http_trace.cc b/src/core/ext/transport/chttp2/transport/http_trace.cc deleted file mode 100644 index 41c17a33d34..00000000000 --- a/src/core/ext/transport/chttp2/transport/http_trace.cc +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "src/core/ext/transport/chttp2/transport/http_trace.h" - -#include - -grpc_core::TraceFlag grpc_http_trace(false, "http"); diff --git a/src/core/ext/transport/chttp2/transport/http_trace.h b/src/core/ext/transport/chttp2/transport/http_trace.h deleted file mode 100644 index e0ab22f2896..00000000000 --- a/src/core/ext/transport/chttp2/transport/http_trace.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2022 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP_TRACE_H -#define GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP_TRACE_H - -#include - -#include "src/core/lib/debug/trace.h" - -extern grpc_core::TraceFlag grpc_http_trace; - -#endif // GRPC_SRC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP_TRACE_H diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 0661330999f..6e077a835ed 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -807,13 +807,12 @@ void grpc_chttp2_settings_timeout( #define GRPC_CHTTP2_CLIENT_CONNECT_STRLEN \ (sizeof(GRPC_CHTTP2_CLIENT_CONNECT_STRING) - 1) -// extern grpc_core::TraceFlag grpc_flowctl_trace; - -#define GRPC_CHTTP2_IF_TRACING(stmt) \ - do { \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { \ - (stmt); \ - } \ +// +#define GRPC_CHTTP2_IF_TRACING(stmt) \ + do { \ + if (GRPC_TRACE_FLAG_ENABLED(http)) { \ + (stmt); \ + } \ } while (0) void grpc_chttp2_fake_status(grpc_chttp2_transport* t, diff --git a/src/core/ext/transport/chttp2/transport/parsing.cc b/src/core/ext/transport/chttp2/transport/parsing.cc index 343399919fb..e0a8297b31a 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.cc +++ b/src/core/ext/transport/chttp2/transport/parsing.cc @@ -54,7 +54,6 @@ #include "src/core/ext/transport/chttp2/transport/hpack_parser.h" #include "src/core/ext/transport/chttp2/transport/hpack_parser_table.h" #include "src/core/ext/transport/chttp2/transport/http2_settings.h" -#include "src/core/ext/transport/chttp2/transport/http_trace.h" #include "src/core/ext/transport/chttp2/transport/internal.h" #include "src/core/ext/transport/chttp2/transport/legacy_frame.h" #include "src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.h" @@ -78,8 +77,6 @@ using grpc_core::HPackParser; -grpc_core::TraceFlag grpc_trace_chttp2_new_stream(false, "chttp2_new_stream"); - static grpc_error_handle init_frame_parser(grpc_chttp2_transport* t, size_t& requests_started); static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t, @@ -334,7 +331,7 @@ absl::variant grpc_chttp2_perform_read( case GRPC_DTS_FH_8: DCHECK_LT(cur, end); t->incoming_stream_id |= (static_cast(*cur)); - if (grpc_http_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_INFO, "INCOMING[%p]: %s len:%d id:0x%08x", t, FrameTypeString(t->incoming_frame_type, t->incoming_frame_flags) .c_str(), @@ -455,7 +452,7 @@ static grpc_error_handle init_frame_parser(grpc_chttp2_transport* t, case GRPC_CHTTP2_FRAME_GOAWAY: return init_goaway_parser(t); default: - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_ERROR, "Unknown frame type %02x", t->incoming_frame_type); } return init_non_header_skip_frame_parser(t); @@ -715,8 +712,8 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t, gpr_log(GPR_ERROR, "grpc_chttp2_stream not accepted")); return init_header_skip_frame_parser(t, priority_type, is_eoh); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_new_stream)) { + if (GRPC_TRACE_FLAG_ENABLED(http) || + GRPC_TRACE_FLAG_ENABLED(chttp2_new_stream)) { gpr_log(GPR_INFO, "[t:%p fd:%d peer:%s] Accepting new stream; " "num_incoming_streams_before_settings_ack=%u", @@ -796,7 +793,7 @@ static grpc_error_handle init_window_update_frame_parser( grpc_chttp2_stream* s = t->incoming_stream = grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id); if (s == nullptr) { - if (grpc_http_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_ERROR, "Stream %d not found, ignoring WINDOW_UPDATE", t->incoming_stream_id); } @@ -888,18 +885,17 @@ static grpc_error_handle parse_frame_slice(grpc_chttp2_transport* t, const grpc_slice& slice, int is_last) { grpc_chttp2_stream* s = t->incoming_stream; - if (grpc_http_trace.enabled()) { - VLOG(2) << "INCOMING[" << t << ";" << s << "]: Parse " - << GRPC_SLICE_LENGTH(slice) << "b " << (is_last ? "last " : "") - << "frame fragment with " << t->parser.name; - } + GRPC_TRACE_VLOG(http, 2) << "INCOMING[" << t << ";" << s << "]: Parse " + << GRPC_SLICE_LENGTH(slice) << "b " + << (is_last ? "last " : "") << "frame fragment with " + << t->parser.name; grpc_error_handle err = t->parser.parser(t->parser.user_data, t, s, slice, is_last); intptr_t unused; if (GPR_LIKELY(err.ok())) { return err; } - if (grpc_http_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(http)) { gpr_log(GPR_ERROR, "INCOMING[%p;%p]: Parse failed with %s", t, s, err.ToString().c_str()); } diff --git a/src/core/ext/transport/chttp2/transport/ping_callbacks.cc b/src/core/ext/transport/chttp2/transport/ping_callbacks.cc index 49adbe27fe0..b568ad860a7 100644 --- a/src/core/ext/transport/chttp2/transport/ping_callbacks.cc +++ b/src/core/ext/transport/chttp2/transport/ping_callbacks.cc @@ -23,8 +23,6 @@ #include #include -grpc_core::TraceFlag grpc_ping_trace(false, "http2_ping"); - namespace grpc_core { void Chttp2PingCallbacks::OnPing(Callback on_start, Callback on_ack) { diff --git a/src/core/ext/transport/chttp2/transport/ping_callbacks.h b/src/core/ext/transport/chttp2/transport/ping_callbacks.h index 58a762aa013..6bbe07e0c8f 100644 --- a/src/core/ext/transport/chttp2/transport/ping_callbacks.h +++ b/src/core/ext/transport/chttp2/transport/ping_callbacks.h @@ -33,8 +33,6 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/time.h" -extern grpc_core::TraceFlag grpc_ping_trace; - namespace grpc_core { class Chttp2PingCallbacks { diff --git a/src/core/ext/transport/chttp2/transport/stream_lists.cc b/src/core/ext/transport/chttp2/transport/stream_lists.cc index 424666044e6..22918442b7d 100644 --- a/src/core/ext/transport/chttp2/transport/stream_lists.cc +++ b/src/core/ext/transport/chttp2/transport/stream_lists.cc @@ -44,8 +44,6 @@ static const char* stream_list_id_string(grpc_chttp2_stream_list_id id) { GPR_UNREACHABLE_CODE(return "unknown"); } -grpc_core::TraceFlag grpc_trace_http2_stream_state(false, "http2_stream_state"); - // core list management static bool stream_list_empty(grpc_chttp2_transport* t, @@ -70,7 +68,7 @@ static bool stream_list_pop(grpc_chttp2_transport* t, s->included.clear(id); } *stream = s; - if (s && GRPC_TRACE_FLAG_ENABLED(grpc_trace_http2_stream_state)) { + if (s && GRPC_TRACE_FLAG_ENABLED(http2_stream_state)) { gpr_log(GPR_INFO, "%p[%d][%s]: pop from %s", t, s->id, t->is_client ? "cli" : "svr", stream_list_id_string(id)); } @@ -92,7 +90,7 @@ static void stream_list_remove(grpc_chttp2_transport* t, grpc_chttp2_stream* s, } else { t->lists[id].tail = s->links[id].prev; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_http2_stream_state)) { + if (GRPC_TRACE_FLAG_ENABLED(http2_stream_state)) { gpr_log(GPR_INFO, "%p[%d][%s]: remove from %s", t, s->id, t->is_client ? "cli" : "svr", stream_list_id_string(id)); } @@ -124,7 +122,7 @@ static void stream_list_add_tail(grpc_chttp2_transport* t, } t->lists[id].tail = s; s->included.set(id); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_http2_stream_state)) { + if (GRPC_TRACE_FLAG_ENABLED(http2_stream_state)) { gpr_log(GPR_INFO, "%p[%d][%s]: add to %s", t, s->id, t->is_client ? "cli" : "svr", stream_list_id_string(id)); } diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index f15c391b831..7112e1ffbf3 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -47,7 +47,6 @@ #include "src/core/ext/transport/chttp2/transport/frame_window_update.h" #include "src/core/ext/transport/chttp2/transport/hpack_encoder.h" #include "src/core/ext/transport/chttp2/transport/http2_settings.h" -#include "src/core/ext/transport/chttp2/transport/http_trace.h" #include "src/core/ext/transport/chttp2/transport/internal.h" #include "src/core/ext/transport/chttp2/transport/legacy_frame.h" #include "src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.h" @@ -133,10 +132,10 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { t->channelz_socket->RecordKeepaliveSent(); } grpc_core::global_stats().IncrementHttp2PingsSent(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_ping_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http) || + GRPC_TRACE_FLAG_ENABLED(bdp_estimator) || + GRPC_TRACE_FLAG_ENABLED(http_keepalive) || + GRPC_TRACE_FLAG_ENABLED(http2_ping)) { gpr_log(GPR_INFO, "%s[%p]: Ping %" PRIx64 " sent [%s]: %s", t->is_client ? "CLIENT" : "SERVER", t, id, std::string(t->peer_string.as_string_view()).c_str(), @@ -145,10 +144,10 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { }, [t](grpc_core::Chttp2PingRatePolicy::TooManyRecentPings) { // need to receive something of substance before sending a ping again - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_ping_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http) || + GRPC_TRACE_FLAG_ENABLED(bdp_estimator) || + GRPC_TRACE_FLAG_ENABLED(http_keepalive) || + GRPC_TRACE_FLAG_ENABLED(http2_ping)) { gpr_log(GPR_INFO, "%s[%p]: Ping delayed [%s]: too many recent pings: %s", t->is_client ? "CLIENT" : "SERVER", t, @@ -158,10 +157,10 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { }, [t](grpc_core::Chttp2PingRatePolicy::TooSoon too_soon) { // not enough elapsed time between successive pings - if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_ping_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http) || + GRPC_TRACE_FLAG_ENABLED(bdp_estimator) || + GRPC_TRACE_FLAG_ENABLED(http_keepalive) || + GRPC_TRACE_FLAG_ENABLED(http2_ping)) { gpr_log( GPR_INFO, "%s[%p]: Ping delayed [%s]: not enough time elapsed since last " @@ -207,7 +206,7 @@ static bool update_list(grpc_chttp2_transport* t, int64_t send_bytes, static void report_stall(grpc_chttp2_transport* t, grpc_chttp2_stream* s, const char* staller) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_flowctl_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(flowctl)) { gpr_log( GPR_DEBUG, "%s:%p stream %d moved to stalled list by %s. This is FULLY expected " @@ -728,7 +727,7 @@ void grpc_chttp2_end_write(grpc_chttp2_transport* t, grpc_error_handle error) { grpc_core::ExecCtx exec_ctx; grpc_chttp2_ping_timeout(t); }); - if (GRPC_TRACE_FLAG_ENABLED(grpc_ping_trace) && id.has_value()) { + if (GRPC_TRACE_FLAG_ENABLED(http2_ping) && id.has_value()) { gpr_log(GPR_INFO, "%s[%p]: Set ping timeout timer of %s for ping id %" PRIx64, t->is_client ? "CLIENT" : "SERVER", t, timeout.ToString().c_str(), @@ -740,8 +739,8 @@ void grpc_chttp2_end_write(grpc_chttp2_transport* t, grpc_error_handle error) { t->keepalive_ping_timeout_handle != grpc_event_engine::experimental::EventEngine::TaskHandle:: kInvalid) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_ping_trace) || - GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http2_ping) || + GRPC_TRACE_FLAG_ENABLED(http_keepalive)) { gpr_log(GPR_INFO, "%s[%p]: Set keepalive ping timeout timer of %s", t->is_client ? "CLIENT" : "SERVER", t, t->keepalive_timeout.ToString().c_str()); diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.cc b/src/core/ext/transport/cronet/transport/cronet_transport.cc index 8e1242a3f4b..b5be87ea636 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.cc +++ b/src/core/ext/transport/cronet/transport/cronet_transport.cc @@ -67,10 +67,9 @@ #define GRPC_HEADER_SIZE_IN_BYTES 5 #define GRPC_FLUSH_READ_SIZE 4096 -grpc_core::TraceFlag grpc_cronet_trace(false, "cronet"); -#define CRONET_LOG(...) \ - do { \ - if (grpc_cronet_trace.enabled()) gpr_log(__VA_ARGS__); \ +#define CRONET_LOG(...) \ + do { \ + if (GRPC_TRACE_FLAG_ENABLED(cronet)) gpr_log(__VA_ARGS__); \ } while (0) enum e_op_result { diff --git a/src/core/ext/transport/inproc/inproc_plugin.cc b/src/core/ext/transport/inproc/inproc_plugin.cc deleted file mode 100644 index 98ac752e6b2..00000000000 --- a/src/core/ext/transport/inproc/inproc_plugin.cc +++ /dev/null @@ -1,23 +0,0 @@ -// -// -// Copyright 2017 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// - -#include - -#include "src/core/lib/debug/trace.h" - -grpc_core::TraceFlag grpc_inproc_trace(false, "inproc"); diff --git a/src/core/ext/transport/inproc/inproc_transport.h b/src/core/ext/transport/inproc/inproc_transport.h index 46dc9b540f1..05030d6e40a 100644 --- a/src/core/ext/transport/inproc/inproc_transport.h +++ b/src/core/ext/transport/inproc/inproc_transport.h @@ -25,8 +25,6 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server, const grpc_channel_args* args, void* reserved); -extern grpc_core::TraceFlag grpc_inproc_trace; - namespace grpc_core { std::pair, OrphanablePtr> diff --git a/src/core/ext/transport/inproc/legacy_inproc_transport.cc b/src/core/ext/transport/inproc/legacy_inproc_transport.cc index bf63cc2e3a7..fd8699f9b99 100644 --- a/src/core/ext/transport/inproc/legacy_inproc_transport.cc +++ b/src/core/ext/transport/inproc/legacy_inproc_transport.cc @@ -69,11 +69,11 @@ #include "src/core/lib/transport/transport.h" #include "src/core/server/server.h" -#define INPROC_LOG(...) \ - do { \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_inproc_trace)) { \ - gpr_log(__VA_ARGS__); \ - } \ +#define INPROC_LOG(...) \ + do { \ + if (GRPC_TRACE_FLAG_ENABLED(inproc)) { \ + gpr_log(__VA_ARGS__); \ + } \ } while (0) namespace { @@ -352,7 +352,7 @@ class CopySink { void fill_in_metadata(inproc_stream* s, const grpc_metadata_batch* metadata, grpc_metadata_batch* out_md, bool* markfilled) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_inproc_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(inproc)) { log_metadata(metadata, s->t->is_client, metadata->get_pointer(grpc_core::WaitForReady()) != nullptr); } @@ -949,7 +949,7 @@ void inproc_transport::PerformStreamOp(grpc_stream* gs, gpr_mu* mu = &s->t->mu->mu; // save aside in case s gets closed gpr_mu_lock(mu); - if (GRPC_TRACE_FLAG_ENABLED(grpc_inproc_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(inproc)) { if (op->send_initial_metadata) { log_metadata(op->payload->send_initial_metadata.send_initial_metadata, s->t->is_client, true); diff --git a/src/core/ext/transport/inproc/legacy_inproc_transport.h b/src/core/ext/transport/inproc/legacy_inproc_transport.h index b50355ae905..5a2d21e0bcc 100644 --- a/src/core/ext/transport/inproc/legacy_inproc_transport.h +++ b/src/core/ext/transport/inproc/legacy_inproc_transport.h @@ -24,6 +24,4 @@ grpc_channel* grpc_legacy_inproc_channel_create(grpc_server* server, const grpc_channel_args* args, void* reserved); -extern grpc_core::TraceFlag grpc_inproc_trace; - #endif // GRPC_SRC_CORE_EXT_TRANSPORT_INPROC_LEGACY_INPROC_TRANSPORT_H diff --git a/src/core/handshaker/handshaker.cc b/src/core/handshaker/handshaker.cc index 84a0d88ed2a..4279755cb6d 100644 --- a/src/core/handshaker/handshaker.cc +++ b/src/core/handshaker/handshaker.cc @@ -43,8 +43,6 @@ namespace grpc_core { -TraceFlag grpc_handshaker_trace(false, "handshaker"); - namespace { using ::grpc_event_engine::experimental::EventEngine; @@ -62,13 +60,12 @@ std::string HandshakerArgsString(HandshakerArgs* args) { } // namespace HandshakeManager::HandshakeManager() - : RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_handshaker_trace) - ? "HandshakeManager" - : nullptr) {} + : RefCounted(GRPC_TRACE_FLAG_ENABLED(handshaker) ? "HandshakeManager" + : nullptr) {} void HandshakeManager::Add(RefCountedPtr handshaker) { MutexLock lock(&mu_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_handshaker_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(handshaker)) { gpr_log( GPR_INFO, "handshake_manager %p: adding handshaker %s [%p] at index %" PRIuPTR, @@ -94,7 +91,7 @@ void HandshakeManager::Shutdown(grpc_error_handle why) { // on_handshake_done callback. // Returns true if we've scheduled the on_handshake_done callback. bool HandshakeManager::CallNextHandshakerLocked(grpc_error_handle error) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_handshaker_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(handshaker)) { gpr_log(GPR_INFO, "handshake_manager %p: error=%s shutdown=%d index=%" PRIuPTR ", args=%s", @@ -123,7 +120,7 @@ bool HandshakeManager::CallNextHandshakerLocked(grpc_error_handle error) { } args_.args = ChannelArgs(); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_handshaker_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(handshaker)) { gpr_log(GPR_INFO, "handshake_manager %p: handshaking complete -- scheduling " "on_handshake_done with error=%s", @@ -136,7 +133,7 @@ bool HandshakeManager::CallNextHandshakerLocked(grpc_error_handle error) { is_shutdown_ = true; } else { auto handshaker = handshakers_[index_]; - if (GRPC_TRACE_FLAG_ENABLED(grpc_handshaker_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(handshaker)) { gpr_log( GPR_INFO, "handshake_manager %p: calling handshaker %s [%p] at index %" PRIuPTR, diff --git a/src/core/handshaker/security/secure_endpoint.cc b/src/core/handshaker/security/secure_endpoint.cc index 0e426e1afbd..2ca7e6773e2 100644 --- a/src/core/handshaker/security/secure_endpoint.cc +++ b/src/core/handshaker/security/secure_endpoint.cc @@ -51,7 +51,6 @@ #include "src/core/lib/resource_quota/api.h" #include "src/core/lib/resource_quota/memory_quota.h" #include "src/core/lib/resource_quota/resource_quota.h" -#include "src/core/lib/resource_quota/trace.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/tsi/transport_security_grpc.h" @@ -146,8 +145,6 @@ struct secure_endpoint { }; } // namespace -grpc_core::TraceFlag grpc_trace_secure_endpoint(false, "secure_endpoint"); - static void destroy(secure_endpoint* ep) { delete ep; } #ifndef NDEBUG @@ -157,7 +154,7 @@ static void destroy(secure_endpoint* ep) { delete ep; } secure_endpoint_ref((ep), (reason), __FILE__, __LINE__) static void secure_endpoint_unref(secure_endpoint* ep, const char* reason, const char* file, int line) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_secure_endpoint)) { + if (GRPC_TRACE_FLAG_ENABLED(secure_endpoint)) { gpr_atm val = gpr_atm_no_barrier_load(&ep->ref.count); gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "SECENDP unref %p : %s %" PRIdPTR " -> %" PRIdPTR, ep, reason, val, @@ -170,7 +167,7 @@ static void secure_endpoint_unref(secure_endpoint* ep, const char* reason, static void secure_endpoint_ref(secure_endpoint* ep, const char* reason, const char* file, int line) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_secure_endpoint)) { + if (GRPC_TRACE_FLAG_ENABLED(secure_endpoint)) { gpr_atm val = gpr_atm_no_barrier_load(&ep->ref.count); gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "SECENDP ref %p : %s %" PRIdPTR " -> %" PRIdPTR, ep, reason, val, @@ -198,7 +195,7 @@ static void maybe_post_reclaimer(secure_endpoint* ep) { grpc_core::ReclamationPass::kBenign, [ep](absl::optional sweep) { if (sweep.has_value()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { gpr_log(GPR_INFO, "secure endpoint: benign reclamation to free memory"); } @@ -235,7 +232,7 @@ static void flush_read_staging_buffer(secure_endpoint* ep, uint8_t** cur, } static void call_read_cb(secure_endpoint* ep, grpc_error_handle error) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_secure_endpoint) && + if (GRPC_TRACE_FLAG_ENABLED(secure_endpoint) && gpr_should_log(GPR_LOG_SEVERITY_INFO)) { size_t i; for (i = 0; i < ep->read_buffer->count; i++) { @@ -403,7 +400,7 @@ static void endpoint_write(grpc_endpoint* secure_ep, grpc_slice_buffer* slices, grpc_slice_buffer_reset_and_unref(&ep->output_buffer); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_secure_endpoint) && + if (GRPC_TRACE_FLAG_ENABLED(secure_endpoint) && gpr_should_log(GPR_LOG_SEVERITY_INFO)) { for (i = 0; i < slices->count; i++) { char* data = diff --git a/src/core/handshaker/security/secure_endpoint.h b/src/core/handshaker/security/secure_endpoint.h index c185c060e11..a9d6d2088c4 100644 --- a/src/core/handshaker/security/secure_endpoint.h +++ b/src/core/handshaker/security/secure_endpoint.h @@ -28,8 +28,6 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/iomgr/endpoint.h" -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 // used. diff --git a/src/core/lib/channel/channel_stack.cc b/src/core/lib/channel/channel_stack.cc index 837c90a445a..63e322d6b93 100644 --- a/src/core/lib/channel/channel_stack.cc +++ b/src/core/lib/channel/channel_stack.cc @@ -31,14 +31,11 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_fwd.h" -#include "src/core/lib/channel/channel_stack_trace.h" #include "src/core/lib/surface/channel_init.h" #include "src/core/util/alloc.h" using grpc_event_engine::experimental::EventEngine; -grpc_core::TraceFlag grpc_trace_channel(false, "channel"); - static int register_get_name_fn = []() { grpc_core::NameFromChannelFilter = [](const grpc_channel_filter* filter) { return filter->name; @@ -121,7 +118,7 @@ grpc_error_handle grpc_channel_stack_init( const grpc_channel_filter** filters, size_t filter_count, const grpc_core::ChannelArgs& channel_args, const char* name, grpc_channel_stack* stack) { - if (grpc_trace_channel_stack.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel_stack)) { LOG(INFO) << "CHANNEL_STACK: init " << name; for (size_t i = 0; i < filter_count; i++) { LOG(INFO) << "CHANNEL_STACK: filter " << filters[i]->name; diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h index ce9d2dfab0a..ff0fc291c0a 100644 --- a/src/core/lib/channel/channel_stack.h +++ b/src/core/lib/channel/channel_stack.h @@ -364,13 +364,11 @@ void grpc_call_log_op(const char* file, int line, gpr_log_severity severity, void grpc_channel_stack_no_post_init(grpc_channel_stack* stk, grpc_channel_element* elem); -extern grpc_core::TraceFlag grpc_trace_channel; - -#define GRPC_CALL_LOG_OP(sev, elem, op) \ - do { \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_channel)) { \ - grpc_call_log_op(sev, elem, op); \ - } \ +#define GRPC_CALL_LOG_OP(sev, elem, op) \ + do { \ + if (GRPC_TRACE_FLAG_ENABLED(channel)) { \ + grpc_call_log_op(sev, elem, op); \ + } \ } while (0) #endif // GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_STACK_H diff --git a/src/core/lib/channel/channel_stack_builder_impl.cc b/src/core/lib/channel/channel_stack_builder_impl.cc index 935eb222f35..7db444474e9 100644 --- a/src/core/lib/channel/channel_stack_builder_impl.cc +++ b/src/core/lib/channel/channel_stack_builder_impl.cc @@ -46,7 +46,6 @@ #include "src/core/lib/promise/activity.h" #include "src/core/lib/promise/arena_promise.h" #include "src/core/lib/promise/poll.h" -#include "src/core/lib/surface/call_trace.h" #include "src/core/lib/surface/channel_stack_type.h" #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/metadata_batch.h" diff --git a/src/core/lib/channel/channel_stack_trace.cc b/src/core/lib/channel/channel_stack_trace.cc deleted file mode 100644 index b8e7b204a6a..00000000000 --- a/src/core/lib/channel/channel_stack_trace.cc +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2023 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "src/core/lib/channel/channel_stack_trace.h" - -#include - -grpc_core::TraceFlag grpc_trace_channel_stack(false, "channel_stack"); diff --git a/src/core/lib/channel/channel_stack_trace.h b/src/core/lib/channel/channel_stack_trace.h deleted file mode 100644 index 9e7b720d66c..00000000000 --- a/src/core/lib/channel/channel_stack_trace.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2023 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_STACK_TRACE_H -#define GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_STACK_TRACE_H - -#include - -#include "src/core/lib/debug/trace.h" - -extern grpc_core::TraceFlag grpc_trace_channel_stack; - -#endif // GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_STACK_TRACE_H diff --git a/src/core/lib/channel/connected_channel.cc b/src/core/lib/channel/connected_channel.cc index 692a3ae68c8..5507e1ef65e 100644 --- a/src/core/lib/channel/connected_channel.cc +++ b/src/core/lib/channel/connected_channel.cc @@ -72,7 +72,6 @@ #include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_buffer.h" #include "src/core/lib/surface/call.h" -#include "src/core/lib/surface/call_trace.h" #include "src/core/lib/surface/channel_stack_type.h" #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/metadata_batch.h" diff --git a/src/core/lib/channel/promise_based_filter.cc b/src/core/lib/channel/promise_based_filter.cc index e0b6e054c96..e2d9d8cffff 100644 --- a/src/core/lib/channel/promise_based_filter.cc +++ b/src/core/lib/channel/promise_based_filter.cc @@ -40,8 +40,6 @@ #include "src/core/lib/promise/seq.h" #include "src/core/lib/slice/slice.h" -extern grpc_core::TraceFlag grpc_trace_channel; - namespace grpc_core { namespace promise_filter_detail { @@ -212,7 +210,7 @@ void BaseCallData::CapturedBatch::ResumeWith(Flusher* releaser) { uintptr_t& refcnt = *RefCountField(batch); if (refcnt == 0) { // refcnt==0 ==> cancelled - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%sRESUME BATCH REQUEST CANCELLED", releaser->call()->DebugTag().c_str()); } @@ -268,7 +266,7 @@ BaseCallData::Flusher::~Flusher() { auto* batch = static_cast(p); BaseCallData* call = static_cast(batch->handler_private.extra_arg); - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "FLUSHER:forward batch via closure: %s", grpc_transport_stream_op_batch_string(batch, false).c_str()); } @@ -280,7 +278,7 @@ BaseCallData::Flusher::~Flusher() { if (call_->call() != nullptr && call_->call()->traced()) { batch->is_traced = true; } - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log( GPR_INFO, "FLUSHER:queue batch to forward in closure: %s", grpc_transport_stream_op_batch_string(release_[i], false).c_str()); @@ -293,7 +291,7 @@ BaseCallData::Flusher::~Flusher() { "flusher_batch"); } call_closures_.RunClosuresWithoutYielding(call_->call_combiner()); - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "FLUSHER:forward batch: %s", grpc_transport_stream_op_batch_string(release_[0], false).c_str()); } @@ -334,7 +332,7 @@ const char* BaseCallData::SendMessage::StateString(State state) { } void BaseCallData::SendMessage::StartOp(CapturedBatch batch) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s SendMessage.StartOp st=%s", base_->LogTag().c_str(), StateString(state_)); } @@ -362,7 +360,7 @@ void BaseCallData::SendMessage::StartOp(CapturedBatch batch) { template void BaseCallData::SendMessage::GotPipe(T* pipe_end) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s SendMessage.GotPipe st=%s", base_->LogTag().c_str(), StateString(state_)); } @@ -410,7 +408,7 @@ bool BaseCallData::SendMessage::IsIdle() const { void BaseCallData::SendMessage::OnComplete(absl::Status status) { Flusher flusher(base_); - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s SendMessage.OnComplete st=%s status=%s", base_->LogTag().c_str(), StateString(state_), status.ToString().c_str()); @@ -441,7 +439,7 @@ void BaseCallData::SendMessage::OnComplete(absl::Status status) { void BaseCallData::SendMessage::Done(const ServerMetadata& metadata, Flusher* flusher) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s SendMessage.Done st=%s md=%s", base_->LogTag().c_str(), StateString(state_), metadata.DebugString().c_str()); @@ -484,7 +482,7 @@ void BaseCallData::SendMessage::Done(const ServerMetadata& metadata, void BaseCallData::SendMessage::WakeInsideCombiner(Flusher* flusher, bool allow_push_to_pipe) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s SendMessage.WakeInsideCombiner st=%s%s", base_->LogTag().c_str(), StateString(state_), state_ == State::kBatchCompleted @@ -518,7 +516,7 @@ void BaseCallData::SendMessage::WakeInsideCombiner(Flusher* flusher, CHECK(push_.has_value()); auto r_push = (*push_)(); if (auto* p = r_push.value_if_ready()) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s SendMessage.WakeInsideCombiner push complete, result=%s", base_->LogTag().c_str(), *p ? "true" : "false"); @@ -532,7 +530,7 @@ void BaseCallData::SendMessage::WakeInsideCombiner(Flusher* flusher, CHECK(next_.has_value()); auto r_next = (*next_)(); if (auto* p = r_next.value_if_ready()) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s SendMessage.WakeInsideCombiner next complete, " "result.has_value=%s", @@ -617,7 +615,7 @@ const char* BaseCallData::ReceiveMessage::StateString(State state) { } void BaseCallData::ReceiveMessage::StartOp(CapturedBatch& batch) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ReceiveMessage.StartOp st=%s", base_->LogTag().c_str(), StateString(state_)); } @@ -658,7 +656,7 @@ void BaseCallData::ReceiveMessage::StartOp(CapturedBatch& batch) { template void BaseCallData::ReceiveMessage::GotPipe(T* pipe_end) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ReceiveMessage.GotPipe st=%s", base_->LogTag().c_str(), StateString(state_)); } @@ -694,7 +692,7 @@ void BaseCallData::ReceiveMessage::GotPipe(T* pipe_end) { } void BaseCallData::ReceiveMessage::OnComplete(absl::Status status) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ReceiveMessage.OnComplete st=%s status=%s", base_->LogTag().c_str(), StateString(state_), status.ToString().c_str()); @@ -735,7 +733,7 @@ void BaseCallData::ReceiveMessage::OnComplete(absl::Status status) { void BaseCallData::ReceiveMessage::Done(const ServerMetadata& metadata, Flusher* flusher) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ReceiveMessage.Done st=%s md=%s", base_->LogTag().c_str(), StateString(state_), metadata.DebugString().c_str()); @@ -794,7 +792,7 @@ void BaseCallData::ReceiveMessage::Done(const ServerMetadata& metadata, void BaseCallData::ReceiveMessage::WakeInsideCombiner(Flusher* flusher, bool allow_push_to_pipe) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ReceiveMessage.WakeInsideCombiner st=%s push?=%s next?=%s " "allow_push_to_pipe=%s", @@ -856,7 +854,7 @@ void BaseCallData::ReceiveMessage::WakeInsideCombiner(Flusher* flusher, CHECK(push_.has_value()); auto r_push = (*push_)(); if (auto* p = r_push.value_if_ready()) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ReceiveMessage.WakeInsideCombiner push complete: %s", base_->LogTag().c_str(), *p ? "true" : "false"); @@ -887,7 +885,7 @@ void BaseCallData::ReceiveMessage::WakeInsideCombiner(Flusher* flusher, p->cancelled() ? absl::CancelledError() : absl::OkStatus(), "recv_message"); } - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ReceiveMessage.WakeInsideCombiner next complete: %s " "new_state=%s", @@ -906,7 +904,7 @@ void BaseCallData::ReceiveMessage::WakeInsideCombiner(Flusher* flusher, case State::kPulledFromPipe: { CHECK(push_.has_value()); if ((*push_)().ready()) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ReceiveMessage.WakeInsideCombiner push complete", base_->LogTag().c_str()); @@ -1022,7 +1020,7 @@ class ClientCallData::PollContext { void Run() { DCHECK(HasContext()); - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ClientCallData.PollContext.Run %s", self_->LogTag().c_str(), self_->DebugString().c_str()); } @@ -1106,7 +1104,7 @@ class ClientCallData::PollContext { case SendInitialState::kForwarded: { // Poll the promise once since we're waiting for it. Poll poll = self_->promise_(); - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ClientCallData.PollContext.Run: poll=%s; %s", self_->LogTag().c_str(), PollToString(poll, @@ -1386,7 +1384,7 @@ void ClientCallData::StartBatch(grpc_transport_stream_op_batch* b) { CapturedBatch batch(b); Flusher flusher(this); - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s StartBatch %s", LogTag().c_str(), DebugString().c_str()); } @@ -1510,7 +1508,7 @@ void ClientCallData::StartBatch(grpc_transport_stream_op_batch* b) { // Handle cancellation. void ClientCallData::Cancel(grpc_error_handle error, Flusher* flusher) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s Cancel error=%s", LogTag().c_str(), error.ToString().c_str()); } @@ -1590,7 +1588,7 @@ void ClientCallData::StartPromise(Flusher* flusher) { } void ClientCallData::RecvInitialMetadataReady(grpc_error_handle error) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ClientCallData.RecvInitialMetadataReady %s error:%s md:%s", LogTag().c_str(), DebugString().c_str(), error.ToString().c_str(), @@ -1674,7 +1672,7 @@ void ClientCallData::HookRecvTrailingMetadata(CapturedBatch batch) { // - return a wrapper around PollTrailingMetadata as the promise. ArenaPromise ClientCallData::MakeNextPromise( CallArgs call_args) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ClientCallData.MakeNextPromise %s", LogTag().c_str(), DebugString().c_str()); } @@ -1737,7 +1735,7 @@ ArenaPromise ClientCallData::MakeNextPromise( // All polls: await receiving the trailing metadata, then return it to the // application. Poll ClientCallData::PollTrailingMetadata() { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ClientCallData.PollTrailingMetadata %s", LogTag().c_str(), DebugString().c_str()); } @@ -1788,7 +1786,7 @@ void ClientCallData::RecvTrailingMetadataReadyCallback( void ClientCallData::RecvTrailingMetadataReady(grpc_error_handle error) { Flusher flusher(this); - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ClientCallData.RecvTrailingMetadataReady " "recv_trailing_state=%s error=%s md=%s", @@ -2003,7 +2001,7 @@ ServerCallData::ServerCallData(grpc_call_element* elem, } ServerCallData::~ServerCallData() { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s ~ServerCallData %s", LogTag().c_str(), DebugString().c_str()); } @@ -2031,7 +2029,7 @@ void ServerCallData::StartBatch(grpc_transport_stream_op_batch* b) { Flusher flusher(this); bool wake = false; - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s StartBatch: %s", LogTag().c_str(), DebugString().c_str()); } @@ -2165,7 +2163,7 @@ void ServerCallData::StartBatch(grpc_transport_stream_op_batch* b) { // Handle cancellation. void ServerCallData::Completed(grpc_error_handle error, bool tarpit_cancellation, Flusher* flusher) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log( GPR_DEBUG, "%sServerCallData::Completed: send_trailing_state=%s " @@ -2291,7 +2289,7 @@ ArenaPromise ServerCallData::MakeNextPromise( // All polls: await sending the trailing metadata, then foward it down the // stack. Poll ServerCallData::PollTrailingMetadata() { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s PollTrailingMetadata: %s", LogTag().c_str(), StateString(send_trailing_state_)); } @@ -2322,7 +2320,7 @@ void ServerCallData::RecvTrailingMetadataReadyCallback( } void ServerCallData::RecvTrailingMetadataReady(grpc_error_handle error) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s: RecvTrailingMetadataReady error=%s md=%s", LogTag().c_str(), error.ToString().c_str(), recv_trailing_metadata_->DebugString().c_str()); @@ -2342,7 +2340,7 @@ void ServerCallData::RecvInitialMetadataReadyCallback(void* arg, void ServerCallData::RecvInitialMetadataReady(grpc_error_handle error) { Flusher flusher(this); - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s: RecvInitialMetadataReady %s", LogTag().c_str(), error.ToString().c_str()); } @@ -2407,7 +2405,7 @@ std::string ServerCallData::DebugString() const { // Wakeup and poll the promise if appropriate. void ServerCallData::WakeInsideCombiner(Flusher* flusher) { PollContext poll_ctx(this, flusher); - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s: WakeInsideCombiner %s", LogTag().c_str(), DebugString().c_str()); } @@ -2430,12 +2428,12 @@ void ServerCallData::WakeInsideCombiner(Flusher* flusher) { } if (send_initial_metadata_->metadata_push_.has_value()) { if ((*send_initial_metadata_->metadata_push_)().ready()) { - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s: WakeInsideCombiner: metadata_push done", LogTag().c_str()); } send_initial_metadata_->metadata_push_.reset(); - } else if (grpc_trace_channel.enabled()) { + } else if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s: WakeInsideCombiner: metadata_push pending", LogTag().c_str()); } @@ -2453,7 +2451,7 @@ void ServerCallData::WakeInsideCombiner(Flusher* flusher) { flusher, send_initial_metadata_ == nullptr || send_initial_metadata_->state == SendInitialMetadata::kForwarded); - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_DEBUG, "%s: After send_message WakeInsideCombiner %s is_idle=%s " "is_forwarded=%s", @@ -2482,7 +2480,7 @@ void ServerCallData::WakeInsideCombiner(Flusher* flusher) { if (promise_.has_value()) { Poll poll; poll = promise_(); - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log( GPR_INFO, "%s: WakeInsideCombiner poll=%s; send_initial_metadata=%s " @@ -2502,7 +2500,7 @@ void ServerCallData::WakeInsideCombiner(Flusher* flusher) { SendInitialMetadata::kQueuedAndPushedToPipe) { CHECK(send_initial_metadata_->metadata_next_.has_value()); auto p = (*send_initial_metadata_->metadata_next_)(); - if (grpc_trace_channel.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel)) { gpr_log(GPR_INFO, "%s: WakeInsideCombiner send_initial_metadata poll=%s", LogTag().c_str(), diff --git a/src/core/lib/debug/trace.cc b/src/core/lib/debug/trace.cc index 8500def37f7..78b79eb968e 100644 --- a/src/core/lib/debug/trace.cc +++ b/src/core/lib/debug/trace.cc @@ -24,97 +24,79 @@ #include "absl/log/log.h" #include "absl/strings/match.h" +#include "absl/strings/str_cat.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" +#include "absl/strings/strip.h" #include #include #include #include "src/core/lib/config/config_vars.h" +#include "src/core/lib/gprpp/glob.h" int grpc_tracer_set_enabled(const char* name, int enabled); namespace grpc_core { - -TraceFlag* TraceFlagList::root_tracer_ = nullptr; - -bool TraceFlagList::Set(absl::string_view name, bool enabled) { - TraceFlag* t; - if (name == "all") { - for (t = root_tracer_; t; t = t->next_tracer_) { - t->set_enabled(enabled); - } - } else if (name == "list_tracers") { - LogAllTracers(); - } else if (name == "refcount") { - for (t = root_tracer_; t; t = t->next_tracer_) { - if (absl::StrContains(t->name_, "refcount")) { - t->set_enabled(enabled); - } - } - } else { - bool found = false; - for (t = root_tracer_; t; t = t->next_tracer_) { - if (name == t->name_) { - t->set_enabled(enabled); - found = true; - } - } - // check for unknowns, but ignore "", to allow to GRPC_TRACE= - if (!found && !name.empty()) { - gpr_log(GPR_ERROR, "Unknown trace var: '%s'", std::string(name).c_str()); - return false; // early return - } - } - return true; -} - -void TraceFlagList::Add(TraceFlag* flag) { - flag->next_tracer_ = root_tracer_; - root_tracer_ = flag; -} - -void TraceFlagList::LogAllTracers() { - VLOG(2) << "available tracers:"; - for (TraceFlag* t = root_tracer_; t != nullptr; t = t->next_tracer_) { - VLOG(2) << "\t" << t->name_; +namespace { +void LogAllTracers() { + gpr_log(GPR_DEBUG, "available tracers:"); + for (const auto& name : GetAllTraceFlags()) { + LOG(INFO) << " " << name.first; } } -void TraceFlagList::SaveTo(std::map& values) { - for (TraceFlag* t = root_tracer_; t != nullptr; t = t->next_tracer_) { - values[t->name_] = t->enabled(); - } -} +} // namespace // Flags register themselves on the list during construction TraceFlag::TraceFlag(bool default_enabled, const char* name) : name_(name) { static_assert(std::is_trivially_destructible::value, "TraceFlag needs to be trivially destructible."); set_enabled(default_enabled); - TraceFlagList::Add(this); } -SavedTraceFlags::SavedTraceFlags() { TraceFlagList::SaveTo(values_); } +SavedTraceFlags::SavedTraceFlags() { + for (const auto& flag : GetAllTraceFlags()) { + values_[flag.first] = {flag.second->enabled(), flag.second}; + } +} void SavedTraceFlags::Restore() { for (const auto& flag : values_) { - TraceFlagList::Set(flag.first, flag.second); + flag.second.second->set_enabled(flag.second.first); } } -namespace { -void ParseTracers(absl::string_view tracers) { - for (auto s : absl::StrSplit(tracers, ',', absl::SkipWhitespace())) { - if (s[0] == '-') { - TraceFlagList::Set(s.substr(1), false); - } else { - TraceFlagList::Set(s, true); +bool ParseTracers(absl::string_view tracers) { + std::string enabled_tracers; + bool some_trace_was_found = false; + for (auto trace_glob : absl::StrSplit(tracers, ',', absl::SkipWhitespace())) { + if (trace_glob == "list_tracers") { + LogAllTracers(); + continue; } + bool enabled = !absl::ConsumePrefix(&trace_glob, "-"); + if (trace_glob == "all") trace_glob = "*"; + if (trace_glob == "refcount") trace_glob = "*refcount*"; + bool found = false; + for (const auto& flag : GetAllTraceFlags()) { + if (GlobMatch(flag.first, trace_glob)) { + flag.second->set_enabled(enabled); + if (enabled) absl::StrAppend(&enabled_tracers, flag.first, ", "); + found = true; + some_trace_was_found = true; + } + } + if (!found) LOG(ERROR) << "Unknown tracer: " << trace_glob; + } + if (!enabled_tracers.empty()) { + absl::string_view enabled_tracers_view(enabled_tracers); + absl::ConsumeSuffix(&enabled_tracers_view, ", "); + LOG(INFO) << "gRPC Tracers: " << enabled_tracers_view; } + return some_trace_was_found; } -} // namespace } // namespace grpc_core @@ -123,5 +105,6 @@ void grpc_tracer_init() { } int grpc_tracer_set_enabled(const char* name, int enabled) { - return grpc_core::TraceFlagList::Set(name, enabled != 0); + if (enabled != 0) return grpc_core::ParseTracers(name); + return grpc_core::ParseTracers(absl::StrCat("-", name)); } diff --git a/src/core/lib/debug/trace.h b/src/core/lib/debug/trace.h index 21b037c1139..6f05aa7abf4 100644 --- a/src/core/lib/debug/trace.h +++ b/src/core/lib/debug/trace.h @@ -1,5 +1,3 @@ -// -// // Copyright 2015 gRPC authors. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,104 +11,11 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// -// #ifndef GRPC_SRC_CORE_LIB_DEBUG_TRACE_H #define GRPC_SRC_CORE_LIB_DEBUG_TRACE_H -#include -#include -#include - -#include "absl/strings/string_view.h" - -#include - -void grpc_tracer_init(); -void grpc_tracer_shutdown(void); - -namespace grpc_core { - -class TraceFlag; -class TraceFlagList { - public: - static bool Set(absl::string_view name, bool enabled); - static void Add(TraceFlag* flag); - static void SaveTo(std::map& values); - - private: - static void LogAllTracers(); - static TraceFlag* root_tracer_; -}; - -namespace testing { -void grpc_tracer_enable_flag(TraceFlag* flag); -} - -class TraceFlag { - public: - TraceFlag(bool default_enabled, const char* name); - // TraceFlag needs to be trivially destructible since it is used as global - // variable. - ~TraceFlag() = default; - - const char* name() const { return name_; } - -// Use the symbol GRPC_USE_TRACERS to determine if tracers will be enabled in -// opt builds (tracers are always on in dbg builds). The default in OSS is for -// tracers to be on since we support binary distributions of gRPC for the -// wrapped language (wr don't want to force recompilation to get tracing). -// Internally, however, for performance reasons, we compile them out by -// default, since internal build systems make recompiling trivial. -// -// Prefer GRPC_TRACE_FLAG_ENABLED() macro instead of using enabled() directly. -#define GRPC_USE_TRACERS // tracers on by default in OSS -#if defined(GRPC_USE_TRACERS) || !defined(NDEBUG) - bool enabled() { return value_.load(std::memory_order_relaxed); } -#else - bool enabled() { return false; } -#endif // defined(GRPC_USE_TRACERS) || !defined(NDEBUG) - - private: - friend void testing::grpc_tracer_enable_flag(TraceFlag* flag); - friend class TraceFlagList; - - void set_enabled(bool enabled) { - value_.store(enabled, std::memory_order_relaxed); - } - - TraceFlag* next_tracer_; - const char* const name_; - std::atomic value_; -}; - -#define GRPC_TRACE_FLAG_ENABLED(f) GPR_UNLIKELY((f).enabled()) - -#ifndef NDEBUG -typedef TraceFlag DebugOnlyTraceFlag; -#else -class DebugOnlyTraceFlag { - public: - constexpr DebugOnlyTraceFlag(bool /*default_enabled*/, const char* /*name*/) { - } - constexpr bool enabled() const { return false; } - constexpr const char* name() const { return "DebugOnlyTraceFlag"; } - - private: - void set_enabled(bool /*enabled*/) {} -}; -#endif - -class SavedTraceFlags { - public: - SavedTraceFlags(); - void Restore(); - - private: - std::map values_; -}; - -} // namespace grpc_core +#include "src/core/lib/debug/trace_flags.h" // IWYU pragma: export +#include "src/core/lib/debug/trace_impl.h" // IWYU pragma: export #endif // GRPC_SRC_CORE_LIB_DEBUG_TRACE_H diff --git a/src/core/lib/debug/trace_flags.cc b/src/core/lib/debug/trace_flags.cc index cdba9785c0b..05ef50af0e4 100644 --- a/src/core/lib/debug/trace_flags.cc +++ b/src/core/lib/debug/trace_flags.cc @@ -11,3 +11,245 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + +// +// Automatically generated by tools/codegen/core/gen_trace_flags.py +// + +#include "absl/container/flat_hash_map.h" + +#include "src/core/lib/debug/trace.h" +#include "src/core/lib/gprpp/no_destruct.h" + +namespace grpc_core { + +DebugOnlyTraceFlag auth_context_refcount_trace(false, "auth_context_refcount"); +DebugOnlyTraceFlag call_combiner_trace(false, "call_combiner"); +DebugOnlyTraceFlag call_refcount_trace(false, "call_refcount"); +DebugOnlyTraceFlag closure_trace(false, "closure"); +DebugOnlyTraceFlag combiner_trace(false, "combiner"); +DebugOnlyTraceFlag cq_refcount_trace(false, "cq_refcount"); +DebugOnlyTraceFlag error_refcount_trace(false, "error_refcount"); +DebugOnlyTraceFlag fd_refcount_trace(false, "fd_refcount"); +DebugOnlyTraceFlag fd_trace_trace(false, "fd_trace"); +DebugOnlyTraceFlag lb_policy_refcount_trace(false, "lb_policy_refcount"); +DebugOnlyTraceFlag party_state_trace(false, "party_state"); +DebugOnlyTraceFlag pending_tags_trace(false, "pending_tags"); +DebugOnlyTraceFlag polling_trace(false, "polling"); +DebugOnlyTraceFlag polling_api_trace(false, "polling_api"); +DebugOnlyTraceFlag promise_primitives_trace(false, "promise_primitives"); +DebugOnlyTraceFlag resolver_refcount_trace(false, "resolver_refcount"); +DebugOnlyTraceFlag security_connector_refcount_trace( + false, "security_connector_refcount"); +DebugOnlyTraceFlag slice_refcount_trace(false, "slice_refcount"); +DebugOnlyTraceFlag stream_refcount_trace(false, "stream_refcount"); +DebugOnlyTraceFlag subchannel_refcount_trace(false, "subchannel_refcount"); +DebugOnlyTraceFlag work_serializer_trace(false, "work_serializer"); +TraceFlag api_trace(false, "api"); +TraceFlag apple_polling_trace(false, "apple_polling"); +TraceFlag backend_metric_trace(false, "backend_metric"); +TraceFlag backend_metric_filter_trace(false, "backend_metric_filter"); +TraceFlag bdp_estimator_trace(false, "bdp_estimator"); +TraceFlag call_trace(false, "call"); +TraceFlag call_error_trace(false, "call_error"); +TraceFlag cares_address_sorting_trace(false, "cares_address_sorting"); +TraceFlag cares_resolver_trace(false, "cares_resolver"); +TraceFlag cds_lb_trace(false, "cds_lb"); +TraceFlag channel_trace(false, "channel"); +TraceFlag channel_stack_trace(false, "channel_stack"); +TraceFlag chaotic_good_trace(false, "chaotic_good"); +TraceFlag chttp2_hpack_parser_trace(false, "chttp2_hpack_parser"); +TraceFlag chttp2_new_stream_trace(false, "chttp2_new_stream"); +TraceFlag client_channel_trace(false, "client_channel"); +TraceFlag client_channel_call_trace(false, "client_channel_call"); +TraceFlag client_channel_lb_call_trace(false, "client_channel_lb_call"); +TraceFlag client_idle_filter_trace(false, "client_idle_filter"); +TraceFlag compression_trace(false, "compression"); +TraceFlag connectivity_state_trace(false, "connectivity_state"); +TraceFlag cronet_trace(false, "cronet"); +TraceFlag dns_resolver_trace(false, "dns_resolver"); +TraceFlag environment_autodetect_trace(false, "environment_autodetect"); +TraceFlag event_engine_trace(false, "event_engine"); +TraceFlag event_engine_client_channel_resolver_trace( + false, "event_engine_client_channel_resolver"); +TraceFlag event_engine_dns_trace(false, "event_engine_dns"); +TraceFlag event_engine_endpoint_trace(false, "event_engine_endpoint"); +TraceFlag event_engine_endpoint_data_trace(false, "event_engine_endpoint_data"); +TraceFlag event_engine_poller_trace(false, "event_engine_poller"); +TraceFlag executor_trace(false, "executor"); +TraceFlag fault_injection_filter_trace(false, "fault_injection_filter"); +TraceFlag flowctl_trace(false, "flowctl"); +TraceFlag fork_trace(false, "fork"); +TraceFlag fuzzing_ee_timers_trace(false, "fuzzing_ee_timers"); +TraceFlag fuzzing_ee_writes_trace(false, "fuzzing_ee_writes"); +TraceFlag glb_trace(false, "glb"); +TraceFlag grpc_authz_api_trace(false, "grpc_authz_api"); +TraceFlag handshaker_trace(false, "handshaker"); +TraceFlag health_check_client_trace(false, "health_check_client"); +TraceFlag http_trace(false, "http"); +TraceFlag http1_trace(false, "http1"); +TraceFlag http2_ping_trace(false, "http2_ping"); +TraceFlag http2_stream_state_trace(false, "http2_stream_state"); +TraceFlag http_keepalive_trace(false, "http_keepalive"); +TraceFlag inproc_trace(false, "inproc"); +TraceFlag metadata_query_trace(false, "metadata_query"); +TraceFlag op_failure_trace(false, "op_failure"); +TraceFlag orca_client_trace(false, "orca_client"); +TraceFlag outlier_detection_lb_trace(false, "outlier_detection_lb"); +TraceFlag pick_first_trace(false, "pick_first"); +TraceFlag plugin_credentials_trace(false, "plugin_credentials"); +TraceFlag priority_lb_trace(false, "priority_lb"); +TraceFlag queue_pluck_trace(false, "queue_pluck"); +TraceFlag resource_quota_trace(false, "resource_quota"); +TraceFlag retry_trace(false, "retry"); +TraceFlag ring_hash_lb_trace(false, "ring_hash_lb"); +TraceFlag rls_lb_trace(false, "rls_lb"); +TraceFlag round_robin_trace(false, "round_robin"); +TraceFlag secure_endpoint_trace(false, "secure_endpoint"); +TraceFlag server_channel_trace(false, "server_channel"); +TraceFlag stateful_session_filter_trace(false, "stateful_session_filter"); +TraceFlag subchannel_trace(false, "subchannel"); +TraceFlag subchannel_pool_trace(false, "subchannel_pool"); +TraceFlag tcp_trace(false, "tcp"); +TraceFlag timer_trace(false, "timer"); +TraceFlag timer_check_trace(false, "timer_check"); +TraceFlag tsi_trace(false, "tsi"); +TraceFlag weighted_round_robin_lb_trace(false, "weighted_round_robin_lb"); +TraceFlag weighted_target_lb_trace(false, "weighted_target_lb"); +TraceFlag xds_client_trace(false, "xds_client"); +TraceFlag xds_client_refcount_trace(false, "xds_client_refcount"); +TraceFlag xds_cluster_impl_lb_trace(false, "xds_cluster_impl_lb"); +TraceFlag xds_cluster_manager_lb_trace(false, "xds_cluster_manager_lb"); +TraceFlag xds_cluster_resource_type_test_trace( + true, "xds_cluster_resource_type_test"); +TraceFlag xds_common_types_test_trace(true, "xds_common_types_test"); +TraceFlag xds_endpoint_resource_type_test_trace( + true, "xds_endpoint_resource_type_test"); +TraceFlag xds_listener_resource_type_test_trace( + true, "xds_listener_resource_type_test"); +TraceFlag xds_override_host_lb_trace(false, "xds_override_host_lb"); +TraceFlag xds_resolver_trace(false, "xds_resolver"); +TraceFlag xds_route_config_resource_type_test_trace( + true, "xds_route_config_resource_type_test"); +TraceFlag xds_server_config_fetcher_trace(false, "xds_server_config_fetcher"); +TraceFlag xds_wrr_locality_lb_trace(false, "xds_wrr_locality_lb"); + +const absl::flat_hash_map& GetAllTraceFlags() { + static const NoDestruct> all( + absl::flat_hash_map({ + {"api", &api_trace}, + {"apple_polling", &apple_polling_trace}, + {"backend_metric", &backend_metric_trace}, + {"backend_metric_filter", &backend_metric_filter_trace}, + {"bdp_estimator", &bdp_estimator_trace}, + {"call", &call_trace}, + {"call_error", &call_error_trace}, + {"cares_address_sorting", &cares_address_sorting_trace}, + {"cares_resolver", &cares_resolver_trace}, + {"cds_lb", &cds_lb_trace}, + {"channel", &channel_trace}, + {"channel_stack", &channel_stack_trace}, + {"chaotic_good", &chaotic_good_trace}, + {"chttp2_hpack_parser", &chttp2_hpack_parser_trace}, + {"chttp2_new_stream", &chttp2_new_stream_trace}, + {"client_channel", &client_channel_trace}, + {"client_channel_call", &client_channel_call_trace}, + {"client_channel_lb_call", &client_channel_lb_call_trace}, + {"client_idle_filter", &client_idle_filter_trace}, + {"compression", &compression_trace}, + {"connectivity_state", &connectivity_state_trace}, + {"cronet", &cronet_trace}, + {"dns_resolver", &dns_resolver_trace}, + {"environment_autodetect", &environment_autodetect_trace}, + {"event_engine", &event_engine_trace}, + {"event_engine_client_channel_resolver", + &event_engine_client_channel_resolver_trace}, + {"event_engine_dns", &event_engine_dns_trace}, + {"event_engine_endpoint", &event_engine_endpoint_trace}, + {"event_engine_endpoint_data", &event_engine_endpoint_data_trace}, + {"event_engine_poller", &event_engine_poller_trace}, + {"executor", &executor_trace}, + {"fault_injection_filter", &fault_injection_filter_trace}, + {"flowctl", &flowctl_trace}, + {"fork", &fork_trace}, + {"fuzzing_ee_timers", &fuzzing_ee_timers_trace}, + {"fuzzing_ee_writes", &fuzzing_ee_writes_trace}, + {"glb", &glb_trace}, + {"grpc_authz_api", &grpc_authz_api_trace}, + {"handshaker", &handshaker_trace}, + {"health_check_client", &health_check_client_trace}, + {"http", &http_trace}, + {"http1", &http1_trace}, + {"http2_ping", &http2_ping_trace}, + {"http2_stream_state", &http2_stream_state_trace}, + {"http_keepalive", &http_keepalive_trace}, + {"inproc", &inproc_trace}, + {"metadata_query", &metadata_query_trace}, + {"op_failure", &op_failure_trace}, + {"orca_client", &orca_client_trace}, + {"outlier_detection_lb", &outlier_detection_lb_trace}, + {"pick_first", &pick_first_trace}, + {"plugin_credentials", &plugin_credentials_trace}, + {"priority_lb", &priority_lb_trace}, + {"queue_pluck", &queue_pluck_trace}, + {"resource_quota", &resource_quota_trace}, + {"retry", &retry_trace}, + {"ring_hash_lb", &ring_hash_lb_trace}, + {"rls_lb", &rls_lb_trace}, + {"round_robin", &round_robin_trace}, + {"secure_endpoint", &secure_endpoint_trace}, + {"server_channel", &server_channel_trace}, + {"stateful_session_filter", &stateful_session_filter_trace}, + {"subchannel", &subchannel_trace}, + {"subchannel_pool", &subchannel_pool_trace}, + {"tcp", &tcp_trace}, + {"timer", &timer_trace}, + {"timer_check", &timer_check_trace}, + {"tsi", &tsi_trace}, + {"weighted_round_robin_lb", &weighted_round_robin_lb_trace}, + {"weighted_target_lb", &weighted_target_lb_trace}, + {"xds_client", &xds_client_trace}, + {"xds_client_refcount", &xds_client_refcount_trace}, + {"xds_cluster_impl_lb", &xds_cluster_impl_lb_trace}, + {"xds_cluster_manager_lb", &xds_cluster_manager_lb_trace}, + {"xds_cluster_resource_type_test", + &xds_cluster_resource_type_test_trace}, + {"xds_common_types_test", &xds_common_types_test_trace}, + {"xds_endpoint_resource_type_test", + &xds_endpoint_resource_type_test_trace}, + {"xds_listener_resource_type_test", + &xds_listener_resource_type_test_trace}, + {"xds_override_host_lb", &xds_override_host_lb_trace}, + {"xds_resolver", &xds_resolver_trace}, + {"xds_route_config_resource_type_test", + &xds_route_config_resource_type_test_trace}, + {"xds_server_config_fetcher", &xds_server_config_fetcher_trace}, + {"xds_wrr_locality_lb", &xds_wrr_locality_lb_trace}, +#ifndef NDEBUG + {"auth_context_refcount", &auth_context_refcount_trace}, + {"call_combiner", &call_combiner_trace}, + {"call_refcount", &call_refcount_trace}, + {"closure", &closure_trace}, + {"combiner", &combiner_trace}, + {"cq_refcount", &cq_refcount_trace}, + {"error_refcount", &error_refcount_trace}, + {"fd_refcount", &fd_refcount_trace}, + {"fd_trace", &fd_trace_trace}, + {"lb_policy_refcount", &lb_policy_refcount_trace}, + {"party_state", &party_state_trace}, + {"pending_tags", &pending_tags_trace}, + {"polling", &polling_trace}, + {"polling_api", &polling_api_trace}, + {"promise_primitives", &promise_primitives_trace}, + {"resolver_refcount", &resolver_refcount_trace}, + {"security_connector_refcount", &security_connector_refcount_trace}, + {"slice_refcount", &slice_refcount_trace}, + {"stream_refcount", &stream_refcount_trace}, + {"subchannel_refcount", &subchannel_refcount_trace}, + {"work_serializer", &work_serializer_trace}, +#endif + })); + return *all; +} + +} // namespace grpc_core diff --git a/src/core/lib/debug/trace_flags.h b/src/core/lib/debug/trace_flags.h index 0f8228e58f1..65d59df5078 100644 --- a/src/core/lib/debug/trace_flags.h +++ b/src/core/lib/debug/trace_flags.h @@ -12,7 +12,122 @@ // See the License for the specific language governing permissions and // limitations under the License. +// +// Automatically generated by tools/codegen/core/gen_trace_flags.py +// + #ifndef GRPC_SRC_CORE_LIB_DEBUG_TRACE_FLAGS_H #define GRPC_SRC_CORE_LIB_DEBUG_TRACE_FLAGS_H +#include "src/core/lib/debug/trace_impl.h" + +namespace grpc_core { + +extern DebugOnlyTraceFlag auth_context_refcount_trace; +extern DebugOnlyTraceFlag call_combiner_trace; +extern DebugOnlyTraceFlag call_refcount_trace; +extern DebugOnlyTraceFlag closure_trace; +extern DebugOnlyTraceFlag combiner_trace; +extern DebugOnlyTraceFlag cq_refcount_trace; +extern DebugOnlyTraceFlag error_refcount_trace; +extern DebugOnlyTraceFlag fd_refcount_trace; +extern DebugOnlyTraceFlag fd_trace_trace; +extern DebugOnlyTraceFlag lb_policy_refcount_trace; +extern DebugOnlyTraceFlag party_state_trace; +extern DebugOnlyTraceFlag pending_tags_trace; +extern DebugOnlyTraceFlag polling_trace; +extern DebugOnlyTraceFlag polling_api_trace; +extern DebugOnlyTraceFlag promise_primitives_trace; +extern DebugOnlyTraceFlag resolver_refcount_trace; +extern DebugOnlyTraceFlag security_connector_refcount_trace; +extern DebugOnlyTraceFlag slice_refcount_trace; +extern DebugOnlyTraceFlag stream_refcount_trace; +extern DebugOnlyTraceFlag subchannel_refcount_trace; +extern DebugOnlyTraceFlag work_serializer_trace; +extern TraceFlag api_trace; +extern TraceFlag apple_polling_trace; +extern TraceFlag backend_metric_trace; +extern TraceFlag backend_metric_filter_trace; +extern TraceFlag bdp_estimator_trace; +extern TraceFlag call_trace; +extern TraceFlag call_error_trace; +extern TraceFlag cares_address_sorting_trace; +extern TraceFlag cares_resolver_trace; +extern TraceFlag cds_lb_trace; +extern TraceFlag channel_trace; +extern TraceFlag channel_stack_trace; +extern TraceFlag chaotic_good_trace; +extern TraceFlag chttp2_hpack_parser_trace; +extern TraceFlag chttp2_new_stream_trace; +extern TraceFlag client_channel_trace; +extern TraceFlag client_channel_call_trace; +extern TraceFlag client_channel_lb_call_trace; +extern TraceFlag client_idle_filter_trace; +extern TraceFlag compression_trace; +extern TraceFlag connectivity_state_trace; +extern TraceFlag cronet_trace; +extern TraceFlag dns_resolver_trace; +extern TraceFlag environment_autodetect_trace; +extern TraceFlag event_engine_trace; +extern TraceFlag event_engine_client_channel_resolver_trace; +extern TraceFlag event_engine_dns_trace; +extern TraceFlag event_engine_endpoint_trace; +extern TraceFlag event_engine_endpoint_data_trace; +extern TraceFlag event_engine_poller_trace; +extern TraceFlag executor_trace; +extern TraceFlag fault_injection_filter_trace; +extern TraceFlag flowctl_trace; +extern TraceFlag fork_trace; +extern TraceFlag fuzzing_ee_timers_trace; +extern TraceFlag fuzzing_ee_writes_trace; +extern TraceFlag glb_trace; +extern TraceFlag grpc_authz_api_trace; +extern TraceFlag handshaker_trace; +extern TraceFlag health_check_client_trace; +extern TraceFlag http_trace; +extern TraceFlag http1_trace; +extern TraceFlag http2_ping_trace; +extern TraceFlag http2_stream_state_trace; +extern TraceFlag http_keepalive_trace; +extern TraceFlag inproc_trace; +extern TraceFlag metadata_query_trace; +extern TraceFlag op_failure_trace; +extern TraceFlag orca_client_trace; +extern TraceFlag outlier_detection_lb_trace; +extern TraceFlag pick_first_trace; +extern TraceFlag plugin_credentials_trace; +extern TraceFlag priority_lb_trace; +extern TraceFlag queue_pluck_trace; +extern TraceFlag resource_quota_trace; +extern TraceFlag retry_trace; +extern TraceFlag ring_hash_lb_trace; +extern TraceFlag rls_lb_trace; +extern TraceFlag round_robin_trace; +extern TraceFlag secure_endpoint_trace; +extern TraceFlag server_channel_trace; +extern TraceFlag stateful_session_filter_trace; +extern TraceFlag subchannel_trace; +extern TraceFlag subchannel_pool_trace; +extern TraceFlag tcp_trace; +extern TraceFlag timer_trace; +extern TraceFlag timer_check_trace; +extern TraceFlag tsi_trace; +extern TraceFlag weighted_round_robin_lb_trace; +extern TraceFlag weighted_target_lb_trace; +extern TraceFlag xds_client_trace; +extern TraceFlag xds_client_refcount_trace; +extern TraceFlag xds_cluster_impl_lb_trace; +extern TraceFlag xds_cluster_manager_lb_trace; +extern TraceFlag xds_cluster_resource_type_test_trace; +extern TraceFlag xds_common_types_test_trace; +extern TraceFlag xds_endpoint_resource_type_test_trace; +extern TraceFlag xds_listener_resource_type_test_trace; +extern TraceFlag xds_override_host_lb_trace; +extern TraceFlag xds_resolver_trace; +extern TraceFlag xds_route_config_resource_type_test_trace; +extern TraceFlag xds_server_config_fetcher_trace; +extern TraceFlag xds_wrr_locality_lb_trace; + +} // namespace grpc_core + #endif // GRPC_SRC_CORE_LIB_DEBUG_TRACE_FLAGS_H diff --git a/src/core/lib/debug/trace_flags.yaml b/src/core/lib/debug/trace_flags.yaml index e69de29bb2d..8260daf561c 100644 --- a/src/core/lib/debug/trace_flags.yaml +++ b/src/core/lib/debug/trace_flags.yaml @@ -0,0 +1,363 @@ +# Copyright 2024 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# File format: +# Each config var must have a name, a default, and a description. +# Optionally: +# * a `debug_only: true` flag can be added to ensure that this flag is only +# enabled in debug builds. +# * an `internal: true` flag can be added to ensure that this flag does not +# show up in the environment_variables.md documentations. + +api: + default: false + description: API calls to the C core. +apple_polling: + default: false + description: (legacy) Apple polling trace. + internal: true +auth_context_refcount: + debug_only: true + default: false + description: Auth context refcounting. +backend_metric: + default: false + description: C++ backend metric recorder APIs. +backend_metric_filter: + default: false + description: Filter that populates backend metric data in server trailing metadata. +bdp_estimator: + default: false + description: Behavior of bdp estimation logic. +call: + default: false + description: Traces operations on a call through the gRPC stack. +call_combiner: + debug_only: true + default: false + description: Call combiner state. +call_error: + default: false + description: Possible errors contributing to final call statuses. +call_refcount: + debug_only: true + default: false + description: Refcount on call. +cares_address_sorting: + default: false + description: Operations of the c-ares based DNS resolver's address sorter. +cares_resolver: + default: false + description: Operations of the c-ares based DNS resolver. +cds_lb: + default: false + description: CDS LB policy. +channel: + default: false + description: Operations on the C core channel stack. +channel_stack: + default: false + description: Construction of the set of filters in a channel stack. +chaotic_good: + default: false + description: Chaotic good transport. +chttp2_hpack_parser: + default: false + description: HTTP/2 HPACK parser. +chttp2_new_stream: + default: false + description: HTTP/2 incoming stream creation. +client_channel: + default: false + description: Client channel control plane activity, including resolver and load balancing policy interaction. +client_channel_call: + default: false + description: Client channel call activity related to name resolution. +client_channel_lb_call: + default: false + description: Client channel call activity related to load balancing picking. +client_idle_filter: + default: false + description: Client idleness filter. +closure: + debug_only: true + default: false + description: Legacy closure creation, scheduling, and completion. +combiner: + debug_only: true + default: false + description: Combiner lock state. +compression: + default: false + description: Compression operations. +connectivity_state: + default: false + description: Connectivity state changes to channels. +cq_refcount: + debug_only: true + default: false + description: Completion queue refcounting. +cronet: + default: false + description: Cronet transport engine. +dns_resolver: + default: false + description: The active DNS resolver. +environment_autodetect: + default: false + description: GCP environment auto-detection. +error_refcount: + debug_only: true + default: false + description: Error refcounting. +event_engine: + default: false + description: High-level EventEngine operations. +event_engine_client_channel_resolver: + default: false + description: EventEngine-based client channel resolver state and events. +event_engine_dns: + default: false + description: EventEngine DNS resolver. +event_engine_endpoint: + default: false + description: EventEngine Endpoint operations. +event_engine_endpoint_data: + default: false + description: Detailed dump of EventEngine endpoint TCP data. +event_engine_poller: + default: false + description: EventEngine Poller events. +executor: + default: false + description: gRPC's legacy thread pool ('the executor'). +fault_injection_filter: + default: false + description: Fault injection. +fd_refcount: + debug_only: true + default: false + description: File descriptor refcounting. +fd_trace: + debug_only: true + default: false + description: Legacy file descriptor create(), shutdown() and close() calls for channel fds. +flowctl: + default: false + description: Http2 flow control. +fork: + default: false + description: Fork support. +fuzzing_ee_timers: + default: false + description: Fuzzing EventEngine timers. + internal: true +fuzzing_ee_writes: + default: false + description: Fuzzing EventEngine writes. + internal: true +glb: + default: false + description: gRPClb load balancer. +grpc_authz_api: + default: false + description: gRPC authorization. +handshaker: + default: false + description: Handshaking state. +health_check_client: + default: false + description: Health checking client code. +http: + default: false + description: Http2 transport engine. +http1: + default: false + description: HTTP/1.x operations performed by gRPC. +http2_ping: + default: false + description: Pings/ping acks/antagonist writes in http2 stack. +http2_stream_state: + default: false + description: Http2 stream state mutations. +http_keepalive: + default: false + description: gRPC keepalive pings. +inproc: + default: false + description: In-process transport. +lb_policy_refcount: + debug_only: true + default: false + description: LB policy refcounting. +metadata_query: + default: false + description: GCP metadata queries. +op_failure: + default: false + description: Error information when failure is pushed onto a completion queue. The `api` tracer must be enabled for this flag to have any effect. +orca_client: + default: false + description: Out-of-band backend metric reporting client. +outlier_detection_lb: + default: false + description: Outlier detection. +party_state: + debug_only: true + default: false + description: Coordination of activities related to a call. +pending_tags: + debug_only: true + default: false + description: Still-in-progress tags on completion queues. The `api` tracer must be enabled for this flag to have any effect. +pick_first: + default: false + description: Pick first load balancing policy. +plugin_credentials: + default: false + description: Plugin credentials. +polling: + debug_only: true + default: false + description: The active polling engine. +polling_api: + debug_only: true + default: false + description: API calls to polling engine. +priority_lb: + default: false + description: Priority LB policy. +promise_primitives: + debug_only: true + default: false + description: Low-level primitives in the promise library. +queue_pluck: + default: false + description: Completion queue plucking. The `api` tracer must be enabled for this flag to have any effect. +resolver_refcount: + debug_only: true + default: false + description: Resolver refcouting. +resource_quota: + default: false + description: Resource quota objects internals. +retry: + default: false + description: Call retries. +ring_hash_lb: + default: false + description: Ring hash load balancing policy. +rls_lb: + default: false + description: RLS load balancing policy. +round_robin: + default: false + description: Round robin load balancing policy. +secure_endpoint: + default: false + description: Bytes flowing through encrypted channels. +security_connector_refcount: + debug_only: true + default: false + description: Refcounting for security connectors (part of channel credentials). +server_channel: + default: false + description: Lightweight trace of significant server channel events. +slice_refcount: + debug_only: true + default: false + description: Slice refcounting. +stateful_session_filter: + default: false + description: Stateful session affinity. +stream_refcount: + debug_only: true + default: false + description: Stream refcounting. +subchannel: + default: false + description: Connectivity state of subchannels. +subchannel_pool: + default: false + description: Subchannel pool. +subchannel_refcount: + debug_only: true + default: false + description: Subchannel refcounting. +tcp: + default: false + description: Bytes in and out of a channel. +timer: + default: false + description: Timers (alarms) in the grpc internals. +timer_check: + default: false + description: more detailed trace of timer logic in grpc internals. +tsi: + default: false + description: TSI transport security. +weighted_round_robin_lb: + default: false + description: Weighted round robin load balancing policy. +weighted_target_lb: + default: false + description: Weighted target LB policy. +work_serializer: + debug_only: true + default: false + description: A synchronization mechanism used to ensure that only one thread is executing at a given time. +xds_client: + default: false + description: XDS client. +xds_client_refcount: + default: false + description: Refcount of XDS client. +xds_cluster_impl_lb: + default: false + description: XDS Cluster impl LB policy. +xds_cluster_manager_lb: + default: false + description: XDS Cluster manager LB policy. +xds_cluster_resource_type_test: + default: true + description: XDS Cluster resource type. + internal: true +xds_common_types_test: + default: true + description: XDS Common types. + internal: true +xds_endpoint_resource_type_test: + default: true + description: XDS Endpoint resource type. + internal: true +xds_listener_resource_type_test: + default: true + description: XDS Listener resource type. + internal: true +xds_override_host_lb: + default: false + description: XDS Override host LB. +xds_resolver: + default: false + description: XDS Resolver. +xds_route_config_resource_type_test: + default: true + description: XDS Route config resource type. + internal: true +xds_server_config_fetcher: + default: false + description: XDS Server config fetcher. +xds_wrr_locality_lb: + default: false + description: XDS WRR locality LB policy. diff --git a/src/core/lib/debug/trace_impl.h b/src/core/lib/debug/trace_impl.h new file mode 100644 index 00000000000..705e2bbe572 --- /dev/null +++ b/src/core/lib/debug/trace_impl.h @@ -0,0 +1,115 @@ +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef GRPC_SRC_CORE_LIB_DEBUG_TRACE_IMPL_H +#define GRPC_SRC_CORE_LIB_DEBUG_TRACE_IMPL_H + +#include +#include +#include + +#include "absl/container/flat_hash_map.h" +#include "absl/log/log.h" +#include "absl/strings/string_view.h" + +#include + +void grpc_tracer_init(); +void grpc_tracer_shutdown(void); + +namespace grpc_core { +bool ParseTracers(absl::string_view tracers); +class SavedTraceFlags; + +class TraceFlag; + +namespace testing { +void grpc_tracer_enable_flag(TraceFlag* flag); +} + +class TraceFlag { + public: + TraceFlag(bool default_enabled, const char* name); + // TraceFlag needs to be trivially destructible since it is used as global + // variable. + ~TraceFlag() = default; + + const char* name() const { return name_; } + +// Use the symbol GRPC_USE_TRACERS to determine if tracers will be enabled in +// opt builds (tracers are always on in dbg builds). The default in OSS is for +// tracers to be on since we support binary distributions of gRPC for the +// wrapped language (wr don't want to force recompilation to get tracing). +// Internally, however, for performance reasons, we compile them out by +// default, since internal build systems make recompiling trivial. +// +// Prefer GRPC_TRACE_FLAG_ENABLED() macro instead of using enabled() directly. +#define GRPC_USE_TRACERS // tracers on by default in OSS +#if defined(GRPC_USE_TRACERS) || !defined(NDEBUG) + bool enabled() { return value_.load(std::memory_order_relaxed); } +#else + bool enabled() { return false; } +#endif // defined(GRPC_USE_TRACERS) || !defined(NDEBUG) + + private: + friend void testing::grpc_tracer_enable_flag(TraceFlag* flag); + friend bool ParseTracers(absl::string_view tracers); + friend SavedTraceFlags; + + void set_enabled(bool enabled) { + value_.store(enabled, std::memory_order_relaxed); + } + + TraceFlag* next_tracer_; + const char* const name_; + std::atomic value_; +}; + +#define GRPC_TRACE_FLAG_ENABLED_OBJ(obj) GPR_UNLIKELY((obj).enabled()) +#define GRPC_TRACE_FLAG_ENABLED(tracer) \ + GPR_UNLIKELY((grpc_core::tracer##_trace).enabled()) +#define GRPC_TRACE_LOG(tracer, level) \ + LOG_IF(level, GRPC_TRACE_FLAG_ENABLED(tracer)) +#define GRPC_TRACE_VLOG(tracer, level) \ + if (GRPC_TRACE_FLAG_ENABLED(tracer)) VLOG(level) + +#ifndef NDEBUG +typedef TraceFlag DebugOnlyTraceFlag; +#else +class DebugOnlyTraceFlag { + public: + constexpr DebugOnlyTraceFlag(bool /*default_enabled*/, const char* /*name*/) { + } + constexpr bool enabled() const { return false; } + constexpr const char* name() const { return "DebugOnlyTraceFlag"; } + + private: + void set_enabled(bool /*enabled*/) {} +}; +#endif + +class SavedTraceFlags { + public: + SavedTraceFlags(); + void Restore(); + + private: + std::map> values_; +}; + +const absl::flat_hash_map& GetAllTraceFlags(); + +} // namespace grpc_core + +#endif // GRPC_SRC_CORE_LIB_DEBUG_TRACE_IMPL_H diff --git a/src/core/lib/event_engine/ares_resolver.cc b/src/core/lib/event_engine/ares_resolver.cc index 58df73794b9..7fb665d744e 100644 --- a/src/core/lib/event_engine/ares_resolver.cc +++ b/src/core/lib/event_engine/ares_resolver.cc @@ -81,8 +81,6 @@ namespace grpc_event_engine { namespace experimental { -grpc_core::TraceFlag grpc_trace_ares_resolver(false, "cares_resolver"); - namespace { absl::Status AresStatusToAbslStatus(int status, absl::string_view error_msg) { @@ -222,8 +220,7 @@ AresResolver::AresResolver( std::unique_ptr polled_fd_factory, std::shared_ptr event_engine, ares_channel channel) : RefCountedDNSResolverInterface( - GRPC_TRACE_FLAG_ENABLED(grpc_trace_ares_resolver) ? "AresResolver" - : nullptr), + GRPC_TRACE_FLAG_ENABLED(cares_resolver) ? "AresResolver" : nullptr), channel_(channel), polled_fd_factory_(std::move(polled_fd_factory)), event_engine_(std::move(event_engine)) { @@ -768,7 +765,7 @@ void AresResolver::OnTXTDoneLocked(void* arg, int status, int /*timeouts*/, } GRPC_ARES_RESOLVER_TRACE_LOG("resolver:%p Got %zu TXT records", ares_resolver, result.size()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_ares_resolver)) { + if (GRPC_TRACE_FLAG_ENABLED(cares_resolver)) { for (const auto& record : result) { LOG(INFO) << record; } diff --git a/src/core/lib/event_engine/ares_resolver.h b/src/core/lib/event_engine/ares_resolver.h index 5c61bd7bd3d..b0e1f3c06c3 100644 --- a/src/core/lib/event_engine/ares_resolver.h +++ b/src/core/lib/event_engine/ares_resolver.h @@ -46,11 +46,9 @@ namespace grpc_event_engine { namespace experimental { -extern grpc_core::TraceFlag grpc_trace_ares_resolver; - #define GRPC_ARES_RESOLVER_TRACE_LOG(format, ...) \ do { \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_ares_resolver)) { \ + if (GRPC_TRACE_FLAG_ENABLED(cares_resolver)) { \ gpr_log(GPR_INFO, "(EventEngine c-ares resolver) " format, __VA_ARGS__); \ } \ } while (0) diff --git a/src/core/lib/event_engine/cf_engine/cf_engine.cc b/src/core/lib/event_engine/cf_engine/cf_engine.cc index 5b869962dfd..83f4a57aca3 100644 --- a/src/core/lib/event_engine/cf_engine/cf_engine.cc +++ b/src/core/lib/event_engine/cf_engine/cf_engine.cc @@ -63,7 +63,7 @@ CFEventEngine::CFEventEngine() CFEventEngine::~CFEventEngine() { { grpc_core::MutexLock lock(&task_mu_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_event_engine_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(event_engine)) { for (auto handle : known_handles_) { gpr_log(GPR_ERROR, "CFEventEngine:%p uncleared TaskHandle at shutdown:%s", this, diff --git a/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc index fb5f7bfb7ba..3a8ade4ed04 100644 --- a/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc +++ b/src/core/lib/event_engine/cf_engine/dns_service_resolver.cc @@ -35,11 +35,9 @@ namespace experimental { void DNSServiceResolverImpl::LookupHostname( EventEngine::DNSResolver::LookupHostnameCallback on_resolve, absl::string_view name, absl::string_view default_port) { - GRPC_EVENT_ENGINE_DNS_TRACE( - "DNSServiceResolverImpl::LookupHostname: name: %.*s, default_port: %.*s, " - "this: %p", - static_cast(name.length()), name.data(), - static_cast(default_port.length()), default_port.data(), this); + GRPC_TRACE_LOG(event_engine_dns, INFO) + << "DNSServiceResolverImpl::LookupHostname: name: " << name + << ", default_port: " << default_port << ", this: " << this; absl::string_view host; absl::string_view port_string; @@ -139,13 +137,12 @@ void DNSServiceResolverImpl::ResolveCallback( DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char* hostname, const struct sockaddr* address, uint32_t ttl, void* context) { - GRPC_EVENT_ENGINE_DNS_TRACE( - "DNSServiceResolverImpl::ResolveCallback: sdRef: %p, flags: %x, " - "interface: %d, errorCode: %d, hostname: %s, addressFamily: %d, ttl: " - "%d, " - "this: %p", - sdRef, flags, interfaceIndex, errorCode, hostname, address->sa_family, - ttl, context); + GRPC_TRACE_LOG(event_engine_dns, INFO) + << "DNSServiceResolverImpl::ResolveCallback: sdRef: " << sdRef + << ", flags: " << flags << ", interface: " << interfaceIndex + << ", errorCode: " << errorCode << ", hostname: " << hostname + << ", addressFamily: " << address->sa_family << ", ttl: " << ttl + << ", this: " << context; // no need to increase refcount here, since ResolveCallback and Shutdown is // called from the serial queue and it is guarenteed that it won't be called @@ -195,12 +192,11 @@ void DNSServiceResolverImpl::ResolveCallback( ->sin6_port = htons(request.port); } - GRPC_EVENT_ENGINE_DNS_TRACE( - "DNSServiceResolverImpl::ResolveCallback: " - "sdRef: %p, hostname: %s, addressPort: %s, this: %p", - sdRef, hostname, - ResolvedAddressToString(resolved_address).value_or("ERROR").c_str(), - context); + GRPC_TRACE_LOG(event_engine_dns, INFO) + << "DNSServiceResolverImpl::ResolveCallback: sdRef: " << sdRef + << ", hostname: " << hostname << ", addressPort: " + << ResolvedAddressToString(resolved_address).value_or("ERROR") + << ", this: " << context; } // received both ipv4 and ipv6 responses, and no more responses (e.g. multiple @@ -231,10 +227,9 @@ void DNSServiceResolverImpl::Shutdown() { for (auto& kv : that->requests_) { auto& sdRef = kv.first; auto& request = kv.second; - GRPC_EVENT_ENGINE_DNS_TRACE( - "DNSServiceResolverImpl::Shutdown sdRef: %p, this: %p", sdRef, - thatPtr); - + GRPC_TRACE_LOG(event_engine_dns, INFO) + << "DNSServiceResolverImpl::Shutdown sdRef: " << sdRef + << ", this: " << thatPtr; request.on_resolve( absl::CancelledError("DNSServiceResolverImpl::Shutdown")); DNSServiceRefDeallocate(static_cast(sdRef)); diff --git a/src/core/lib/event_engine/forkable.cc b/src/core/lib/event_engine/forkable.cc index d4fcd1e2599..c096ceb7782 100644 --- a/src/core/lib/event_engine/forkable.cc +++ b/src/core/lib/event_engine/forkable.cc @@ -28,12 +28,11 @@ #include #include "src/core/lib/config/config_vars.h" +#include "src/core/lib/debug/trace.h" namespace grpc_event_engine { namespace experimental { -grpc_core::TraceFlag grpc_trace_fork(false, "fork"); - namespace { bool IsForkEnabled() { static bool enabled = grpc_core::ConfigVars::Get().EnableForkSupport(); @@ -58,7 +57,7 @@ void ObjectGroupForkHandler::RegisterForkable( void ObjectGroupForkHandler::Prefork() { if (IsForkEnabled()) { CHECK(!std::exchange(is_forking_, true)); - GRPC_FORK_TRACE_LOG_STRING("PrepareFork"); + GRPC_TRACE_LOG(fork, INFO) << "PrepareFork"; for (auto it = forkables_.begin(); it != forkables_.end();) { auto shared = it->lock(); if (shared) { @@ -74,7 +73,7 @@ void ObjectGroupForkHandler::Prefork() { void ObjectGroupForkHandler::PostforkParent() { if (IsForkEnabled()) { CHECK(is_forking_); - GRPC_FORK_TRACE_LOG_STRING("PostforkParent"); + GRPC_TRACE_LOG(fork, INFO) << "PostforkParent"; for (auto it = forkables_.begin(); it != forkables_.end();) { auto shared = it->lock(); if (shared) { @@ -91,7 +90,7 @@ void ObjectGroupForkHandler::PostforkParent() { void ObjectGroupForkHandler::PostforkChild() { if (IsForkEnabled()) { CHECK(is_forking_); - GRPC_FORK_TRACE_LOG_STRING("PostforkChild"); + GRPC_TRACE_LOG(fork, INFO) << "PostforkChild"; for (auto it = forkables_.begin(); it != forkables_.end();) { auto shared = it->lock(); if (shared) { diff --git a/src/core/lib/event_engine/forkable.h b/src/core/lib/event_engine/forkable.h index 09d07dda28e..cf8edac8e64 100644 --- a/src/core/lib/event_engine/forkable.h +++ b/src/core/lib/event_engine/forkable.h @@ -25,17 +25,6 @@ namespace grpc_event_engine { namespace experimental { -extern grpc_core::TraceFlag grpc_trace_fork; - -#define GRPC_FORK_TRACE_LOG(format, ...) \ - do { \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fork)) { \ - gpr_log(GPR_DEBUG, "[fork] " format, __VA_ARGS__); \ - } \ - } while (0) - -#define GRPC_FORK_TRACE_LOG_STRING(format) GRPC_FORK_TRACE_LOG("%s", format) - // An interface to be implemented by EventEngines that wish to have managed fork // support. The child class must guarantee that those methods are thread-safe. class Forkable { diff --git a/src/core/lib/event_engine/posix_engine/posix_engine.cc b/src/core/lib/event_engine/posix_engine/posix_engine.cc index f5c1bf6c3d2..ac739083239 100644 --- a/src/core/lib/event_engine/posix_engine/posix_engine.cc +++ b/src/core/lib/event_engine/posix_engine/posix_engine.cc @@ -460,7 +460,7 @@ struct PosixEventEngine::ClosureData final : public EventEngine::Closure { PosixEventEngine::~PosixEventEngine() { { grpc_core::MutexLock lock(&mu_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_event_engine_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(event_engine)) { for (auto handle : known_handles_) { gpr_log(GPR_ERROR, "(event_engine) PosixEventEngine:%p uncleared " @@ -559,8 +559,8 @@ PosixEventEngine::GetDNSResolver( // configuration. if (ShouldUseAresDnsResolver()) { #if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) - GRPC_EVENT_ENGINE_DNS_TRACE("PosixEventEngine:%p creating AresResolver", - this); + GRPC_TRACE_LOG(event_engine_dns, INFO) + << "PosixEventEngine::" << this << " creating AresResolver"; auto ares_resolver = AresResolver::CreateAresResolver( options.dns_server, std::make_unique(poller_manager_->Poller()), @@ -572,8 +572,8 @@ PosixEventEngine::GetDNSResolver( std::move(*ares_resolver)); #endif // GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) } - GRPC_EVENT_ENGINE_DNS_TRACE( - "PosixEventEngine:%p creating NativePosixDNSResolver", this); + GRPC_TRACE_LOG(event_engine_dns, INFO) + << "PosixEventEngine::" << this << " creating NativePosixDNSResolver"; return std::make_unique(shared_from_this()); #endif // GRPC_POSIX_SOCKET_RESOLVE_ADDRESS } diff --git a/src/core/lib/event_engine/posix_engine/timer_manager.cc b/src/core/lib/event_engine/posix_engine/timer_manager.cc index 6a48045b0ac..1c9f81f6419 100644 --- a/src/core/lib/event_engine/posix_engine/timer_manager.cc +++ b/src/core/lib/event_engine/posix_engine/timer_manager.cc @@ -36,8 +36,6 @@ static thread_local bool g_timer_thread; namespace grpc_event_engine { namespace experimental { -grpc_core::DebugOnlyTraceFlag grpc_event_engine_timer_trace(false, "timer"); - void TimerManager::RunSomeTimers( std::vector timers) { for (auto* timer : timers) { @@ -101,7 +99,7 @@ grpc_core::Timestamp TimerManager::Host::Now() { void TimerManager::TimerInit(Timer* timer, grpc_core::Timestamp deadline, experimental::EventEngine::Closure* closure) { - if (grpc_event_engine_timer_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(timer)) { grpc_core::MutexLock lock(&mu_); if (shutdown_) { gpr_log(GPR_ERROR, @@ -121,7 +119,7 @@ void TimerManager::Shutdown() { { grpc_core::MutexLock lock(&mu_); if (shutdown_) return; - if (grpc_event_engine_timer_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(timer)) { gpr_log(GPR_DEBUG, "TimerManager::%p shutting down", this); } shutdown_ = true; @@ -129,7 +127,7 @@ void TimerManager::Shutdown() { cv_wait_.Signal(); } main_loop_exit_signal_->WaitForNotification(); - if (grpc_event_engine_timer_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(timer)) { gpr_log(GPR_DEBUG, "TimerManager::%p shutdown complete", this); } } @@ -147,7 +145,7 @@ void TimerManager::Kick() { void TimerManager::RestartPostFork() { grpc_core::MutexLock lock(&mu_); CHECK(GPR_LIKELY(shutdown_)); - if (grpc_event_engine_timer_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(timer)) { gpr_log(GPR_DEBUG, "TimerManager::%p restarting after shutdown", this); } shutdown_ = false; diff --git a/src/core/lib/event_engine/trace.cc b/src/core/lib/event_engine/trace.cc deleted file mode 100644 index 33b2fa7f367..00000000000 --- a/src/core/lib/event_engine/trace.cc +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2022 The gRPC Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#include "src/core/lib/debug/trace.h" - -#include - -grpc_core::TraceFlag grpc_event_engine_trace(false, "event_engine"); -grpc_core::TraceFlag grpc_event_engine_dns_trace(false, "event_engine_dns"); -grpc_core::TraceFlag grpc_event_engine_endpoint_trace(false, - "event_engine_endpoint"); -grpc_core::TraceFlag grpc_event_engine_endpoint_data_trace( - false, "event_engine_endpoint_data"); -grpc_core::TraceFlag grpc_event_engine_poller_trace(false, - "event_engine_poller"); diff --git a/src/core/lib/event_engine/trace.h b/src/core/lib/event_engine/trace.h index a81302281d5..5b91ffb949e 100644 --- a/src/core/lib/event_engine/trace.h +++ b/src/core/lib/event_engine/trace.h @@ -19,30 +19,19 @@ #include "src/core/lib/debug/trace.h" -extern grpc_core::TraceFlag grpc_event_engine_trace; -extern grpc_core::TraceFlag grpc_event_engine_dns_trace; -extern grpc_core::TraceFlag grpc_event_engine_endpoint_data_trace; -extern grpc_core::TraceFlag grpc_event_engine_poller_trace; -extern grpc_core::TraceFlag grpc_event_engine_endpoint_trace; - #define GRPC_EVENT_ENGINE_TRACE(format, ...) \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_event_engine_trace)) { \ + if (GRPC_TRACE_FLAG_ENABLED(event_engine)) { \ gpr_log(GPR_ERROR, "(event_engine) " format, __VA_ARGS__); \ } #define GRPC_EVENT_ENGINE_ENDPOINT_TRACE(format, ...) \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_event_engine_endpoint_trace)) { \ + if (GRPC_TRACE_FLAG_ENABLED(event_engine_endpoint)) { \ gpr_log(GPR_ERROR, "(event_engine endpoint) " format, __VA_ARGS__); \ } #define GRPC_EVENT_ENGINE_POLLER_TRACE(format, ...) \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_event_engine_poller_trace)) { \ + if (GRPC_TRACE_FLAG_ENABLED(event_engine_poller)) { \ gpr_log(GPR_ERROR, "(event_engine poller) " format, __VA_ARGS__); \ } -#define GRPC_EVENT_ENGINE_DNS_TRACE(format, ...) \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_event_engine_dns_trace)) { \ - gpr_log(GPR_ERROR, "(event_engine dns) " format, __VA_ARGS__); \ - } - #endif // GRPC_SRC_CORE_LIB_EVENT_ENGINE_TRACE_H diff --git a/src/core/lib/event_engine/windows/windows_endpoint.cc b/src/core/lib/event_engine/windows/windows_endpoint.cc index 7ade5c95b20..9ace8ddccb5 100644 --- a/src/core/lib/event_engine/windows/windows_endpoint.cc +++ b/src/core/lib/event_engine/windows/windows_endpoint.cc @@ -156,7 +156,7 @@ bool WindowsEndpoint::Write(absl::AnyInvocable on_writable, }); return false; } - if (grpc_event_engine_endpoint_data_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(event_engine_endpoint_data)) { for (size_t i = 0; i < data->Count(); i++) { auto str = data->RefSlice(i).as_string_view(); gpr_log(GPR_INFO, "WindowsEndpoint::%p WRITE (peer=%s): %.*s", this, @@ -293,7 +293,7 @@ void WindowsEndpoint::HandleReadClosure::Run() { } if (result.bytes_transferred == 0) { // Either the endpoint is shut down or we've seen the end of the stream - if (grpc_event_engine_endpoint_data_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(event_engine_endpoint_data)) { DumpSliceBuffer(buffer_, absl::StrFormat("WindowsEndpoint::%p READ", io_state->endpoint)); } diff --git a/src/core/lib/event_engine/windows/windows_engine.cc b/src/core/lib/event_engine/windows/windows_engine.cc index b674606c9b7..7d683d52691 100644 --- a/src/core/lib/event_engine/windows/windows_engine.cc +++ b/src/core/lib/event_engine/windows/windows_engine.cc @@ -218,7 +218,7 @@ WindowsEventEngine::~WindowsEventEngine() { { task_mu_.Lock(); if (!known_handles_.empty()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_event_engine_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(event_engine)) { for (auto handle : known_handles_) { gpr_log(GPR_ERROR, "WindowsEventEngine:%p uncleared TaskHandle at shutdown:%s", @@ -230,7 +230,7 @@ WindowsEventEngine::~WindowsEventEngine() { auto deadline = timer_manager_.Now() + grpc_core::Duration::FromSecondsAsDouble(10); while (!known_handles_.empty() && timer_manager_.Now() < deadline) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_event_engine_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(event_engine)) { GRPC_LOG_EVERY_N_SEC(1, GPR_DEBUG, "Waiting for timers. %d remaining", known_handles_.size()); } @@ -337,8 +337,8 @@ WindowsEventEngine::GetDNSResolver( return std::make_unique( std::move(*ares_resolver)); #else // GRPC_ARES == 1 && defined(GRPC_WINDOWS_SOCKET_ARES_EV_DRIVER) - GRPC_EVENT_ENGINE_DNS_TRACE( - "WindowsEventEngine:%p creating NativeWindowsDNSResolver", this); + GRPC_TRACE_LOG(event_engine_dns, INFO) + << "WindowsEventEngine::" << this << " creating NativeWindowsDNSResolver"; return std::make_unique(shared_from_this()); #endif // GRPC_ARES == 1 && defined(GRPC_WINDOWS_SOCKET_ARES_EV_DRIVER) } diff --git a/src/core/lib/gprpp/glob.cc b/src/core/lib/gprpp/glob.cc new file mode 100644 index 00000000000..1b1c16e23d3 --- /dev/null +++ b/src/core/lib/gprpp/glob.cc @@ -0,0 +1,70 @@ +// Copyright 2024 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "absl/strings/string_view.h" + +namespace grpc_core { + +namespace { +bool IsGlob(absl::string_view trace_glob) { + return std::any_of(trace_glob.begin(), trace_glob.end(), + [](const char c) { return c == '?' || c == '*'; }); +} +} // namespace + +bool GlobMatch(absl::string_view name, absl::string_view pattern) { + if (!IsGlob(pattern)) return name == pattern; + size_t name_idx = 0; + size_t trace_idx = 0; + // pointers for iterative wildcard * matching. + size_t name_next_idx = name_idx; + size_t trace_next_idx = trace_idx; + + while (trace_idx < pattern.length() || name_idx < name.length()) { + if (trace_idx < pattern.length()) { + switch (pattern.at(trace_idx)) { + case '?': + if (name_idx < name.length()) { + ++trace_idx; + ++name_idx; + continue; + } + break; + case '*': + trace_next_idx = trace_idx; + name_next_idx = name_idx + 1; + ++trace_idx; + continue; + default: + if (name_idx < name.length() && + name.at(name_idx) == pattern.at(trace_idx)) { + ++trace_idx; + ++name_idx; + continue; + } + break; + } + } + // Failed to match a character. Restart if possible. + if (name_next_idx > 0 && name_next_idx <= name.length()) { + trace_idx = trace_next_idx; + name_idx = name_next_idx; + continue; + } + return false; + } + return true; +} + +} // namespace grpc_core diff --git a/src/core/resolver/xds/xds_resolver_trace.h b/src/core/lib/gprpp/glob.h similarity index 59% rename from src/core/resolver/xds/xds_resolver_trace.h rename to src/core/lib/gprpp/glob.h index 759b49f1bd2..dafcb9bf729 100644 --- a/src/core/resolver/xds/xds_resolver_trace.h +++ b/src/core/lib/gprpp/glob.h @@ -1,5 +1,4 @@ -// -// Copyright 2019 gRPC authors. +// Copyright 2024 The gRPC Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,19 +11,19 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// - -#ifndef GRPC_SRC_CORE_RESOLVER_XDS_XDS_RESOLVER_TRACE_H -#define GRPC_SRC_CORE_RESOLVER_XDS_XDS_RESOLVER_TRACE_H -#include +#ifndef GRPC_SRC_CORE_LIB_GPRPP_GLOB_H +#define GRPC_SRC_CORE_LIB_GPRPP_GLOB_H -#include "src/core/lib/debug/trace.h" +#include "absl/strings/string_view.h" namespace grpc_core { -extern TraceFlag grpc_xds_resolver_trace; +// A basic glob matcher based on https://research.swtch.com/glob. +// This supports `?` (a single wildcard character), and `*` (multiple wildcard +// characters). +bool GlobMatch(absl::string_view name, absl::string_view pattern); } // namespace grpc_core -#endif // GRPC_SRC_CORE_RESOLVER_XDS_XDS_RESOLVER_TRACE_H +#endif // GRPC_SRC_CORE_LIB_GPRPP_GLOB_H diff --git a/src/core/lib/gprpp/work_serializer.cc b/src/core/lib/gprpp/work_serializer.cc index 653aa8659cf..45de57f9ba8 100644 --- a/src/core/lib/gprpp/work_serializer.cc +++ b/src/core/lib/gprpp/work_serializer.cc @@ -46,8 +46,6 @@ namespace grpc_core { -DebugOnlyTraceFlag grpc_work_serializer_trace(false, "work_serializer"); - // // WorkSerializer::WorkSerializerImpl // @@ -138,7 +136,7 @@ class WorkSerializer::LegacyWorkSerializer final : public WorkSerializerImpl { void WorkSerializer::LegacyWorkSerializer::Run(std::function callback, const DebugLocation& location) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(work_serializer)) { gpr_log(GPR_INFO, "WorkSerializer::Run() %p Scheduling callback [%s:%d]", this, location.file(), location.line()); } @@ -151,9 +149,7 @@ void WorkSerializer::LegacyWorkSerializer::Run(std::function callback, if (GetOwners(prev_ref_pair) == 0) { // We took ownership of the WorkSerializer. Invoke callback and drain queue. SetCurrentThread(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { - LOG(INFO) << " Executing immediately"; - } + GRPC_TRACE_LOG(work_serializer, INFO) << " Executing immediately"; callback(); // Delete the callback while still holding the WorkSerializer, so // that any refs being held by the callback via lambda captures will @@ -161,12 +157,12 @@ void WorkSerializer::LegacyWorkSerializer::Run(std::function callback, callback = nullptr; DrainQueueOwned(); } else { - // Another thread is holding the WorkSerializer, so decrement the ownership - // count we just added and queue the callback. + // Another thread is holding the WorkSerializer, so decrement the + // ownership count we just added and queue the callback. refs_.fetch_sub(MakeRefPair(1, 0), std::memory_order_acq_rel); CallbackWrapper* cb_wrapper = new CallbackWrapper(std::move(callback), location); - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(work_serializer)) { gpr_log(GPR_INFO, " Scheduling on queue : item %p", cb_wrapper); } queue_.Push(&cb_wrapper->mpscq_node); @@ -177,7 +173,7 @@ void WorkSerializer::LegacyWorkSerializer::Schedule( std::function callback, const DebugLocation& location) { CallbackWrapper* cb_wrapper = new CallbackWrapper(std::move(callback), location); - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(work_serializer)) { gpr_log(GPR_INFO, "WorkSerializer::Schedule() %p Scheduling callback %p [%s:%d]", this, cb_wrapper, location.file(), location.line()); @@ -187,15 +183,13 @@ void WorkSerializer::LegacyWorkSerializer::Schedule( } void WorkSerializer::LegacyWorkSerializer::Orphan() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(work_serializer)) { gpr_log(GPR_INFO, "WorkSerializer::Orphan() %p", this); } const uint64_t prev_ref_pair = refs_.fetch_sub(MakeRefPair(0, 1), std::memory_order_acq_rel); if (GetOwners(prev_ref_pair) == 0 && GetSize(prev_ref_pair) == 1) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { - LOG(INFO) << " Destroying"; - } + GRPC_TRACE_LOG(work_serializer, INFO) << " Destroying"; delete this; } } @@ -203,7 +197,7 @@ void WorkSerializer::LegacyWorkSerializer::Orphan() { // The thread that calls this loans itself to the work serializer so as to // execute all the scheduled callbacks. void WorkSerializer::LegacyWorkSerializer::DrainQueue() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(work_serializer)) { gpr_log(GPR_INFO, "WorkSerializer::DrainQueue() %p", this); } // Attempt to take ownership of the WorkSerializer. Also increment the queue @@ -215,8 +209,8 @@ void WorkSerializer::LegacyWorkSerializer::DrainQueue() { // We took ownership of the WorkSerializer. Drain the queue. DrainQueueOwned(); } else { - // Another thread is holding the WorkSerializer, so decrement the ownership - // count we just added and queue a no-op callback. + // Another thread is holding the WorkSerializer, so decrement the + // ownership count we just added and queue a no-op callback. refs_.fetch_sub(MakeRefPair(1, 0), std::memory_order_acq_rel); CallbackWrapper* cb_wrapper = new CallbackWrapper([]() {}, DEBUG_LOCATION); queue_.Push(&cb_wrapper->mpscq_node); @@ -224,7 +218,7 @@ void WorkSerializer::LegacyWorkSerializer::DrainQueue() { } void WorkSerializer::LegacyWorkSerializer::DrainQueueOwned() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(work_serializer)) { gpr_log(GPR_INFO, "WorkSerializer::DrainQueueOwned() %p", this); } while (true) { @@ -232,9 +226,7 @@ void WorkSerializer::LegacyWorkSerializer::DrainQueueOwned() { // It is possible that while draining the queue, the last callback ended // up orphaning the work serializer. In that case, delete the object. if (GetSize(prev_ref_pair) == 1) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { - LOG(INFO) << " Queue Drained. Destroying"; - } + GRPC_TRACE_LOG(work_serializer, INFO) << " Queue Drained. Destroying"; delete this; return; } @@ -252,9 +244,7 @@ void WorkSerializer::LegacyWorkSerializer::DrainQueueOwned() { } if (GetSize(expected) == 0) { // WorkSerializer got orphaned while this was running - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { - LOG(INFO) << " Queue Drained. Destroying"; - } + GRPC_TRACE_LOG(work_serializer, INFO) << " Queue Drained. Destroying"; delete this; return; } @@ -272,11 +262,10 @@ void WorkSerializer::LegacyWorkSerializer::DrainQueueOwned() { queue_.PopAndCheckEnd(&empty_unused))) == nullptr) { // This can happen due to a race condition within the mpscq // implementation or because of a race with Run()/Schedule(). - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { - LOG(INFO) << " Queue returned nullptr, trying again"; - } + GRPC_TRACE_LOG(work_serializer, INFO) + << " Queue returned nullptr, trying again"; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(work_serializer)) { gpr_log(GPR_INFO, " Running item %p : callback scheduled at [%s:%d]", cb_wrapper, cb_wrapper->location.file(), cb_wrapper->location.line()); @@ -292,9 +281,9 @@ void WorkSerializer::LegacyWorkSerializer::DrainQueueOwned() { // DispatchingWorkSerializer: executes callbacks one at a time on EventEngine. // One at a time guarantees that fixed size thread pools in EventEngine -// implementations are not starved of threads by long running work serializers. -// We implement EventEngine::Closure directly to avoid allocating once per -// callback in the queue when scheduling. +// implementations are not starved of threads by long running work +// serializers. We implement EventEngine::Closure directly to avoid allocating +// once per callback in the queue when scheduling. class WorkSerializer::DispatchingWorkSerializer final : public WorkSerializerImpl, public grpc_event_engine::experimental::EventEngine::Closure { @@ -307,7 +296,8 @@ class WorkSerializer::DispatchingWorkSerializer final const DebugLocation& location) override; void Schedule(std::function callback, const DebugLocation& location) override { - // We always dispatch to event engine, so Schedule and Run share semantics. + // We always dispatch to event engine, so Schedule and Run share + // semantics. Run(callback, location); } void DrainQueue() override {} @@ -357,11 +347,11 @@ class WorkSerializer::DispatchingWorkSerializer final // separated from incoming cache lines. // Callbacks that are currently being processed. - // Only accessed by: a Run() call going from not-running to running, or a work - // item being executed in EventEngine -- ie this does not need a mutex because - // all access is serialized. - // Stored in reverse execution order so that callbacks can be `pop_back()`'d - // on completion to free up any resources they hold. + // Only accessed by: a Run() call going from not-running to running, or a + // work item being executed in EventEngine -- ie this does not need a mutex + // because all access is serialized. Stored in reverse execution order so + // that callbacks can be `pop_back()`'d on completion to free up any + // resources they hold. CallbackVector processing_; // EventEngine instance upon which we'll do our work. const std::shared_ptr @@ -375,16 +365,16 @@ class WorkSerializer::DispatchingWorkSerializer final // on an idle WorkSerializer, and transitions back to false after the last // callback scheduled is completed and the WorkSerializer is again idle. // - orphaned_ transitions to true once upon Orphan being called. - // When orphaned_ is true and running_ is false, the DispatchingWorkSerializer - // instance is deleted. + // When orphaned_ is true and running_ is false, the + // DispatchingWorkSerializer instance is deleted. bool running_ ABSL_GUARDED_BY(mu_) = false; bool orphaned_ ABSL_GUARDED_BY(mu_) = false; Mutex mu_; - // Queued callbacks. New work items land here, and when processing_ is drained - // we move this entire queue into processing_ and work on draining it again. - // In low traffic scenarios this gives two mutex acquisitions per work item, - // but as load increases we get some natural batching and the rate of mutex - // acquisitions per work item tends towards 1. + // Queued callbacks. New work items land here, and when processing_ is + // drained we move this entire queue into processing_ and work on draining + // it again. In low traffic scenarios this gives two mutex acquisitions per + // work item, but as load increases we get some natural batching and the + // rate of mutex acquisitions per work item tends towards 1. CallbackVector incoming_ ABSL_GUARDED_BY(mu_); #ifndef NDEBUG @@ -413,15 +403,15 @@ void WorkSerializer::DispatchingWorkSerializer::Orphan() { // Implementation of WorkSerializerImpl::Run void WorkSerializer::DispatchingWorkSerializer::Run( std::function callback, const DebugLocation& location) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(work_serializer)) { gpr_log(GPR_INFO, "WorkSerializer[%p] Scheduling callback [%s:%d]", this, location.file(), location.line()); } global_stats().IncrementWorkSerializerItemsEnqueued(); MutexLock lock(&mu_); if (!running_) { - // If we were previously idle, insert this callback directly into the empty - // processing_ list and start running. + // If we were previously idle, insert this callback directly into the + // empty processing_ list and start running. running_ = true; running_start_time_ = std::chrono::steady_clock::now(); items_processed_during_run_ = 0; @@ -441,10 +431,10 @@ void WorkSerializer::DispatchingWorkSerializer::Run() { // TODO(ctiller): remove these when we can deprecate ExecCtx ApplicationCallbackExecCtx app_exec_ctx; ExecCtx exec_ctx; - // Grab the last element of processing_ - which is the next item in our queue - // since processing_ is stored in reverse order. + // Grab the last element of processing_ - which is the next item in our + // queue since processing_ is stored in reverse order. auto& cb = processing_.back(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(work_serializer)) { gpr_log(GPR_INFO, "WorkSerializer[%p] Executing callback [%s:%d]", this, cb.location.file(), cb.location.line()); } @@ -452,9 +442,9 @@ void WorkSerializer::DispatchingWorkSerializer::Run() { const auto start = std::chrono::steady_clock::now(); SetCurrentThread(); cb.callback(); - // pop_back here destroys the callback - freeing any resources it might hold. - // We do so before clearing the current thread in case the callback destructor - // wants to check that it's in the WorkSerializer too. + // pop_back here destroys the callback - freeing any resources it might + // hold. We do so before clearing the current thread in case the callback + // destructor wants to check that it's in the WorkSerializer too. processing_.pop_back(); ClearCurrentThread(); global_stats().IncrementWorkSerializerItemsDequeued(); @@ -508,8 +498,8 @@ bool WorkSerializer::DispatchingWorkSerializer::Refill() { case RefillResult::kRefilled: // Reverse processing_ so that we can pop_back() items in the correct // order. (note that this is mostly pointer swaps inside the - // std::function's, so should be relatively cheap even for longer lists). - // Do so here so we're outside of the RefillInner lock. + // std::function's, so should be relatively cheap even for longer + // lists). Do so here so we're outside of the RefillInner lock. std::reverse(processing_.begin(), processing_.end()); return true; case RefillResult::kFinished: diff --git a/src/core/lib/iomgr/call_combiner.cc b/src/core/lib/iomgr/call_combiner.cc index fa56bfa3e76..21d9edef063 100644 --- a/src/core/lib/iomgr/call_combiner.cc +++ b/src/core/lib/iomgr/call_combiner.cc @@ -32,8 +32,6 @@ namespace grpc_core { -DebugOnlyTraceFlag grpc_call_combiner_trace(false, "call_combiner"); - namespace { // grpc_error LSB can be used @@ -116,7 +114,7 @@ void CallCombiner::ScheduleClosure(grpc_closure* closure, void CallCombiner::Start(grpc_closure* closure, grpc_error_handle error, DEBUG_ARGS const char* reason) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(call_combiner)) { gpr_log(GPR_INFO, "==> CallCombiner::Start() [%p] closure=%s [" DEBUG_FMT_STR "%s] error=%s", @@ -125,20 +123,16 @@ void CallCombiner::Start(grpc_closure* closure, grpc_error_handle error, } size_t prev_size = static_cast(gpr_atm_full_fetch_add(&size_, (gpr_atm)1)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(call_combiner)) { gpr_log(GPR_INFO, " size: %" PRIdPTR " -> %" PRIdPTR, prev_size, prev_size + 1); } if (prev_size == 0) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { - LOG(INFO) << " EXECUTING IMMEDIATELY"; - } + GRPC_TRACE_LOG(call_combiner, INFO) << " EXECUTING IMMEDIATELY"; // Queue was empty, so execute this closure immediately. ScheduleClosure(closure, error); } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { - LOG(INFO) << " QUEUING"; - } + GRPC_TRACE_LOG(call_combiner, INFO) << " QUEUING"; // Queue was not empty, so add closure to queue. closure->error_data.error = internal::StatusAllocHeapPtr(error); queue_.Push( @@ -147,45 +141,41 @@ void CallCombiner::Start(grpc_closure* closure, grpc_error_handle error, } void CallCombiner::Stop(DEBUG_ARGS const char* reason) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(call_combiner)) { gpr_log(GPR_INFO, "==> CallCombiner::Stop() [%p] [" DEBUG_FMT_STR "%s]", this DEBUG_FMT_ARGS, reason); } size_t prev_size = static_cast(gpr_atm_full_fetch_add(&size_, (gpr_atm)-1)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(call_combiner)) { gpr_log(GPR_INFO, " size: %" PRIdPTR " -> %" PRIdPTR, prev_size, prev_size - 1); } CHECK_GE(prev_size, 1u); if (prev_size > 1) { while (true) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { - LOG(INFO) << " checking queue"; - } + GRPC_TRACE_LOG(call_combiner, INFO) << " checking queue"; bool empty; grpc_closure* closure = reinterpret_cast(queue_.PopAndCheckEnd(&empty)); if (closure == nullptr) { // This can happen either due to a race condition within the mpscq // code or because of a race with Start(). - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { - LOG(INFO) << " queue returned no result; checking again"; - } + GRPC_TRACE_LOG(call_combiner, INFO) + << " queue returned no result; checking again"; continue; } grpc_error_handle error = internal::StatusMoveFromHeapPtr(closure->error_data.error); closure->error_data.error = 0; - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(call_combiner)) { gpr_log(GPR_INFO, " EXECUTING FROM QUEUE: closure=%s error=%s", closure->DebugString().c_str(), StatusToString(error).c_str()); } ScheduleClosure(closure, error); break; } - } else if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { - LOG(INFO) << " queue empty"; + GRPC_TRACE_LOG(call_combiner, INFO) << " queue empty"; } } @@ -197,7 +187,7 @@ void CallCombiner::SetNotifyOnCancel(grpc_closure* closure) { // If error is set, invoke the cancellation closure immediately. // Otherwise, store the new closure. if (!original_error.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(call_combiner)) { gpr_log(GPR_INFO, "call_combiner=%p: scheduling notify_on_cancel callback=%p " "for pre-existing cancellation", @@ -208,7 +198,7 @@ void CallCombiner::SetNotifyOnCancel(grpc_closure* closure) { } else { if (gpr_atm_full_cas(&cancel_state_, original_state, reinterpret_cast(closure))) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(call_combiner)) { gpr_log(GPR_INFO, "call_combiner=%p: setting notify_on_cancel=%p", this, closure); } @@ -217,7 +207,7 @@ void CallCombiner::SetNotifyOnCancel(grpc_closure* closure) { // up any resources they may be holding for the callback. if (original_state != 0) { closure = reinterpret_cast(original_state); - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(call_combiner)) { gpr_log(GPR_INFO, "call_combiner=%p: scheduling old cancel callback=%p", this, closure); @@ -245,7 +235,7 @@ void CallCombiner::Cancel(grpc_error_handle error) { if (original_state != 0) { grpc_closure* notify_on_cancel = reinterpret_cast(original_state); - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(call_combiner)) { gpr_log(GPR_INFO, "call_combiner=%p: scheduling notify_on_cancel callback=%p", this, notify_on_cancel); diff --git a/src/core/lib/iomgr/call_combiner.h b/src/core/lib/iomgr/call_combiner.h index 28ed8388a94..0d969505775 100644 --- a/src/core/lib/iomgr/call_combiner.h +++ b/src/core/lib/iomgr/call_combiner.h @@ -44,8 +44,6 @@ namespace grpc_core { -extern DebugOnlyTraceFlag grpc_call_combiner_trace; - class CallCombiner { public: CallCombiner(); @@ -167,7 +165,7 @@ class CallCombinerClosureList { GRPC_CALL_COMBINER_START(call_combiner, closure.closure, closure.error, closure.reason); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(call_combiner)) { gpr_log(GPR_INFO, "CallCombinerClosureList executing closure while already " "holding call_combiner %p: closure=%s error=%s reason=%s", diff --git a/src/core/lib/iomgr/cfstream_handle.cc b/src/core/lib/iomgr/cfstream_handle.cc index 2978139b606..faee427f2bc 100644 --- a/src/core/lib/iomgr/cfstream_handle.cc +++ b/src/core/lib/iomgr/cfstream_handle.cc @@ -35,8 +35,6 @@ #include "src/core/lib/iomgr/ev_apple.h" #include "src/core/lib/iomgr/exec_ctx.h" -extern grpc_core::TraceFlag grpc_tcp_trace; - GrpcLibraryInitHolder::GrpcLibraryInitHolder() { grpc_init(); } GrpcLibraryInitHolder::~GrpcLibraryInitHolder() { grpc_shutdown(); } @@ -65,7 +63,7 @@ void CFStreamHandle::ReadCallback(CFReadStreamRef stream, grpc_error_handle error; CFErrorRef stream_error; CFStreamHandle* handle = static_cast(client_callback_info); - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_DEBUG, "CFStream ReadCallback (%p, %p, %lu, %p)", handle, stream, type, client_callback_info); } @@ -99,7 +97,7 @@ void CFStreamHandle::WriteCallback(CFWriteStreamRef stream, grpc_error_handle error; CFErrorRef stream_error; CFStreamHandle* handle = static_cast(clientCallBackInfo); - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_DEBUG, "CFStream WriteCallback (%p, %p, %lu, %p)", handle, stream, type, clientCallBackInfo); } @@ -176,7 +174,7 @@ void CFStreamHandle::Shutdown(grpc_error_handle error) { } void CFStreamHandle::Ref(const char* file, int line, const char* reason) { - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_atm val = gpr_atm_no_barrier_load(&refcount_.count); gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "CFStream Handle ref %p : %s %" PRIdPTR " -> %" PRIdPTR, this, @@ -186,7 +184,7 @@ void CFStreamHandle::Ref(const char* file, int line, const char* reason) { } void CFStreamHandle::Unref(const char* file, int line, const char* reason) { - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_atm val = gpr_atm_no_barrier_load(&refcount_.count); gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "CFStream Handle unref %p : %s %" PRIdPTR " -> %" PRIdPTR, this, diff --git a/src/core/lib/iomgr/closure.h b/src/core/lib/iomgr/closure.h index caf84fe30df..efdb25f2fd3 100644 --- a/src/core/lib/iomgr/closure.h +++ b/src/core/lib/iomgr/closure.h @@ -37,8 +37,6 @@ struct grpc_closure; typedef struct grpc_closure grpc_closure; -extern grpc_core::DebugOnlyTraceFlag grpc_trace_closure; - typedef struct grpc_closure_list { grpc_closure* head; grpc_closure* tail; @@ -294,7 +292,7 @@ class Closure { return; } #ifndef NDEBUG - if (grpc_trace_closure.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(closure)) { gpr_log(GPR_DEBUG, "running closure %p: created [%s:%d]: run [%s:%d]", closure, closure->file_created, closure->line_created, location.file(), location.line()); @@ -303,7 +301,7 @@ class Closure { #endif closure->cb(closure->cb_arg, error); #ifndef NDEBUG - if (grpc_trace_closure.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(closure)) { gpr_log(GPR_DEBUG, "closure %p finished", closure); } #endif diff --git a/src/core/lib/iomgr/combiner.cc b/src/core/lib/iomgr/combiner.cc index eb36799e215..348df4a0cb6 100644 --- a/src/core/lib/iomgr/combiner.cc +++ b/src/core/lib/iomgr/combiner.cc @@ -34,13 +34,11 @@ #include "src/core/lib/iomgr/executor.h" #include "src/core/lib/iomgr/iomgr_internal.h" -grpc_core::DebugOnlyTraceFlag grpc_combiner_trace(false, "combiner"); - -#define GRPC_COMBINER_TRACE(fn) \ - do { \ - if (grpc_combiner_trace.enabled()) { \ - fn; \ - } \ +#define GRPC_COMBINER_TRACE(fn) \ + do { \ + if (GRPC_TRACE_FLAG_ENABLED(combiner)) { \ + fn; \ + } \ } while (0) #define STATE_UNORPHANED 1 @@ -81,7 +79,7 @@ static void start_destroy(grpc_core::Combiner* lock) { #ifndef NDEBUG #define GRPC_COMBINER_DEBUG_SPAM(op, delta) \ - if (grpc_combiner_trace.enabled()) { \ + if (GRPC_TRACE_FLAG_ENABLED(combiner)) { \ 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/combiner.h b/src/core/lib/iomgr/combiner.h index 685e46b0d70..af15e83af29 100644 --- a/src/core/lib/iomgr/combiner.h +++ b/src/core/lib/iomgr/combiner.h @@ -88,6 +88,4 @@ void grpc_combiner_unref(grpc_core::Combiner* lock GRPC_COMBINER_DEBUG_ARGS); bool grpc_combiner_continue_exec_ctx(); -extern grpc_core::DebugOnlyTraceFlag grpc_combiner_trace; - #endif // GRPC_SRC_CORE_LIB_IOMGR_COMBINER_H diff --git a/src/core/lib/iomgr/endpoint.cc b/src/core/lib/iomgr/endpoint.cc index fa252004601..cd9125ca5e7 100644 --- a/src/core/lib/iomgr/endpoint.cc +++ b/src/core/lib/iomgr/endpoint.cc @@ -20,8 +20,6 @@ #include -grpc_core::TraceFlag grpc_tcp_trace(false, "tcp"); - void grpc_endpoint_read(grpc_endpoint* ep, grpc_slice_buffer* slices, grpc_closure* cb, bool urgent, int min_progress_size) { ep->vtable->read(ep, slices, cb, urgent, min_progress_size); diff --git a/src/core/lib/iomgr/endpoint_cfstream.cc b/src/core/lib/iomgr/endpoint_cfstream.cc index f3776907158..157cca42795 100644 --- a/src/core/lib/iomgr/endpoint_cfstream.cc +++ b/src/core/lib/iomgr/endpoint_cfstream.cc @@ -42,8 +42,6 @@ #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/util/string.h" -extern grpc_core::TraceFlag grpc_tcp_trace; - struct CFStreamEndpoint { grpc_endpoint base; gpr_refcount refcount; @@ -75,7 +73,7 @@ static void CFStreamFree(CFStreamEndpoint* ep) { #define EP_UNREF(ep, reason) CFStreamUnref((ep), (reason), __FILE__, __LINE__) static void CFStreamUnref(CFStreamEndpoint* ep, const char* reason, const char* file, int line) { - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_atm val = gpr_atm_no_barrier_load(&ep->refcount.count); gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "CFStream endpoint unref %p : %s %" PRIdPTR " -> %" PRIdPTR, ep, @@ -87,7 +85,7 @@ static void CFStreamUnref(CFStreamEndpoint* ep, const char* reason, } static void CFStreamRef(CFStreamEndpoint* ep, const char* reason, const char* file, int line) { - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_atm val = gpr_atm_no_barrier_load(&ep->refcount.count); gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "CFStream endpoint ref %p : %s %" PRIdPTR " -> %" PRIdPTR, ep, @@ -112,8 +110,7 @@ static grpc_error_handle CFStreamAnnotateError(grpc_error_handle src_error) { } static void CallReadCb(CFStreamEndpoint* ep, grpc_error_handle error) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace) && - gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp) && gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { gpr_log(GPR_DEBUG, "CFStream endpoint:%p call_read_cb %p %p:%p", ep, ep->read_cb, ep->read_cb->cb, ep->read_cb->cb_arg); size_t i; @@ -135,7 +132,7 @@ static void CallReadCb(CFStreamEndpoint* ep, grpc_error_handle error) { } static void CallWriteCb(CFStreamEndpoint* ep, grpc_error_handle error) { - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_DEBUG, "CFStream endpoint:%p call_write_cb %p %p:%p", ep, ep->write_cb, ep->write_cb->cb, ep->write_cb->cb_arg); gpr_log(GPR_DEBUG, "write: error=%s", @@ -224,7 +221,7 @@ static void WriteAction(void* arg, grpc_error_handle error) { EP_UNREF(ep, "write"); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace) && + if (GRPC_TRACE_FLAG_ENABLED(tcp) && gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { grpc_slice trace_slice = grpc_slice_sub(slice, 0, write_size); char* dump = grpc_dump_slice(trace_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII); @@ -241,7 +238,7 @@ static void CFStreamRead(grpc_endpoint* ep, grpc_slice_buffer* slices, grpc_closure* cb, bool /*urgent*/, int /*min_progress_size*/) { CFStreamEndpoint* ep_impl = reinterpret_cast(ep); - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_DEBUG, "CFStream endpoint:%p read (%p, %p) length:%zu", ep_impl, slices, cb, slices->length); } @@ -259,7 +256,7 @@ static void CFStreamWrite(grpc_endpoint* ep, grpc_slice_buffer* slices, grpc_closure* cb, void* /*arg*/, int /*max_frame_size*/) { CFStreamEndpoint* ep_impl = reinterpret_cast(ep); - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_DEBUG, "CFStream endpoint:%p write (%p, %p) length:%zu", ep_impl, slices, cb, slices->length); } @@ -272,15 +269,11 @@ static void CFStreamWrite(grpc_endpoint* ep, grpc_slice_buffer* slices, void CFStreamDestroy(grpc_endpoint* ep) { CFStreamEndpoint* ep_impl = reinterpret_cast(ep); - if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "CFStream endpoint:%p destroy", ep_impl); - } + GRPC_TRACE_VLOG(tcp, 2) << "CFStream endpoint:" << ep_impl << " destroy"; CFReadStreamClose(ep_impl->read_stream); CFWriteStreamClose(ep_impl->write_stream); ep_impl->stream_sync->Shutdown(absl::UnavailableError("endpoint shutdown")); - if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "CFStream endpoint:%p destroy DONE", ep_impl); - } + GRPC_TRACE_VLOG(tcp, 2) << "CFStream endpoint:" << ep_impl << " destroy DONE"; EP_UNREF(ep_impl, "destroy"); } @@ -320,7 +313,7 @@ grpc_endpoint* grpc_cfstream_endpoint_create(CFReadStreamRef read_stream, const char* peer_string, CFStreamHandle* stream_sync) { CFStreamEndpoint* ep_impl = new CFStreamEndpoint; - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_DEBUG, "CFStream endpoint:%p create readStream:%p writeStream: %p", ep_impl, read_stream, write_stream); diff --git a/src/core/lib/iomgr/error.cc b/src/core/lib/iomgr/error.cc index b0d72a503fe..d646b9a8a5f 100644 --- a/src/core/lib/iomgr/error.cc +++ b/src/core/lib/iomgr/error.cc @@ -41,10 +41,6 @@ #include "src/core/lib/slice/slice_internal.h" #include "src/core/util/useful.h" -grpc_core::DebugOnlyTraceFlag grpc_trace_error_refcount(false, - "error_refcount"); -grpc_core::DebugOnlyTraceFlag grpc_trace_closure(false, "closure"); - absl::Status grpc_status_create(absl::StatusCode code, absl::string_view msg, const grpc_core::DebugLocation& location, size_t children_count, absl::Status* children) { diff --git a/src/core/lib/iomgr/ev_apple.cc b/src/core/lib/iomgr/ev_apple.cc index ba6c21d670c..f0b205314e6 100644 --- a/src/core/lib/iomgr/ev_apple.cc +++ b/src/core/lib/iomgr/ev_apple.cc @@ -39,12 +39,10 @@ #include "src/core/lib/gprpp/time_util.h" #include "src/core/lib/iomgr/ev_apple.h" -grpc_core::DebugOnlyTraceFlag grpc_apple_polling_trace(false, "apple_polling"); - #ifndef NDEBUG -#define GRPC_POLLING_TRACE(format, ...) \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_apple_polling_trace)) { \ - gpr_log(GPR_DEBUG, "(polling) " format, __VA_ARGS__); \ +#define GRPC_POLLING_TRACE(format, ...) \ + if (GRPC_TRACE_FLAG_ENABLED(apple_polling)) { \ + gpr_log(GPR_DEBUG, "(polling) " format, __VA_ARGS__); \ } #else #define GRPC_POLLING_TRACE(...) diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc index f0021d0ed7e..bf266705d92 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.cc +++ b/src/core/lib/iomgr/ev_epoll1_linux.cc @@ -362,7 +362,7 @@ static grpc_fd* fd_create(int fd, const char* name, bool track_err) { grpc_iomgr_register_object(&new_fd->iomgr_object, fd_name.c_str()); fork_fd_list_add_grpc_fd(new_fd); #ifndef NDEBUG - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fd_refcount)) { + if (GRPC_TRACE_FLAG_ENABLED(fd_refcount)) { gpr_log(GPR_DEBUG, "FD %d %p create %s", fd, new_fd, fd_name.c_str()); } #endif @@ -731,7 +731,7 @@ static grpc_error_handle do_epoll_wait(grpc_pollset* ps, if (r < 0) return GRPC_OS_ERROR(errno, "epoll_wait"); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, "ps: %p poll got %d events", ps, r); } @@ -750,7 +750,7 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, worker->schedule_on_end_work = (grpc_closure_list)GRPC_CLOSURE_LIST_INIT; pollset->begin_refs++; - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, "PS:%p BEGIN_STARTS:%p", pollset, worker); } @@ -769,7 +769,7 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, retry_lock_neighborhood: gpr_mu_lock(&neighborhood->mu); gpr_mu_lock(&pollset->mu); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, "PS:%p BEGIN_REORG:%p kick_state=%s is_reassigning=%d", pollset, worker, kick_state_string(worker->state), is_reassigning); @@ -822,7 +822,7 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, worker->initialized_cv = true; gpr_cv_init(&worker->cv); while (worker->state == UNKICKED && !pollset->shutting_down) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, "PS:%p BEGIN_WAIT:%p kick_state=%s shutdown=%d", pollset, worker, kick_state_string(worker->state), pollset->shutting_down); @@ -839,7 +839,7 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, grpc_core::ExecCtx::Get()->InvalidateNow(); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, "PS:%p BEGIN_DONE:%p kick_state=%s shutdown=%d " "kicked_without_poller: %d", @@ -882,7 +882,7 @@ static bool check_neighborhood_for_available_poller( if (gpr_atm_no_barrier_cas( &g_active_poller, 0, reinterpret_cast(inspect_worker))) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, " .. choose next poller to be %p", inspect_worker); } @@ -891,7 +891,7 @@ static bool check_neighborhood_for_available_poller( gpr_cv_signal(&inspect_worker->cv); } } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { LOG(INFO) << " .. beaten to choose next poller"; } } @@ -909,7 +909,7 @@ static bool check_neighborhood_for_available_poller( } while (!found_worker && inspect_worker != inspect->root_worker); } if (!found_worker) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, " .. mark pollset %p inactive", inspect); } inspect->seen_inactive = true; @@ -928,7 +928,7 @@ static bool check_neighborhood_for_available_poller( static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, grpc_pollset_worker** worker_hdl) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, "PS:%p END_WORKER:%p", pollset, worker); } if (worker_hdl != nullptr) *worker_hdl = nullptr; @@ -939,7 +939,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, if (gpr_atm_no_barrier_load(&g_active_poller) == reinterpret_cast(worker)) { if (worker->next != worker && worker->next->state == UNKICKED) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, " .. choose next poller to be peer %p", worker); } CHECK(worker->next->initialized_cv); @@ -990,7 +990,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, if (worker->initialized_cv) { gpr_cv_destroy(&worker->cv); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { LOG(INFO) << " .. remove worker"; } if (EMPTIED == worker_remove(pollset, worker)) { @@ -1056,7 +1056,7 @@ static grpc_error_handle pollset_work(grpc_pollset* ps, static grpc_error_handle pollset_kick(grpc_pollset* pollset, grpc_pollset_worker* specific_worker) { grpc_error_handle ret_err; - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { std::vector log; log.push_back(absl::StrFormat( "PS:%p KICK:%p curps=%p curworker=%p root=%p", pollset, specific_worker, @@ -1081,20 +1081,20 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset, grpc_pollset_worker* root_worker = pollset->root_worker; if (root_worker == nullptr) { pollset->kicked_without_poller = true; - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { LOG(INFO) << " .. kicked_without_poller"; } goto done; } grpc_pollset_worker* next_worker = root_worker->next; if (root_worker->state == KICKED) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, " .. already kicked %p", root_worker); } SET_KICK_STATE(root_worker, KICKED); goto done; } else if (next_worker->state == KICKED) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, " .. already kicked %p", next_worker); } SET_KICK_STATE(next_worker, KICKED); @@ -1104,14 +1104,14 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset, root_worker == reinterpret_cast( gpr_atm_no_barrier_load(&g_active_poller))) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, " .. kicked %p", root_worker); } SET_KICK_STATE(root_worker, KICKED); ret_err = grpc_wakeup_fd_wakeup(&global_wakeup_fd); goto done; } else if (next_worker->state == UNKICKED) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, " .. kicked %p", next_worker); } CHECK(next_worker->initialized_cv); @@ -1120,7 +1120,7 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset, goto done; } else if (next_worker->state == DESIGNATED_POLLER) { if (root_worker->state != DESIGNATED_POLLER) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log( GPR_INFO, " .. kicked root non-poller %p (initialized_cv=%d) (poller=%p)", @@ -1132,7 +1132,7 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset, } goto done; } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, " .. non-root poller %p (root=%p)", next_worker, root_worker); } @@ -1146,7 +1146,7 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset, goto done; } } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { LOG(INFO) << " .. kicked while waking up"; } goto done; @@ -1156,12 +1156,12 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset, } if (specific_worker->state == KICKED) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { LOG(INFO) << " .. specific worker already kicked"; } goto done; } else if (g_current_thread_worker == specific_worker) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, " .. mark %p kicked", specific_worker); } SET_KICK_STATE(specific_worker, KICKED); @@ -1169,21 +1169,21 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset, } else if (specific_worker == reinterpret_cast( gpr_atm_no_barrier_load(&g_active_poller))) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { LOG(INFO) << " .. kick active poller"; } SET_KICK_STATE(specific_worker, KICKED); ret_err = grpc_wakeup_fd_wakeup(&global_wakeup_fd); goto done; } else if (specific_worker->initialized_cv) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { LOG(INFO) << " .. kick waiting worker"; } SET_KICK_STATE(specific_worker, KICKED); gpr_cv_signal(&specific_worker->cv); goto done; } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { LOG(INFO) << " .. kick non-waiting worker"; } SET_KICK_STATE(specific_worker, KICKED); diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc index 02c3bb77c4b..049787596df 100644 --- a/src/core/lib/iomgr/ev_poll_posix.cc +++ b/src/core/lib/iomgr/ev_poll_posix.cc @@ -333,7 +333,7 @@ static void fork_fd_list_add_wakeup_fd(grpc_cached_wakeup_fd* fd) { #define UNREF_BY(fd, n, reason) unref_by(fd, n, reason, __FILE__, __LINE__) static void ref_by(grpc_fd* fd, int n, const char* reason, const char* file, int line) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fd_refcount)) { + if (GRPC_TRACE_FLAG_ENABLED(fd_refcount)) { gpr_log(GPR_DEBUG, "FD %d %p ref %d %" PRIdPTR " -> %" PRIdPTR " [%s; %s:%d]", fd->fd, fd, n, gpr_atm_no_barrier_load(&fd->refst), @@ -358,7 +358,7 @@ static void ref_by(grpc_fd* fd, int n) { #ifndef NDEBUG static void unref_by(grpc_fd* fd, int n, const char* reason, const char* file, int line) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_fd_refcount)) { + if (GRPC_TRACE_FLAG_ENABLED(fd_refcount)) { gpr_log(GPR_DEBUG, "FD %d %p unref %d %" PRIdPTR " -> %" PRIdPTR " [%s; %s:%d]", fd->fd, fd, n, gpr_atm_no_barrier_load(&fd->refst), @@ -593,9 +593,8 @@ static void fd_notify_on_write(grpc_fd* fd, grpc_closure* closure) { } static void fd_notify_on_error(grpc_fd* /*fd*/, grpc_closure* closure) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - LOG(ERROR) << "Polling engine does not support tracking errors."; - } + GRPC_TRACE_LOG(polling, ERROR) + << "Polling engine does not support tracking errors."; grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, absl::CancelledError()); } @@ -612,9 +611,8 @@ static void fd_set_writable(grpc_fd* fd) { } static void fd_set_error(grpc_fd* /*fd*/) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { - LOG(ERROR) << "Polling engine does not support tracking errors."; - } + GRPC_TRACE_LOG(polling, ERROR) + << "Polling engine does not support tracking errors."; } static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset, @@ -1031,7 +1029,7 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, r = grpc_poll_function(pfds, pfd_count, timeout); GRPC_SCHEDULING_END_BLOCKING_REGION; - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, "%p poll=%d", pollset, r); } @@ -1055,7 +1053,7 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, } } else { if (pfds[0].revents & POLLIN_CHECK) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, "%p: got_wakeup", pollset); } work_combine_error( @@ -1069,7 +1067,7 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, } fd_end_poll(&watchers[i], 0, 0); } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_INFO, "%p got_event: %d r:%d w:%d [%d]", pollset, pfds[i].fd, (pfds[i].revents & POLLIN_CHECK) != 0, (pfds[i].revents & POLLOUT_CHECK) != 0, pfds[i].revents); diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc index 77176ffdf7e..e60dd685241 100644 --- a/src/core/lib/iomgr/ev_posix.cc +++ b/src/core/lib/iomgr/ev_posix.cc @@ -42,18 +42,12 @@ #include "src/core/lib/iomgr/internal_errqueue.h" #include "src/core/util/useful.h" -grpc_core::DebugOnlyTraceFlag grpc_polling_trace( - false, "polling"); // Disabled by default - // Traces fd create/close operations -grpc_core::DebugOnlyTraceFlag grpc_fd_trace(false, "fd_trace"); -grpc_core::DebugOnlyTraceFlag grpc_trace_fd_refcount(false, "fd_refcount"); -grpc_core::DebugOnlyTraceFlag grpc_polling_api_trace(false, "polling_api"); // Polling API trace only enabled in debug builds #ifndef NDEBUG #define GRPC_POLLING_API_TRACE(format, ...) \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_api_trace)) { \ + if (GRPC_TRACE_FLAG_ENABLED(polling_api)) { \ gpr_log(GPR_INFO, "(polling-api) " format, __VA_ARGS__); \ } #else diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h index 502e6a94690..bbacc4813ac 100644 --- a/src/core/lib/iomgr/ev_posix.h +++ b/src/core/lib/iomgr/ev_posix.h @@ -33,11 +33,8 @@ #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/iomgr/wakeup_fd_posix.h" -extern grpc_core::DebugOnlyTraceFlag grpc_fd_trace; // Disabled by default -extern grpc_core::DebugOnlyTraceFlag grpc_polling_trace; // Disabled by default - #define GRPC_FD_TRACE(format, ...) \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_fd_trace)) { \ + if (GRPC_TRACE_FLAG_ENABLED(fd_trace)) { \ gpr_log(GPR_INFO, "(fd-trace) " format, __VA_ARGS__); \ } diff --git a/src/core/lib/iomgr/ev_windows.cc b/src/core/lib/iomgr/ev_windows.cc deleted file mode 100644 index 8dcd3c1f957..00000000000 --- a/src/core/lib/iomgr/ev_windows.cc +++ /dev/null @@ -1,30 +0,0 @@ -// -// -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// - -#include - -#include "src/core/lib/iomgr/port.h" - -#ifdef GRPC_WINSOCK_SOCKET - -#include "src/core/lib/debug/trace.h" - -grpc_core::DebugOnlyTraceFlag grpc_polling_trace( - false, "polling"); // Disabled by default - -#endif // GRPC_WINSOCK_SOCKET diff --git a/src/core/lib/iomgr/event_engine_shims/closure.cc b/src/core/lib/iomgr/event_engine_shims/closure.cc index 280f7124e7b..4e67097b462 100644 --- a/src/core/lib/iomgr/event_engine_shims/closure.cc +++ b/src/core/lib/iomgr/event_engine_shims/closure.cc @@ -34,7 +34,7 @@ void RunEventEngineClosure(grpc_closure* closure, grpc_error_handle error) { grpc_core::ExecCtx exec_ctx; #ifndef NDEBUG closure->scheduled = false; - if (grpc_trace_closure.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(closure)) { gpr_log(GPR_DEBUG, "EventEngine: running closure %p: created [%s:%d]: %s [%s:%d]", closure, closure->file_created, closure->line_created, @@ -44,7 +44,7 @@ void RunEventEngineClosure(grpc_closure* closure, grpc_error_handle error) { #endif closure->cb(closure->cb_arg, error); #ifndef NDEBUG - if (grpc_trace_closure.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(closure)) { gpr_log(GPR_DEBUG, "EventEngine: closure %p finished", closure); } #endif diff --git a/src/core/lib/iomgr/event_engine_shims/endpoint.cc b/src/core/lib/iomgr/event_engine_shims/endpoint.cc index cb0051a7508..a33d712f2b9 100644 --- a/src/core/lib/iomgr/event_engine_shims/endpoint.cc +++ b/src/core/lib/iomgr/event_engine_shims/endpoint.cc @@ -51,8 +51,6 @@ #include "src/core/lib/transport/error_utils.h" #include "src/core/util/string.h" -extern grpc_core::TraceFlag grpc_tcp_trace; - namespace grpc_event_engine { namespace experimental { namespace { @@ -121,7 +119,7 @@ class EventEngineEndpointWrapper { grpc_slice_buffer_move_into(read_buffer->c_slice_buffer(), pending_read_buffer_); read_buffer->~SliceBuffer(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { size_t i; gpr_log(GPR_INFO, "TCP: %p READ error=%s", eeep_->wrapper, status.ToString().c_str()); @@ -152,7 +150,7 @@ class EventEngineEndpointWrapper { bool Write(grpc_closure* write_cb, grpc_slice_buffer* slices, const EventEngine::Endpoint::WriteArgs* args) { Ref(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { size_t i; gpr_log(GPR_INFO, "TCP: %p WRITE (peer=%s)", this, std::string(PeerAddress()).c_str()); @@ -179,7 +177,7 @@ class EventEngineEndpointWrapper { void FinishPendingWrite(absl::Status status) { auto* write_buffer = reinterpret_cast(&eeep_->write_buffer); write_buffer->~SliceBuffer(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "TCP: %p WRITE (peer=%s) error=%s", this, std::string(PeerAddress()).c_str(), status.ToString().c_str()); } diff --git a/src/core/lib/iomgr/exec_ctx.cc b/src/core/lib/iomgr/exec_ctx.cc index 66653a0c15c..aa7350b4540 100644 --- a/src/core/lib/iomgr/exec_ctx.cc +++ b/src/core/lib/iomgr/exec_ctx.cc @@ -32,7 +32,7 @@ static void exec_ctx_run(grpc_closure* closure) { #ifndef NDEBUG closure->scheduled = false; - if (grpc_trace_closure.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(closure)) { gpr_log(GPR_DEBUG, "running closure %p: created [%s:%d]: %s [%s:%d]", closure, closure->file_created, closure->line_created, closure->run ? "run" : "scheduled", closure->file_initiated, @@ -44,7 +44,7 @@ static void exec_ctx_run(grpc_closure* closure) { closure->error_data.error = 0; closure->cb(closure->cb_arg, std::move(error)); #ifndef NDEBUG - if (grpc_trace_closure.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(closure)) { gpr_log(GPR_DEBUG, "closure %p finished", closure); } #endif diff --git a/src/core/lib/iomgr/executor.cc b/src/core/lib/iomgr/executor.cc index 827bfc10c9d..ef6d01b1d6c 100644 --- a/src/core/lib/iomgr/executor.cc +++ b/src/core/lib/iomgr/executor.cc @@ -38,18 +38,11 @@ #define EXECUTOR_TRACE(format, ...) \ do { \ - if (GRPC_TRACE_FLAG_ENABLED(executor_trace)) { \ + if (GRPC_TRACE_FLAG_ENABLED(executor)) { \ gpr_log(GPR_INFO, "EXECUTOR " format, __VA_ARGS__); \ } \ } while (0) -#define EXECUTOR_TRACE0(str) \ - do { \ - if (GRPC_TRACE_FLAG_ENABLED(executor_trace)) { \ - gpr_log(GPR_INFO, "EXECUTOR " str); \ - } \ - } while (0) - namespace grpc_core { namespace { @@ -87,8 +80,6 @@ const EnqueueFunc } // namespace -TraceFlag executor_trace(false, "executor"); - Executor::Executor(const char* name) : name_(name) { adding_thread_lock_ = GPR_SPINLOCK_STATIC_INITIALIZER; gpr_atm_rel_store(&num_threads_, 0); @@ -368,7 +359,7 @@ void Executor::Enqueue(grpc_closure* closure, grpc_error_handle error, // the grpc_init() and grpc_shutdown() code paths which are protected by a // global mutex. So it is okay to assume that these functions are thread-safe void Executor::InitAll() { - EXECUTOR_TRACE0("Executor::InitAll() enter"); + GRPC_TRACE_LOG(executor, INFO) << "Executor::InitAll() enter"; // Return if Executor::InitAll() is already called earlier if (executors[static_cast(ExecutorType::DEFAULT)] != nullptr) { @@ -384,7 +375,7 @@ void Executor::InitAll() { executors[static_cast(ExecutorType::DEFAULT)]->Init(); executors[static_cast(ExecutorType::RESOLVER)]->Init(); - EXECUTOR_TRACE0("Executor::InitAll() done"); + GRPC_TRACE_LOG(executor, INFO) << "Executor::InitAll() done"; } void Executor::Run(grpc_closure* closure, grpc_error_handle error, @@ -394,7 +385,7 @@ void Executor::Run(grpc_closure* closure, grpc_error_handle error, } void Executor::ShutdownAll() { - EXECUTOR_TRACE0("Executor::ShutdownAll() enter"); + GRPC_TRACE_LOG(executor, INFO) << "Executor::ShutdownAll() enter"; // Return if Executor:SshutdownAll() is already called earlier if (executors[static_cast(ExecutorType::DEFAULT)] == nullptr) { @@ -422,7 +413,7 @@ void Executor::ShutdownAll() { executors[static_cast(ExecutorType::DEFAULT)] = nullptr; executors[static_cast(ExecutorType::RESOLVER)] = nullptr; - EXECUTOR_TRACE0("Executor::ShutdownAll() done"); + GRPC_TRACE_LOG(executor, INFO) << "Executor::ShutdownAll() done"; } bool Executor::IsThreaded(ExecutorType executor_type) { diff --git a/src/core/lib/iomgr/lockfree_event.cc b/src/core/lib/iomgr/lockfree_event.cc index 114625e5e79..7b20767870f 100644 --- a/src/core/lib/iomgr/lockfree_event.cc +++ b/src/core/lib/iomgr/lockfree_event.cc @@ -27,8 +27,6 @@ #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/exec_ctx.h" -extern grpc_core::DebugOnlyTraceFlag grpc_polling_trace; - // 'state' holds the to call when the fd is readable or writable respectively. // It can contain one of the following values: // kClosureReady : The fd has an I/O event of interest but there is no @@ -97,7 +95,7 @@ void LockfreeEvent::NotifyOn(grpc_closure* closure) { // sure that the shutdown error has been initialized properly before us // referencing it. gpr_atm curr = gpr_atm_acq_load(&state_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_DEBUG, "LockfreeEvent::NotifyOn: %p curr=%" PRIxPTR " closure=%p", this, curr, closure); @@ -166,7 +164,7 @@ bool LockfreeEvent::SetShutdown(grpc_error_handle shutdown_error) { while (true) { gpr_atm curr = gpr_atm_no_barrier_load(&state_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_DEBUG, "LockfreeEvent::SetShutdown: %p curr=%" PRIxPTR " err=%s", &state_, curr, StatusToString(shutdown_error).c_str()); @@ -216,7 +214,7 @@ void LockfreeEvent::SetReady() { while (true) { gpr_atm curr = gpr_atm_no_barrier_load(&state_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(polling)) { gpr_log(GPR_DEBUG, "LockfreeEvent::SetReady: %p curr=%" PRIxPTR, &state_, curr); } diff --git a/src/core/lib/iomgr/pollset.h b/src/core/lib/iomgr/pollset.h index 07966b08e04..d5097bb88fd 100644 --- a/src/core/lib/iomgr/pollset.h +++ b/src/core/lib/iomgr/pollset.h @@ -26,8 +26,6 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/iomgr_fwd.h" -extern grpc_core::DebugOnlyTraceFlag grpc_trace_fd_refcount; - // A grpc_pollset is a set of file descriptors that a higher level item is // interested in. For example: // - a server will typically keep a pollset containing all connected channels, diff --git a/src/core/lib/iomgr/pollset_windows.cc b/src/core/lib/iomgr/pollset_windows.cc index ab50af4bb4c..c42d83da495 100644 --- a/src/core/lib/iomgr/pollset_windows.cc +++ b/src/core/lib/iomgr/pollset_windows.cc @@ -33,8 +33,6 @@ #define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker*)1) -grpc_core::DebugOnlyTraceFlag grpc_trace_fd_refcount(false, "fd_refcount"); - gpr_mu grpc_polling_mu; static grpc_pollset_worker* g_active_poller; static grpc_pollset_worker g_global_root_worker; diff --git a/src/core/lib/iomgr/socket_utils_common_posix.cc b/src/core/lib/iomgr/socket_utils_common_posix.cc index e2d1ffa249f..017fc316f5a 100644 --- a/src/core/lib/iomgr/socket_utils_common_posix.cc +++ b/src/core/lib/iomgr/socket_utils_common_posix.cc @@ -349,7 +349,6 @@ grpc_error_handle grpc_set_socket_tcp_user_timeout( // Use conditionally-important parameter to avoid warning (void)fd; (void)is_client; - extern grpc_core::TraceFlag grpc_tcp_trace; if (g_socket_supports_tcp_user_timeout.load() >= 0) { bool enable; int timeout; @@ -387,7 +386,7 @@ grpc_error_handle grpc_set_socket_tcp_user_timeout( } } if (g_socket_supports_tcp_user_timeout.load() > 0) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "Enabling TCP_USER_TIMEOUT with a timeout of %d ms", timeout); } @@ -412,9 +411,8 @@ grpc_error_handle grpc_set_socket_tcp_user_timeout( } } } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { - LOG(INFO) << "TCP_USER_TIMEOUT not supported for this platform"; - } + GRPC_TRACE_LOG(tcp, INFO) + << "TCP_USER_TIMEOUT not supported for this platform"; } return absl::OkStatus(); } diff --git a/src/core/lib/iomgr/tcp_client_cfstream.cc b/src/core/lib/iomgr/tcp_client_cfstream.cc index 09e7c5d799a..f350703e4c9 100644 --- a/src/core/lib/iomgr/tcp_client_cfstream.cc +++ b/src/core/lib/iomgr/tcp_client_cfstream.cc @@ -45,8 +45,6 @@ #include "src/core/lib/iomgr/tcp_client.h" #include "src/core/lib/iomgr/timer.h" -extern grpc_core::TraceFlag grpc_tcp_trace; - struct CFStreamConnect { gpr_mu mu; gpr_refcount refcount; @@ -79,7 +77,7 @@ static void CFStreamConnectCleanup(CFStreamConnect* connect) { static void OnAlarm(void* arg, grpc_error_handle error) { CFStreamConnect* connect = static_cast(arg); - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnAlarm, error:%s", connect, grpc_core::StatusToString(error).c_str()); } @@ -100,7 +98,7 @@ static void OnAlarm(void* arg, grpc_error_handle error) { static void OnOpen(void* arg, grpc_error_handle error) { CFStreamConnect* connect = static_cast(arg); - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnOpen, error:%s", connect, grpc_core::StatusToString(error).c_str()); } @@ -174,7 +172,7 @@ static int64_t CFStreamClientConnect( gpr_ref_init(&connect->refcount, 1); gpr_mu_init(&connect->mu); - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_DEBUG, "CLIENT_CONNECT: %p, %s: asynchronously connecting", connect, connect->addr_name.c_str()); } diff --git a/src/core/lib/iomgr/tcp_client_posix.cc b/src/core/lib/iomgr/tcp_client_posix.cc index 32f7d56e229..eed6762c443 100644 --- a/src/core/lib/iomgr/tcp_client_posix.cc +++ b/src/core/lib/iomgr/tcp_client_posix.cc @@ -56,8 +56,6 @@ #include "src/core/lib/slice/slice_internal.h" #include "src/core/util/string.h" -extern grpc_core::TraceFlag grpc_tcp_trace; - using ::grpc_event_engine::experimental::EndpointConfig; struct async_connect { @@ -144,7 +142,7 @@ done: static void tc_on_alarm(void* acp, grpc_error_handle error) { int done; async_connect* ac = static_cast(acp); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_alarm: error=%s", ac->addr_str.c_str(), grpc_core::StatusToString(error).c_str()); } @@ -183,7 +181,7 @@ static void on_writable(void* acp, grpc_error_handle error) { std::string addr_str = ac->addr_str; grpc_fd* fd; - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_writable: error=%s", ac->addr_str.c_str(), grpc_core::StatusToString(error).c_str()); } @@ -384,7 +382,7 @@ int64_t grpc_tcp_client_create_from_prepared_fd( grpc_schedule_on_exec_ctx); ac->options = options; - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: asynchronously connecting fd %p", ac->addr_str.c_str(), fdobj); } diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index a31d8f54429..9ceeacfece5 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -71,7 +71,6 @@ #include "src/core/lib/iomgr/tcp_posix.h" #include "src/core/lib/resource_quota/api.h" #include "src/core/lib/resource_quota/memory_quota.h" -#include "src/core/lib/resource_quota/trace.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/telemetry/stats.h" @@ -109,8 +108,6 @@ typedef GRPC_MSG_IOVLEN_TYPE msg_iovlen_type; typedef size_t msg_iovlen_type; #endif -extern grpc_core::TraceFlag grpc_tcp_trace; - namespace grpc_core { class TcpZerocopySendRecord { @@ -621,7 +618,7 @@ static void tcp_drop_uncovered_then_handle_write(void* arg /* grpc_tcp */, static void done_poller(void* bp, grpc_error_handle /*error_ignored*/) { backup_poller* p = static_cast(bp); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "BACKUP_POLLER:%p destroy", p); } grpc_pollset_destroy(BACKUP_POLLER_POLLSET(p)); @@ -630,7 +627,7 @@ static void done_poller(void* bp, grpc_error_handle /*error_ignored*/) { static void run_poller(void* bp, grpc_error_handle /*error_ignored*/) { backup_poller* p = static_cast(bp); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "BACKUP_POLLER:%p run", p); } gpr_mu_lock(p->pollset_mu); @@ -647,7 +644,7 @@ static void run_poller(void* bp, grpc_error_handle /*error_ignored*/) { g_backup_poller = nullptr; g_uncovered_notifications_pending = 0; g_backup_poller_mu->Unlock(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "BACKUP_POLLER:%p shutdown", p); } grpc_pollset_shutdown(BACKUP_POLLER_POLLSET(p), @@ -655,7 +652,7 @@ static void run_poller(void* bp, grpc_error_handle /*error_ignored*/) { grpc_schedule_on_exec_ctx)); } else { g_backup_poller_mu->Unlock(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "BACKUP_POLLER:%p reschedule", p); } grpc_core::Executor::Run(&p->run_poller, absl::OkStatus(), @@ -672,7 +669,7 @@ static void drop_uncovered(grpc_tcp* /*tcp*/) { old_count = g_uncovered_notifications_pending--; g_backup_poller_mu->Unlock(); CHECK_GT(old_count, 1); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "BACKUP_POLLER:%p uncover cnt %d->%d", p, old_count, old_count - 1); } @@ -696,7 +693,7 @@ static void cover_self(grpc_tcp* tcp) { g_backup_poller = p; grpc_pollset_init(BACKUP_POLLER_POLLSET(p), &p->pollset_mu); g_backup_poller_mu->Unlock(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "BACKUP_POLLER:%p create", p); } grpc_core::Executor::Run( @@ -708,7 +705,7 @@ static void cover_self(grpc_tcp* tcp) { p = g_backup_poller; g_backup_poller_mu->Unlock(); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "BACKUP_POLLER:%p add %p cnt %d->%d", p, tcp, old_count - 1, old_count); } @@ -716,14 +713,14 @@ static void cover_self(grpc_tcp* tcp) { } static void notify_on_read(grpc_tcp* tcp) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "TCP:%p notify_on_read", tcp); } grpc_fd_notify_on_read(tcp->em_fd, &tcp->read_done_closure); } static void notify_on_write(grpc_tcp* tcp) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "TCP:%p notify_on_write", tcp); } if (!grpc_event_engine_run_in_background()) { @@ -734,7 +731,7 @@ static void notify_on_write(grpc_tcp* tcp) { static void tcp_drop_uncovered_then_handle_write(void* arg, grpc_error_handle error) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "TCP:%p got_write: %s", arg, grpc_core::StatusToString(error).c_str()); } @@ -825,7 +822,7 @@ static void tcp_destroy(grpc_endpoint* ep) { static void perform_reclamation(grpc_tcp* tcp) ABSL_LOCKS_EXCLUDED(tcp->read_mu) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { LOG(INFO) << "TCP: benign reclamation to free memory"; } tcp->read_mu.Lock(); @@ -855,7 +852,7 @@ static void maybe_post_reclaimer(grpc_tcp* tcp) static void tcp_trace_read(grpc_tcp* tcp, grpc_error_handle error) ABSL_EXCLUSIVE_LOCKS_REQUIRED(tcp->read_mu) { grpc_closure* cb = tcp->read_cb; - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "TCP:%p call_cb %p %p:%p", tcp, cb, cb->cb, cb->cb_arg); size_t i; gpr_log(GPR_INFO, "READ %p (peer=%s) error=%s", tcp, @@ -920,7 +917,7 @@ static void update_rcvlowat(grpc_tcp* tcp) #define MAX_READ_IOVEC 64 static bool tcp_do_read(grpc_tcp* tcp, grpc_error_handle* error) ABSL_EXCLUSIVE_LOCKS_REQUIRED(tcp->read_mu) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "TCP:%p do_read", tcp); } struct msghdr msg; @@ -1133,7 +1130,7 @@ static void maybe_make_read_slices(grpc_tcp* tcp) static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error) { grpc_tcp* tcp = static_cast(arg); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "TCP:%p got_read: %s", tcp, grpc_core::StatusToString(error).c_str()); } @@ -1283,7 +1280,7 @@ static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg, uint32_t opt = grpc_core::kTimestampingSocketOptions; if (setsockopt(tcp->fd, SOL_SOCKET, SO_TIMESTAMPING, static_cast(&opt), sizeof(opt)) != 0) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { LOG(ERROR) << "Failed to set timestamping options on the socket."; } return false; @@ -1369,7 +1366,7 @@ struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg, auto next_cmsg = CMSG_NXTHDR(msg, cmsg); cmsghdr* opt_stats = nullptr; if (next_cmsg == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { LOG(ERROR) << "Received timestamp without extended error"; } return cmsg; @@ -1381,7 +1378,7 @@ struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg, opt_stats = next_cmsg; next_cmsg = CMSG_NXTHDR(msg, opt_stats); if (next_cmsg == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { LOG(ERROR) << "Received timestamp without extended error"; } return opt_stats; @@ -1391,7 +1388,7 @@ struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg, if (!(next_cmsg->cmsg_level == SOL_IP || next_cmsg->cmsg_level == SOL_IPV6) || !(next_cmsg->cmsg_type == IP_RECVERR || next_cmsg->cmsg_type == IPV6_RECVERR)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { LOG(ERROR) << "Unexpected control message"; } return cmsg; @@ -1474,7 +1471,7 @@ static bool process_errors(grpc_tcp* tcp) { } else { // Got a control message that is not a timestamp or zerocopy. Don't know // how to handle this. - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "unknown control message cmsg_level:%d cmsg_type:%d", cmsg->cmsg_level, cmsg->cmsg_type); @@ -1491,7 +1488,7 @@ static bool process_errors(grpc_tcp* tcp) { static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error_handle error) { grpc_tcp* tcp = static_cast(arg); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "TCP:%p got_error: %s", tcp, grpc_core::StatusToString(error).c_str()); } @@ -1822,7 +1819,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, ? tcp_flush_zerocopy(tcp, tcp->current_zerocopy_send, &error) : tcp_flush(tcp, &error); if (!flush_result) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { LOG(INFO) << "write: delayed"; } notify_on_write(tcp); @@ -1832,9 +1829,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, cb = tcp->write_cb; tcp->write_cb = nullptr; tcp->current_zerocopy_send = nullptr; - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { - LOG(INFO) << "write: " << grpc_core::StatusToString(error); - } + GRPC_TRACE_LOG(tcp, INFO) << "write: " << grpc_core::StatusToString(error); // No need to take a ref on error since tcp_flush provides a ref. grpc_core::Closure::Run(DEBUG_LOCATION, cb, error); TCP_UNREF(tcp, "write"); @@ -1849,7 +1844,7 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf, grpc_core::EventLog::Append("tcp-write-outstanding", buf->length); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { size_t i; for (i = 0; i < buf->count; i++) { @@ -1895,14 +1890,12 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf, TCP_REF(tcp, "write"); tcp->write_cb = cb; tcp->current_zerocopy_send = zerocopy_send_record; - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { LOG(INFO) << "write: delayed"; } notify_on_write(tcp); } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { - LOG(INFO) << "write: " << grpc_core::StatusToString(error); - } + GRPC_TRACE_LOG(tcp, INFO) << "write: " << grpc_core::StatusToString(error); grpc_core::Closure::Run(DEBUG_LOCATION, cb, error); } } @@ -2014,8 +2007,8 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd, #endif } // paired with unref in grpc_tcp_destroy - new (&tcp->refcount) grpc_core::RefCount( - 1, GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace) ? "tcp" : nullptr); + new (&tcp->refcount) + grpc_core::RefCount(1, GRPC_TRACE_FLAG_ENABLED(tcp) ? "tcp" : nullptr); gpr_atm_no_barrier_store(&tcp->shutdown_count, 0); tcp->em_fd = em_fd; grpc_slice_buffer_init(&tcp->last_read_buffer); diff --git a/src/core/lib/iomgr/tcp_posix.h b/src/core/lib/iomgr/tcp_posix.h index e13fe66aa59..2d3a094333c 100644 --- a/src/core/lib/iomgr/tcp_posix.h +++ b/src/core/lib/iomgr/tcp_posix.h @@ -38,8 +38,6 @@ #include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/socket_utils_posix.h" -extern grpc_core::TraceFlag grpc_tcp_trace; - /// Create a tcp endpoint given a file desciptor and a read slice size. /// Takes ownership of \a fd. Takes ownership of the \a slice_allocator. grpc_endpoint* grpc_tcp_create(grpc_fd* fd, diff --git a/src/core/lib/iomgr/tcp_server_posix.cc b/src/core/lib/iomgr/tcp_server_posix.cc index 8811eac862b..2828f69d206 100644 --- a/src/core/lib/iomgr/tcp_server_posix.cc +++ b/src/core/lib/iomgr/tcp_server_posix.cc @@ -177,7 +177,7 @@ static grpc_error_handle CreateEventEngineListener( addr_uri.status().ToString().c_str()); return; } - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "SERVER_CONNECT: incoming external connection: %s", addr_uri->c_str()); @@ -467,7 +467,7 @@ static void on_read(void* arg, grpc_error_handle err) { addr_uri.status().ToString().c_str()); goto error; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "SERVER_CONNECT: incoming connection: %s", addr_uri->c_str()); } @@ -928,7 +928,7 @@ class ExternalConnectionHandler : public grpc_core::TcpServerFdHandler { addr_uri.status().ToString().c_str()); return; } - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "SERVER_CONNECT: incoming external connection: %s", addr_uri->c_str()); } diff --git a/src/core/lib/iomgr/tcp_windows.cc b/src/core/lib/iomgr/tcp_windows.cc index 1569497e746..f4f8b9c7c3d 100644 --- a/src/core/lib/iomgr/tcp_windows.cc +++ b/src/core/lib/iomgr/tcp_windows.cc @@ -54,8 +54,6 @@ #define GRPC_FIONBIO FIONBIO #endif -extern grpc_core::TraceFlag grpc_tcp_trace; - grpc_error_handle grpc_tcp_set_non_block(SOCKET sock) { int status; uint32_t param = 1; @@ -141,7 +139,7 @@ static void tcp_free(grpc_tcp* tcp) { #define TCP_REF(tcp, reason) tcp_ref((tcp), (reason), __FILE__, __LINE__) static void tcp_unref(grpc_tcp* tcp, const char* reason, const char* file, int line) { - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count); gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "TCP unref %p : %s %" PRIdPTR " -> %" PRIdPTR, tcp, reason, val, @@ -154,7 +152,7 @@ static void tcp_unref(grpc_tcp* tcp, const char* reason, const char* file, static void tcp_ref(grpc_tcp* tcp, const char* reason, const char* file, int line) { - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count); gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "TCP ref %p : %s %" PRIdPTR " -> %" PRIdPTR, tcp, reason, val, @@ -181,7 +179,7 @@ static void on_read(void* tcpp, grpc_error_handle error) { grpc_winsocket* socket = tcp->socket; grpc_winsocket_callback_info* info = &socket->read_info; - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "TCP:%p on_read", tcp); } @@ -202,7 +200,7 @@ static void on_read(void* tcpp, grpc_error_handle error) { } CHECK((size_t)info->bytes_transferred == tcp->read_slices->length); - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace) && + if (GRPC_TRACE_FLAG_ENABLED(tcp) && gpr_should_log(GPR_LOG_SEVERITY_INFO)) { size_t i; for (i = 0; i < tcp->read_slices->count; i++) { @@ -214,7 +212,7 @@ static void on_read(void* tcpp, grpc_error_handle error) { } } } else { - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "TCP:%p unref read_slice", tcp); } grpc_slice_buffer_reset_and_unref(tcp->read_slices); @@ -245,7 +243,7 @@ static void win_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices, WSABUF buffers[MAX_WSABUF_COUNT]; size_t i; - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "TCP:%p win_read", tcp); } @@ -316,7 +314,7 @@ static void on_write(void* tcpp, grpc_error_handle error) { grpc_winsocket_callback_info* info = &handle->write_info; grpc_closure* cb; - if (grpc_tcp_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(tcp)) { gpr_log(GPR_INFO, "TCP:%p on_write", tcp); } @@ -352,8 +350,7 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices, WSABUF* buffers = local_buffers; size_t len, async_buffers_offset = 0; - if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace) && - gpr_should_log(GPR_LOG_SEVERITY_INFO)) { + if (GRPC_TRACE_FLAG_ENABLED(tcp) && gpr_should_log(GPR_LOG_SEVERITY_INFO)) { size_t i; for (i = 0; i < slices->count; i++) { char* data = diff --git a/src/core/lib/iomgr/timer_generic.cc b/src/core/lib/iomgr/timer_generic.cc index 1b0ab4b71cc..91813830818 100644 --- a/src/core/lib/iomgr/timer_generic.cc +++ b/src/core/lib/iomgr/timer_generic.cc @@ -48,9 +48,6 @@ #define MIN_QUEUE_WINDOW_DURATION 0.01 #define MAX_QUEUE_WINDOW_DURATION 1.0 -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 // deadlines earlier than 'queue_deadline_cap' are maintained in the heap and // others are maintained in the list (unordered). This helps to keep the number @@ -337,7 +334,7 @@ static void timer_init(grpc_timer* timer, grpc_core::Timestamp deadline, timer->hash_table_next = nullptr; #endif - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer)) { gpr_log(GPR_DEBUG, "TIMER %p: SET %" PRId64 " now %" PRId64 " call %p[%p]", timer, deadline.milliseconds_after_process_epoch(), grpc_core::Timestamp::Now().milliseconds_after_process_epoch(), @@ -373,7 +370,7 @@ static void timer_init(grpc_timer* timer, grpc_core::Timestamp deadline, timer->heap_index = INVALID_HEAP_INDEX; list_join(&shard->list, timer); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer)) { gpr_log(GPR_DEBUG, " .. add to shard %d with queue_deadline_cap=%" PRId64 " => is_first_timer=%s", @@ -396,7 +393,7 @@ static void timer_init(grpc_timer* timer, grpc_core::Timestamp deadline, // grpc_timer_check. if (is_first_timer) { gpr_mu_lock(&g_shared_mutables.mu); - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer)) { gpr_log(GPR_DEBUG, " .. old shard min_deadline=%" PRId64, shard->min_deadline.milliseconds_after_process_epoch()); } @@ -438,7 +435,7 @@ static void timer_cancel(grpc_timer* timer) { timer_shard* shard = &g_shards[grpc_core::HashPointer(timer, g_num_shards)]; gpr_mu_lock(&shard->mu); - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer)) { gpr_log(GPR_DEBUG, "TIMER %p: CANCEL pending=%s", timer, timer->pending ? "true" : "false"); } @@ -479,7 +476,7 @@ static bool refill_heap(timer_shard* shard, grpc_core::Timestamp now) { std::max(now, shard->queue_deadline_cap) + grpc_core::Duration::FromSecondsAsDouble(deadline_delta); - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer_check)) { gpr_log(GPR_DEBUG, " .. shard[%d]->queue_deadline_cap --> %" PRId64, static_cast(shard - g_shards), shard->queue_deadline_cap.milliseconds_after_process_epoch()); @@ -491,7 +488,7 @@ static bool refill_heap(timer_shard* shard, grpc_core::Timestamp now) { timer->deadline); if (timer_deadline < shard->queue_deadline_cap) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer_check)) { gpr_log(GPR_DEBUG, " .. add timer with deadline %" PRId64 " to heap", timer_deadline.milliseconds_after_process_epoch()); } @@ -508,7 +505,7 @@ static bool refill_heap(timer_shard* shard, grpc_core::Timestamp now) { static grpc_timer* pop_one(timer_shard* shard, grpc_core::Timestamp now) { grpc_timer* timer; for (;;) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer_check)) { gpr_log(GPR_DEBUG, " .. shard[%d]: heap_empty=%s", static_cast(shard - g_shards), grpc_timer_heap_is_empty(&shard->heap) ? "true" : "false"); @@ -521,14 +518,14 @@ static grpc_timer* pop_one(timer_shard* shard, grpc_core::Timestamp now) { auto timer_deadline = grpc_core::Timestamp::FromMillisecondsAfterProcessEpoch( timer->deadline); - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer_check)) { gpr_log(GPR_DEBUG, " .. check top timer deadline=%" PRId64 " now=%" PRId64, timer_deadline.milliseconds_after_process_epoch(), now.milliseconds_after_process_epoch()); } if (timer_deadline > now) return nullptr; - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer)) { gpr_log(GPR_DEBUG, "TIMER %p: FIRE %" PRId64 "ms late", timer, (now - timer_deadline).millis()); } @@ -552,7 +549,7 @@ static size_t pop_timers(timer_shard* shard, grpc_core::Timestamp now, } *new_min_deadline = compute_min_deadline(shard); gpr_mu_unlock(&shard->mu); - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer_check)) { gpr_log(GPR_DEBUG, " .. shard[%d] popped %" PRIdPTR, static_cast(shard - g_shards), n); } @@ -591,7 +588,7 @@ static grpc_timer_check_result run_some_expired_timers( gpr_mu_lock(&g_shared_mutables.mu); result = GRPC_TIMERS_CHECKED_AND_EMPTY; - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer_check)) { gpr_log( GPR_DEBUG, " .. shard[%d]->min_deadline = %" PRId64, static_cast(g_shard_queue[0] - g_shards), @@ -610,7 +607,7 @@ static grpc_timer_check_result run_some_expired_timers( result = GRPC_TIMERS_FIRED; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer_check)) { gpr_log( GPR_DEBUG, " .. result --> %d" @@ -670,7 +667,7 @@ static grpc_timer_check_result timer_check(grpc_core::Timestamp* next) { if (next != nullptr) { *next = std::min(*next, min_timer); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer_check)) { gpr_log(GPR_DEBUG, "TIMER CHECK SKIP: now=%" PRId64 " min_timer=%" PRId64, now.milliseconds_after_process_epoch(), min_timer.milliseconds_after_process_epoch()); @@ -684,7 +681,7 @@ static grpc_timer_check_result timer_check(grpc_core::Timestamp* next) { : GRPC_ERROR_CREATE("Shutting down timer system"); // tracing - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer_check)) { std::string next_str; if (next == nullptr) { next_str = "NULL"; @@ -712,7 +709,7 @@ static grpc_timer_check_result timer_check(grpc_core::Timestamp* next) { grpc_timer_check_result r = run_some_expired_timers(now, next, shutdown_error); // tracing - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer_check)) { std::string next_str; if (next == nullptr) { next_str = "NULL"; diff --git a/src/core/lib/iomgr/timer_manager.cc b/src/core/lib/iomgr/timer_manager.cc index 9cab02d2877..3e865b6ae0e 100644 --- a/src/core/lib/iomgr/timer_manager.cc +++ b/src/core/lib/iomgr/timer_manager.cc @@ -37,8 +37,6 @@ struct completed_thread { completed_thread* next; }; -extern grpc_core::TraceFlag grpc_timer_check_trace; - // global mutex static gpr_mu g_mu; // are we multi-threaded @@ -89,9 +87,7 @@ static void start_timer_thread_and_unlock(void) { ++g_waiter_count; ++g_thread_count; gpr_mu_unlock(&g_mu); - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { - LOG(INFO) << "Spawn timer thread"; - } + GRPC_TRACE_LOG(timer_check, INFO) << "Spawn timer thread"; completed_thread* ct = static_cast(gpr_malloc(sizeof(*ct))); ct->thd = grpc_core::Thread("grpc_global_timer", timer_thread, ct); @@ -125,17 +121,13 @@ static void run_some_timers() { // if there's no thread waiting with a timeout, kick an existing untimed // waiter so that the next deadline is not missed if (!g_has_timed_waiter) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { - LOG(INFO) << "kick untimed waiter"; - } + GRPC_TRACE_LOG(timer_check, INFO) << "kick untimed waiter"; gpr_cv_signal(&g_cv_wait); } gpr_mu_unlock(&g_mu); } // without our lock, flush the exec_ctx - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { - LOG(INFO) << "flush exec_ctx"; - } + GRPC_TRACE_LOG(timer_check, INFO) << "flush exec_ctx"; grpc_core::ExecCtx::Get()->Flush(); gpr_mu_lock(&g_mu); // garbage collect any threads that are dead @@ -188,7 +180,7 @@ static bool wait_until(grpc_core::Timestamp next) { g_has_timed_waiter = true; g_timed_waiter_deadline = next; - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer_check)) { grpc_core::Duration wait_time = next - grpc_core::Timestamp::Now(); gpr_log(GPR_INFO, "sleep for a %" PRId64 " milliseconds", wait_time.millis()); @@ -198,14 +190,14 @@ static bool wait_until(grpc_core::Timestamp next) { } } - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace) && + if (GRPC_TRACE_FLAG_ENABLED(timer_check) && next == grpc_core::Timestamp::InfFuture()) { LOG(INFO) << "sleep until kicked"; } gpr_cv_wait(&g_cv_wait, &g_mu, next.as_timespec(GPR_CLOCK_MONOTONIC)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(timer_check)) { gpr_log(GPR_INFO, "wait ended: was_timed:%d kicked:%d", my_timed_waiter_generation == g_timed_waiter_generation, g_kicked); @@ -251,9 +243,8 @@ static void timer_main_loop() { // Consequently, we can just sleep forever here and be happy at some // saved wakeup cycles. - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { - LOG(INFO) << "timers not checked: expect another thread to"; - } + GRPC_TRACE_LOG(timer_check, INFO) + << "timers not checked: expect another thread to"; next = grpc_core::Timestamp::InfFuture(); ABSL_FALLTHROUGH_INTENDED; case GRPC_TIMERS_CHECKED_AND_EMPTY: @@ -277,9 +268,7 @@ static void timer_thread_cleanup(completed_thread* ct) { ct->next = g_completed_threads; g_completed_threads = ct; gpr_mu_unlock(&g_mu); - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { - LOG(INFO) << "End timer thread"; - } + GRPC_TRACE_LOG(timer_check, INFO) << "End timer thread"; } static void timer_thread(void* completed_thread_ptr) { @@ -318,20 +307,17 @@ void grpc_timer_manager_init(void) { static void stop_threads(void) { gpr_mu_lock(&g_mu); - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { - LOG(INFO) << "stop timer threads: threaded=" << g_threaded; - } + GRPC_TRACE_LOG(timer_check, INFO) + << "stop timer threads: threaded=" << g_threaded; if (g_threaded) { g_threaded = false; gpr_cv_broadcast(&g_cv_wait); - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { - LOG(INFO) << "num timer threads: " << g_thread_count; - } + GRPC_TRACE_LOG(timer_check, INFO) + << "num timer threads: " << g_thread_count; while (g_thread_count > 0) { gpr_cv_wait(&g_cv_shutdown, &g_mu, gpr_inf_future(GPR_CLOCK_MONOTONIC)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { - LOG(INFO) << "num timer threads: " << g_thread_count; - } + GRPC_TRACE_LOG(timer_check, INFO) + << "num timer threads: " << g_thread_count; gc_completed_threads(); } } diff --git a/src/core/lib/promise/detail/join_state.h b/src/core/lib/promise/detail/join_state.h index e930ba53f36..5f0effcb652 100644 --- a/src/core/lib/promise/detail/join_state.h +++ b/src/core/lib/promise/detail/join_state.h @@ -22,15 +22,15 @@ #include #include "absl/log/check.h" +#include "absl/log/log.h" -#include #include +#include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/bitset.h" #include "src/core/lib/gprpp/construct_destruct.h" #include "src/core/lib/promise/detail/promise_like.h" #include "src/core/lib/promise/poll.h" -#include "src/core/lib/promise/trace.h" namespace grpc_core { namespace promise_detail { @@ -93,15 +93,14 @@ struct JoinState { typename Traits::template ResultType>; Poll PollOnce() { if (!ready.is_set(0)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 1/2", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 1/2"; auto poll = promise0(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 1/2 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 1/2 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -112,19 +111,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 1/2 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 1/2 already ready"; } if (!ready.is_set(1)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 2/2", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 2/2"; auto poll = promise1(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 2/2 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 2/2 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -135,8 +133,8 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 2/2 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 2/2 already ready"; } if (ready.all()) { return Traits::FinalReturn(std::move(result0), std::move(result1)); @@ -219,15 +217,14 @@ struct JoinState { std::tuple>; Poll PollOnce() { if (!ready.is_set(0)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 1/3", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 1/3"; auto poll = promise0(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 1/3 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 1/3 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -238,19 +235,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 1/3 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 1/3 already ready"; } if (!ready.is_set(1)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 2/3", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 2/3"; auto poll = promise1(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 2/3 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 2/3 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -261,19 +257,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 2/3 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 2/3 already ready"; } if (!ready.is_set(2)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 3/3", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 3/3"; auto poll = promise2(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 3/3 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 3/3 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -284,8 +279,8 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 3/3 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 3/3 already ready"; } if (ready.all()) { return Traits::FinalReturn(std::move(result0), std::move(result1), @@ -387,15 +382,14 @@ struct JoinState { std::tuple>; Poll PollOnce() { if (!ready.is_set(0)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 1/4", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 1/4"; auto poll = promise0(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 1/4 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 1/4 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -406,19 +400,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 1/4 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 1/4 already ready"; } if (!ready.is_set(1)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 2/4", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 2/4"; auto poll = promise1(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 2/4 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 2/4 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -429,19 +422,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 2/4 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 2/4 already ready"; } if (!ready.is_set(2)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 3/4", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 3/4"; auto poll = promise2(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 3/4 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 3/4 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -452,19 +444,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 3/4 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 3/4 already ready"; } if (!ready.is_set(3)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 4/4", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 4/4"; auto poll = promise3(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 4/4 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 4/4 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -475,8 +466,8 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 4/4 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 4/4 already ready"; } if (ready.all()) { return Traits::FinalReturn(std::move(result0), std::move(result1), @@ -597,15 +588,14 @@ struct JoinState { std::tuple>; Poll PollOnce() { if (!ready.is_set(0)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 1/5", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 1/5"; auto poll = promise0(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 1/5 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 1/5 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -616,19 +606,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 1/5 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 1/5 already ready"; } if (!ready.is_set(1)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 2/5", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 2/5"; auto poll = promise1(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 2/5 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 2/5 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -639,19 +628,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 2/5 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 2/5 already ready"; } if (!ready.is_set(2)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 3/5", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 3/5"; auto poll = promise2(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 3/5 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 3/5 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -662,19 +650,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 3/5 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 3/5 already ready"; } if (!ready.is_set(3)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 4/5", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 4/5"; auto poll = promise3(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 4/5 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 4/5 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -685,19 +672,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 4/5 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 4/5 already ready"; } if (!ready.is_set(4)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 5/5", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 5/5"; auto poll = promise4(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 5/5 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 5/5 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -708,8 +694,8 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 5/5 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 5/5 already ready"; } if (ready.all()) { return Traits::FinalReturn(std::move(result0), std::move(result1), @@ -849,15 +835,14 @@ struct JoinState { std::tuple>; Poll PollOnce() { if (!ready.is_set(0)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 1/6", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 1/6"; auto poll = promise0(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 1/6 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 1/6 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -868,19 +853,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 1/6 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 1/6 already ready"; } if (!ready.is_set(1)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 2/6", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 2/6"; auto poll = promise1(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 2/6 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 2/6 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -891,19 +875,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 2/6 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 2/6 already ready"; } if (!ready.is_set(2)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 3/6", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 3/6"; auto poll = promise2(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 3/6 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 3/6 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -914,19 +897,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 3/6 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 3/6 already ready"; } if (!ready.is_set(3)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 4/6", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 4/6"; auto poll = promise3(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 4/6 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 4/6 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -937,19 +919,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 4/6 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 4/6 already ready"; } if (!ready.is_set(4)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 5/6", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 5/6"; auto poll = promise4(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 5/6 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 5/6 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -960,19 +941,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 5/6 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 5/6 already ready"; } if (!ready.is_set(5)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 6/6", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 6/6"; auto poll = promise5(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 6/6 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 6/6 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -983,8 +963,8 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 6/6 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 6/6 already ready"; } if (ready.all()) { return Traits::FinalReturn(std::move(result0), std::move(result1), @@ -1142,15 +1122,14 @@ struct JoinState { Result0, Result1, Result2, Result3, Result4, Result5, Result6>>; Poll PollOnce() { if (!ready.is_set(0)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 1/7", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 1/7"; auto poll = promise0(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 1/7 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 1/7 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1161,19 +1140,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 1/7 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 1/7 already ready"; } if (!ready.is_set(1)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 2/7", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 2/7"; auto poll = promise1(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 2/7 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 2/7 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1184,19 +1162,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 2/7 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 2/7 already ready"; } if (!ready.is_set(2)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 3/7", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 3/7"; auto poll = promise2(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 3/7 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 3/7 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1207,19 +1184,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 3/7 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 3/7 already ready"; } if (!ready.is_set(3)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 4/7", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 4/7"; auto poll = promise3(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 4/7 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 4/7 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1230,19 +1206,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 4/7 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 4/7 already ready"; } if (!ready.is_set(4)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 5/7", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 5/7"; auto poll = promise4(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 5/7 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 5/7 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1253,19 +1228,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 5/7 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 5/7 already ready"; } if (!ready.is_set(5)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 6/7", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 6/7"; auto poll = promise5(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 6/7 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 6/7 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1276,19 +1250,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 6/7 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 6/7 already ready"; } if (!ready.is_set(6)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 7/7", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 7/7"; auto poll = promise6(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 7/7 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 7/7 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1299,8 +1272,8 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 7/7 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 7/7 already ready"; } if (ready.all()) { return Traits::FinalReturn(std::move(result0), std::move(result1), @@ -1478,15 +1451,14 @@ struct JoinState { Result0, Result1, Result2, Result3, Result4, Result5, Result6, Result7>>; Poll PollOnce() { if (!ready.is_set(0)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 1/8", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 1/8"; auto poll = promise0(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 1/8 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 1/8 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1497,19 +1469,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 1/8 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 1/8 already ready"; } if (!ready.is_set(1)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 2/8", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 2/8"; auto poll = promise1(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 2/8 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 2/8 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1520,19 +1491,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 2/8 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 2/8 already ready"; } if (!ready.is_set(2)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 3/8", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 3/8"; auto poll = promise2(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 3/8 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 3/8 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1543,19 +1513,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 3/8 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 3/8 already ready"; } if (!ready.is_set(3)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 4/8", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 4/8"; auto poll = promise3(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 4/8 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 4/8 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1566,19 +1535,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 4/8 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 4/8 already ready"; } if (!ready.is_set(4)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 5/8", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 5/8"; auto poll = promise4(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 5/8 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 5/8 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1589,19 +1557,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 5/8 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 5/8 already ready"; } if (!ready.is_set(5)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 6/8", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 6/8"; auto poll = promise5(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 6/8 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 6/8 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1612,19 +1579,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 6/8 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 6/8 already ready"; } if (!ready.is_set(6)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 7/8", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 7/8"; auto poll = promise6(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 7/8 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 7/8 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1635,19 +1601,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 7/8 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 7/8 already ready"; } if (!ready.is_set(7)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 8/8", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 8/8"; auto poll = promise7(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 8/8 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 8/8 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1658,8 +1623,8 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 8/8 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 8/8 already ready"; } if (ready.all()) { return Traits::FinalReturn(std::move(result0), std::move(result1), @@ -1856,15 +1821,14 @@ struct JoinState { Result7, Result8>>; Poll PollOnce() { if (!ready.is_set(0)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 1/9", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 1/9"; auto poll = promise0(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 1/9 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 1/9 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1875,19 +1839,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 1/9 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 1/9 already ready"; } if (!ready.is_set(1)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 2/9", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 2/9"; auto poll = promise1(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 2/9 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 2/9 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1898,19 +1861,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 2/9 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 2/9 already ready"; } if (!ready.is_set(2)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 3/9", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 3/9"; auto poll = promise2(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 3/9 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 3/9 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1921,19 +1883,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 3/9 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 3/9 already ready"; } if (!ready.is_set(3)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 4/9", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 4/9"; auto poll = promise3(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 4/9 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 4/9 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1944,19 +1905,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 4/9 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 4/9 already ready"; } if (!ready.is_set(4)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 5/9", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 5/9"; auto poll = promise4(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 5/9 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 5/9 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1967,19 +1927,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 5/9 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 5/9 already ready"; } if (!ready.is_set(5)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 6/9", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 6/9"; auto poll = promise5(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 6/9 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 6/9 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -1990,19 +1949,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 6/9 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 6/9 already ready"; } if (!ready.is_set(6)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 7/9", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 7/9"; auto poll = promise6(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 7/9 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 7/9 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -2013,19 +1971,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 7/9 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 7/9 already ready"; } if (!ready.is_set(7)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 8/9", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 8/9"; auto poll = promise7(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 8/9 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 8/9 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -2036,19 +1993,18 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 8/9 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 8/9 already ready"; } if (!ready.is_set(8)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: begin poll joint 9/9", this); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << "join[" << this << "]: begin poll joint 9/9"; auto poll = promise8(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); - gpr_log(GPR_DEBUG, "join[%p]: joint 9/9 %s", this, - p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") - : "pending"); + VLOG(2) << "join[" << this << "]: joint 9/9 " + << (p != nullptr ? (Traits::IsOk(*p) ? "ready" : "early-error") + : "pending"); } if (auto* p = poll.value_if_ready()) { if (Traits::IsOk(*p)) { @@ -2059,8 +2015,8 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_DEBUG, "join[%p]: joint 9/9 already ready", this); + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2) << "join[" << this << "]: joint 9/9 already ready"; } if (ready.all()) { return Traits::FinalReturn( diff --git a/src/core/lib/promise/detail/seq_state.h b/src/core/lib/promise/detail/seq_state.h index 841cd6cb042..d343e32a324 100644 --- a/src/core/lib/promise/detail/seq_state.h +++ b/src/core/lib/promise/detail/seq_state.h @@ -26,15 +26,14 @@ #include "absl/log/log.h" #include "absl/strings/str_cat.h" -#include #include +#include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/construct_destruct.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/promise/detail/promise_factory.h" #include "src/core/lib/promise/detail/promise_like.h" #include "src/core/lib/promise/poll.h" -#include "src/core/lib/promise/trace.h" // A sequence under some traits for some set of callables P, Fs. // P should be a promise-like object that yields a value. @@ -144,21 +143,22 @@ struct SeqState { Poll PollOnce() { switch (state) { case State::kState0: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 1/2"; } auto result = prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 1/2 gets " << (p != nullptr ? (PromiseResultTraits0::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits0::ErrorString(*p))) + PromiseResultTraits0::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -176,13 +176,13 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState1: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 2/2"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 2/2 gets " << (result.ready() ? "ready" : "pending"); } @@ -286,21 +286,22 @@ struct SeqState { Poll PollOnce() { switch (state) { case State::kState0: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 1/3"; } auto result = prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 1/3 gets " << (p != nullptr ? (PromiseResultTraits0::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits0::ErrorString(*p))) + PromiseResultTraits0::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -317,21 +318,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 2/3"; } auto result = prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 2/3 gets " << (p != nullptr ? (PromiseResultTraits1::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits1::ErrorString(*p))) + PromiseResultTraits1::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -349,13 +351,13 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState2: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 3/3"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 3/3 gets " << (result.ready() ? "ready" : "pending"); } @@ -486,21 +488,22 @@ struct SeqState { Poll PollOnce() { switch (state) { case State::kState0: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 1/4"; } auto result = prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 1/4 gets " << (p != nullptr ? (PromiseResultTraits0::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits0::ErrorString(*p))) + PromiseResultTraits0::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -517,21 +520,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 2/4"; } auto result = prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 2/4 gets " << (p != nullptr ? (PromiseResultTraits1::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits1::ErrorString(*p))) + PromiseResultTraits1::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -548,21 +552,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 3/4"; } auto result = prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 3/4 gets " << (p != nullptr ? (PromiseResultTraits2::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits2::ErrorString(*p))) + PromiseResultTraits2::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -580,13 +585,13 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState3: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 4/4"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 4/4 gets " << (result.ready() ? "ready" : "pending"); } @@ -745,21 +750,22 @@ struct SeqState { Poll PollOnce() { switch (state) { case State::kState0: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 1/5"; } auto result = prior.prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 1/5 gets " << (p != nullptr ? (PromiseResultTraits0::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits0::ErrorString(*p))) + PromiseResultTraits0::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -776,21 +782,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 2/5"; } auto result = prior.prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 2/5 gets " << (p != nullptr ? (PromiseResultTraits1::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits1::ErrorString(*p))) + PromiseResultTraits1::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -807,21 +814,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 3/5"; } auto result = prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 3/5 gets " << (p != nullptr ? (PromiseResultTraits2::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits2::ErrorString(*p))) + PromiseResultTraits2::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -838,21 +846,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 4/5"; } auto result = prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 4/5 gets " << (p != nullptr ? (PromiseResultTraits3::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits3::ErrorString(*p))) + PromiseResultTraits3::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -870,13 +879,13 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState4: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 5/5"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 5/5 gets " << (result.ready() ? "ready" : "pending"); } @@ -1072,21 +1081,22 @@ struct SeqState { Poll PollOnce() { switch (state) { case State::kState0: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 1/6"; } auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 1/6 gets " << (p != nullptr ? (PromiseResultTraits0::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits0::ErrorString(*p))) + PromiseResultTraits0::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1104,21 +1114,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 2/6"; } auto result = prior.prior.prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 2/6 gets " << (p != nullptr ? (PromiseResultTraits1::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits1::ErrorString(*p))) + PromiseResultTraits1::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1135,21 +1146,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 3/6"; } auto result = prior.prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 3/6 gets " << (p != nullptr ? (PromiseResultTraits2::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits2::ErrorString(*p))) + PromiseResultTraits2::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1166,21 +1178,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 4/6"; } auto result = prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 4/6 gets " << (p != nullptr ? (PromiseResultTraits3::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits3::ErrorString(*p))) + PromiseResultTraits3::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1197,21 +1210,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 5/6"; } auto result = prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 5/6 gets " << (p != nullptr ? (PromiseResultTraits4::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits4::ErrorString(*p))) + PromiseResultTraits4::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1229,13 +1243,13 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState5: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 6/6", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/6"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 6/6 gets " << (result.ready() ? "ready" : "pending"); } @@ -1463,21 +1477,22 @@ struct SeqState { Poll PollOnce() { switch (state) { case State::kState0: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 1/7"; } auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 1/7 gets " << (p != nullptr ? (PromiseResultTraits0::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits0::ErrorString(*p))) + PromiseResultTraits0::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1495,21 +1510,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 2/7"; } auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 2/7 gets " << (p != nullptr ? (PromiseResultTraits1::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits1::ErrorString(*p))) + PromiseResultTraits1::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1527,21 +1543,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 3/7"; } auto result = prior.prior.prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 3/7 gets " << (p != nullptr ? (PromiseResultTraits2::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits2::ErrorString(*p))) + PromiseResultTraits2::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1558,21 +1575,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 4/7"; } auto result = prior.prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 4/7 gets " << (p != nullptr ? (PromiseResultTraits3::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits3::ErrorString(*p))) + PromiseResultTraits3::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1589,21 +1607,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 5/7"; } auto result = prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 5/7 gets " << (p != nullptr ? (PromiseResultTraits4::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits4::ErrorString(*p))) + PromiseResultTraits4::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1620,21 +1639,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 6/7"; } auto result = prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 6/7 gets " << (p != nullptr ? (PromiseResultTraits5::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits5::ErrorString(*p))) + PromiseResultTraits5::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1652,13 +1672,13 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState6: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 7/7"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 7/7 gets " << (result.ready() ? "ready" : "pending"); } @@ -1919,22 +1939,23 @@ struct SeqState { Poll PollOnce() { switch (state) { case State::kState0: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 1/8"; } auto result = prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 1/8 gets " << (p != nullptr ? (PromiseResultTraits0::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits0::ErrorString(*p))) + PromiseResultTraits0::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1953,21 +1974,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 2/8"; } auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 2/8 gets " << (p != nullptr ? (PromiseResultTraits1::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits1::ErrorString(*p))) + PromiseResultTraits1::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -1985,21 +2007,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 3/8"; } auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 3/8 gets " << (p != nullptr ? (PromiseResultTraits2::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits2::ErrorString(*p))) + PromiseResultTraits2::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -2017,21 +2040,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 4/8"; } auto result = prior.prior.prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 4/8 gets " << (p != nullptr ? (PromiseResultTraits3::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits3::ErrorString(*p))) + PromiseResultTraits3::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -2048,21 +2072,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 5/8"; } auto result = prior.prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 5/8 gets " << (p != nullptr ? (PromiseResultTraits4::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits4::ErrorString(*p))) + PromiseResultTraits4::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -2079,21 +2104,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 6/8"; } auto result = prior.prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 6/8 gets " << (p != nullptr ? (PromiseResultTraits5::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits5::ErrorString(*p))) + PromiseResultTraits5::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -2110,21 +2136,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState6: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 7/8"; } auto result = prior.current_promise(); PromiseResult6* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 7/8 gets " << (p != nullptr ? (PromiseResultTraits6::IsOk(*p) ? "ready" : absl::StrCat( "early-error:", - PromiseResultTraits6::ErrorString(*p))) + PromiseResultTraits6::ErrorString(*p)) + .c_str()) : "pending"); } if (p == nullptr) return Pending{}; @@ -2142,13 +2169,13 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState7: { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step 8/8"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step 8/8 gets " << (result.ready() ? "ready" : "pending"); } @@ -2443,24 +2470,24 @@ struct SeqState { Poll PollOnce() { switch (state) { case State::kState0: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 1/9", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/9"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 1/9 gets %s", this, - p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/9 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { @@ -2479,24 +2506,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 2/9", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/9"; } auto result = prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 2/9 gets %s", this, - p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/9 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { @@ -2514,23 +2541,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 3/9", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/9"; } auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 3/9 gets %s", this, - p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/9 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { @@ -2547,23 +2574,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 4/9", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/9"; } auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 4/9 gets %s", this, - p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/9 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { @@ -2580,23 +2607,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 5/9", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/9"; } auto result = prior.prior.prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 5/9 gets %s", this, - p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/9 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { @@ -2612,23 +2639,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 6/9", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/9"; } auto result = prior.prior.prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 6/9 gets %s", this, - p != nullptr - ? (PromiseResultTraits5::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits5::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/9 gets " + << (p != nullptr + ? (PromiseResultTraits5::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits5::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits5::IsOk(*p)) { @@ -2644,23 +2671,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState6: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 7/9", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 7/9"; } auto result = prior.prior.current_promise(); PromiseResult6* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 7/9 gets %s", this, - p != nullptr - ? (PromiseResultTraits6::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits6::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 7/9 gets " + << (p != nullptr + ? (PromiseResultTraits6::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits6::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits6::IsOk(*p)) { @@ -2676,23 +2703,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState7: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 8/9", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 8/9"; } auto result = prior.current_promise(); PromiseResult7* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 8/9 gets %s", this, - p != nullptr - ? (PromiseResultTraits7::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits7::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 8/9 gets " + << (p != nullptr + ? (PromiseResultTraits7::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits7::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits7::IsOk(*p)) { @@ -2709,15 +2736,15 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState8: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 9/9", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 9/9"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 9/9 gets %s", this, - result.ready() ? "ready" : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 9/9 gets " + << (result.ready() ? "ready" : "pending"); } auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; @@ -3049,24 +3076,24 @@ struct SeqState { Poll PollOnce() { switch (state) { case State::kState0: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 1/10", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/10"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .current_promise(); PromiseResult0* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 1/10 gets %s", this, - p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/10 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { @@ -3087,24 +3114,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 2/10", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/10"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 2/10 gets %s", this, - p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/10 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { @@ -3123,24 +3150,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 3/10", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/10"; } auto result = prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 3/10 gets %s", this, - p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/10 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { @@ -3158,23 +3185,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 4/10", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/10"; } auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 4/10 gets %s", this, - p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/10 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { @@ -3191,23 +3218,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 5/10", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/10"; } auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 5/10 gets %s", this, - p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/10 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { @@ -3224,23 +3251,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 6/10", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/10"; } auto result = prior.prior.prior.prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 6/10 gets %s", this, - p != nullptr - ? (PromiseResultTraits5::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits5::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/10 gets " + << (p != nullptr + ? (PromiseResultTraits5::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits5::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits5::IsOk(*p)) { @@ -3256,23 +3283,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState6: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 7/10", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 7/10"; } auto result = prior.prior.prior.current_promise(); PromiseResult6* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 7/10 gets %s", this, - p != nullptr - ? (PromiseResultTraits6::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits6::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 7/10 gets " + << (p != nullptr + ? (PromiseResultTraits6::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits6::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits6::IsOk(*p)) { @@ -3288,23 +3315,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState7: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 8/10", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 8/10"; } auto result = prior.prior.current_promise(); PromiseResult7* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 8/10 gets %s", this, - p != nullptr - ? (PromiseResultTraits7::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits7::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 8/10 gets " + << (p != nullptr + ? (PromiseResultTraits7::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits7::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits7::IsOk(*p)) { @@ -3320,23 +3347,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState8: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 9/10", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 9/10"; } auto result = prior.current_promise(); PromiseResult8* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 9/10 gets %s", this, - p != nullptr - ? (PromiseResultTraits8::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits8::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 9/10 gets " + << (p != nullptr + ? (PromiseResultTraits8::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits8::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits8::IsOk(*p)) { @@ -3353,15 +3380,15 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState9: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 10/10", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 10/10"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 10/10 gets %s", this, - result.ready() ? "ready" : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 10/10 gets " + << (result.ready() ? "ready" : "pending"); } auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; @@ -3731,24 +3758,24 @@ struct SeqState { Poll PollOnce() { switch (state) { case State::kState0: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 1/11", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/11"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 1/11 gets %s", this, - p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/11 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { @@ -3770,24 +3797,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 2/11", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/11"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .current_promise(); PromiseResult1* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 2/11 gets %s", this, - p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/11 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { @@ -3808,24 +3835,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 3/11", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/11"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 3/11 gets %s", this, - p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/11 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { @@ -3844,24 +3871,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 4/11", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/11"; } auto result = prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 4/11 gets %s", this, - p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/11 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { @@ -3879,23 +3906,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 5/11", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/11"; } auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 5/11 gets %s", this, - p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/11 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { @@ -3912,23 +3939,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 6/11", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/11"; } auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 6/11 gets %s", this, - p != nullptr - ? (PromiseResultTraits5::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits5::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/11 gets " + << (p != nullptr + ? (PromiseResultTraits5::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits5::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits5::IsOk(*p)) { @@ -3945,23 +3972,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState6: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 7/11", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 7/11"; } auto result = prior.prior.prior.prior.current_promise(); PromiseResult6* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 7/11 gets %s", this, - p != nullptr - ? (PromiseResultTraits6::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits6::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 7/11 gets " + << (p != nullptr + ? (PromiseResultTraits6::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits6::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits6::IsOk(*p)) { @@ -3977,23 +4004,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState7: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 8/11", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 8/11"; } auto result = prior.prior.prior.current_promise(); PromiseResult7* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 8/11 gets %s", this, - p != nullptr - ? (PromiseResultTraits7::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits7::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 8/11 gets " + << (p != nullptr + ? (PromiseResultTraits7::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits7::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits7::IsOk(*p)) { @@ -4009,23 +4036,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState8: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 9/11", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 9/11"; } auto result = prior.prior.current_promise(); PromiseResult8* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 9/11 gets %s", this, - p != nullptr - ? (PromiseResultTraits8::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits8::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 9/11 gets " + << (p != nullptr + ? (PromiseResultTraits8::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits8::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits8::IsOk(*p)) { @@ -4041,23 +4068,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState9: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 10/11", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 10/11"; } auto result = prior.current_promise(); PromiseResult9* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 10/11 gets %s", this, - p != nullptr - ? (PromiseResultTraits9::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits9::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 10/11 gets " + << (p != nullptr + ? (PromiseResultTraits9::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits9::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits9::IsOk(*p)) { @@ -4074,15 +4101,15 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState10: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 11/11", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 11/11"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 11/11 gets %s", this, - result.ready() ? "ready" : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 11/11 gets " + << (result.ready() ? "ready" : "pending"); } auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; @@ -4490,24 +4517,24 @@ struct SeqState { Poll PollOnce() { switch (state) { case State::kState0: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 1/12", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/12"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 1/12 gets %s", this, - p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/12 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { @@ -4529,24 +4556,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 2/12", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/12"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 2/12 gets %s", this, - p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/12 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { @@ -4568,24 +4595,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 3/12", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/12"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .current_promise(); PromiseResult2* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 3/12 gets %s", this, - p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/12 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { @@ -4606,24 +4633,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 4/12", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/12"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 4/12 gets %s", this, - p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/12 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { @@ -4642,24 +4669,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 5/12", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/12"; } auto result = prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 5/12 gets %s", this, - p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/12 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { @@ -4677,23 +4704,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 6/12", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/12"; } auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 6/12 gets %s", this, - p != nullptr - ? (PromiseResultTraits5::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits5::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/12 gets " + << (p != nullptr + ? (PromiseResultTraits5::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits5::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits5::IsOk(*p)) { @@ -4710,23 +4737,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState6: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 7/12", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 7/12"; } auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult6* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 7/12 gets %s", this, - p != nullptr - ? (PromiseResultTraits6::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits6::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 7/12 gets " + << (p != nullptr + ? (PromiseResultTraits6::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits6::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits6::IsOk(*p)) { @@ -4743,23 +4770,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState7: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 8/12", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 8/12"; } auto result = prior.prior.prior.prior.current_promise(); PromiseResult7* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 8/12 gets %s", this, - p != nullptr - ? (PromiseResultTraits7::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits7::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 8/12 gets " + << (p != nullptr + ? (PromiseResultTraits7::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits7::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits7::IsOk(*p)) { @@ -4775,23 +4802,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState8: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 9/12", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 9/12"; } auto result = prior.prior.prior.current_promise(); PromiseResult8* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 9/12 gets %s", this, - p != nullptr - ? (PromiseResultTraits8::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits8::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 9/12 gets " + << (p != nullptr + ? (PromiseResultTraits8::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits8::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits8::IsOk(*p)) { @@ -4807,23 +4834,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState9: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 10/12", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 10/12"; } auto result = prior.prior.current_promise(); PromiseResult9* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 10/12 gets %s", this, - p != nullptr - ? (PromiseResultTraits9::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits9::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 10/12 gets " + << (p != nullptr + ? (PromiseResultTraits9::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits9::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits9::IsOk(*p)) { @@ -4839,23 +4866,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState10: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 11/12", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 11/12"; } auto result = prior.current_promise(); PromiseResult10* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 11/12 gets %s", this, - p != nullptr - ? (PromiseResultTraits10::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits10::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 11/12 gets " + << (p != nullptr + ? (PromiseResultTraits10::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits10::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits10::IsOk(*p)) { @@ -4872,15 +4899,15 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState11: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 12/12", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 12/12"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 12/12 gets %s", this, - result.ready() ? "ready" : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 12/12 gets " + << (result.ready() ? "ready" : "pending"); } auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; @@ -5329,24 +5356,24 @@ struct SeqState { Poll PollOnce() { switch (state) { case State::kState0: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 1/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/13"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 1/13 gets %s", this, - p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/13 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { @@ -5368,24 +5395,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 2/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/13"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 2/13 gets %s", this, - p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/13 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { @@ -5407,24 +5434,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 3/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/13"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 3/13 gets %s", this, - p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/13 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { @@ -5446,24 +5473,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 4/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/13"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .current_promise(); PromiseResult3* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 4/13 gets %s", this, - p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/13 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { @@ -5484,24 +5511,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 5/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/13"; } auto result = prior.prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 5/13 gets %s", this, - p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/13 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { @@ -5520,24 +5547,24 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 6/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/13"; } auto result = prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 6/13 gets %s", this, - p != nullptr - ? (PromiseResultTraits5::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits5::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/13 gets " + << (p != nullptr + ? (PromiseResultTraits5::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits5::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits5::IsOk(*p)) { @@ -5555,23 +5582,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState6: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 7/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 7/13"; } auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult6* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 7/13 gets %s", this, - p != nullptr - ? (PromiseResultTraits6::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits6::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 7/13 gets " + << (p != nullptr + ? (PromiseResultTraits6::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits6::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits6::IsOk(*p)) { @@ -5588,23 +5615,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState7: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 8/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 8/13"; } auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult7* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 8/13 gets %s", this, - p != nullptr - ? (PromiseResultTraits7::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits7::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 8/13 gets " + << (p != nullptr + ? (PromiseResultTraits7::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits7::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits7::IsOk(*p)) { @@ -5621,23 +5648,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState8: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 9/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 9/13"; } auto result = prior.prior.prior.prior.current_promise(); PromiseResult8* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 9/13 gets %s", this, - p != nullptr - ? (PromiseResultTraits8::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits8::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 9/13 gets " + << (p != nullptr + ? (PromiseResultTraits8::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits8::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits8::IsOk(*p)) { @@ -5653,23 +5680,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState9: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 10/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 10/13"; } auto result = prior.prior.prior.current_promise(); PromiseResult9* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 10/13 gets %s", this, - p != nullptr - ? (PromiseResultTraits9::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits9::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 10/13 gets " + << (p != nullptr + ? (PromiseResultTraits9::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits9::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits9::IsOk(*p)) { @@ -5685,23 +5712,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState10: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 11/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 11/13"; } auto result = prior.prior.current_promise(); PromiseResult10* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 11/13 gets %s", this, - p != nullptr - ? (PromiseResultTraits10::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits10::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 11/13 gets " + << (p != nullptr + ? (PromiseResultTraits10::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits10::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits10::IsOk(*p)) { @@ -5717,23 +5744,23 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState11: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 12/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 12/13"; } auto result = prior.current_promise(); PromiseResult11* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log( - whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 12/13 gets %s", this, - p != nullptr - ? (PromiseResultTraits11::IsOk(*p) - ? "ready" - : absl::StrCat("early-error:", - PromiseResultTraits11::ErrorString(*p)) - .c_str()) - : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 12/13 gets " + << (p != nullptr + ? (PromiseResultTraits11::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits11::ErrorString(*p)) + .c_str()) + : "pending"); } if (p == nullptr) return Pending{}; if (!PromiseResultTraits11::IsOk(*p)) { @@ -5750,15 +5777,15 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState12: { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: begin poll step 13/13", this); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 13/13"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(whence.file(), whence.line(), GPR_LOG_SEVERITY_INFO, - "seq[%p]: poll step 13/13 gets %s", this, - result.ready() ? "ready" : "pending"); + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 13/13 gets " + << (result.ready() ? "ready" : "pending"); } auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; diff --git a/src/core/lib/promise/for_each.h b/src/core/lib/promise/for_each.h index 80d066a18dc..4aefd1a3088 100644 --- a/src/core/lib/promise/for_each.h +++ b/src/core/lib/promise/for_each.h @@ -27,13 +27,13 @@ #include #include +#include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/construct_destruct.h" #include "src/core/lib/promise/activity.h" #include "src/core/lib/promise/detail/promise_factory.h" #include "src/core/lib/promise/detail/status.h" #include "src/core/lib/promise/poll.h" #include "src/core/lib/promise/status_flag.h" -#include "src/core/lib/promise/trace.h" namespace grpc_core { @@ -164,14 +164,14 @@ class ForEach { } Poll PollReaderNext() { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%s PollReaderNext", DebugTag().c_str()); } auto r = reader_next_(); if (auto* p = r.value_if_ready()) { switch (NextValueTraits::Type(*p)) { case NextValueType::kValue: { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%s PollReaderNext: got value", DebugTag().c_str()); } @@ -183,14 +183,14 @@ class ForEach { return PollAction(); } case NextValueType::kEndOfStream: { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%s PollReaderNext: got end of stream", DebugTag().c_str()); } return Done::Make(false); } case NextValueType::kError: { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%s PollReaderNext: got error", DebugTag().c_str()); } @@ -202,7 +202,7 @@ class ForEach { } Poll PollAction() { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%s PollAction", DebugTag().c_str()); } auto r = in_action_.promise(); diff --git a/src/core/lib/promise/inter_activity_latch.h b/src/core/lib/promise/inter_activity_latch.h index b6465af0700..b27b481aade 100644 --- a/src/core/lib/promise/inter_activity_latch.h +++ b/src/core/lib/promise/inter_activity_latch.h @@ -25,10 +25,10 @@ #include #include +#include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/promise/activity.h" #include "src/core/lib/promise/poll.h" -#include "src/core/lib/promise/trace.h" #include "src/core/lib/promise/wait_set.h" namespace grpc_core { @@ -45,7 +45,7 @@ class InterActivityLatch { auto Wait() { return [this]() -> Poll { MutexLock lock(&mu_); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%sPollWait %s", DebugTag().c_str(), StateString().c_str()); } @@ -61,7 +61,7 @@ class InterActivityLatch { // Set the latch. void Set(T value) { MutexLock lock(&mu_); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%sSet %s", DebugTag().c_str(), StateString().c_str()); } is_set_ = true; @@ -103,7 +103,7 @@ class InterActivityLatch { auto Wait() { return [this]() -> Poll { MutexLock lock(&mu_); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%sPollWait %s", DebugTag().c_str(), StateString().c_str()); } @@ -119,7 +119,7 @@ class InterActivityLatch { // Set the latch. void Set() { MutexLock lock(&mu_); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%sSet %s", DebugTag().c_str(), StateString().c_str()); } is_set_ = true; diff --git a/src/core/lib/promise/interceptor_list.h b/src/core/lib/promise/interceptor_list.h index da44df51b71..fe5bac1a4d5 100644 --- a/src/core/lib/promise/interceptor_list.h +++ b/src/core/lib/promise/interceptor_list.h @@ -35,7 +35,6 @@ #include "src/core/lib/promise/context.h" #include "src/core/lib/promise/detail/promise_factory.h" #include "src/core/lib/promise/poll.h" -#include "src/core/lib/promise/trace.h" #include "src/core/lib/resource_quota/arena.h" namespace grpc_core { @@ -88,7 +87,7 @@ class InterceptorList { public: RunPromise(size_t memory_required, Map** factory, absl::optional value) { if (!value.has_value() || *factory == nullptr) { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_DEBUG, "InterceptorList::RunPromise[%p]: create immediate", this); } @@ -101,7 +100,7 @@ class InterceptorList { async_resolution_.space.get()); async_resolution_.current_factory = *factory; async_resolution_.first_factory = factory; - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_DEBUG, "InterceptorList::RunPromise[%p]: create async; mem=%p", this, async_resolution_.space.get()); @@ -110,7 +109,7 @@ class InterceptorList { } ~RunPromise() { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_DEBUG, "InterceptorList::RunPromise[%p]: destroy", this); } if (is_immediately_resolved_) { @@ -129,7 +128,7 @@ class InterceptorList { RunPromise(RunPromise&& other) noexcept : is_immediately_resolved_(other.is_immediately_resolved_) { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_DEBUG, "InterceptorList::RunPromise[%p]: move from %p", this, &other); } @@ -143,7 +142,7 @@ class InterceptorList { RunPromise& operator=(RunPromise&& other) noexcept = delete; Poll> operator()() { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_DEBUG, "InterceptorList::RunPromise[%p]: %s", this, DebugString().c_str()); } @@ -161,7 +160,7 @@ class InterceptorList { async_resolution_.current_factory = async_resolution_.current_factory->next(); if (!p->has_value()) async_resolution_.current_factory = nullptr; - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_DEBUG, "InterceptorList::RunPromise[%p]: %s", this, DebugString().c_str()); } diff --git a/src/core/lib/promise/latch.h b/src/core/lib/promise/latch.h index 221793e7cd0..5504d10f132 100644 --- a/src/core/lib/promise/latch.h +++ b/src/core/lib/promise/latch.h @@ -27,9 +27,9 @@ #include #include +#include "src/core/lib/debug/trace.h" #include "src/core/lib/promise/activity.h" #include "src/core/lib/promise/poll.h" -#include "src/core/lib/promise/trace.h" namespace grpc_core { @@ -67,7 +67,7 @@ class Latch { has_had_waiters_ = true; #endif return [this]() -> Poll { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%sWait %s", DebugTag().c_str(), StateString().c_str()); } @@ -86,7 +86,7 @@ class Latch { has_had_waiters_ = true; #endif return [this]() -> Poll { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%sWaitAndCopy %s", DebugTag().c_str(), StateString().c_str()); } @@ -100,7 +100,7 @@ class Latch { // Set the value of the latch. Can only be called once. void Set(T value) { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%sSet %s", DebugTag().c_str(), StateString().c_str()); } DCHECK(!has_value_); @@ -163,7 +163,7 @@ class Latch { has_had_waiters_ = true; #endif return [this]() -> Poll { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%sPollWait %s", DebugTag().c_str(), StateString().c_str()); } @@ -177,7 +177,7 @@ class Latch { // Set the latch. Can only be called once. void Set() { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%sSet %s", DebugTag().c_str(), StateString().c_str()); } DCHECK(!is_set_); @@ -226,7 +226,7 @@ class ExternallyObservableLatch { // Produce a promise to wait for this latch. auto Wait() { return [this]() -> Poll { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%sPollWait %s", DebugTag().c_str(), StateString().c_str()); } @@ -240,7 +240,7 @@ class ExternallyObservableLatch { // Set the latch. void Set() { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%sSet %s", DebugTag().c_str(), StateString().c_str()); } is_set_.store(true, std::memory_order_relaxed); @@ -250,7 +250,7 @@ class ExternallyObservableLatch { bool IsSet() const { return is_set_.load(std::memory_order_relaxed); } void Reset() { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%sReset %s", DebugTag().c_str(), StateString().c_str()); } diff --git a/src/core/lib/promise/map_pipe.h b/src/core/lib/promise/map_pipe.h index fef1f18994f..e2dc6a9ee6e 100644 --- a/src/core/lib/promise/map_pipe.h +++ b/src/core/lib/promise/map_pipe.h @@ -26,7 +26,6 @@ #include "src/core/lib/promise/map.h" #include "src/core/lib/promise/pipe.h" #include "src/core/lib/promise/poll.h" -#include "src/core/lib/promise/trace.h" #include "src/core/lib/promise/try_seq.h" namespace grpc_core { @@ -46,16 +45,12 @@ auto MapPipe(PipeReceiver src, PipeSender dst, Filter filter_factory) { dst = std::move(dst)](T t) mutable { return TrySeq( [] { - if (grpc_trace_promise_primitives.enabled()) { - VLOG(2) << "MapPipe: start map"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) << "MapPipe: start map"; return Empty{}; }, filter_factory.Make(std::move(t)), [&dst](T t) { - if (grpc_trace_promise_primitives.enabled()) { - VLOG(2) << "MapPipe: start push"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) << "MapPipe: start push"; return Map(dst.Push(std::move(t)), [](bool successful_push) { if (successful_push) { return absl::OkStatus(); diff --git a/src/core/lib/promise/party.cc b/src/core/lib/promise/party.cc index 58931d978d4..5a14f235cf4 100644 --- a/src/core/lib/promise/party.cc +++ b/src/core/lib/promise/party.cc @@ -26,15 +26,12 @@ #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/promise/activity.h" -#include "src/core/lib/promise/trace.h" #ifdef GRPC_MAXIMIZE_THREADYNESS #include "src/core/lib/gprpp/thd.h" // IWYU pragma: keep #include "src/core/lib/iomgr/exec_ctx.h" // IWYU pragma: keep #endif -grpc_core::DebugOnlyTraceFlag grpc_trace_party_state(false, "party_state"); - namespace grpc_core { namespace { @@ -273,14 +270,14 @@ bool Party::RunOneParticipant(int i) { // somewhere. auto* participant = participants_[i].load(std::memory_order_acquire); if (participant == nullptr) { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%s[party] wakeup %d already complete", DebugTag().c_str(), i); } return false; } absl::string_view name; - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { name = participant->name(); gpr_log(GPR_INFO, "%s[%s] begin job %d", DebugTag().c_str(), std::string(name).c_str(), i); @@ -306,7 +303,7 @@ void Party::AddParticipants(Participant** participants, size_t count) { bool run_party = sync_.AddParticipantsAndRef(count, [this, participants, count](size_t* slots) { for (size_t i = 0; i < count; i++) { - if (grpc_trace_party_state.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(party_state)) { gpr_log(GPR_INFO, "Party %p AddParticipant: %s @ %" PRIdPTR " [participant=%p]", diff --git a/src/core/lib/promise/party.h b/src/core/lib/promise/party.h index 9b0aedd2fe9..6a1894ff2bf 100644 --- a/src/core/lib/promise/party.h +++ b/src/core/lib/promise/party.h @@ -31,6 +31,7 @@ #include #include +#include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/construct_destruct.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/ref_counted.h" @@ -40,7 +41,6 @@ #include "src/core/lib/promise/context.h" #include "src/core/lib/promise/detail/promise_factory.h" #include "src/core/lib/promise/poll.h" -#include "src/core/lib/promise/trace.h" // Two implementations of party synchronization are provided: one using a single // atomic, the other using a mutex and a set of state variables. @@ -52,8 +52,6 @@ // There's a thought of fuzzing the two implementations against each other as // a correctness check of both, but that's not implemented yet. -extern grpc_core::DebugOnlyTraceFlag grpc_trace_party_state; - #define GRPC_PARTY_SYNC_USING_ATOMICS // #define GRPC_PARTY_SYNC_USING_MUTEX @@ -231,7 +229,7 @@ class PartySyncUsingAtomics { void LogStateChange(const char* op, uint64_t prev_state, uint64_t new_state, DebugLocation loc = {}) { - if (grpc_trace_party_state.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(party_state)) { gpr_log(loc.file(), loc.line(), GPR_LOG_SEVERITY_INFO, "Party %p %30s: %016" PRIx64 " -> %016" PRIx64, this, op, prev_state, new_state); @@ -646,11 +644,9 @@ struct ContextSubclass { template void Party::BulkSpawner::Spawn(absl::string_view name, Factory promise_factory, OnComplete on_complete) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_INFO, "%s[bulk_spawn] On %p queue %s (%" PRIdPTR " bytes)", - party_->DebugTag().c_str(), this, std::string(name).c_str(), - sizeof(ParticipantImpl)); - } + GRPC_TRACE_LOG(promise_primitives, INFO) + << party_->DebugTag() << "[bulk_spawn] On " << this << " queue " << name + << " (" << sizeof(ParticipantImpl) << " bytes)"; participants_[num_participants_++] = new ParticipantImpl( name, std::move(promise_factory), std::move(on_complete)); } diff --git a/src/core/lib/promise/pipe.h b/src/core/lib/promise/pipe.h index 570f59e77a1..9c896682fec 100644 --- a/src/core/lib/promise/pipe.h +++ b/src/core/lib/promise/pipe.h @@ -40,7 +40,6 @@ #include "src/core/lib/promise/map.h" #include "src/core/lib/promise/poll.h" #include "src/core/lib/promise/seq.h" -#include "src/core/lib/promise/trace.h" #include "src/core/lib/resource_quota/arena.h" namespace grpc_core { @@ -119,9 +118,8 @@ class Center : public InterceptorList { // Add one ref to this object, and return this. void IncrementRefCount() { - if (grpc_trace_promise_primitives.enabled()) { - VLOG(2) << DebugOpString("IncrementRefCount"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + << DebugOpString("IncrementRefCount"); refs_++; DCHECK_NE(refs_, 0); } @@ -134,9 +132,7 @@ class Center : public InterceptorList { // Drop a ref // If no refs remain, destroy this object void Unref() { - if (grpc_trace_promise_primitives.enabled()) { - VLOG(2) << DebugOpString("Unref"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) << DebugOpString("Unref"); DCHECK_GT(refs_, 0); refs_--; if (0 == refs_) { @@ -149,9 +145,7 @@ class Center : public InterceptorList { // Return true if the value was pushed. // Return false if the recv end is closed. Poll Push(T* value) { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO) << DebugOpString("Push"); - } + GRPC_TRACE_LOG(promise_primitives, INFO) << DebugOpString("Push"); DCHECK_NE(refs_, 0); switch (value_state_) { case ValueState::kClosed: @@ -173,9 +167,7 @@ class Center : public InterceptorList { } Poll PollAck() { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO) << DebugOpString("PollAck"); - } + GRPC_TRACE_LOG(promise_primitives, INFO) << DebugOpString("PollAck"); DCHECK_NE(refs_, 0); switch (value_state_) { case ValueState::kClosed: @@ -201,9 +193,7 @@ class Center : public InterceptorList { // Return the value if one was retrieved. // Return nullopt if the send end is closed and no value had been pushed. Poll> Next() { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO) << DebugOpString("Next"); - } + GRPC_TRACE_LOG(promise_primitives, INFO) << DebugOpString("Next"); DCHECK_NE(refs_, 0); switch (value_state_) { case ValueState::kEmpty: @@ -227,9 +217,8 @@ class Center : public InterceptorList { // Check if the pipe is closed for sending (if there is a value still queued // but the pipe is closed, reports closed). Poll PollClosedForSender() { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO) << DebugOpString("PollClosedForSender"); - } + GRPC_TRACE_LOG(promise_primitives, INFO) + << DebugOpString("PollClosedForSender"); DCHECK_NE(refs_, 0); switch (value_state_) { case ValueState::kEmpty: @@ -250,9 +239,8 @@ class Center : public InterceptorList { // Check if the pipe is closed for receiving (if there is a value still queued // but the pipe is closed, reports open). Poll PollClosedForReceiver() { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO) << DebugOpString("PollClosedForReceiver"); - } + GRPC_TRACE_LOG(promise_primitives, INFO) + << DebugOpString("PollClosedForReceiver"); DCHECK_NE(refs_, 0); switch (value_state_) { case ValueState::kEmpty: @@ -271,9 +259,7 @@ class Center : public InterceptorList { } Poll PollEmpty() { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO) << DebugOpString("PollEmpty"); - } + GRPC_TRACE_LOG(promise_primitives, INFO) << DebugOpString("PollEmpty"); DCHECK_NE(refs_, 0); switch (value_state_) { case ValueState::kReady: @@ -291,9 +277,7 @@ class Center : public InterceptorList { } void AckNext() { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO) << DebugOpString("AckNext"); - } + GRPC_TRACE_LOG(promise_primitives, INFO) << DebugOpString("AckNext"); switch (value_state_) { case ValueState::kReady: case ValueState::kWaitingForAck: @@ -318,9 +302,7 @@ class Center : public InterceptorList { } void MarkClosed() { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO) << DebugOpString("MarkClosed"); - } + GRPC_TRACE_LOG(promise_primitives, INFO) << DebugOpString("MarkClosed"); switch (value_state_) { case ValueState::kEmpty: case ValueState::kAcked: @@ -347,9 +329,7 @@ class Center : public InterceptorList { } void MarkCancelled() { - if (grpc_trace_promise_primitives.enabled()) { - LOG(INFO) << DebugOpString("MarkCancelled"); - } + GRPC_TRACE_LOG(promise_primitives, INFO) << DebugOpString("MarkCancelled"); switch (value_state_) { case ValueState::kEmpty: case ValueState::kAcked: @@ -655,7 +635,7 @@ class Push { Poll operator()() { if (center_ == nullptr) { - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_DEBUG, "%s Pipe push has a null center", GetContext()->DebugTag().c_str()); } diff --git a/src/core/lib/promise/trace.cc b/src/core/lib/promise/trace.cc deleted file mode 100644 index 603f69f1da1..00000000000 --- a/src/core/lib/promise/trace.cc +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2022 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "src/core/lib/promise/trace.h" - -#include - -grpc_core::DebugOnlyTraceFlag grpc_trace_promise_primitives( - false, "promise_primitives"); diff --git a/src/core/lib/promise/trace.h b/src/core/lib/promise/trace.h deleted file mode 100644 index de66138fec6..00000000000 --- a/src/core/lib/promise/trace.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2022 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_SRC_CORE_LIB_PROMISE_TRACE_H -#define GRPC_SRC_CORE_LIB_PROMISE_TRACE_H - -#include - -#include "src/core/lib/debug/trace.h" - -extern grpc_core::DebugOnlyTraceFlag grpc_trace_promise_primitives; - -#endif // GRPC_SRC_CORE_LIB_PROMISE_TRACE_H diff --git a/src/core/lib/resource_quota/memory_quota.cc b/src/core/lib/resource_quota/memory_quota.cc index 458597da5da..76eb6fb3959 100644 --- a/src/core/lib/resource_quota/memory_quota.cc +++ b/src/core/lib/resource_quota/memory_quota.cc @@ -40,7 +40,6 @@ #include "src/core/lib/promise/map.h" #include "src/core/lib/promise/race.h" #include "src/core/lib/promise/seq.h" -#include "src/core/lib/resource_quota/trace.h" #include "src/core/lib/slice/slice_refcount.h" #include "src/core/util/useful.h" @@ -355,7 +354,7 @@ void GrpcMemoryAllocatorImpl::MaybeDonateBack() { if (free_bytes_.compare_exchange_weak(free, new_free, std::memory_order_acq_rel, std::memory_order_acquire)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { gpr_log(GPR_INFO, "[%p] Early return %" PRIdPTR " bytes", this, ret); } CHECK(taken_bytes_.fetch_sub(ret, std::memory_order_relaxed) >= ret); @@ -450,7 +449,7 @@ void BasicMemoryQuota::Start() { [self]( std::tuple> arg) { auto reclaimer = std::move(std::get<1>(arg)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { double free = std::max(intptr_t{0}, self->free_bytes_.load()); size_t quota_size = self->quota_size_.load(); gpr_log(GPR_INFO, @@ -533,7 +532,7 @@ void BasicMemoryQuota::FinishReclamation(uint64_t token, Waker waker) { if (reclamation_counter_.compare_exchange_strong(current, current + 1, std::memory_order_relaxed, std::memory_order_relaxed)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { double free = std::max(intptr_t{0}, free_bytes_.load()); size_t quota_size = quota_size_.load(); gpr_log(GPR_INFO, @@ -550,7 +549,7 @@ void BasicMemoryQuota::Return(size_t amount) { } void BasicMemoryQuota::AddNewAllocator(GrpcMemoryAllocatorImpl* allocator) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { gpr_log(GPR_INFO, "Adding allocator %p", allocator); } @@ -563,7 +562,7 @@ void BasicMemoryQuota::AddNewAllocator(GrpcMemoryAllocatorImpl* allocator) { } void BasicMemoryQuota::RemoveAllocator(GrpcMemoryAllocatorImpl* allocator) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { gpr_log(GPR_INFO, "Removing allocator %p", allocator); } @@ -610,7 +609,7 @@ void BasicMemoryQuota::MaybeMoveAllocator(GrpcMemoryAllocatorImpl* allocator, void BasicMemoryQuota::MaybeMoveAllocatorBigToSmall( GrpcMemoryAllocatorImpl* allocator) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { gpr_log(GPR_INFO, "Moving allocator %p to small", allocator); } @@ -631,7 +630,7 @@ void BasicMemoryQuota::MaybeMoveAllocatorBigToSmall( void BasicMemoryQuota::MaybeMoveAllocatorSmallToBig( GrpcMemoryAllocatorImpl* allocator) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { gpr_log(GPR_INFO, "Moving allocator %p to big", allocator); } @@ -768,7 +767,7 @@ double PressureTracker::AddSampleAndGetControlValue(double sample) { } else { report = controller_.Update(current_estimate - kSetPoint); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { gpr_log(GPR_INFO, "RQ: pressure:%lf report:%lf controller:%s", current_estimate, report, controller_.DebugString().c_str()); } diff --git a/src/core/lib/resource_quota/memory_quota.h b/src/core/lib/resource_quota/memory_quota.h index 79de77cf793..4011d76f554 100644 --- a/src/core/lib/resource_quota/memory_quota.h +++ b/src/core/lib/resource_quota/memory_quota.h @@ -46,7 +46,6 @@ #include "src/core/lib/promise/activity.h" #include "src/core/lib/promise/poll.h" #include "src/core/lib/resource_quota/periodic_update.h" -#include "src/core/lib/resource_quota/trace.h" #include "src/core/util/useful.h" namespace grpc_core { @@ -426,7 +425,7 @@ class GrpcMemoryAllocatorImpl final : public EventEngineMemoryAllocatorImpl { void ReturnFree() { size_t ret = free_bytes_.exchange(0, std::memory_order_acq_rel); if (ret == 0) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(resource_quota)) { gpr_log(GPR_INFO, "Allocator %p returning %zu bytes to quota", this, ret); } taken_bytes_.fetch_sub(ret, std::memory_order_relaxed); diff --git a/src/core/lib/resource_quota/trace.cc b/src/core/lib/resource_quota/trace.cc deleted file mode 100644 index 056120d7691..00000000000 --- a/src/core/lib/resource_quota/trace.cc +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "src/core/lib/resource_quota/trace.h" - -#include - -grpc_core::TraceFlag grpc_resource_quota_trace(false, "resource_quota"); diff --git a/src/core/lib/resource_quota/trace.h b/src/core/lib/resource_quota/trace.h deleted file mode 100644 index 47e963f36a2..00000000000 --- a/src/core/lib/resource_quota/trace.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2021 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_SRC_CORE_LIB_RESOURCE_QUOTA_TRACE_H -#define GRPC_SRC_CORE_LIB_RESOURCE_QUOTA_TRACE_H - -#include - -#include "src/core/lib/debug/trace.h" - -extern grpc_core::TraceFlag grpc_resource_quota_trace; - -#endif // GRPC_SRC_CORE_LIB_RESOURCE_QUOTA_TRACE_H diff --git a/src/core/lib/security/authorization/grpc_authorization_policy_provider.cc b/src/core/lib/security/authorization/grpc_authorization_policy_provider.cc index 85de990fa88..12bb8b403aa 100644 --- a/src/core/lib/security/authorization/grpc_authorization_policy_provider.cc +++ b/src/core/lib/security/authorization/grpc_authorization_policy_provider.cc @@ -41,8 +41,6 @@ namespace grpc_core { -extern TraceFlag grpc_authz_trace; - absl::StatusOr> StaticDataAuthorizationPolicyProvider::Create(absl::string_view authz_policy) { auto policies_or = GenerateRbacPolicies(authz_policy); @@ -115,7 +113,7 @@ FileWatcherAuthorizationPolicyProvider::FileWatcherAuthorizationPolicyProvider( return; } absl::Status status = provider->ForceUpdate(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_trace) && !status.ok()) { + if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_api) && !status.ok()) { gpr_log(GPR_ERROR, "authorization policy reload status. code=%d error_details=%s", static_cast(status.code()), @@ -170,7 +168,7 @@ absl::Status FileWatcherAuthorizationPolicyProvider::ForceUpdate() { if (cb_ != nullptr) { cb_(contents_changed, absl::OkStatus()); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_api)) { gpr_log(GPR_INFO, "authorization policy reload status: successfully loaded new " "policy\n%s", diff --git a/src/core/lib/security/authorization/grpc_server_authz_filter.cc b/src/core/lib/security/authorization/grpc_server_authz_filter.cc index 7207b3897fa..176f49fdb78 100644 --- a/src/core/lib/security/authorization/grpc_server_authz_filter.cc +++ b/src/core/lib/security/authorization/grpc_server_authz_filter.cc @@ -36,8 +36,6 @@ namespace grpc_core { -TraceFlag grpc_authz_trace(false, "grpc_authz_api"); - const NoInterceptor GrpcServerAuthzFilter::Call::OnServerInitialMetadata; const NoInterceptor GrpcServerAuthzFilter::Call::OnServerTrailingMetadata; const NoInterceptor GrpcServerAuthzFilter::Call::OnClientToServerMessage; @@ -66,7 +64,7 @@ GrpcServerAuthzFilter::Create(const ChannelArgs& args, ChannelFilter::Args) { bool GrpcServerAuthzFilter::IsAuthorized(ClientMetadata& initial_metadata) { EvaluateArgs args(&initial_metadata, &per_channel_evaluate_args_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_api)) { gpr_log(GPR_DEBUG, "checking request: url_path=%s, transport_security_type=%s, " "uri_sans=[%s], dns_sans=[%s], subject=%s", @@ -82,7 +80,7 @@ bool GrpcServerAuthzFilter::IsAuthorized(ClientMetadata& initial_metadata) { AuthorizationEngine::Decision decision = engines.deny_engine->Evaluate(args); if (decision.type == AuthorizationEngine::Decision::Type::kDeny) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_api)) { gpr_log(GPR_INFO, "chand=%p: request denied by policy %s.", this, decision.matching_policy_name.c_str()); } @@ -93,14 +91,14 @@ bool GrpcServerAuthzFilter::IsAuthorized(ClientMetadata& initial_metadata) { AuthorizationEngine::Decision decision = engines.allow_engine->Evaluate(args); if (decision.type == AuthorizationEngine::Decision::Type::kAllow) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_api)) { gpr_log(GPR_DEBUG, "chand=%p: request allowed by policy %s.", this, decision.matching_policy_name.c_str()); } return true; } } - if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(grpc_authz_api)) { gpr_log(GPR_INFO, "chand=%p: request denied, no matching policy found.", this); } diff --git a/src/core/lib/security/context/security_context.cc b/src/core/lib/security/context/security_context.cc index bbbd8365207..78c220274b7 100644 --- a/src/core/lib/security/context/security_context.cc +++ b/src/core/lib/security/context/security_context.cc @@ -33,6 +33,7 @@ #include #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/resource_quota/arena.h" @@ -40,9 +41,6 @@ #include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/call.h" -grpc_core::DebugOnlyTraceFlag grpc_trace_auth_context_refcount( - false, "auth_context_refcount"); - // --- grpc_call --- grpc_call_error grpc_call_set_credentials(grpc_call* call, diff --git a/src/core/lib/security/context/security_context.h b/src/core/lib/security/context/security_context.h index b583c4b36ab..7240ba955bd 100644 --- a/src/core/lib/security/context/security_context.h +++ b/src/core/lib/security/context/security_context.h @@ -40,8 +40,6 @@ #include "src/core/lib/security/credentials/credentials.h" // IWYU pragma: keep #include "src/core/util/useful.h" -extern grpc_core::DebugOnlyTraceFlag grpc_trace_auth_context_refcount; - // --- grpc_auth_context --- // High level authentication context object. Can optionally be chained. @@ -74,7 +72,7 @@ struct grpc_auth_context grpc_core::RefCountedPtr chained) : grpc_core::RefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_trace_auth_context_refcount) + GRPC_TRACE_FLAG_ENABLED(auth_context_refcount) ? "auth_context_refcount" : nullptr), chained_(std::move(chained)) { diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.cc b/src/core/lib/security/credentials/jwt/jwt_credentials.cc index 398a898f2b2..132b7086309 100644 --- a/src/core/lib/security/credentials/jwt/jwt_credentials.cc +++ b/src/core/lib/security/credentials/jwt/jwt_credentials.cc @@ -156,7 +156,7 @@ static char* redact_private_key(const char* json_key) { grpc_call_credentials* grpc_service_account_jwt_access_credentials_create( const char* json_key, gpr_timespec token_lifetime, void* reserved) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(api)) { char* clean_json = redact_private_key(json_key); gpr_log(GPR_INFO, "grpc_service_account_jwt_access_credentials_create(" diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc index 834dae28305..728428b8074 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc @@ -513,7 +513,7 @@ grpc_call_credentials* grpc_google_refresh_token_credentials_create( const char* json_refresh_token, void* reserved) { grpc_auth_refresh_token token = grpc_auth_refresh_token_create_from_string(json_refresh_token); - if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(api)) { gpr_log(GPR_INFO, "grpc_refresh_token_credentials_create(json_refresh_token=%s, " "reserved=%p)", diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.cc b/src/core/lib/security/credentials/plugin/plugin_credentials.cc index f31b422a93f..a6474c06c65 100644 --- a/src/core/lib/security/credentials/plugin/plugin_credentials.cc +++ b/src/core/lib/security/credentials/plugin/plugin_credentials.cc @@ -40,8 +40,6 @@ #include "src/core/lib/surface/validate_metadata.h" #include "src/core/lib/transport/metadata_batch.h" -grpc_core::TraceFlag grpc_plugin_credentials_trace(false, "plugin_credentials"); - grpc_plugin_credentials::~grpc_plugin_credentials() { if (plugin_.state != nullptr && plugin_.destroy != nullptr) { plugin_.destroy(plugin_.state); @@ -125,7 +123,7 @@ void grpc_plugin_credentials::PendingRequest::RequestMetadataReady( GRPC_EXEC_CTX_FLAG_THREAD_RESOURCE_LOOP); grpc_core::RefCountedPtr r( static_cast(request)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(plugin_credentials)) { gpr_log(GPR_INFO, "plugin_credentials[%p]: request %p: plugin returned " "asynchronously", @@ -156,7 +154,7 @@ grpc_plugin_credentials::GetRequestMetadata( RefAsSubclass(), std::move(initial_metadata), args); // Invoke the plugin. The callback holds a ref to us. - if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(plugin_credentials)) { gpr_log(GPR_INFO, "plugin_credentials[%p]: request %p: invoking plugin", this, request.get()); } @@ -174,7 +172,7 @@ grpc_plugin_credentials::GetRequestMetadata( child_request.get(), creds_md, &num_creds_md, &status, &error_details)) { child_request.release(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(plugin_credentials)) { gpr_log(GPR_INFO, "plugin_credentials[%p]: request %p: plugin will return " "asynchronously", @@ -183,7 +181,7 @@ grpc_plugin_credentials::GetRequestMetadata( return [request] { return request->PollAsyncResult(); }; } // Synchronous return. - if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(plugin_credentials)) { gpr_log(GPR_INFO, "plugin_credentials[%p]: request %p: plugin returned " "synchronously", diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.h b/src/core/lib/security/credentials/plugin/plugin_credentials.h index a81dd171202..b1f6710af13 100644 --- a/src/core/lib/security/credentials/plugin/plugin_credentials.h +++ b/src/core/lib/security/credentials/plugin/plugin_credentials.h @@ -48,8 +48,6 @@ #include "src/core/lib/transport/transport.h" #include "src/core/util/useful.h" -extern grpc_core::TraceFlag grpc_plugin_credentials_trace; - // This type is forward declared as a C struct and we cannot define it as a // class. Otherwise, compiler will complain about type mismatch due to // -Wmismatched-tags. diff --git a/src/core/lib/security/security_connector/security_connector.cc b/src/core/lib/security/security_connector/security_connector.cc index 3090ba61928..4e3f041d2ee 100644 --- a/src/core/lib/security/security_connector/security_connector.cc +++ b/src/core/lib/security/security_connector/security_connector.cc @@ -32,9 +32,6 @@ #include "src/core/lib/security/credentials/credentials.h" #include "src/core/util/useful.h" -grpc_core::DebugOnlyTraceFlag grpc_trace_security_connector_refcount( - false, "security_connector_refcount"); - grpc_channel_security_connector::grpc_channel_security_connector( absl::string_view url_scheme, grpc_core::RefCountedPtr channel_creds, diff --git a/src/core/lib/security/security_connector/security_connector.h b/src/core/lib/security/security_connector/security_connector.h index 38b90956b7b..1a8e7a67b76 100644 --- a/src/core/lib/security/security_connector/security_connector.h +++ b/src/core/lib/security/security_connector/security_connector.h @@ -42,8 +42,6 @@ #include "src/core/lib/promise/arena_promise.h" #include "src/core/tsi/transport_security_interface.h" -extern grpc_core::DebugOnlyTraceFlag grpc_trace_security_connector_refcount; - // --- URL schemes. --- #define GRPC_SSL_URL_SCHEME "https" @@ -63,7 +61,7 @@ class grpc_security_connector public: explicit grpc_security_connector(absl::string_view url_scheme) : grpc_core::RefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_trace_security_connector_refcount) + GRPC_TRACE_FLAG_ENABLED(security_connector_refcount) ? "security_connector_refcount" : nullptr), url_scheme_(url_scheme) {} diff --git a/src/core/lib/security/transport/server_auth_filter.cc b/src/core/lib/security/transport/server_auth_filter.cc index 9f1f19ebf91..15a5e0d15fe 100644 --- a/src/core/lib/security/transport/server_auth_filter.cc +++ b/src/core/lib/security/transport/server_auth_filter.cc @@ -56,7 +56,6 @@ #include "src/core/lib/security/transport/auth_filters.h" // IWYU pragma: keep #include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_internal.h" -#include "src/core/lib/surface/call_trace.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" @@ -133,7 +132,7 @@ struct ServerAuthFilter::RunApplicationCode::State { ServerAuthFilter::RunApplicationCode::RunApplicationCode( ServerAuthFilter* filter, ClientMetadata& metadata) : state_(GetContext()->ManagedNew(metadata)) { - if (grpc_call_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(call)) { gpr_log(GPR_ERROR, "%s[server-auth]: Delegate to application: filter=%p this=%p " "auth_ctx=%p", diff --git a/src/core/lib/slice/slice_refcount.cc b/src/core/lib/slice/slice_refcount.cc deleted file mode 100644 index 3bba7d75bda..00000000000 --- a/src/core/lib/slice/slice_refcount.cc +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "src/core/lib/slice/slice_refcount.h" - -#include - -grpc_core::DebugOnlyTraceFlag grpc_slice_refcount_trace(false, - "slice_refcount"); diff --git a/src/core/lib/slice/slice_refcount.h b/src/core/lib/slice/slice_refcount.h index aa1c6d146b3..ec4061ab91d 100644 --- a/src/core/lib/slice/slice_refcount.h +++ b/src/core/lib/slice/slice_refcount.h @@ -26,8 +26,6 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/debug_location.h" -extern GRPC_DLL grpc_core::DebugOnlyTraceFlag grpc_slice_refcount_trace; - // grpc_slice_refcount : A reference count for grpc_slice. struct grpc_slice_refcount { public: @@ -49,14 +47,14 @@ struct grpc_slice_refcount { void Ref(grpc_core::DebugLocation location) { auto prev_refs = ref_.fetch_add(1, std::memory_order_relaxed); - if (grpc_slice_refcount_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(slice_refcount)) { gpr_log(location.file(), location.line(), GPR_LOG_SEVERITY_INFO, "REF %p %" PRIdPTR "->%" PRIdPTR, this, prev_refs, prev_refs + 1); } } void Unref(grpc_core::DebugLocation location) { auto prev_refs = ref_.fetch_sub(1, std::memory_order_acq_rel); - if (grpc_slice_refcount_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(slice_refcount)) { gpr_log(location.file(), location.line(), GPR_LOG_SEVERITY_INFO, "UNREF %p %" PRIdPTR "->%" PRIdPTR, this, prev_refs, prev_refs - 1); diff --git a/src/core/lib/surface/api_trace.cc b/src/core/lib/surface/api_trace.cc deleted file mode 100644 index 16fd62b7596..00000000000 --- a/src/core/lib/surface/api_trace.cc +++ /dev/null @@ -1,25 +0,0 @@ -// -// -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// - -#include "src/core/lib/surface/api_trace.h" - -#include - -#include "src/core/lib/debug/trace.h" - -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 1e08e5367c2..1ea6a8a4156 100644 --- a/src/core/lib/surface/api_trace.h +++ b/src/core/lib/surface/api_trace.h @@ -24,8 +24,6 @@ #include "src/core/lib/debug/trace.h" -extern grpc_core::TraceFlag grpc_api_trace; - // Provide unwrapping macros because we're in C89 and variadic macros weren't // introduced until C99... #define GRPC_API_TRACE_UNWRAP0() @@ -45,7 +43,7 @@ extern grpc_core::TraceFlag 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_TRACE_FLAG_ENABLED(grpc_api_trace)) { \ + if (GRPC_TRACE_FLAG_ENABLED(api)) { \ 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 bd62362559c..2d4129c1297 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -109,11 +109,6 @@ #include "src/core/util/time_precise.h" #include "src/core/util/useful.h" -grpc_core::TraceFlag grpc_call_error_trace(false, "call_error"); -grpc_core::TraceFlag grpc_compression_trace(false, "compression"); -grpc_core::TraceFlag grpc_call_trace(false, "call"); -grpc_core::DebugOnlyTraceFlag grpc_call_refcount_trace(false, "call_refcount"); - namespace grpc_core { // Alias to make this type available in Call implementation without a grpc_core @@ -312,7 +307,7 @@ void Call::ProcessIncomingInitialMetadata(grpc_metadata_batch& md) { // GRPC_COMPRESS_NONE is always set. DCHECK(encodings_accepted_by_peer_.IsSet(GRPC_COMPRESS_NONE)); if (GPR_UNLIKELY(!encodings_accepted_by_peer_.IsSet(compression_algorithm))) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(compression)) { HandleCompressionAlgorithmNotAccepted(compression_algorithm); } } @@ -343,7 +338,7 @@ void Call::HandleCompressionAlgorithmDisabled( void Call::UpdateDeadline(Timestamp deadline) { ReleasableMutexLock lock(&deadline_mu_); - if (grpc_call_trace.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(call)) { gpr_log(GPR_DEBUG, "[call %p] UpdateDeadline from=%s to=%s", this, deadline_.ToString().c_str(), deadline.ToString().c_str()); } @@ -377,10 +372,9 @@ void Call::ResetDeadline() { void Call::Run() { ApplicationCallbackExecCtx callback_exec_ctx; ExecCtx exec_ctx; - if (grpc_call_trace.enabled()) { - LOG(INFO) << "call deadline expired " - << GRPC_DUMP_ARGS(Timestamp::Now(), send_deadline_); - } + GRPC_TRACE_LOG(call, INFO) + << "call deadline expired " + << GRPC_DUMP_ARGS(Timestamp::Now(), send_deadline_); CancelWithError(grpc_error_set_int( absl::DeadlineExceededError("Deadline Exceeded"), StatusIntProperty::kRpcStatus, GRPC_STATUS_DEADLINE_EXCEEDED)); diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h index b824e38f602..37805d8c91b 100644 --- a/src/core/lib/surface/call.h +++ b/src/core/lib/surface/call.h @@ -276,11 +276,11 @@ void grpc_call_tracer_set(grpc_call* call, grpc_core::ClientCallTracer* tracer); void* grpc_call_tracer_get(grpc_call* call); -#define GRPC_CALL_LOG_BATCH(sev, ops, nops) \ - do { \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace)) { \ - grpc_call_log_batch(sev, ops, nops); \ - } \ +#define GRPC_CALL_LOG_BATCH(sev, ops, nops) \ + do { \ + if (GRPC_TRACE_FLAG_ENABLED(api)) { \ + grpc_call_log_batch(sev, ops, nops); \ + } \ } while (0) uint8_t grpc_call_is_client(grpc_call* call); @@ -298,7 +298,4 @@ bool grpc_call_is_trailers_only(const grpc_call* call); // Returns the authority for the call, as seen on the server side. absl::string_view grpc_call_server_authority(const grpc_call* call); -extern grpc_core::TraceFlag grpc_call_error_trace; -extern grpc_core::TraceFlag grpc_compression_trace; - #endif // GRPC_SRC_CORE_LIB_SURFACE_CALL_H diff --git a/src/core/lib/surface/call_trace.h b/src/core/lib/surface/call_trace.h deleted file mode 100644 index e9abf6707e8..00000000000 --- a/src/core/lib/surface/call_trace.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2022 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef GRPC_SRC_CORE_LIB_SURFACE_CALL_TRACE_H -#define GRPC_SRC_CORE_LIB_SURFACE_CALL_TRACE_H - -#include - -#include "src/core/lib/debug/trace.h" - -extern grpc_core::TraceFlag grpc_call_trace; - -#endif // GRPC_SRC_CORE_LIB_SURFACE_CALL_TRACE_H diff --git a/src/core/lib/surface/call_utils.cc b/src/core/lib/surface/call_utils.cc index e749e70d13a..4ffcf367316 100644 --- a/src/core/lib/surface/call_utils.cc +++ b/src/core/lib/surface/call_utils.cc @@ -123,11 +123,9 @@ const char* GrpcOpTypeName(grpc_op_type op) { // WaitForCqEndOp Poll WaitForCqEndOp::operator()() { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_INFO, "%sWaitForCqEndOp[%p] %s", - Activity::current()->DebugTag().c_str(), this, - StateString(state_).c_str()); - } + GRPC_TRACE_LOG(promise_primitives, INFO) + << Activity::current()->DebugTag() << "WaitForCqEndOp[" << this << "] " + << StateString(state_); if (auto* n = absl::get_if(&state_)) { if (n->is_closure) { ExecCtx::Run(DEBUG_LOCATION, static_cast(n->tag), @@ -178,23 +176,17 @@ std::string WaitForCqEndOp::StateString(const State& state) { StatusFlag MessageReceiver::FinishRecvMessage( ValueOrFailure> result) { if (!result.ok()) { - if (grpc_call_trace.enabled()) { - gpr_log(GPR_INFO, - "%s[call] RecvMessage: outstanding_recv " - "finishes: received end-of-stream with error", - Activity::current()->DebugTag().c_str()); - } + GRPC_TRACE_LOG(call, INFO) << Activity::current()->DebugTag() + << "[call] RecvMessage: outstanding_recv " + "finishes: received end-of-stream with error"; *recv_message_ = nullptr; recv_message_ = nullptr; return Failure{}; } if (!result->has_value()) { - if (grpc_call_trace.enabled()) { - gpr_log(GPR_INFO, - "%s[call] RecvMessage: outstanding_recv " - "finishes: received end-of-stream", - Activity::current()->DebugTag().c_str()); - } + GRPC_TRACE_LOG(call, INFO) << Activity::current()->DebugTag() + << "[call] RecvMessage: outstanding_recv " + "finishes: received end-of-stream"; *recv_message_ = nullptr; recv_message_ = nullptr; return Success{}; @@ -210,13 +202,11 @@ StatusFlag MessageReceiver::FinishRecvMessage( } grpc_slice_buffer_move_into(message->payload()->c_slice_buffer(), &(*recv_message_)->data.raw.slice_buffer); - if (grpc_call_trace.enabled()) { - gpr_log(GPR_INFO, - "%s[call] RecvMessage: outstanding_recv " - "finishes: received %" PRIdPTR " byte message", - Activity::current()->DebugTag().c_str(), - (*recv_message_)->data.raw.slice_buffer.length); - } + GRPC_TRACE_LOG(call, INFO) + << Activity::current()->DebugTag() + << "[call] RecvMessage: outstanding_recv " + "finishes: received " + << (*recv_message_)->data.raw.slice_buffer.length << " byte message"; recv_message_ = nullptr; return Success{}; } @@ -283,4 +273,4 @@ void EndOpImmediately(grpc_completion_queue* cq, void* notify_tag, } } -} // namespace grpc_core \ No newline at end of file +} // namespace grpc_core diff --git a/src/core/lib/surface/call_utils.h b/src/core/lib/surface/call_utils.h index ca71f2af168..a68fa4a5694 100644 --- a/src/core/lib/surface/call_utils.h +++ b/src/core/lib/surface/call_utils.h @@ -54,7 +54,6 @@ #include "src/core/lib/promise/poll.h" #include "src/core/lib/promise/seq.h" #include "src/core/lib/promise/status_flag.h" -#include "src/core/lib/surface/call_trace.h" #include "src/core/lib/surface/completion_queue.h" #include "src/core/lib/transport/message.h" #include "src/core/lib/transport/metadata.h" @@ -206,17 +205,13 @@ class OpHandlerImpl { } ABSL_FALLTHROUGH_INTENDED; case State::kPromise: { - if (grpc_call_trace.enabled()) { - gpr_log(GPR_INFO, "%sBeginPoll %s", - Activity::current()->DebugTag().c_str(), OpName()); - } + GRPC_TRACE_LOG(call, INFO) + << Activity::current()->DebugTag() << "BeginPoll " << OpName(); auto r = poll_cast(promise_()); - if (grpc_call_trace.enabled()) { - gpr_log( - GPR_INFO, "%sEndPoll %s --> %s", - Activity::current()->DebugTag().c_str(), OpName(), - r.pending() ? "PENDING" : (r.value().ok() ? "OK" : "FAILURE")); - } + GRPC_TRACE_LOG(call, INFO) + << Activity::current()->DebugTag() << "EndPoll " << OpName() + << " --> " + << (r.pending() ? "PENDING" : (r.value().ok() ? "OK" : "FAILURE")); return r; } } @@ -387,13 +382,10 @@ class PollBatchLogger { PollBatchLogger(void* tag, F f) : tag_(tag), f_(std::move(f)) {} auto operator()() { - if (grpc_call_trace.enabled()) { - gpr_log(GPR_INFO, "Poll batch %p", tag_); - } + GRPC_TRACE_LOG(call, INFO) << "Poll batch " << tag_; auto r = f_(); - if (grpc_call_trace.enabled()) { - gpr_log(GPR_INFO, "Poll batch %p --> %s", tag_, ResultString(r).c_str()); - } + GRPC_TRACE_LOG(call, INFO) + << "Poll batch " << tag_ << " --> " << ResultString(r); return r; } diff --git a/src/core/lib/surface/channel_init.cc b/src/core/lib/surface/channel_init.cc index 47863090030..4adb4241402 100644 --- a/src/core/lib/surface/channel_init.cc +++ b/src/core/lib/surface/channel_init.cc @@ -36,7 +36,6 @@ #include #include -#include "src/core/lib/channel/channel_stack_trace.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/sync.h" @@ -241,7 +240,7 @@ ChannelInit::StackConfig ChannelInit::BuildStackConfig( post_processor_functions.emplace_back(std::move(post_processors[i])); } // Log out the graph we built if that's been requested. - if (grpc_trace_channel_stack.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(channel_stack)) { // It can happen that multiple threads attempt to construct a core config at // once. // This is benign - the first one wins and others are discarded. diff --git a/src/core/lib/surface/client_call.cc b/src/core/lib/surface/client_call.cc index af7f34c9c60..6ca22f87b4d 100644 --- a/src/core/lib/surface/client_call.cc +++ b/src/core/lib/surface/client_call.cc @@ -54,7 +54,6 @@ #include "src/core/lib/promise/try_seq.h" #include "src/core/lib/resource_quota/arena.h" #include "src/core/lib/slice/slice_buffer.h" -#include "src/core/lib/surface/call_trace.h" #include "src/core/lib/surface/completion_queue.h" #include "src/core/lib/transport/metadata.h" #include "src/core/telemetry/stats.h" @@ -145,10 +144,8 @@ void ClientCall::CancelWithError(grpc_error_handle error) { cancel_status_.Set(new absl::Status(error)); auto cur_state = call_state_.load(std::memory_order_acquire); while (true) { - if (grpc_call_trace.enabled()) { - LOG(INFO) << DebugTag() << "CancelWithError " - << GRPC_DUMP_ARGS(cur_state, error); - } + GRPC_TRACE_LOG(call, INFO) + << DebugTag() << "CancelWithError " << GRPC_DUMP_ARGS(cur_state, error); switch (cur_state) { case kCancelled: return; @@ -341,10 +338,9 @@ void ClientCall::CommitBatch(const grpc_op* ops, size_t nops, void* notify_tag, [this, out_status, out_status_details, out_error_string, out_trailing_metadata]( ServerMetadataHandle server_trailing_metadata) { - if (grpc_call_trace.enabled()) { - LOG(INFO) << DebugTag() << "RecvStatusOnClient " - << server_trailing_metadata->DebugString(); - } + GRPC_TRACE_LOG(call, INFO) + << DebugTag() << "RecvStatusOnClient " + << server_trailing_metadata->DebugString(); const auto status = server_trailing_metadata->get(GrpcStatusMetadata()) .value_or(GRPC_STATUS_UNKNOWN); diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc index 1c77614f6fb..6619dd3bae7 100644 --- a/src/core/lib/surface/completion_queue.cc +++ b/src/core/lib/surface/completion_queue.cc @@ -61,10 +61,6 @@ #include "src/core/lib/experiments/experiments.h" #endif -grpc_core::TraceFlag grpc_trace_operation_failures(false, "op_failure"); -grpc_core::DebugOnlyTraceFlag grpc_trace_pending_tags(false, "pending_tags"); -grpc_core::DebugOnlyTraceFlag grpc_trace_cq_refcount(false, "cq_refcount"); - namespace { // Specifies a cq thread local cache. @@ -442,16 +438,14 @@ 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::TraceFlag grpc_cq_pluck_trace(false, "queue_pluck"); - -#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \ - do { \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) && \ - (GRPC_TRACE_FLAG_ENABLED(grpc_cq_pluck_trace) || \ - (event)->type != GRPC_QUEUE_TIMEOUT)) { \ - gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, \ - grpc_event_string(event).c_str()); \ - } \ +#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \ + do { \ + if (GRPC_TRACE_FLAG_ENABLED(api) && \ + (GRPC_TRACE_FLAG_ENABLED(queue_pluck) || \ + (event)->type != GRPC_QUEUE_TIMEOUT)) { \ + gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, \ + grpc_event_string(event).c_str()); \ + } \ } while (0) static void on_pollset_shutdown_done(void* arg, grpc_error_handle error); @@ -547,7 +541,7 @@ grpc_completion_queue* grpc_completion_queue_create_internal( // One for destroy(), one for pollset_shutdown new (&cq->owning_refs) grpc_core::RefCount( - 2, grpc_trace_cq_refcount.enabled() ? "completion_queue" : nullptr); + 2, GRPC_TRACE_FLAG_ENABLED(cq_refcount) ? "completion_queue" : nullptr); poller_vtable->init(POLLSET_FROM_CQ(cq), &cq->mu); vtable->init(DATA_FROM_CQ(cq), shutdown_callback); @@ -701,14 +695,14 @@ static void cq_end_op_for_next( grpc_completion_queue* cq, void* tag, grpc_error_handle error, void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg, grpc_cq_completion* storage, bool /*internal*/) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) || - (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) && !error.ok())) { + if (GRPC_TRACE_FLAG_ENABLED(api) || + (GRPC_TRACE_FLAG_ENABLED(op_failure) && !error.ok())) { std::string errmsg = grpc_core::StatusToString(error); GRPC_API_TRACE( "cq_end_op_for_next(cq=%p, tag=%p, error=%s, " "done=%p, done_arg=%p, storage=%p)", 6, (cq, tag, errmsg.c_str(), done, done_arg, storage)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) && !error.ok()) { + if (GRPC_TRACE_FLAG_ENABLED(op_failure) && !error.ok()) { gpr_log(GPR_INFO, "Operation failed: tag=%p, error=%s", tag, errmsg.c_str()); } @@ -775,14 +769,14 @@ static void cq_end_op_for_pluck( cq_pluck_data* cqd = static_cast DATA_FROM_CQ(cq); int is_success = (error.ok()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) || - (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) && !error.ok())) { + if (GRPC_TRACE_FLAG_ENABLED(api) || + (GRPC_TRACE_FLAG_ENABLED(op_failure) && !error.ok())) { std::string errmsg = grpc_core::StatusToString(error); GRPC_API_TRACE( "cq_end_op_for_pluck(cq=%p, tag=%p, error=%s, " "done=%p, done_arg=%p, storage=%p)", 6, (cq, tag, errmsg.c_str(), done, done_arg, storage)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) && !error.ok()) { + if (GRPC_TRACE_FLAG_ENABLED(op_failure) && !error.ok()) { gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag, errmsg.c_str()); } @@ -837,14 +831,14 @@ static void cq_end_op_for_callback( grpc_cq_completion* storage, bool internal) { cq_callback_data* cqd = static_cast DATA_FROM_CQ(cq); - if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) || - (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) && !error.ok())) { + if (GRPC_TRACE_FLAG_ENABLED(api) || + (GRPC_TRACE_FLAG_ENABLED(op_failure) && !error.ok())) { std::string errmsg = grpc_core::StatusToString(error); GRPC_API_TRACE( "cq_end_op_for_callback(cq=%p, tag=%p, error=%s, " "done=%p, done_arg=%p, storage=%p)", 6, (cq, tag, errmsg.c_str(), done, done_arg, storage)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) && !error.ok()) { + if (GRPC_TRACE_FLAG_ENABLED(op_failure) && !error.ok()) { gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag, errmsg.c_str()); } @@ -935,7 +929,7 @@ class ExecCtxNext : public grpc_core::ExecCtx { #ifndef NDEBUG static void dump_pending_tags(grpc_completion_queue* cq) { - if (!GRPC_TRACE_FLAG_ENABLED(grpc_trace_pending_tags)) return; + if (!GRPC_TRACE_FLAG_ENABLED(pending_tags)) return; std::vector parts; parts.push_back("PENDING TAGS:"); gpr_mu_lock(cq->mu); @@ -1197,7 +1191,7 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag, grpc_pollset_worker* worker = nullptr; cq_pluck_data* cqd = static_cast DATA_FROM_CQ(cq); - if (GRPC_TRACE_FLAG_ENABLED(grpc_cq_pluck_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(queue_pluck)) { GRPC_API_TRACE( "grpc_completion_queue_pluck(" "cq=%p, tag=%p, " diff --git a/src/core/lib/surface/completion_queue.h b/src/core/lib/surface/completion_queue.h index 9779b210ada..0abf4dc6c47 100644 --- a/src/core/lib/surface/completion_queue.h +++ b/src/core/lib/surface/completion_queue.h @@ -26,19 +26,11 @@ #include #include -#include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/manual_constructor.h" #include "src/core/lib/gprpp/mpscq.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/iomgr_fwd.h" -// These trace flags default to 1. The corresponding lines are only traced -// if grpc_api_trace is also truthy -extern grpc_core::TraceFlag grpc_cq_pluck_trace; -extern grpc_core::TraceFlag grpc_trace_operation_failures; -extern grpc_core::DebugOnlyTraceFlag grpc_trace_pending_tags; -extern grpc_core::DebugOnlyTraceFlag grpc_trace_cq_refcount; - typedef struct grpc_cq_completion { grpc_core::ManualConstructor< grpc_core::MultiProducerSingleConsumerQueue::Node> diff --git a/src/core/lib/surface/filter_stack_call.cc b/src/core/lib/surface/filter_stack_call.cc index 973c3cb85ff..40bc6ef3e9d 100644 --- a/src/core/lib/surface/filter_stack_call.cc +++ b/src/core/lib/surface/filter_stack_call.cc @@ -330,10 +330,9 @@ void FilterStackCall::CancelWithError(grpc_error_handle error) { if (!gpr_atm_rel_cas(&cancelled_with_error_, 0, 1)) { return; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_error_trace)) { - gpr_log(GPR_INFO, "CancelWithError %s %s", is_client() ? "CLI" : "SVR", - StatusToString(error).c_str()); - } + GRPC_TRACE_LOG(call_error, INFO) + << "CancelWithError " << (is_client() ? "CLI" : "SVR") << " " + << StatusToString(error); ClearPeerString(); InternalRef("termination"); ResetDeadline(); @@ -354,10 +353,9 @@ void FilterStackCall::CancelWithError(grpc_error_handle error) { } void FilterStackCall::SetFinalStatus(grpc_error_handle error) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_call_error_trace)) { - gpr_log(GPR_INFO, "set_final_status %s %s", is_client() ? "CLI" : "SVR", - StatusToString(error).c_str()); - } + GRPC_TRACE_LOG(call_error, INFO) + << "set_final_status " << (is_client() ? "CLI" : "SVR") << " " + << StatusToString(error); ResetDeadline(); if (is_client()) { std::string status_details; @@ -544,11 +542,10 @@ void FilterStackCall::BatchControl::PostCompletion() { } } - if (grpc_call_trace.enabled()) { - gpr_log(GPR_DEBUG, "tag:%p batch_error=%s op:%s", - completion_data_.notify_tag.tag, error.ToString().c_str(), - grpc_transport_stream_op_batch_string(&op_, false).c_str()); - } + GRPC_TRACE_VLOG(call, 2) << "tag:" << completion_data_.notify_tag.tag + << " batch_error=" << error << " op:" + << grpc_transport_stream_op_batch_string(&op_, + false); if (op_.send_initial_metadata) { call->send_initial_metadata_.Clear(); @@ -629,14 +626,12 @@ void FilterStackCall::BatchControl::ProcessDataAfterMetadata() { void FilterStackCall::BatchControl::ReceivingStreamReady( grpc_error_handle error) { - if (grpc_call_trace.enabled()) { - gpr_log(GPR_DEBUG, - "tag:%p ReceivingStreamReady error=%s " - "receiving_slice_buffer.has_value=%d recv_state=%" PRIdPTR, - completion_data_.notify_tag.tag, error.ToString().c_str(), - call_->receiving_slice_buffer_.has_value(), - gpr_atm_no_barrier_load(&call_->recv_state_)); - } + GRPC_TRACE_VLOG(call, 2) << "tag:" << completion_data_.notify_tag.tag + << " ReceivingStreamReady error=" << error + << " receiving_slice_buffer.has_value=" + << call_->receiving_slice_buffer_.has_value() + << " recv_state=" + << gpr_atm_no_barrier_load(&call_->recv_state_); FilterStackCall* call = call_; if (!error.ok()) { call->receiving_slice_buffer_.reset(); @@ -1101,12 +1096,10 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops, stream_op->on_complete = &bctl->finish_batch_; } - if (grpc_call_trace.enabled()) { - gpr_log(GPR_DEBUG, "BATCH:%p START:%s BATCH:%s (tag:%p)", bctl, - PendingOpString(pending_ops).c_str(), - grpc_transport_stream_op_batch_string(stream_op, false).c_str(), - bctl->completion_data_.notify_tag.tag); - } + GRPC_TRACE_VLOG(call, 2) + << "BATCH:" << bctl << " START:" << PendingOpString(pending_ops) + << " BATCH:" << grpc_transport_stream_op_batch_string(stream_op, false) + << " (tag:" << bctl->completion_data_.notify_tag.tag << ")"; ExecuteBatch(stream_op, &bctl->start_batch_); done: diff --git a/src/core/lib/surface/filter_stack_call.h b/src/core/lib/surface/filter_stack_call.h index 390e3b927d6..d3ad7f8b40b 100644 --- a/src/core/lib/surface/filter_stack_call.h +++ b/src/core/lib/surface/filter_stack_call.h @@ -54,7 +54,6 @@ #include "src/core/lib/resource_quota/arena.h" #include "src/core/lib/slice/slice_buffer.h" #include "src/core/lib/surface/call.h" -#include "src/core/lib/surface/call_trace.h" #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/completion_queue.h" #include "src/core/lib/transport/metadata_batch.h" @@ -219,12 +218,10 @@ class FilterStackCall final : public Call { bool completed_batch_step(PendingOp op) { auto mask = PendingOpMask(op); auto r = ops_pending_.fetch_sub(mask, std::memory_order_acq_rel); - if (grpc_call_trace.enabled()) { - gpr_log(GPR_DEBUG, "BATCH:%p COMPLETE:%s REMAINING:%s (tag:%p)", this, - PendingOpString(mask).c_str(), - PendingOpString(r & ~mask).c_str(), - completion_data_.notify_tag.tag); - } + GRPC_TRACE_VLOG(call, 2) + << "BATCH:" << this << " COMPLETE:" << PendingOpString(mask) + << " REMAINING:" << PendingOpString(r & ~mask) + << " (tag:" << completion_data_.notify_tag.tag << ")"; CHECK_NE((r & mask), 0); return r == mask; } diff --git a/src/core/lib/surface/legacy_channel.cc b/src/core/lib/surface/legacy_channel.cc index fc4c855950d..0b12f96274c 100644 --- a/src/core/lib/surface/legacy_channel.cc +++ b/src/core/lib/surface/legacy_channel.cc @@ -284,7 +284,7 @@ class LegacyChannel::StateWatcher final : public DualRefCounted { static void WatchComplete(void* arg, grpc_error_handle error) { RefCountedPtr self(static_cast(arg)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures)) { + if (GRPC_TRACE_FLAG_ENABLED(op_failure)) { GRPC_LOG_IF_ERROR("watch_completion_error", error); } MutexLock lock(&self->mu_); diff --git a/src/core/lib/surface/server_call.cc b/src/core/lib/surface/server_call.cc index 9affa893ab8..92f7db547d1 100644 --- a/src/core/lib/surface/server_call.cc +++ b/src/core/lib/surface/server_call.cc @@ -128,10 +128,8 @@ void ServerCall::CommitBatch(const grpc_op* ops, size_t nops, void* notify_tag, PrepareOutgoingInitialMetadata(op, *metadata); CToMetadata(op.data.send_initial_metadata.metadata, op.data.send_initial_metadata.count, metadata.get()); - if (grpc_call_trace.enabled()) { - gpr_log(GPR_INFO, "%s[call] Send initial metadata", - DebugTag().c_str()); - } + GRPC_TRACE_LOG(call, INFO) + << DebugTag() << "[call] Send initial metadata"; return [this, metadata = std::move(metadata)]() mutable { return call_handler_.PushServerInitialMetadata(std::move(metadata)); }; diff --git a/src/core/lib/transport/bdp_estimator.cc b/src/core/lib/transport/bdp_estimator.cc index d81e047cbc0..16d266ebdfd 100644 --- a/src/core/lib/transport/bdp_estimator.cc +++ b/src/core/lib/transport/bdp_estimator.cc @@ -27,8 +27,6 @@ #include -grpc_core::TraceFlag grpc_bdp_estimator_trace(false, "bdp_estimator"); - namespace grpc_core { BdpEstimator::BdpEstimator(absl::string_view name) @@ -48,7 +46,7 @@ Timestamp BdpEstimator::CompletePing() { 1e-9 * static_cast(dt_ts.tv_nsec); double bw = dt > 0 ? (static_cast(accumulator_) / dt) : 0; Duration start_inter_ping_delay = inter_ping_delay_; - if (GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(bdp_estimator)) { gpr_log(GPR_INFO, "bdp[%s]:complete acc=%" PRId64 " est=%" PRId64 " dt=%lf bw=%lfMbs bw_est=%lfMbs", @@ -59,7 +57,7 @@ Timestamp BdpEstimator::CompletePing() { if (accumulator_ > 2 * estimate_ / 3 && bw > bw_est_) { estimate_ = std::max(accumulator_, estimate_ * 2); bw_est_ = bw; - if (GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(bdp_estimator)) { gpr_log(GPR_INFO, "bdp[%s]: estimate increased to %" PRId64, std::string(name_).c_str(), estimate_); } @@ -75,7 +73,7 @@ Timestamp BdpEstimator::CompletePing() { } if (start_inter_ping_delay != inter_ping_delay_) { stable_estimate_count_ = 0; - if (GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(bdp_estimator)) { gpr_log(GPR_INFO, "bdp[%s]:update_inter_time to %" PRId64 "ms", std::string(name_).c_str(), inter_ping_delay_.millis()); } diff --git a/src/core/lib/transport/bdp_estimator.h b/src/core/lib/transport/bdp_estimator.h index 6c953bd4054..872ea2a2752 100644 --- a/src/core/lib/transport/bdp_estimator.h +++ b/src/core/lib/transport/bdp_estimator.h @@ -33,8 +33,6 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/time.h" -extern grpc_core::TraceFlag grpc_bdp_estimator_trace; - namespace grpc_core { class BdpEstimator { @@ -51,7 +49,7 @@ class BdpEstimator { // grpc_bdp_estimator_add_incoming_bytes once a ping has been scheduled by a // transport (but not necessarily started) void SchedulePing() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(bdp_estimator)) { gpr_log(GPR_INFO, "bdp[%s]:sched acc=%" PRId64 " est=%" PRId64, std::string(name_).c_str(), accumulator_, estimate_); } @@ -64,7 +62,7 @@ class BdpEstimator { // once // the ping is on the wire void StartPing() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(bdp_estimator)) { gpr_log(GPR_INFO, "bdp[%s]:start acc=%" PRId64 " est=%" PRId64, std::string(name_).c_str(), accumulator_, estimate_); } diff --git a/src/core/lib/transport/call_filters.cc b/src/core/lib/transport/call_filters.cc index 64b8c418d33..26c6b3e7bbd 100644 --- a/src/core/lib/transport/call_filters.cc +++ b/src/core/lib/transport/call_filters.cc @@ -225,7 +225,7 @@ void CallFilters::Finalize(const grpc_call_final_info* final_info) { void CallFilters::CancelDueToFailedPipeOperation(SourceLocation but_where) { // We expect something cancelled before now if (server_trailing_metadata_ == nullptr) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(but_where.file(), but_where.line(), GPR_LOG_SEVERITY_DEBUG, "Cancelling due to failed pipe operation: %s", DebugString().c_str()); @@ -237,7 +237,7 @@ void CallFilters::CancelDueToFailedPipeOperation(SourceLocation but_where) { void CallFilters::PushServerTrailingMetadata(ServerMetadataHandle md) { CHECK(md != nullptr); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%s PushServerTrailingMetadata[%p]: %s into %s", GetContext()->DebugTag().c_str(), this, md->DebugString().c_str(), DebugString().c_str()); @@ -380,7 +380,7 @@ void filters_detail::PipeState::DropPush() { case ValueState::kReady: case ValueState::kProcessing: case ValueState::kWaiting: - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%p drop push in state %s", this, DebugString().c_str()); } @@ -400,7 +400,7 @@ void filters_detail::PipeState::DropPull() { case ValueState::kReady: case ValueState::kProcessing: case ValueState::kWaiting: - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%p drop pull in state %s", this, DebugString().c_str()); } diff --git a/src/core/lib/transport/call_filters.h b/src/core/lib/transport/call_filters.h index c69ef82c1dc..04296316fe8 100644 --- a/src/core/lib/transport/call_filters.h +++ b/src/core/lib/transport/call_filters.h @@ -1491,7 +1491,7 @@ class CallFilters { Push(CallFilters* filters, T x) : filters_(filters), value_(std::move(x)) { CHECK(value_ != nullptr); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "BeginPush[%p|%p]: %s", &state(), this, state().DebugString().c_str()); } @@ -1525,17 +1525,17 @@ class CallFilters { Poll operator()() { if (value_ == nullptr) { CHECK_EQ(filters_, nullptr); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "Push[|%p]: already done", this); } return Success{}; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "Push[%p|%p]: %s", &state(), this, state().DebugString().c_str()); } auto r = state().PollPush(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { if (r.pending()) { gpr_log(GPR_INFO, "Push[%p|%p]: pending; %s", &state(), this, state().DebugString().c_str()); @@ -1555,7 +1555,7 @@ class CallFilters { } T TakeValue() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "Push[%p|%p]: take value; %s", &state(), this, state().DebugString().c_str()); } @@ -1602,7 +1602,7 @@ class CallFilters { PullMaybe& operator=(PullMaybe&&) = delete; Poll>> operator()() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "PullMaybe[%p|%p]: %s executor:%d", &state(), this, state().DebugString().c_str(), executor_.IsRunning()); } @@ -1669,7 +1669,7 @@ class CallFilters { Poll>> operator()() { CHECK(filters_ != nullptr); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "PullMessage[%p|%p]: %s executor:%d", &state(), this, state().DebugString().c_str(), executor_.IsRunning()); } @@ -1684,7 +1684,7 @@ class CallFilters { auto p = state().PollPull(); auto* r = p.value_if_ready(); if (r == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "PullMessage[%p] pending: %s executor:%d", &state(), state().DebugString().c_str(), executor_.IsRunning()); @@ -1721,7 +1721,7 @@ class CallFilters { auto* r = p.value_if_ready(); if (r == nullptr) return Pending{}; DCHECK(!executor_.IsRunning()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "PullMessage[%p|%p] executor done: %s", &state(), this, state().DebugString().c_str()); } @@ -1758,7 +1758,7 @@ class CallFilters { } auto p = state().PollPull(); auto* r = p.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%s", r == nullptr ? "PENDING" @@ -1814,7 +1814,7 @@ class CallFilters { Poll operator()() { if (executor_.IsRunning()) { auto r = executor_.Step(filters_->call_data_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { if (r.pending()) { gpr_log(GPR_INFO, "%s PullServerTrailingMetadata[%p]: Pending(but executing)", @@ -1828,7 +1828,7 @@ class CallFilters { return r; } if (filters_->server_trailing_metadata_ == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%s PullServerTrailingMetadata[%p]: Pending(not pushed)", GetContext()->DebugTag().c_str(), filters_); @@ -1837,7 +1837,7 @@ class CallFilters { } // If no stack has been set, we can just return the result of the call if (filters_->stack_ == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { gpr_log(GPR_INFO, "%s PullServerTrailingMetadata[%p]: Ready(no-stack): %s", GetContext()->DebugTag().c_str(), filters_, @@ -1849,7 +1849,7 @@ class CallFilters { auto r = executor_.Start( &filters_->stack_->data_.server_trailing_metadata, std::move(filters_->server_trailing_metadata_), filters_->call_data_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_promise_primitives)) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { if (r.pending()) { gpr_log(GPR_INFO, "%s PullServerTrailingMetadata[%p]: Pending(but executing)", diff --git a/src/core/lib/transport/call_spine.h b/src/core/lib/transport/call_spine.h index 6bfcd979292..e3d0be4a32b 100644 --- a/src/core/lib/transport/call_spine.h +++ b/src/core/lib/transport/call_spine.h @@ -167,10 +167,9 @@ class CallSpine final : public Party { "SpawnGuarded promise must return a status-like object"); Spawn(name, std::move(promise_factory), [this, whence](ResultType r) { if (!IsStatusOk(r)) { - if (grpc_trace_promise_primitives.enabled()) { - gpr_log(GPR_INFO, "SpawnGuarded sees failure: %s (source: %s:%d)", - r.ToString().c_str(), whence.file(), whence.line()); - } + GRPC_TRACE_LOG(promise_primitives, INFO) + << "SpawnGuarded sees failure: " << r + << " (source: " << whence.file() << ":" << whence.line() << ")"; auto status = StatusCast(std::move(r)); status->Set(GrpcCallWasCancelled(), true); PushServerTrailingMetadata(std::move(status)); diff --git a/src/core/lib/transport/connectivity_state.cc b/src/core/lib/transport/connectivity_state.cc index 35bd75185e1..1f63e516597 100644 --- a/src/core/lib/transport/connectivity_state.cc +++ b/src/core/lib/transport/connectivity_state.cc @@ -29,8 +29,6 @@ namespace grpc_core { -TraceFlag grpc_connectivity_state_trace(false, "connectivity_state"); - const char* ConnectivityStateName(grpc_connectivity_state state) { switch (state) { case GRPC_CHANNEL_IDLE: @@ -73,7 +71,7 @@ class AsyncConnectivityStateWatcherInterface::Notifier { private: static void SendNotification(void* arg, grpc_error_handle /*ignored*/) { Notifier* self = static_cast(arg); - if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) { gpr_log(GPR_INFO, "watcher %p: delivering async notification for %s (%s)", self->watcher_.get(), ConnectivityStateName(self->state_), self->status_.ToString().c_str()); @@ -104,7 +102,7 @@ ConnectivityStateTracker::~ConnectivityStateTracker() { state_.load(std::memory_order_relaxed); if (current_state == GRPC_CHANNEL_SHUTDOWN) return; for (const auto& p : watchers_) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) { gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: notifying watcher %p: %s -> %s", name_, this, p.first, ConnectivityStateName(current_state), @@ -117,14 +115,14 @@ ConnectivityStateTracker::~ConnectivityStateTracker() { void ConnectivityStateTracker::AddWatcher( grpc_connectivity_state initial_state, OrphanablePtr watcher) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) { gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: add watcher %p", name_, this, watcher.get()); } grpc_connectivity_state current_state = state_.load(std::memory_order_relaxed); if (initial_state != current_state) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) { gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: notifying watcher %p: %s -> %s", name_, this, watcher.get(), ConnectivityStateName(initial_state), @@ -141,7 +139,7 @@ void ConnectivityStateTracker::AddWatcher( void ConnectivityStateTracker::RemoveWatcher( ConnectivityStateWatcherInterface* watcher) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) { gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: remove watcher %p", name_, this, watcher); } @@ -154,7 +152,7 @@ void ConnectivityStateTracker::SetState(grpc_connectivity_state state, grpc_connectivity_state current_state = state_.load(std::memory_order_relaxed); if (state == current_state) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) { gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: %s -> %s (%s, %s)", name_, this, ConnectivityStateName(current_state), ConnectivityStateName(state), reason, status.ToString().c_str()); @@ -162,7 +160,7 @@ void ConnectivityStateTracker::SetState(grpc_connectivity_state state, state_.store(state, std::memory_order_relaxed); status_ = status; for (const auto& p : watchers_) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) { gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: notifying watcher %p: %s -> %s", name_, this, p.first, ConnectivityStateName(current_state), @@ -177,7 +175,7 @@ void ConnectivityStateTracker::SetState(grpc_connectivity_state state, grpc_connectivity_state ConnectivityStateTracker::state() const { grpc_connectivity_state state = state_.load(std::memory_order_relaxed); - if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(connectivity_state)) { gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: get current state: %s", name_, this, ConnectivityStateName(state)); } diff --git a/src/core/lib/transport/connectivity_state.h b/src/core/lib/transport/connectivity_state.h index 8b5fb677186..b72933ba868 100644 --- a/src/core/lib/transport/connectivity_state.h +++ b/src/core/lib/transport/connectivity_state.h @@ -35,8 +35,6 @@ namespace grpc_core { -extern TraceFlag grpc_connectivity_state_trace; - // Enum to string conversion. const char* ConnectivityStateName(grpc_connectivity_state state); diff --git a/src/core/lib/transport/transport.cc b/src/core/lib/transport/transport.cc index 883931182d8..d5c285aadd7 100644 --- a/src/core/lib/transport/transport.cc +++ b/src/core/lib/transport/transport.cc @@ -40,9 +40,6 @@ #include "src/core/lib/slice/slice.h" #include "src/core/lib/transport/error_utils.h" -grpc_core::DebugOnlyTraceFlag grpc_trace_stream_refcount(false, - "stream_refcount"); - void grpc_stream_destroy(grpc_stream_refcount* refcount) { if ((grpc_core::ExecCtx::Get()->flags() & GRPC_EXEC_CTX_FLAG_THREAD_RESOURCE_LOOP)) { @@ -81,8 +78,8 @@ void grpc_stream_ref_init(grpc_stream_refcount* refcount, int /*initial_refs*/, GRPC_CLOSURE_INIT(&refcount->destroy, cb, cb_arg, grpc_schedule_on_exec_ctx); new (&refcount->refs) grpc_core::RefCount( - 1, GRPC_TRACE_FLAG_ENABLED(grpc_trace_stream_refcount) ? "stream_refcount" - : nullptr); + 1, + GRPC_TRACE_FLAG_ENABLED(stream_refcount) ? "stream_refcount" : nullptr); } namespace grpc_core { diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h index 7acee54793b..1ae3c07821d 100644 --- a/src/core/lib/transport/transport.h +++ b/src/core/lib/transport/transport.h @@ -163,8 +163,6 @@ using NextPromiseFactory = // for a stream. typedef struct grpc_stream grpc_stream; -extern grpc_core::DebugOnlyTraceFlag grpc_trace_stream_refcount; - typedef struct grpc_stream_refcount { grpc_core::RefCount refs; grpc_closure destroy; @@ -192,7 +190,7 @@ void grpc_stream_ref_init(grpc_stream_refcount* refcount, int initial_refs, #ifndef NDEBUG inline void grpc_stream_ref(grpc_stream_refcount* refcount, const char* reason) { - if (grpc_trace_stream_refcount.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(stream_refcount)) { gpr_log(GPR_DEBUG, "%s %p:%p REF %s", refcount->object_type, refcount, refcount->destroy.cb_arg, reason); } @@ -209,7 +207,7 @@ void grpc_stream_destroy(grpc_stream_refcount* refcount); #ifndef NDEBUG inline void grpc_stream_unref(grpc_stream_refcount* refcount, const char* reason) { - if (grpc_trace_stream_refcount.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(stream_refcount)) { gpr_log(GPR_DEBUG, "%s %p:%p UNREF %s", refcount->object_type, refcount, refcount->destroy.cb_arg, reason); } diff --git a/src/core/load_balancing/child_policy_handler.cc b/src/core/load_balancing/child_policy_handler.cc index 87e29859e57..586957685cb 100644 --- a/src/core/load_balancing/child_policy_handler.cc +++ b/src/core/load_balancing/child_policy_handler.cc @@ -67,7 +67,7 @@ class ChildPolicyHandler::Helper final // it reports something other than CONNECTING, at which point we swap it // into place. if (CalledByPendingChild()) { - if (GRPC_TRACE_FLAG_ENABLED(*(parent()->tracer_))) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*(parent()->tracer_))) { gpr_log(GPR_INFO, "[child_policy_handler %p] helper %p: pending child policy %p " "reports state=%s (%s)", @@ -97,7 +97,7 @@ class ChildPolicyHandler::Helper final ? parent()->pending_child_policy_.get() : parent()->child_policy_.get(); if (child_ != latest_child_policy) return; - if (GRPC_TRACE_FLAG_ENABLED(*(parent()->tracer_))) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*(parent()->tracer_))) { gpr_log(GPR_INFO, "[child_policy_handler %p] requesting re-resolution", parent()); } @@ -132,12 +132,12 @@ class ChildPolicyHandler::Helper final // void ChildPolicyHandler::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*tracer_)) { gpr_log(GPR_INFO, "[child_policy_handler %p] shutting down", this); } shutting_down_ = true; if (child_policy_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*tracer_)) { gpr_log(GPR_INFO, "[child_policy_handler %p] shutting down lb_policy %p", this, child_policy_.get()); } @@ -146,7 +146,7 @@ void ChildPolicyHandler::ShutdownLocked() { child_policy_.reset(); } if (pending_child_policy_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*tracer_)) { gpr_log(GPR_INFO, "[child_policy_handler %p] shutting down pending lb_policy %p", this, pending_child_policy_.get()); @@ -223,7 +223,7 @@ absl::Status ChildPolicyHandler::UpdateLocked(UpdateArgs args) { // that there's an upper bound on the amount of time it takes us to // switch to the new policy, even if the new policy stays in // CONNECTING for a very long period of time. - if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*tracer_)) { gpr_log(GPR_INFO, "[child_policy_handler %p] creating new %schild policy %s", this, child_policy_ == nullptr ? "" : "pending ", @@ -243,7 +243,7 @@ absl::Status ChildPolicyHandler::UpdateLocked(UpdateArgs args) { } CHECK_NE(policy_to_update, nullptr); // Update the policy. - if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*tracer_)) { gpr_log(GPR_INFO, "[child_policy_handler %p] updating %schild policy %p", this, policy_to_update == pending_child_policy_.get() ? "pending " : "", @@ -287,7 +287,7 @@ OrphanablePtr ChildPolicyHandler::CreateChildPolicy( return nullptr; } helper->set_child(lb_policy.get()); - if (GRPC_TRACE_FLAG_ENABLED(*tracer_)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*tracer_)) { gpr_log(GPR_INFO, "[child_policy_handler %p] created new LB policy \"%s\" (%p)", this, std::string(child_policy_name).c_str(), lb_policy.get()); diff --git a/src/core/load_balancing/endpoint_list.h b/src/core/load_balancing/endpoint_list.h index cd8276bf51a..f6d1851624e 100644 --- a/src/core/load_balancing/endpoint_list.h +++ b/src/core/load_balancing/endpoint_list.h @@ -56,7 +56,7 @@ class MyEndpointList : public EndpointList { const ChannelArgs& args, std::vector* errors) : EndpointList(std::move(lb_policy), - GRPC_TRACE_FLAG_ENABLED(grpc_my_tracer) + GRPC_TRACE_FLAG_ENABLED(my_tracer) ? "MyEndpointList" : nullptr) { Init(endpoints, args, diff --git a/src/core/load_balancing/grpclb/grpclb.cc b/src/core/load_balancing/grpclb/grpclb.cc index 6c495a6a787..2437e964979 100644 --- a/src/core/load_balancing/grpclb/grpclb.cc +++ b/src/core/load_balancing/grpclb/grpclb.cc @@ -157,8 +157,6 @@ namespace grpc_core { -TraceFlag grpc_lb_glb_trace(false, "glb"); - namespace { using ::grpc_event_engine::experimental::EventEngine; @@ -853,7 +851,7 @@ void GrpcLb::Helper::UpdateState(grpc_connectivity_state state, parent()->lb_calld_->client_stats() != nullptr) { client_stats = parent()->lb_calld_->client_stats()->Ref(); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p helper %p] state=%s (%s) wrapping child " "picker %p (serverlist=%p, client_stats=%p)", @@ -882,8 +880,7 @@ void GrpcLb::Helper::RequestReresolution() { GrpcLb::BalancerCallState::BalancerCallState( RefCountedPtr parent_grpclb_policy) : InternallyRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace) ? "BalancerCallState" - : nullptr), + GRPC_TRACE_FLAG_ENABLED(glb) ? "BalancerCallState" : nullptr), grpclb_policy_(std::move(parent_grpclb_policy)) { CHECK(grpclb_policy_ != nullptr); CHECK(!grpclb_policy()->shutting_down_); @@ -951,7 +948,7 @@ void GrpcLb::BalancerCallState::Orphan() { void GrpcLb::BalancerCallState::StartQuery() { CHECK_NE(lb_call_, nullptr); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] lb_calld=%p: Starting LB call %p", grpclb_policy_.get(), this, lb_call_); } @@ -1180,7 +1177,7 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked() { if (response.client_stats_report_interval != Duration::Zero()) { client_stats_report_interval_ = std::max( Duration::Seconds(1), response.client_stats_report_interval); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] lb_calld=%p: Received initial LB response " "message; client load reporting interval = %" PRId64 @@ -1188,7 +1185,7 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked() { grpclb_policy(), this, client_stats_report_interval_.millis()); } - } else if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + } else if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] lb_calld=%p: Received initial LB response " "message; client load reporting NOT enabled", @@ -1201,7 +1198,7 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked() { CHECK_NE(lb_call_, nullptr); auto serverlist_wrapper = MakeRefCounted(std::move(response.serverlist)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] lb_calld=%p: Serverlist with %" PRIuPTR " servers received:\n%s", @@ -1222,7 +1219,7 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked() { // Check if the serverlist differs from the previous one. if (grpclb_policy()->serverlist_ != nullptr && *grpclb_policy()->serverlist_ == *serverlist_wrapper) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] lb_calld=%p: Incoming server list identical " "to current, ignoring.", @@ -1320,7 +1317,7 @@ void GrpcLb::BalancerCallState::OnBalancerStatusReceived( void GrpcLb::BalancerCallState::OnBalancerStatusReceivedLocked( grpc_error_handle error) { CHECK_NE(lb_call_, nullptr); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { char* status_details = grpc_slice_to_c_string(lb_call_status_details_); gpr_log(GPR_INFO, "[grpclb %p] lb_calld=%p: Status from LB server received. " @@ -1470,7 +1467,7 @@ GrpcLb::GrpcLb(Args args) GRPC_ARG_GRPCLB_SUBCHANNEL_CACHE_INTERVAL_MS) .value_or(Duration::Milliseconds( GRPC_GRPCLB_DEFAULT_SUBCHANNEL_DELETION_DELAY_MS)))) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] Will use '%s' as the server name for LB request.", this, @@ -1540,7 +1537,7 @@ class GrpcLb::NullLbTokenEndpointIterator final void ForEach(absl::FunctionRef callback) const override { parent_it_->ForEach([&](const EndpointAddresses& endpoint) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] fallback address: %s", this, endpoint.ToString().c_str()); } @@ -1556,7 +1553,7 @@ class GrpcLb::NullLbTokenEndpointIterator final }; absl::Status GrpcLb::UpdateLocked(UpdateArgs args) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] received update", this); } const bool is_initial_update = lb_channel_ == nullptr; @@ -1613,7 +1610,7 @@ absl::Status GrpcLb::UpdateLocked(UpdateArgs args) { absl::Status GrpcLb::UpdateBalancerChannelLocked() { // Get balancer addresses. EndpointAddressesList balancer_addresses = ExtractBalancerAddresses(args_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { for (const auto& endpoint : balancer_addresses) { gpr_log(GPR_INFO, "[grpclb %p] balancer address: %s", this, endpoint.ToString().c_str()); @@ -1670,7 +1667,7 @@ void GrpcLb::StartBalancerCallLocked() { // Init the LB call data. CHECK(lb_calld_ == nullptr); lb_calld_ = MakeOrphanable(Ref()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] Query for backends (lb_channel: %p, lb_calld: %p)", this, lb_channel_.get(), lb_calld_.get()); @@ -1680,7 +1677,7 @@ void GrpcLb::StartBalancerCallLocked() { void GrpcLb::StartBalancerCallRetryTimerLocked() { Duration timeout = lb_call_backoff_.NextAttemptTime() - Timestamp::Now(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] Connection to LB server lost...", this); if (timeout > Duration::Zero()) { gpr_log(GPR_INFO, "[grpclb %p] ... retry_timer_active in %" PRId64 "ms.", @@ -1709,7 +1706,7 @@ void GrpcLb::StartBalancerCallRetryTimerLocked() { void GrpcLb::OnBalancerCallRetryTimerLocked() { lb_call_retry_timer_handle_.reset(); if (!shutting_down_ && lb_calld_ == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] Restarting call to LB server", this); } StartBalancerCallLocked(); @@ -1778,9 +1775,8 @@ OrphanablePtr GrpcLb::CreateChildPolicyLocked( lb_policy_args.channel_control_helper = std::make_unique(RefAsSubclass(DEBUG_LOCATION, "Helper")); OrphanablePtr lb_policy = - MakeOrphanable(std::move(lb_policy_args), - &grpc_lb_glb_trace); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + MakeOrphanable(std::move(lb_policy_args), &glb_trace); + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] Created new child policy handler (%p)", this, lb_policy.get()); } @@ -1834,7 +1830,7 @@ void GrpcLb::CreateOrUpdateChildPolicyLocked() { child_policy_ = CreateChildPolicyLocked(update_args.args); } // Update the policy. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] Updating child policy handler %p", this, child_policy_.get()); } @@ -1879,7 +1875,7 @@ void GrpcLb::OnSubchannelCacheTimerLocked() { subchannel_cache_timer_handle_.reset(); auto it = cached_subchannels_.begin(); if (it != cached_subchannels_.end()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(glb)) { gpr_log(GPR_INFO, "[grpclb %p] removing %" PRIuPTR " subchannels from cache", this, it->second.size()); diff --git a/src/core/load_balancing/health_check_client.cc b/src/core/load_balancing/health_check_client.cc index ba70c0702f8..0c99651c209 100644 --- a/src/core/load_balancing/health_check_client.cc +++ b/src/core/load_balancing/health_check_client.cc @@ -65,8 +65,6 @@ namespace grpc_core { -TraceFlag grpc_health_check_client_trace(false, "health_check_client"); - namespace { // A fire-and-forget class to asynchronously drain a WorkSerializer queue. @@ -147,7 +145,7 @@ void HealthProducer::HealthChecker::OnConnectivityStateChangeLocked( } void HealthProducer::HealthChecker::StartHealthStreamLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(health_check_client)) { gpr_log(GPR_INFO, "HealthProducer %p HealthChecker %p: " "creating HealthClient for \"%s\"", @@ -157,13 +155,12 @@ void HealthProducer::HealthChecker::StartHealthStreamLocked() { stream_client_ = MakeOrphanable( producer_->connected_subchannel_, producer_->subchannel_->pollset_set(), std::make_unique(Ref()), - GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace) ? "HealthClient" - : nullptr); + GRPC_TRACE_FLAG_ENABLED(health_check_client) ? "HealthClient" : nullptr); } void HealthProducer::HealthChecker::NotifyWatchersLocked( grpc_connectivity_state state, absl::Status status) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(health_check_client)) { gpr_log( GPR_INFO, "HealthProducer %p HealthChecker %p: reporting state %s to watchers", @@ -303,7 +300,7 @@ class HealthProducer::HealthChecker::HealthStreamEventHandler final void SetHealthStatusLocked(SubchannelStreamClient* client, grpc_connectivity_state state, const char* reason) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(health_check_client)) { gpr_log(GPR_INFO, "HealthCheckClient %p: setting state=%s reason=%s", client, ConnectivityStateName(state), reason); } @@ -346,7 +343,7 @@ class HealthProducer::ConnectivityWatcher final // void HealthProducer::Start(RefCountedPtr subchannel) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(health_check_client)) { gpr_log(GPR_INFO, "HealthProducer %p: starting with subchannel %p", this, subchannel.get()); } @@ -362,7 +359,7 @@ void HealthProducer::Start(RefCountedPtr subchannel) { } void HealthProducer::Orphaned() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(health_check_client)) { gpr_log(GPR_INFO, "HealthProducer %p: shutting down", this); } { @@ -412,7 +409,7 @@ void HealthProducer::RemoveWatcher( void HealthProducer::OnConnectivityStateChange(grpc_connectivity_state state, const absl::Status& status) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(health_check_client)) { gpr_log(GPR_INFO, "HealthProducer %p: subchannel state update: state=%s status=%s", this, ConnectivityStateName(state), status.ToString().c_str()); @@ -438,7 +435,7 @@ void HealthProducer::OnConnectivityStateChange(grpc_connectivity_state state, // HealthWatcher::~HealthWatcher() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(health_check_client)) { gpr_log(GPR_INFO, "HealthWatcher %p: unregistering from producer %p " "(health_check_service_name=\"%s\")", @@ -474,7 +471,7 @@ void HealthWatcher::SetSubchannel(Subchannel* subchannel) { if (created) producer_->Start(subchannel->Ref()); // Register ourself with the producer. producer_->AddWatcher(this, health_check_service_name_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(health_check_client)) { gpr_log(GPR_INFO, "HealthWatcher %p: registered with producer %p (created=%d, " "health_check_service_name=\"%s\")", @@ -506,7 +503,7 @@ MakeHealthCheckWatcher( health_check_service_name = args.GetOwnedString(GRPC_ARG_HEALTH_CHECK_SERVICE_NAME); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(health_check_client)) { gpr_log(GPR_INFO, "creating HealthWatcher -- health_check_service_name=\"%s\"", health_check_service_name.value_or("N/A").c_str()); diff --git a/src/core/load_balancing/lb_policy.cc b/src/core/load_balancing/lb_policy.cc index 66ce4f4e3ce..c8b20336d3d 100644 --- a/src/core/load_balancing/lb_policy.cc +++ b/src/core/load_balancing/lb_policy.cc @@ -27,18 +27,15 @@ namespace grpc_core { -DebugOnlyTraceFlag grpc_trace_lb_policy_refcount(false, "lb_policy_refcount"); - // // LoadBalancingPolicy // LoadBalancingPolicy::LoadBalancingPolicy(Args args, intptr_t initial_refcount) - : InternallyRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_trace_lb_policy_refcount) - ? "LoadBalancingPolicy" - : nullptr, - initial_refcount), + : InternallyRefCounted(GRPC_TRACE_FLAG_ENABLED(lb_policy_refcount) + ? "LoadBalancingPolicy" + : nullptr, + initial_refcount), work_serializer_(std::move(args.work_serializer)), interested_parties_(grpc_pollset_set_create()), channel_control_helper_(std::move(args.channel_control_helper)), @@ -58,7 +55,7 @@ void LoadBalancingPolicy::Orphan() { // LoadBalancingPolicy::SubchannelPicker::SubchannelPicker() - : DualRefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_trace_lb_policy_refcount) + : DualRefCounted(GRPC_TRACE_FLAG_ENABLED(lb_policy_refcount) ? "SubchannelPicker" : nullptr) {} diff --git a/src/core/load_balancing/lb_policy.h b/src/core/load_balancing/lb_policy.h index 43ea6f00765..cfdab1ba1a6 100644 --- a/src/core/load_balancing/lb_policy.h +++ b/src/core/load_balancing/lb_policy.h @@ -55,8 +55,6 @@ namespace grpc_core { -extern DebugOnlyTraceFlag grpc_trace_lb_policy_refcount; - /// Interface for load balancing policies. /// /// The following concepts are used here: diff --git a/src/core/load_balancing/oob_backend_metric.cc b/src/core/load_balancing/oob_backend_metric.cc index 0a022825e47..fd5c2cefad3 100644 --- a/src/core/load_balancing/oob_backend_metric.cc +++ b/src/core/load_balancing/oob_backend_metric.cc @@ -59,8 +59,6 @@ namespace grpc_core { -TraceFlag grpc_orca_client_trace(false, "orca_client"); - // // OrcaProducer::ConnectivityWatcher // @@ -271,12 +269,12 @@ void OrcaProducer::MaybeStartStreamLocked() { connected_subchannel_, subchannel_->pollset_set(), std::make_unique( WeakRefAsSubclass(), report_interval_), - GRPC_TRACE_FLAG_ENABLED(grpc_orca_client_trace) ? "OrcaClient" : nullptr); + GRPC_TRACE_FLAG_ENABLED(orca_client) ? "OrcaClient" : nullptr); } void OrcaProducer::NotifyWatchers( const BackendMetricData& backend_metric_data) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_orca_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(orca_client)) { gpr_log(GPR_INFO, "OrcaProducer %p: reporting backend metrics to watchers", this); } diff --git a/src/core/load_balancing/outlier_detection/outlier_detection.cc b/src/core/load_balancing/outlier_detection/outlier_detection.cc index 2545345cf33..face9d2823d 100644 --- a/src/core/load_balancing/outlier_detection/outlier_detection.cc +++ b/src/core/load_balancing/outlier_detection/outlier_detection.cc @@ -75,8 +75,6 @@ namespace grpc_core { -TraceFlag grpc_outlier_detection_lb_trace(false, "outlier_detection_lb"); - namespace { using ::grpc_event_engine::experimental::EventEngine; @@ -534,7 +532,7 @@ OutlierDetectionLb::Picker::Picker(OutlierDetectionLb* outlier_detection_lb, RefCountedPtr picker, bool counting_enabled) : picker_(std::move(picker)), counting_enabled_(counting_enabled) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] constructed new picker %p and counting " "is %s", @@ -578,13 +576,13 @@ LoadBalancingPolicy::PickResult OutlierDetectionLb::Picker::Pick( OutlierDetectionLb::OutlierDetectionLb(Args args) : LoadBalancingPolicy(std::move(args)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] created", this); } } OutlierDetectionLb::~OutlierDetectionLb() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] destroying outlier_detection LB policy", this); @@ -592,7 +590,7 @@ OutlierDetectionLb::~OutlierDetectionLb() { } void OutlierDetectionLb::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] shutting down", this); } ejection_timer_.reset(); @@ -618,7 +616,7 @@ void OutlierDetectionLb::ResetBackoffLocked() { } absl::Status OutlierDetectionLb::UpdateLocked(UpdateArgs args) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] Received update", this); } auto old_config = std::move(config_); @@ -627,7 +625,7 @@ absl::Status OutlierDetectionLb::UpdateLocked(UpdateArgs args) { // Update outlier detection timer. if (!config_->CountingEnabled()) { // No need for timer. Cancel the current timer, if any. - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] counting disabled, cancelling timer", this); @@ -635,7 +633,7 @@ absl::Status OutlierDetectionLb::UpdateLocked(UpdateArgs args) { ejection_timer_.reset(); } else if (ejection_timer_ == nullptr) { // No timer running. Start it now. - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] starting timer", this); } ejection_timer_ = MakeOrphanable( @@ -649,7 +647,7 @@ absl::Status OutlierDetectionLb::UpdateLocked(UpdateArgs args) { // with the same start time. // Note that if the new deadline is in the past, the timer will fire // immediately. - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] interval changed, replacing timer", this); @@ -670,7 +668,7 @@ absl::Status OutlierDetectionLb::UpdateLocked(UpdateArgs args) { // Find the entry in the endpoint map. auto it = endpoint_state_map_.find(key); if (it == endpoint_state_map_.end()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] adding endpoint entry for %s", this, key.ToString().c_str()); @@ -682,7 +680,7 @@ absl::Status OutlierDetectionLb::UpdateLocked(UpdateArgs args) { for (const grpc_resolved_address& address : endpoint.addresses()) { auto it2 = subchannel_state_map_.find(address); if (it2 == subchannel_state_map_.end()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { std::string address_str = grpc_sockaddr_to_string(&address, false) .value_or(""); gpr_log(GPR_INFO, @@ -700,7 +698,7 @@ absl::Status OutlierDetectionLb::UpdateLocked(UpdateArgs args) { key, MakeRefCounted(std::move(subchannels))); } else if (!config_->CountingEnabled()) { // If counting is not enabled, reset state. - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] counting disabled; disabling " "ejection for %s", @@ -713,7 +711,7 @@ absl::Status OutlierDetectionLb::UpdateLocked(UpdateArgs args) { for (auto it = subchannel_state_map_.begin(); it != subchannel_state_map_.end();) { if (current_addresses.find(it->first) == current_addresses.end()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { std::string address_str = grpc_sockaddr_to_string(&it->first, false).value_or(""); gpr_log(GPR_INFO, @@ -733,7 +731,7 @@ absl::Status OutlierDetectionLb::UpdateLocked(UpdateArgs args) { for (auto it = endpoint_state_map_.begin(); it != endpoint_state_map_.end();) { if (current_endpoints.find(it->first) == current_endpoints.end()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] removing endpoint map entry %s", this, it->first.ToString().c_str()); @@ -754,7 +752,7 @@ absl::Status OutlierDetectionLb::UpdateLocked(UpdateArgs args) { update_args.resolution_note = std::move(args.resolution_note); update_args.config = config_->child_policy(); update_args.args = std::move(args.args); - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] Updating child policy handler %p", this, child_policy_.get()); @@ -766,7 +764,7 @@ void OutlierDetectionLb::MaybeUpdatePickerLocked() { if (picker_ != nullptr) { auto outlier_detection_picker = MakeRefCounted(this, picker_, config_->CountingEnabled()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] updating connectivity: state=%s " "status=(%s) picker=%p", @@ -787,8 +785,8 @@ OrphanablePtr OutlierDetectionLb::CreateChildPolicyLocked( RefAsSubclass(DEBUG_LOCATION, "Helper")); OrphanablePtr lb_policy = MakeOrphanable(std::move(lb_policy_args), - &grpc_outlier_detection_lb_trace); - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + &outlier_detection_lb_trace); + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] Created new child policy handler %p", this, lb_policy.get()); @@ -814,7 +812,7 @@ RefCountedPtr OutlierDetectionLb::Helper::CreateSubchannel( if (it != parent()->subchannel_state_map_.end()) { subchannel_state = it->second->Ref(); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { std::string address_str = grpc_sockaddr_to_string(&address, false).value_or(""); gpr_log(GPR_INFO, @@ -836,7 +834,7 @@ void OutlierDetectionLb::Helper::UpdateState( grpc_connectivity_state state, const absl::Status& status, RefCountedPtr picker) { if (parent()->shutting_down_) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] child connectivity state update: " "state=%s (%s) picker=%p", @@ -859,7 +857,7 @@ OutlierDetectionLb::EjectionTimer::EjectionTimer( RefCountedPtr parent, Timestamp start_time) : parent_(std::move(parent)), start_time_(start_time) { auto interval = parent_->config_->outlier_detection_config().interval; - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] ejection timer will run in %s", parent_.get(), interval.ToString().c_str()); } @@ -885,7 +883,7 @@ void OutlierDetectionLb::EjectionTimer::Orphan() { void OutlierDetectionLb::EjectionTimer::OnTimerLocked() { if (!timer_handle_.has_value()) return; timer_handle_.reset(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] ejection timer running", parent_.get()); } @@ -925,7 +923,7 @@ void OutlierDetectionLb::EjectionTimer::OnTimerLocked() { } } } - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] found %" PRIuPTR " success rate candidates and %" PRIuPTR @@ -939,7 +937,7 @@ void OutlierDetectionLb::EjectionTimer::OnTimerLocked() { if (!success_rate_ejection_candidates.empty() && success_rate_ejection_candidates.size() >= config.success_rate_ejection->minimum_hosts) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] running success rate algorithm: " "stdev_factor=%d, enforcement_percentage=%d", @@ -958,13 +956,13 @@ void OutlierDetectionLb::EjectionTimer::OnTimerLocked() { const double success_rate_stdev_factor = static_cast(config.success_rate_ejection->stdev_factor) / 1000; double ejection_threshold = mean - stdev * success_rate_stdev_factor; - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] stdev=%.3f, ejection_threshold=%.3f", parent_.get(), stdev, ejection_threshold); } for (auto& candidate : success_rate_ejection_candidates) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] checking candidate %p: " "success_rate=%.3f", @@ -974,7 +972,7 @@ void OutlierDetectionLb::EjectionTimer::OnTimerLocked() { uint32_t random_key = absl::Uniform(bit_gen_, 1, 100); double current_percent = 100.0 * ejected_host_count / parent_->endpoint_state_map_.size(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] random_key=%d " "ejected_host_count=%" PRIuPTR " current_percent=%.3f", @@ -986,7 +984,7 @@ void OutlierDetectionLb::EjectionTimer::OnTimerLocked() { (current_percent < config.max_ejection_percent))) { // Eject and record the timestamp for use when ejecting addresses in // this iteration. - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] ejecting candidate", parent_.get()); } @@ -1000,7 +998,7 @@ void OutlierDetectionLb::EjectionTimer::OnTimerLocked() { if (!failure_percentage_ejection_candidates.empty() && failure_percentage_ejection_candidates.size() >= config.failure_percentage_ejection->minimum_hosts) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] running failure percentage algorithm: " "threshold=%d, enforcement_percentage=%d", @@ -1008,7 +1006,7 @@ void OutlierDetectionLb::EjectionTimer::OnTimerLocked() { config.failure_percentage_ejection->enforcement_percentage); } for (auto& candidate : failure_percentage_ejection_candidates) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] checking candidate %p: " "success_rate=%.3f", @@ -1022,7 +1020,7 @@ void OutlierDetectionLb::EjectionTimer::OnTimerLocked() { uint32_t random_key = absl::Uniform(bit_gen_, 1, 100); double current_percent = 100.0 * ejected_host_count / parent_->endpoint_state_map_.size(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] random_key=%d " "ejected_host_count=%" PRIuPTR " current_percent=%.3f", @@ -1035,7 +1033,7 @@ void OutlierDetectionLb::EjectionTimer::OnTimerLocked() { (current_percent < config.max_ejection_percent))) { // Eject and record the timestamp for use when ejecting addresses in // this iteration. - if (GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] ejecting candidate", parent_.get()); } @@ -1055,7 +1053,7 @@ void OutlierDetectionLb::EjectionTimer::OnTimerLocked() { auto* endpoint_state = state.second.get(); const bool unejected = endpoint_state->MaybeUneject( config.base_ejection_time.millis(), config.max_ejection_time.millis()); - if (unejected && GRPC_TRACE_FLAG_ENABLED(grpc_outlier_detection_lb_trace)) { + if (unejected && GRPC_TRACE_FLAG_ENABLED(outlier_detection_lb)) { gpr_log(GPR_INFO, "[outlier_detection_lb %p] unejected endpoint %s (%p)", parent_.get(), state.first.ToString().c_str(), endpoint_state); } diff --git a/src/core/load_balancing/pick_first/pick_first.cc b/src/core/load_balancing/pick_first/pick_first.cc index 47b43a30114..5e06a9f864d 100644 --- a/src/core/load_balancing/pick_first/pick_first.cc +++ b/src/core/load_balancing/pick_first/pick_first.cc @@ -69,8 +69,6 @@ namespace grpc_core { -TraceFlag grpc_lb_pick_first_trace(false, "pick_first"); - namespace { // @@ -422,20 +420,20 @@ PickFirst::PickFirst(Args args) .GetInt(GRPC_ARG_HAPPY_EYEBALLS_CONNECTION_ATTEMPT_DELAY_MS) .value_or(250), 100, 2000))) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p created.", this); } } PickFirst::~PickFirst() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Destroying Pick First %p", this); } CHECK(subchannel_list_ == nullptr); } void PickFirst::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p Shutting down", this); } shutdown_ = true; @@ -446,7 +444,7 @@ void PickFirst::ShutdownLocked() { void PickFirst::ExitIdleLocked() { if (shutdown_) return; if (IsIdle()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p exiting idle", this); } AttemptToConnectUsingLatestUpdateArgsLocked(); @@ -464,8 +462,7 @@ void PickFirst::AttemptToConnectUsingLatestUpdateArgsLocked() { addresses = latest_update_args_.addresses->get(); } // Replace subchannel_list_. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace) && - subchannel_list_ != nullptr) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first) && subchannel_list_ != nullptr) { gpr_log(GPR_INFO, "[PF %p] Shutting down previous subchannel list %p", this, subchannel_list_.get()); } @@ -518,7 +515,7 @@ class AddressFamilyIterator final { }; absl::Status PickFirst::UpdateLocked(UpdateArgs args) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { if (args.addresses.ok()) { gpr_log(GPR_INFO, "Pick First %p received update", this); } else { @@ -633,7 +630,7 @@ void PickFirst::GoIdle() { void PickFirst::HealthWatcher::OnConnectivityStateChange( grpc_connectivity_state new_state, absl::Status status) { if (policy_->health_watcher_ != this) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] health watch state update: %s (%s)", policy_.get(), ConnectivityStateName(new_state), status.ToString().c_str()); @@ -675,7 +672,7 @@ PickFirst::SubchannelList::SubchannelData::SubchannelState::SubchannelState( : subchannel_data_(subchannel_data), pick_first_(subchannel_data_->subchannel_list_->policy_), subchannel_(std::move(subchannel)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] subchannel state %p (subchannel %p): starting watch", pick_first_.get(), this, subchannel_.get()); @@ -686,7 +683,7 @@ PickFirst::SubchannelList::SubchannelData::SubchannelState::SubchannelState( } void PickFirst::SubchannelList::SubchannelData::SubchannelState::Orphan() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] subchannel state %p (subchannel %p): " "cancelling watch and unreffing subchannel", @@ -701,7 +698,7 @@ void PickFirst::SubchannelList::SubchannelData::SubchannelState::Orphan() { } void PickFirst::SubchannelList::SubchannelData::SubchannelState::Select() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p selected subchannel %p", pick_first_.get(), subchannel_.get()); } @@ -713,7 +710,7 @@ void PickFirst::SubchannelList::SubchannelData::SubchannelState::Select() { // for the health status notification. // If health checking is NOT enabled, report READY. if (pick_first_->enable_health_watch_) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] starting health watch", pick_first_.get()); } auto watcher = std::make_unique( @@ -751,7 +748,7 @@ void PickFirst::SubchannelList::SubchannelData::SubchannelState:: OnConnectivityStateChange(grpc_connectivity_state new_state, absl::Status status) { if (watcher_ == nullptr) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] subchannel state %p (subchannel %p): connectivity " "changed: new_state=%s, status=%s, watcher=%p, " @@ -774,7 +771,7 @@ void PickFirst::SubchannelList::SubchannelData::SubchannelState:: } // We aren't trying to connect, so we must be the selected subchannel. CHECK(pick_first_->selected_.get() == this); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p selected subchannel connectivity changed to %s", pick_first_.get(), ConnectivityStateName(new_state)); @@ -798,7 +795,7 @@ PickFirst::SubchannelList::SubchannelData::SubchannelData( SubchannelList* subchannel_list, size_t index, RefCountedPtr subchannel) : subchannel_list_(subchannel_list), index_(index) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] subchannel list %p index %" PRIuPTR ": creating subchannel data", @@ -811,7 +808,7 @@ PickFirst::SubchannelList::SubchannelData::SubchannelData( void PickFirst::SubchannelList::SubchannelData::OnConnectivityStateChange( grpc_connectivity_state new_state, absl::Status status) { PickFirst* p = subchannel_list_->policy_.get(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log( GPR_INFO, "[PF %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR @@ -864,7 +861,7 @@ void PickFirst::SubchannelList::SubchannelData::OnConnectivityStateChange( // is not in the new list. In that case, we drop the current // connection and report IDLE. if (p->selected_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] subchannel list %p: new update has no subchannels in " "state READY; dropping existing connection and going IDLE", @@ -965,7 +962,7 @@ void PickFirst::SubchannelList::SubchannelData::RequestConnectionWithTimer() { // If this is not the last subchannel in the list, start the timer. if (index_ != subchannel_list_->size() - 1) { PickFirst* p = subchannel_list_->policy_.get(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p subchannel list %p: starting Connection " "Attempt Delay timer for %" PRId64 "ms for index %" PRIuPTR, @@ -982,7 +979,7 @@ void PickFirst::SubchannelList::SubchannelData::RequestConnectionWithTimer() { auto* sl = subchannel_list.get(); sl->policy_->work_serializer()->Run( [subchannel_list = std::move(subchannel_list)]() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p subchannel list %p: Connection " "Attempt Delay timer fired (shutting_down=%d, " @@ -1010,13 +1007,12 @@ PickFirst::SubchannelList::SubchannelList(RefCountedPtr policy, EndpointAddressesIterator* addresses, const ChannelArgs& args) : InternallyRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace) ? "SubchannelList" - : nullptr), + GRPC_TRACE_FLAG_ENABLED(pick_first) ? "SubchannelList" : nullptr), policy_(std::move(policy)), args_(args.Remove(GRPC_ARG_INTERNAL_PICK_FIRST_ENABLE_HEALTH_CHECKING) .Remove( GRPC_ARG_INTERNAL_PICK_FIRST_OMIT_STATUS_MESSAGE_PREFIX)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] Creating subchannel list %p - channel args: %s", policy_.get(), this, args_.ToString().c_str()); } @@ -1029,14 +1025,14 @@ PickFirst::SubchannelList::SubchannelList(RefCountedPtr policy, address.address(), address.args(), args_); if (subchannel == nullptr) { // Subchannel could not be created. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] could not create subchannel for address %s, ignoring", policy_.get(), address.ToString().c_str()); } return; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] subchannel list %p index %" PRIuPTR ": Created subchannel %p for address %s", @@ -1049,14 +1045,14 @@ PickFirst::SubchannelList::SubchannelList(RefCountedPtr policy, } PickFirst::SubchannelList::~SubchannelList() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] Destroying subchannel_list %p", policy_.get(), this); } } void PickFirst::SubchannelList::Orphan() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] Shutting down subchannel_list %p", policy_.get(), this); } @@ -1101,7 +1097,7 @@ void PickFirst::SubchannelList::MaybeFinishHappyEyeballsPass() { // We didn't find another subchannel not in state TRANSIENT_FAILURE, // so report TRANSIENT_FAILURE and switch to a mode in which we try to // connect to all addresses in parallel. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p subchannel list %p failed to connect to " "all subchannels", @@ -1396,13 +1392,13 @@ OldPickFirst::OldPickFirst(Args args) .GetInt(GRPC_ARG_HAPPY_EYEBALLS_CONNECTION_ATTEMPT_DELAY_MS) .value_or(250), 100, 2000))) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p created.", this); } } OldPickFirst::~OldPickFirst() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Destroying Pick First %p", this); } CHECK(subchannel_list_ == nullptr); @@ -1410,7 +1406,7 @@ OldPickFirst::~OldPickFirst() { } void OldPickFirst::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p Shutting down", this); } shutdown_ = true; @@ -1422,7 +1418,7 @@ void OldPickFirst::ShutdownLocked() { void OldPickFirst::ExitIdleLocked() { if (shutdown_) return; if (IsIdle()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p exiting idle", this); } AttemptToConnectUsingLatestUpdateArgsLocked(); @@ -1443,7 +1439,7 @@ void OldPickFirst::AttemptToConnectUsingLatestUpdateArgsLocked() { addresses = latest_update_args_.addresses->get(); } // Replace latest_pending_subchannel_list_. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace) && + if (GRPC_TRACE_FLAG_ENABLED(pick_first) && latest_pending_subchannel_list_ != nullptr) { gpr_log(GPR_INFO, "[PF %p] Shutting down previous pending subchannel list %p", this, @@ -1467,8 +1463,7 @@ void OldPickFirst::AttemptToConnectUsingLatestUpdateArgsLocked() { // the current list, replace the current subchannel list immediately. if (latest_pending_subchannel_list_->size() == 0 || selected_ == nullptr) { UnsetSelectedSubchannel(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace) && - subchannel_list_ != nullptr) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first) && subchannel_list_ != nullptr) { gpr_log(GPR_INFO, "[PF %p] Shutting down previous subchannel list %p", this, subchannel_list_.get()); } @@ -1477,7 +1472,7 @@ void OldPickFirst::AttemptToConnectUsingLatestUpdateArgsLocked() { } absl::Status OldPickFirst::UpdateLocked(UpdateArgs args) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { if (args.addresses.ok()) { gpr_log(GPR_INFO, "Pick First %p received update", this); } else { @@ -1578,7 +1573,7 @@ void OldPickFirst::UnsetSelectedSubchannel() { void OldPickFirst::HealthWatcher::OnConnectivityStateChange( grpc_connectivity_state new_state, absl::Status status) { if (policy_->health_watcher_ != this) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] health watch state update: %s (%s)", policy_.get(), ConnectivityStateName(new_state), status.ToString().c_str()); @@ -1620,7 +1615,7 @@ OldPickFirst::SubchannelList::SubchannelData::SubchannelData( : subchannel_list_(subchannel_list), index_(index), subchannel_(std::move(subchannel)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] subchannel list %p index %" PRIuPTR " (subchannel %p): starting watch", @@ -1635,7 +1630,7 @@ OldPickFirst::SubchannelList::SubchannelData::SubchannelData( void OldPickFirst::SubchannelList::SubchannelData::ShutdownLocked() { if (subchannel_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR " (subchannel %p): cancelling watch and unreffing subchannel", @@ -1651,7 +1646,7 @@ void OldPickFirst::SubchannelList::SubchannelData::ShutdownLocked() { void OldPickFirst::SubchannelList::SubchannelData::OnConnectivityStateChange( grpc_connectivity_state new_state, absl::Status status) { OldPickFirst* p = subchannel_list_->policy_.get(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log( GPR_INFO, "[PF %p] subchannel list %p index %" PRIuPTR " of %" PRIuPTR @@ -1683,7 +1678,7 @@ void OldPickFirst::SubchannelList::SubchannelData::OnConnectivityStateChange( // Handle updates for the currently selected subchannel. if (p->selected_ == this) { CHECK(subchannel_list_ == p->subchannel_list_.get()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p selected subchannel connectivity changed to %s", p, ConnectivityStateName(new_state)); @@ -1702,7 +1697,7 @@ void OldPickFirst::SubchannelList::SubchannelData::OnConnectivityStateChange( p->channel_control_helper()->RequestReresolution(); // If there is a pending update, switch to the pending update. if (p->latest_pending_subchannel_list_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p promoting pending subchannel list %p to " "replace %p", @@ -1866,7 +1861,7 @@ void OldPickFirst::SubchannelList::SubchannelData:: // If this is not the last subchannel in the list, start the timer. if (index_ != subchannel_list_->size() - 1) { OldPickFirst* p = subchannel_list_->policy_.get(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p subchannel list %p: starting Connection " "Attempt Delay timer for %" PRId64 "ms for index %" PRIuPTR, @@ -1883,7 +1878,7 @@ void OldPickFirst::SubchannelList::SubchannelData:: auto* sl = subchannel_list.get(); sl->policy_->work_serializer()->Run( [subchannel_list = std::move(subchannel_list)]() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p subchannel list %p: Connection " "Attempt Delay timer fired (shutting_down=%d, " @@ -1924,7 +1919,7 @@ void OldPickFirst::SubchannelList::SubchannelData:: subchannel_list_ == p->latest_pending_subchannel_list_.get()); // Case 2. Promote p->latest_pending_subchannel_list_ to p->subchannel_list_. if (subchannel_list_ == p->latest_pending_subchannel_list_.get()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p promoting pending subchannel list %p to " "replace %p", @@ -1935,7 +1930,7 @@ void OldPickFirst::SubchannelList::SubchannelData:: p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_); } // Cases 1 and 2. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p selected subchannel %p", p, subchannel_.get()); } @@ -1945,7 +1940,7 @@ void OldPickFirst::SubchannelList::SubchannelData:: // for the health status notification. // If health checking is NOT enabled, report READY. if (p->enable_health_watch_) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] starting health watch", p); } auto watcher = std::make_unique( @@ -1975,13 +1970,12 @@ OldPickFirst::SubchannelList::SubchannelList( RefCountedPtr policy, EndpointAddressesIterator* addresses, const ChannelArgs& args) : InternallyRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace) ? "SubchannelList" - : nullptr), + GRPC_TRACE_FLAG_ENABLED(pick_first) ? "SubchannelList" : nullptr), policy_(std::move(policy)), args_(args.Remove(GRPC_ARG_INTERNAL_PICK_FIRST_ENABLE_HEALTH_CHECKING) .Remove( GRPC_ARG_INTERNAL_PICK_FIRST_OMIT_STATUS_MESSAGE_PREFIX)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] Creating subchannel list %p - channel args: %s", policy_.get(), this, args_.ToString().c_str()); } @@ -1994,14 +1988,14 @@ OldPickFirst::SubchannelList::SubchannelList( address.address(), address.args(), args_); if (subchannel == nullptr) { // Subchannel could not be created. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] could not create subchannel for address %s, ignoring", policy_.get(), address.ToString().c_str()); } return; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] subchannel list %p index %" PRIuPTR ": Created subchannel %p for address %s", @@ -2013,14 +2007,14 @@ OldPickFirst::SubchannelList::SubchannelList( } OldPickFirst::SubchannelList::~SubchannelList() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] Destroying subchannel_list %p", policy_.get(), this); } } void OldPickFirst::SubchannelList::Orphan() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "[PF %p] Shutting down subchannel_list %p", policy_.get(), this); } @@ -2067,7 +2061,7 @@ void OldPickFirst::SubchannelList::MaybeFinishHappyEyeballsPass() { // We didn't find another subchannel not in state TRANSIENT_FAILURE, // so report TRANSIENT_FAILURE and switch to a mode in which we try to // connect to all addresses in parallel. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p subchannel list %p failed to connect to " "all subchannels", @@ -2077,7 +2071,7 @@ void OldPickFirst::SubchannelList::MaybeFinishHappyEyeballsPass() { // TRANSIENT_FAILURE and dropping the existing (working) connection, // but we can't ignore what the control plane has told us. if (policy_->latest_pending_subchannel_list_.get() == this) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(pick_first)) { gpr_log(GPR_INFO, "Pick First %p promoting pending subchannel list %p to " "replace %p", diff --git a/src/core/load_balancing/priority/priority.cc b/src/core/load_balancing/priority/priority.cc index 114ca5df053..441cb51d348 100644 --- a/src/core/load_balancing/priority/priority.cc +++ b/src/core/load_balancing/priority/priority.cc @@ -65,8 +65,6 @@ namespace grpc_core { -TraceFlag grpc_lb_priority_trace(false, "priority_lb"); - namespace { using ::grpc_event_engine::experimental::EventEngine; @@ -296,19 +294,19 @@ PriorityLb::PriorityLb(Args args) channel_args() .GetDurationFromIntMillis(GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS) .value_or(kDefaultChildFailoverTimeout))) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] created", this); } } PriorityLb::~PriorityLb() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] destroying priority LB policy", this); } } void PriorityLb::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] shutting down", this); } shutting_down_ = true; @@ -318,7 +316,7 @@ void PriorityLb::ShutdownLocked() { void PriorityLb::ExitIdleLocked() { if (current_priority_ != UINT32_MAX) { const std::string& child_name = config_->priorities()[current_priority_]; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] exiting IDLE for current priority %d child %s", this, current_priority_, child_name.c_str()); @@ -332,7 +330,7 @@ void PriorityLb::ResetBackoffLocked() { } absl::Status PriorityLb::UpdateLocked(UpdateArgs args) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] received update", this); } // Update config. @@ -404,7 +402,7 @@ void PriorityLb::ChoosePriorityLocked() { ++priority) { // If the child for the priority does not exist yet, create it. const std::string& child_name = config_->priorities()[priority]; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] trying priority %u, child %s", this, priority, child_name.c_str()); } @@ -445,7 +443,7 @@ void PriorityLb::ChoosePriorityLocked() { return; } // Child has been failing for a while. Move on to the next priority. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] skipping priority %u, child %s: state=%s, " "failover timer not pending", @@ -455,7 +453,7 @@ void PriorityLb::ChoosePriorityLocked() { } // If we didn't find any priority to try, pick the first one in state // CONNECTING. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] no priority reachable, checking for CONNECTING " "priority to delegate to", @@ -465,7 +463,7 @@ void PriorityLb::ChoosePriorityLocked() { ++priority) { // If the child for the priority does not exist yet, create it. const std::string& child_name = config_->priorities()[priority]; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] trying priority %u, child %s", this, priority, child_name.c_str()); } @@ -486,7 +484,7 @@ void PriorityLb::ChoosePriorityLocked() { void PriorityLb::SetCurrentPriorityLocked(int32_t priority, bool deactivate_lower_priorities, const char* reason) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] selecting priority %u, child %s (%s, " "deactivate_lower_priorities=%d)", @@ -515,7 +513,7 @@ void PriorityLb::SetCurrentPriorityLocked(int32_t priority, PriorityLb::ChildPriority::DeactivationTimer::DeactivationTimer( RefCountedPtr child_priority) : child_priority_(std::move(child_priority)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): deactivating -- will remove in " "%" PRId64 "ms", @@ -539,7 +537,7 @@ PriorityLb::ChildPriority::DeactivationTimer::DeactivationTimer( void PriorityLb::ChildPriority::DeactivationTimer::Orphan() { if (timer_handle_.has_value()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): reactivating", child_priority_->priority_policy_.get(), child_priority_->name_.c_str(), child_priority_.get()); @@ -555,7 +553,7 @@ void PriorityLb::ChildPriority::DeactivationTimer::Orphan() { void PriorityLb::ChildPriority::DeactivationTimer::OnTimerLocked() { if (timer_handle_.has_value()) { timer_handle_.reset(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): deactivation timer fired, " "deleting child", @@ -573,7 +571,7 @@ void PriorityLb::ChildPriority::DeactivationTimer::OnTimerLocked() { PriorityLb::ChildPriority::FailoverTimer::FailoverTimer( RefCountedPtr child_priority) : child_priority_(std::move(child_priority)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log( GPR_INFO, "[priority_lb %p] child %s (%p): starting failover timer for %" PRId64 @@ -599,7 +597,7 @@ PriorityLb::ChildPriority::FailoverTimer::FailoverTimer( void PriorityLb::ChildPriority::FailoverTimer::Orphan() { if (timer_handle_.has_value()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): cancelling failover timer", child_priority_->priority_policy_.get(), @@ -616,7 +614,7 @@ void PriorityLb::ChildPriority::FailoverTimer::Orphan() { void PriorityLb::ChildPriority::FailoverTimer::OnTimerLocked() { if (timer_handle_.has_value()) { timer_handle_.reset(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): failover timer fired, " "reporting TRANSIENT_FAILURE", @@ -637,7 +635,7 @@ void PriorityLb::ChildPriority::FailoverTimer::OnTimerLocked() { PriorityLb::ChildPriority::ChildPriority( RefCountedPtr priority_policy, std::string name) : priority_policy_(std::move(priority_policy)), name_(std::move(name)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] creating child %s (%p)", priority_policy_.get(), name_.c_str(), this); } @@ -646,7 +644,7 @@ PriorityLb::ChildPriority::ChildPriority( } void PriorityLb::ChildPriority::Orphan() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): orphaned", priority_policy_.get(), name_.c_str(), this); } @@ -676,7 +674,7 @@ absl::Status PriorityLb::ChildPriority::UpdateLocked( RefCountedPtr config, bool ignore_reresolution_requests) { if (priority_policy_->shutting_down_) return absl::OkStatus(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): start update", priority_policy_.get(), name_.c_str(), this); } @@ -702,7 +700,7 @@ absl::Status PriorityLb::ChildPriority::UpdateLocked( update_args.resolution_note = priority_policy_->resolution_note_; update_args.args = priority_policy_->args_; // Update the policy. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): updating child policy handler %p", priority_policy_.get(), name_.c_str(), this, child_policy_.get()); @@ -719,8 +717,8 @@ PriorityLb::ChildPriority::CreateChildPolicyLocked(const ChannelArgs& args) { std::make_unique(this->Ref(DEBUG_LOCATION, "Helper")); OrphanablePtr lb_policy = MakeOrphanable(std::move(lb_policy_args), - &grpc_lb_priority_trace); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + &priority_lb_trace); + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): created new child policy " "handler %p", @@ -745,7 +743,7 @@ void PriorityLb::ChildPriority::ResetBackoffLocked() { void PriorityLb::ChildPriority::OnConnectivityStateUpdateLocked( grpc_connectivity_state state, const absl::Status& status, RefCountedPtr picker) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(priority_lb)) { gpr_log(GPR_INFO, "[priority_lb %p] child %s (%p): state update: %s (%s) picker %p", priority_policy_.get(), name_.c_str(), this, diff --git a/src/core/load_balancing/ring_hash/ring_hash.cc b/src/core/load_balancing/ring_hash/ring_hash.cc index 87f4e722105..73d813b9abc 100644 --- a/src/core/load_balancing/ring_hash/ring_hash.cc +++ b/src/core/load_balancing/ring_hash/ring_hash.cc @@ -71,8 +71,6 @@ namespace grpc_core { -TraceFlag grpc_lb_ring_hash_trace(false, "ring_hash_lb"); - UniqueTypeName RequestHashAttribute::TypeName() { static UniqueTypeName::Factory kFactory("request_hash"); return kFactory.Create(); @@ -530,7 +528,7 @@ void RingHash::RingHashEndpoint::CreateChildPolicy() { child_policy_ = CoreConfiguration::Get().lb_policy_registry().CreateLoadBalancingPolicy( "pick_first", std::move(lb_policy_args)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(ring_hash_lb)) { const EndpointAddresses& endpoint = ring_hash_->endpoints_[index_]; gpr_log(GPR_INFO, "[RH %p] endpoint %p (index %" PRIuPTR " of %" PRIuPTR @@ -574,7 +572,7 @@ absl::Status RingHash::RingHashEndpoint::UpdateChildPolicyLocked() { void RingHash::RingHashEndpoint::OnStateUpdate( grpc_connectivity_state new_state, const absl::Status& status, RefCountedPtr picker) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(ring_hash_lb)) { gpr_log( GPR_INFO, "[RH %p] connectivity changed for endpoint %p (%s, child_policy=%p): " @@ -602,19 +600,19 @@ void RingHash::RingHashEndpoint::OnStateUpdate( // RingHash::RingHash(Args args) : LoadBalancingPolicy(std::move(args)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(ring_hash_lb)) { gpr_log(GPR_INFO, "[RH %p] Created", this); } } RingHash::~RingHash() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(ring_hash_lb)) { gpr_log(GPR_INFO, "[RH %p] Destroying Ring Hash policy", this); } } void RingHash::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(ring_hash_lb)) { gpr_log(GPR_INFO, "[RH %p] Shutting down", this); } shutdown_ = true; @@ -630,7 +628,7 @@ void RingHash::ResetBackoffLocked() { absl::Status RingHash::UpdateLocked(UpdateArgs args) { // Check address list. if (args.addresses.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(ring_hash_lb)) { gpr_log(GPR_INFO, "[RH %p] received update", this); } // De-dup endpoints, taking weight into account. @@ -646,7 +644,7 @@ absl::Status RingHash::UpdateLocked(UpdateArgs args) { endpoint.args().GetInt(GRPC_ARG_ADDRESS_WEIGHT).value_or(1); int prev_weight_arg = prev_endpoint.args().GetInt(GRPC_ARG_ADDRESS_WEIGHT).value_or(1); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(ring_hash_lb)) { gpr_log(GPR_INFO, "[RH %p] merging duplicate endpoint for %s, combined " "weight %d", @@ -661,7 +659,7 @@ absl::Status RingHash::UpdateLocked(UpdateArgs args) { } }); } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(ring_hash_lb)) { gpr_log(GPR_INFO, "[RH %p] received update with addresses error: %s", this, args.addresses.status().ToString().c_str()); } @@ -771,7 +769,7 @@ void RingHash::UpdateAggregatedConnectivityStateLocked( state = GRPC_CHANNEL_TRANSIENT_FAILURE; start_connection_attempt = true; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(ring_hash_lb)) { gpr_log(GPR_INFO, "[RH %p] setting connectivity state to %s (num_idle=%" PRIuPTR ", num_connecting=%" PRIuPTR ", num_ready=%" PRIuPTR @@ -849,7 +847,7 @@ void RingHash::UpdateAggregatedConnectivityStateLocked( auto it = endpoint_map_.find( EndpointAddressSet(endpoints_[first_idle_index].addresses())); CHECK(it != endpoint_map_.end()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(ring_hash_lb)) { gpr_log(GPR_INFO, "[RH %p] triggering internal connection attempt for endpoint " "%p (%s) (index %" PRIuPTR " of %" PRIuPTR ")", diff --git a/src/core/load_balancing/rls/rls.cc b/src/core/load_balancing/rls/rls.cc index 30be3c912cb..d2f76a6db01 100644 --- a/src/core/load_balancing/rls/rls.cc +++ b/src/core/load_balancing/rls/rls.cc @@ -113,8 +113,6 @@ using ::grpc_event_engine::experimental::EventEngine; namespace grpc_core { -TraceFlag grpc_lb_rls_trace(false, "rls_lb"); - namespace { constexpr absl::string_view kMetricLabelRlsServerTarget = @@ -797,8 +795,7 @@ class RlsLb final : public LoadBalancingPolicy { RlsLb::ChildPolicyWrapper::ChildPolicyWrapper(RefCountedPtr lb_policy, std::string target) : DualRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) ? "ChildPolicyWrapper" - : nullptr), + GRPC_TRACE_FLAG_ENABLED(rls_lb) ? "ChildPolicyWrapper" : nullptr), lb_policy_(std::move(lb_policy)), target_(std::move(target)), picker_(MakeRefCounted(nullptr)) { @@ -806,7 +803,7 @@ RlsLb::ChildPolicyWrapper::ChildPolicyWrapper(RefCountedPtr lb_policy, } void RlsLb::ChildPolicyWrapper::Orphaned() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] ChildPolicyWrapper=%p [%s]: shutdown", lb_policy_.get(), this, target_.c_str()); } @@ -865,7 +862,7 @@ void RlsLb::ChildPolicyWrapper::StartUpdate() { lb_policy_->config_->child_policy_config_target_field_name(), target_, lb_policy_->config_->child_policy_config(), &errors); CHECK(child_policy_config.has_value()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log( GPR_INFO, "[rlslb %p] ChildPolicyWrapper=%p [%s]: validating update, config: %s", @@ -877,7 +874,7 @@ void RlsLb::ChildPolicyWrapper::StartUpdate() { *child_policy_config); // Returned RLS target fails the validation. if (!config.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] ChildPolicyWrapper=%p [%s]: config failed to parse: " "%s", @@ -905,8 +902,8 @@ absl::Status RlsLb::ChildPolicyWrapper::MaybeFinishUpdate() { WeakRef(DEBUG_LOCATION, "ChildPolicyHelper")); create_args.args = lb_policy_->channel_args_; child_policy_ = MakeOrphanable(std::move(create_args), - &grpc_lb_rls_trace); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + &rls_lb_trace); + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] ChildPolicyWrapper=%p [%s], created new child policy " "handler %p", @@ -916,7 +913,7 @@ absl::Status RlsLb::ChildPolicyWrapper::MaybeFinishUpdate() { lb_policy_->interested_parties()); } // Send the child the updated config. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] ChildPolicyWrapper=%p [%s], updating child policy " "handler %p", @@ -936,7 +933,7 @@ absl::Status RlsLb::ChildPolicyWrapper::MaybeFinishUpdate() { void RlsLb::ChildPolicyWrapper::ChildPolicyHelper::UpdateState( grpc_connectivity_state state, const absl::Status& status, RefCountedPtr picker) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] ChildPolicyWrapper=%p [%s] ChildPolicyHelper=%p: " "UpdateState(state=%s, status=%s, picker=%p)", @@ -1044,7 +1041,7 @@ LoadBalancingPolicy::PickResult RlsLb::Picker::Pick(PickArgs args) { BuildKeyMap(config_->key_builder_map(), args.path, lb_policy_->channel_control_helper()->GetAuthority(), args.initial_metadata)}; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] picker=%p: request keys: %s", lb_policy_.get(), this, key.ToString().c_str()); } @@ -1082,7 +1079,7 @@ LoadBalancingPolicy::PickResult RlsLb::Picker::Pick(PickArgs args) { if (entry != nullptr) { // If the entry has non-expired data, use it. if (entry->data_expiration_time() >= now) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] picker=%p: using cache entry %p", lb_policy_.get(), this, entry); } @@ -1098,7 +1095,7 @@ LoadBalancingPolicy::PickResult RlsLb::Picker::Pick(PickArgs args) { } } // RLS call pending. Queue the pick. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] picker=%p: RLS request pending; queuing pick", lb_policy_.get(), this); } @@ -1108,7 +1105,7 @@ LoadBalancingPolicy::PickResult RlsLb::Picker::Pick(PickArgs args) { LoadBalancingPolicy::PickResult RlsLb::Picker::PickFromDefaultTargetOrFail( const char* reason, PickArgs args, absl::Status status) { if (default_child_policy_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] picker=%p: %s; using default target", lb_policy_.get(), this, reason); } @@ -1117,7 +1114,7 @@ LoadBalancingPolicy::PickResult RlsLb::Picker::PickFromDefaultTargetOrFail( config_->default_target(), pick_result); return pick_result; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] picker=%p: %s; failing pick", lb_policy_.get(), this, reason); } @@ -1154,7 +1151,7 @@ void RlsLb::Cache::Entry::BackoffTimer::Orphan() { if (backoff_timer_task_handle_.has_value() && entry_->lb_policy_->channel_control_helper()->GetEventEngine()->Cancel( *backoff_timer_task_handle_)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] cache entry=%p %s, backoff timer canceled", entry_->lb_policy_.get(), entry_.get(), entry_->is_shutdown_ ? "(shut down)" @@ -1168,7 +1165,7 @@ void RlsLb::Cache::Entry::BackoffTimer::Orphan() { void RlsLb::Cache::Entry::BackoffTimer::OnBackoffTimerLocked() { { MutexLock lock(&entry_->lb_policy_->mu_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] cache entry=%p %s, backoff timer fired", entry_->lb_policy_.get(), entry_.get(), entry_->is_shutdown_ ? "(shut down)" @@ -1198,8 +1195,8 @@ std::unique_ptr MakeCacheEntryBackoff() { RlsLb::Cache::Entry::Entry(RefCountedPtr lb_policy, const RequestKey& key) - : InternallyRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) ? "CacheEntry" : nullptr), + : InternallyRefCounted(GRPC_TRACE_FLAG_ENABLED(rls_lb) ? "CacheEntry" + : nullptr), lb_policy_(std::move(lb_policy)), backoff_state_(MakeCacheEntryBackoff()), min_expiration_time_(Timestamp::Now() + kMinExpirationTime), @@ -1207,7 +1204,7 @@ RlsLb::Cache::Entry::Entry(RefCountedPtr lb_policy, lb_policy_->cache_.lru_list_.end(), key)) {} void RlsLb::Cache::Entry::Orphan() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] cache entry=%p %s: cache entry evicted", lb_policy_.get(), this, lru_iterator_->ToString().c_str()); } @@ -1238,7 +1235,7 @@ LoadBalancingPolicy::PickResult RlsLb::Cache::Entry::Pick(PickArgs args) { if (child_policy_wrapper->connectivity_state() == GRPC_CHANNEL_TRANSIENT_FAILURE && i < child_policy_wrappers_.size() - 1) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] cache entry=%p %s: target %s (%" PRIuPTR " of %" PRIuPTR ") in state TRANSIENT_FAILURE; skipping", @@ -1252,7 +1249,7 @@ LoadBalancingPolicy::PickResult RlsLb::Cache::Entry::Pick(PickArgs args) { } // Child policy not in TRANSIENT_FAILURE or is the last target in // the list, so delegate. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] cache entry=%p %s: target %s (%" PRIuPTR " of %" PRIuPTR ") in state %s; delegating", @@ -1409,14 +1406,14 @@ RlsLb::Cache::Entry* RlsLb::Cache::FindOrInsert(const RequestKey& key) { lb_policy_->RefAsSubclass(DEBUG_LOCATION, "CacheEntry"), key); map_.emplace(key, OrphanablePtr(entry)); size_ += entry_size; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] key=%s: cache entry added, entry=%p", lb_policy_, key.ToString().c_str(), entry); } return entry; } // Entry found, so use it. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] key=%s: found cache entry %p", lb_policy_, key.ToString().c_str(), it->second.get()); } @@ -1425,7 +1422,7 @@ RlsLb::Cache::Entry* RlsLb::Cache::FindOrInsert(const RequestKey& key) { } void RlsLb::Cache::Resize(size_t bytes) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] resizing cache to %" PRIuPTR " bytes", lb_policy_, bytes); } @@ -1446,7 +1443,7 @@ void RlsLb::Cache::Shutdown() { if (cleanup_timer_handle_.has_value() && lb_policy_->channel_control_helper()->GetEventEngine()->Cancel( *cleanup_timer_handle_)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] cache cleanup timer canceled", lb_policy_); } } @@ -1484,7 +1481,7 @@ void RlsLb::Cache::StartCleanupTimer() { } void RlsLb::Cache::OnCleanupTimer() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] cache cleanup timer fired", lb_policy_); } MutexLock lock(&lb_policy_->mu_); @@ -1513,14 +1510,14 @@ void RlsLb::Cache::MaybeShrinkSize(size_t bytes) { auto map_it = map_.find(*lru_it); CHECK(map_it != map_.end()); if (!map_it->second->CanEvict()) break; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] LRU eviction: removing entry %p %s", lb_policy_, map_it->second.get(), lru_it->ToString().c_str()); } size_ -= map_it->second->Size(); map_.erase(map_it); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] LRU pass complete: desired size=%" PRIuPTR " size=%" PRIuPTR, @@ -1535,7 +1532,7 @@ void RlsLb::Cache::MaybeShrinkSize(size_t bytes) { void RlsLb::RlsChannel::StateWatcher::OnConnectivityStateChange( grpc_connectivity_state new_state, const absl::Status& status) { auto* lb_policy = rls_channel_->lb_policy_.get(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] RlsChannel=%p StateWatcher=%p: " "state changed to %s (%s)", @@ -1600,7 +1597,7 @@ void RlsLb::RlsChannel::Throttle::RegisterResponse(bool success) { RlsLb::RlsChannel::RlsChannel(RefCountedPtr lb_policy) : InternallyRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) ? "RlsChannel" : nullptr), + GRPC_TRACE_FLAG_ENABLED(rls_lb) ? "RlsChannel" : nullptr), lb_policy_(std::move(lb_policy)) { // Get channel creds from parent channel. // Note that we are using the "unsafe" channel creds here, which do @@ -1634,7 +1631,7 @@ RlsLb::RlsChannel::RlsChannel(RefCountedPtr lb_policy) channel_.reset(Channel::FromC( grpc_channel_create(lb_policy_->config_->lookup_service().c_str(), creds.get(), args.ToC().get()))); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] RlsChannel=%p: created channel %p for %s", lb_policy_.get(), this, channel_.get(), lb_policy_->config_->lookup_service().c_str()); @@ -1657,7 +1654,7 @@ RlsLb::RlsChannel::RlsChannel(RefCountedPtr lb_policy) } void RlsLb::RlsChannel::Orphan() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] RlsChannel=%p, channel=%p: shutdown", lb_policy_.get(), this, channel_.get()); } @@ -1716,14 +1713,14 @@ RlsLb::RlsRequest::RlsRequest(RefCountedPtr lb_policy, RequestKey key, grpc_lookup_v1_RouteLookupRequest_Reason reason, std::string stale_header_data) : InternallyRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) ? "RlsRequest" : nullptr), + GRPC_TRACE_FLAG_ENABLED(rls_lb) ? "RlsRequest" : nullptr), lb_policy_(std::move(lb_policy)), key_(std::move(key)), rls_channel_(std::move(rls_channel)), backoff_state_(std::move(backoff_state)), reason_(reason), stale_header_data_(std::move(stale_header_data)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] rls_request=%p: RLS request created for key %s", lb_policy_.get(), this, key_.ToString().c_str()); @@ -1740,7 +1737,7 @@ RlsLb::RlsRequest::~RlsRequest() { CHECK_EQ(call_, nullptr); } void RlsLb::RlsRequest::Orphan() { if (call_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] rls_request=%p %s: cancelling RLS call", lb_policy_.get(), this, key_.ToString().c_str()); } @@ -1813,7 +1810,7 @@ void RlsLb::RlsRequest::OnRlsCallComplete(void* arg, grpc_error_handle error) { } void RlsLb::RlsRequest::OnRlsCallCompleteLocked(grpc_error_handle error) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { std::string status_message(StringViewFromSlice(status_details_recv_)); gpr_log(GPR_INFO, "[rlslb %p] rls_request=%p %s, error=%s, status={%d, %s} RLS call " @@ -1846,7 +1843,7 @@ void RlsLb::RlsRequest::OnRlsCallCompleteLocked(grpc_error_handle error) { grpc_call_unref(call_); call_ = nullptr; // Return result to cache. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] rls_request=%p %s: response info: %s", lb_policy_.get(), this, key_.ToString().c_str(), response.ToString().c_str()); @@ -1965,7 +1962,7 @@ RlsLb::RlsLb(Args args) cache_.ReportMetricsLocked(reporter); }, Duration::Seconds(5), kMetricCacheSize, kMetricCacheEntries)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] policy created", this); } } @@ -1992,14 +1989,14 @@ bool EndpointsEqual( } absl::Status RlsLb::UpdateLocked(UpdateArgs args) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] policy updated", this); } update_in_progress_ = true; // Swap out config. RefCountedPtr old_config = std::move(config_); config_ = args.config.TakeAsSubclass(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) && + if (GRPC_TRACE_FLAG_ENABLED(rls_lb) && (old_config == nullptr || old_config->child_policy_config() != config_->child_policy_config())) { gpr_log(GPR_INFO, "[rlslb %p] updated child policy config: %s", this, @@ -2027,14 +2024,14 @@ absl::Status RlsLb::UpdateLocked(UpdateArgs args) { if (old_config == nullptr || config_->default_target() != old_config->default_target()) { if (config_->default_target().empty()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] unsetting default target", this); } default_child_policy_.reset(); } else { auto it = child_policy_map_.find(config_->default_target()); if (it == child_policy_map_.end()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] creating new default target", this); } default_child_policy_ = MakeRefCounted( @@ -2042,7 +2039,7 @@ absl::Status RlsLb::UpdateLocked(UpdateArgs args) { config_->default_target()); created_default_child = true; } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] using existing child for default target", this); } @@ -2067,14 +2064,14 @@ absl::Status RlsLb::UpdateLocked(UpdateArgs args) { } // Start update of child policies if needed. if (update_child_policies) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] starting child policy updates", this); } for (auto& p : child_policy_map_) { p.second->StartUpdate(); } } else if (created_default_child) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] starting default child policy update", this); } @@ -2084,7 +2081,7 @@ absl::Status RlsLb::UpdateLocked(UpdateArgs args) { // Now that we've released the lock, finish update of child policies. std::vector errors; if (update_child_policies) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] finishing child policy updates", this); } for (auto& p : child_policy_map_) { @@ -2095,7 +2092,7 @@ absl::Status RlsLb::UpdateLocked(UpdateArgs args) { } } } else if (created_default_child) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] finishing default child policy update", this); } @@ -2140,7 +2137,7 @@ void RlsLb::ResetBackoffLocked() { } void RlsLb::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] policy shutdown", this); } registered_metric_callback_.reset(); @@ -2184,7 +2181,7 @@ void RlsLb::UpdatePickerLocked() { // all children. This avoids unnecessary picker churn while an update // is being propagated to our children. if (update_in_progress_) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] updating picker", this); } grpc_connectivity_state state = GRPC_CHANNEL_IDLE; @@ -2197,7 +2194,7 @@ void RlsLb::UpdatePickerLocked() { if (is_shutdown_) return; for (auto& p : child_policy_map_) { grpc_connectivity_state child_state = p.second->connectivity_state(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] target %s in state %s", this, p.second->target().c_str(), ConnectivityStateName(child_state)); @@ -2220,7 +2217,7 @@ void RlsLb::UpdatePickerLocked() { } } } - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(rls_lb)) { gpr_log(GPR_INFO, "[rlslb %p] reporting state %s", this, ConnectivityStateName(state)); } diff --git a/src/core/load_balancing/round_robin/round_robin.cc b/src/core/load_balancing/round_robin/round_robin.cc index f149d153078..8b6be9c0f4e 100644 --- a/src/core/load_balancing/round_robin/round_robin.cc +++ b/src/core/load_balancing/round_robin/round_robin.cc @@ -53,8 +53,6 @@ namespace grpc_core { -TraceFlag grpc_lb_round_robin_trace(false, "round_robin"); - namespace { constexpr absl::string_view kRoundRobin = "round_robin"; @@ -76,7 +74,7 @@ class RoundRobin final : public LoadBalancingPolicy { const ChannelArgs& args, std::vector* errors) : EndpointList(std::move(round_robin), - GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace) + GRPC_TRACE_FLAG_ENABLED(round_robin) ? "RoundRobinEndpointList" : nullptr) { Init(endpoints, args, @@ -186,7 +184,7 @@ RoundRobin::Picker::Picker( // the picker, see https://github.com/grpc/grpc-go/issues/2580. size_t index = absl::Uniform(parent->bit_gen_, 0, pickers_.size()); last_picked_index_.store(index, std::memory_order_relaxed); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { gpr_log(GPR_INFO, "[RR %p picker %p] created picker from endpoint_list=%p " "with %" PRIuPTR " READY children; last_picked_index_=%" PRIuPTR, @@ -198,7 +196,7 @@ RoundRobin::Picker::Picker( RoundRobin::PickResult RoundRobin::Picker::Pick(PickArgs args) { size_t index = last_picked_index_.fetch_add(1, std::memory_order_relaxed) % pickers_.size(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { gpr_log(GPR_INFO, "[RR %p picker %p] using picker index %" PRIuPTR ", picker=%p", parent_, this, index, pickers_[index].get()); @@ -211,13 +209,13 @@ RoundRobin::PickResult RoundRobin::Picker::Pick(PickArgs args) { // RoundRobin::RoundRobin(Args args) : LoadBalancingPolicy(std::move(args)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { gpr_log(GPR_INFO, "[RR %p] Created", this); } } RoundRobin::~RoundRobin() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { gpr_log(GPR_INFO, "[RR %p] Destroying Round Robin policy", this); } CHECK(endpoint_list_ == nullptr); @@ -225,7 +223,7 @@ RoundRobin::~RoundRobin() { } void RoundRobin::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { gpr_log(GPR_INFO, "[RR %p] Shutting down", this); } shutdown_ = true; @@ -243,12 +241,12 @@ void RoundRobin::ResetBackoffLocked() { absl::Status RoundRobin::UpdateLocked(UpdateArgs args) { EndpointAddressesIterator* addresses = nullptr; if (args.addresses.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { gpr_log(GPR_INFO, "[RR %p] received update", this); } addresses = args.addresses->get(); } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { gpr_log(GPR_INFO, "[RR %p] received update with address error: %s", this, args.addresses.status().ToString().c_str()); } @@ -257,7 +255,7 @@ absl::Status RoundRobin::UpdateLocked(UpdateArgs args) { if (endpoint_list_ != nullptr) return args.addresses.status(); } // Create new child list, replacing the previous pending list, if any. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace) && + if (GRPC_TRACE_FLAG_ENABLED(round_robin) && latest_pending_endpoint_list_ != nullptr) { gpr_log(GPR_INFO, "[RR %p] replacing previous pending child list %p", this, latest_pending_endpoint_list_.get()); @@ -269,8 +267,7 @@ absl::Status RoundRobin::UpdateLocked(UpdateArgs args) { // If the new list is empty, immediately promote it to // endpoint_list_ and report TRANSIENT_FAILURE. if (latest_pending_endpoint_list_->size() == 0) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace) && - endpoint_list_ != nullptr) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin) && endpoint_list_ != nullptr) { gpr_log(GPR_INFO, "[RR %p] replacing previous child list %p", this, endpoint_list_.get()); } @@ -305,7 +302,7 @@ void RoundRobin::RoundRobinEndpointList::RoundRobinEndpoint::OnStateUpdate( grpc_connectivity_state new_state, const absl::Status& status) { auto* rr_endpoint_list = endpoint_list(); auto* round_robin = policy(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { gpr_log( GPR_INFO, "[RR %p] connectivity changed for child %p, endpoint_list %p " @@ -315,7 +312,7 @@ void RoundRobin::RoundRobinEndpointList::RoundRobinEndpoint::OnStateUpdate( ConnectivityStateName(new_state), status.ToString().c_str()); } if (new_state == GRPC_CHANNEL_IDLE) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { gpr_log(GPR_INFO, "[RR %p] child %p reported IDLE; requesting connection", round_robin, this); } @@ -378,7 +375,7 @@ void RoundRobin::RoundRobinEndpointList:: (round_robin->endpoint_list_->num_ready_ == 0 || (num_ready_ > 0 && AllEndpointsSeenInitialState()) || num_transient_failure_ == size())) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { const std::string old_counters_string = round_robin->endpoint_list_ != nullptr ? round_robin->endpoint_list_->CountersString() @@ -398,7 +395,7 @@ void RoundRobin::RoundRobinEndpointList:: // 2) ANY child is CONNECTING => policy is CONNECTING. // 3) ALL children are TRANSIENT_FAILURE => policy is TRANSIENT_FAILURE. if (num_ready_ > 0) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { gpr_log(GPR_INFO, "[RR %p] reporting READY with child list %p", round_robin, this); } @@ -414,7 +411,7 @@ void RoundRobin::RoundRobinEndpointList:: GRPC_CHANNEL_READY, absl::OkStatus(), MakeRefCounted(round_robin, std::move(pickers))); } else if (num_connecting_ > 0) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { gpr_log(GPR_INFO, "[RR %p] reporting CONNECTING with child list %p", round_robin, this); } @@ -422,7 +419,7 @@ void RoundRobin::RoundRobinEndpointList:: GRPC_CHANNEL_CONNECTING, absl::Status(), MakeRefCounted(nullptr)); } else if (num_transient_failure_ == size()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_round_robin_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(round_robin)) { gpr_log(GPR_INFO, "[RR %p] reporting TRANSIENT_FAILURE with child list %p: %s", round_robin, this, status_for_tf.ToString().c_str()); diff --git a/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc b/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc index e4f805f7384..55fe3cd7e20 100644 --- a/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc +++ b/src/core/load_balancing/weighted_round_robin/weighted_round_robin.cc @@ -77,8 +77,6 @@ namespace grpc_core { -TraceFlag grpc_lb_wrr_trace(false, "weighted_round_robin_lb"); - namespace { constexpr absl::string_view kWeightedRoundRobin = "weighted_round_robin"; @@ -282,7 +280,7 @@ class WeightedRoundRobin final : public LoadBalancingPolicy { EndpointAddressesIterator* endpoints, const ChannelArgs& args, std::vector* errors) : EndpointList(std::move(wrr), - GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace) + GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb) ? "WrrEndpointList" : nullptr) { Init(endpoints, args, @@ -449,7 +447,7 @@ void WeightedRoundRobin::EndpointWeight::MaybeUpdateWeight( weight = qps / (utilization + penalty); } if (weight == 0) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] subchannel %s: qps=%f, eps=%f, utilization=%f: " "error_util_penalty=%f, weight=%f (not updating)", @@ -461,7 +459,7 @@ void WeightedRoundRobin::EndpointWeight::MaybeUpdateWeight( Timestamp now = Timestamp::Now(); // Grab the lock and update the data. MutexLock lock(&mu_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] subchannel %s: qps=%f, eps=%f, utilization=%f " "error_util_penalty=%f : setting weight=%f weight_=%f now=%s " @@ -480,7 +478,7 @@ float WeightedRoundRobin::EndpointWeight::GetWeight( Timestamp now, Duration weight_expiration_period, Duration blackout_period, uint64_t* num_not_yet_usable, uint64_t* num_stale) { MutexLock lock(&mu_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] subchannel %s: getting weight: now=%s " "weight_expiration_period=%s blackout_period=%s " @@ -558,7 +556,7 @@ WeightedRoundRobin::Picker::Picker(RefCountedPtr wrr, } global_stats().IncrementWrrSubchannelListSize(endpoint_list->size()); global_stats().IncrementWrrSubchannelReadySize(endpoints_.size()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p picker %p] created picker from endpoint_list=%p " "with %" PRIuPTR " subchannels", @@ -568,14 +566,14 @@ WeightedRoundRobin::Picker::Picker(RefCountedPtr wrr, } WeightedRoundRobin::Picker::~Picker() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p picker %p] destroying picker", wrr_.get(), this); } } void WeightedRoundRobin::Picker::Orphaned() { MutexLock lock(&timer_mu_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p picker %p] cancelling timer", wrr_.get(), this); } wrr_->channel_control_helper()->GetEventEngine()->Cancel(*timer_handle_); @@ -587,7 +585,7 @@ WeightedRoundRobin::PickResult WeightedRoundRobin::Picker::Pick(PickArgs args) { size_t index = PickIndex(); CHECK(index < endpoints_.size()); auto& endpoint_info = endpoints_[index]; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p picker %p] returning index %" PRIuPTR ", picker=%p", wrr_.get(), this, index, endpoint_info.picker.get()); @@ -643,7 +641,7 @@ void WeightedRoundRobin::Picker::BuildSchedulerAndStartTimerLocked() { stats_plugins.AddCounter(kMetricEndpointWeightStale, num_stale, {wrr_->channel_control_helper()->GetTarget()}, {wrr_->locality_name_}); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p picker %p] new weights: %s", wrr_.get(), this, absl::StrJoin(weights, " ").c_str()); } @@ -653,12 +651,12 @@ void WeightedRoundRobin::Picker::BuildSchedulerAndStartTimerLocked() { if (scheduler_or.has_value()) { scheduler = std::make_shared(std::move(*scheduler_or)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p picker %p] new scheduler: %p", wrr_.get(), this, scheduler.get()); } } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p picker %p] no scheduler, falling back to RR", wrr_.get(), this); } @@ -671,7 +669,7 @@ void WeightedRoundRobin::Picker::BuildSchedulerAndStartTimerLocked() { scheduler_ = std::move(scheduler); } // Start timer. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p picker %p] scheduling timer for %s", wrr_.get(), this, config_->weight_update_period().ToString().c_str()); } @@ -684,7 +682,7 @@ void WeightedRoundRobin::Picker::BuildSchedulerAndStartTimerLocked() { { MutexLock lock(&self->timer_mu_); if (self->timer_handle_.has_value()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p picker %p] timer fired", self->wrr_.get(), self.get()); } @@ -709,14 +707,14 @@ WeightedRoundRobin::WeightedRoundRobin(Args args) locality_name_(channel_args() .GetString(GRPC_ARG_LB_WEIGHTED_TARGET_CHILD) .value_or("")) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] Created -- locality_name=\"%s\"", this, std::string(locality_name_).c_str()); } } WeightedRoundRobin::~WeightedRoundRobin() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] Destroying Round Robin policy", this); } CHECK(endpoint_list_ == nullptr); @@ -724,7 +722,7 @@ WeightedRoundRobin::~WeightedRoundRobin() { } void WeightedRoundRobin::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] Shutting down", this); } shutdown_ = true; @@ -744,7 +742,7 @@ absl::Status WeightedRoundRobin::UpdateLocked(UpdateArgs args) { config_ = args.config.TakeAsSubclass(); std::shared_ptr addresses; if (args.addresses.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] received update", this); } // Weed out duplicate endpoints. Also sort the endpoints so that if @@ -772,7 +770,7 @@ absl::Status WeightedRoundRobin::UpdateLocked(UpdateArgs args) { std::make_shared(EndpointAddressesList( ordered_addresses.begin(), ordered_addresses.end())); } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] received update with address error: %s", this, args.addresses.status().ToString().c_str()); } @@ -781,7 +779,7 @@ absl::Status WeightedRoundRobin::UpdateLocked(UpdateArgs args) { if (endpoint_list_ != nullptr) return args.addresses.status(); } // Create new endpoint list, replacing the previous pending list, if any. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace) && + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb) && latest_pending_endpoint_list_ != nullptr) { gpr_log(GPR_INFO, "[WRR %p] replacing previous pending endpoint list %p", this, latest_pending_endpoint_list_.get()); @@ -792,7 +790,7 @@ absl::Status WeightedRoundRobin::UpdateLocked(UpdateArgs args) { // If the new list is empty, immediately promote it to // endpoint_list_ and report TRANSIENT_FAILURE. if (latest_pending_endpoint_list_->size() == 0) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace) && + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb) && endpoint_list_ != nullptr) { gpr_log(GPR_INFO, "[WRR %p] replacing previous endpoint list %p", this, endpoint_list_.get()); @@ -875,7 +873,7 @@ void WeightedRoundRobin::WrrEndpointList::WrrEndpoint::OnStateUpdate( grpc_connectivity_state new_state, const absl::Status& status) { auto* wrr_endpoint_list = endpoint_list(); auto* wrr = policy(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] connectivity changed for child %p, endpoint_list %p " "(index %" PRIuPTR " of %" PRIuPTR @@ -885,7 +883,7 @@ void WeightedRoundRobin::WrrEndpointList::WrrEndpoint::OnStateUpdate( ConnectivityStateName(new_state), status.ToString().c_str()); } if (new_state == GRPC_CHANNEL_IDLE) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] child %p reported IDLE; requesting connection", wrr, this); @@ -966,7 +964,7 @@ void WeightedRoundRobin::WrrEndpointList:: (wrr->endpoint_list_->num_ready_ == 0 || (num_ready_ > 0 && AllEndpointsSeenInitialState()) || num_transient_failure_ == size())) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { const std::string old_counters_string = wrr->endpoint_list_ != nullptr ? wrr->endpoint_list_->CountersString() : ""; @@ -984,7 +982,7 @@ void WeightedRoundRobin::WrrEndpointList:: // 2) ANY child is CONNECTING => policy is CONNECTING. // 3) ALL children are TRANSIENT_FAILURE => policy is TRANSIENT_FAILURE. if (num_ready_ > 0) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] reporting READY with endpoint list %p", wrr, this); } @@ -992,7 +990,7 @@ void WeightedRoundRobin::WrrEndpointList:: GRPC_CHANNEL_READY, absl::Status(), MakeRefCounted(wrr->RefAsSubclass(), this)); } else if (num_connecting_ > 0) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] reporting CONNECTING with endpoint list %p", wrr, this); } @@ -1000,7 +998,7 @@ void WeightedRoundRobin::WrrEndpointList:: GRPC_CHANNEL_CONNECTING, absl::Status(), MakeRefCounted(nullptr)); } else if (num_transient_failure_ == size()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_wrr_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_round_robin_lb)) { gpr_log(GPR_INFO, "[WRR %p] reporting TRANSIENT_FAILURE with endpoint list %p: %s", wrr, this, status_for_tf.ToString().c_str()); diff --git a/src/core/load_balancing/weighted_target/weighted_target.cc b/src/core/load_balancing/weighted_target/weighted_target.cc index 61c4777851d..ea676e206ce 100644 --- a/src/core/load_balancing/weighted_target/weighted_target.cc +++ b/src/core/load_balancing/weighted_target/weighted_target.cc @@ -70,8 +70,6 @@ namespace grpc_core { -TraceFlag grpc_lb_weighted_target_trace(false, "weighted_target_lb"); - namespace { using ::grpc_event_engine::experimental::EventEngine; @@ -286,13 +284,13 @@ WeightedTargetLb::PickResult WeightedTargetLb::WeightedPicker::Pick( WeightedTargetLb::WeightedTargetLb(Args args) : LoadBalancingPolicy(std::move(args)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] created", this); } } WeightedTargetLb::~WeightedTargetLb() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] destroying weighted_target LB policy", this); @@ -300,7 +298,7 @@ WeightedTargetLb::~WeightedTargetLb() { } void WeightedTargetLb::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] shutting down", this); } shutting_down_ = true; @@ -313,7 +311,7 @@ void WeightedTargetLb::ResetBackoffLocked() { absl::Status WeightedTargetLb::UpdateLocked(UpdateArgs args) { if (shutting_down_) return absl::OkStatus(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] Received update", this); } update_in_progress_ = true; @@ -385,7 +383,7 @@ void WeightedTargetLb::UpdateStateLocked() { // all children. This avoids unnecessary picker churn while an update // is being propagated to our children. if (update_in_progress_) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] scanning children to determine " "connectivity state", @@ -412,7 +410,7 @@ void WeightedTargetLb::UpdateStateLocked() { continue; } auto child_picker = child->picker(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] child=%s state=%s weight=%u picker=%p", this, child_name.c_str(), @@ -455,7 +453,7 @@ void WeightedTargetLb::UpdateStateLocked() { } else { connectivity_state = GRPC_CHANNEL_TRANSIENT_FAILURE; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] connectivity changed to %s", this, ConnectivityStateName(connectivity_state)); } @@ -499,7 +497,7 @@ WeightedTargetLb::WeightedChild::DelayedRemovalTimer::DelayedRemovalTimer( void WeightedTargetLb::WeightedChild::DelayedRemovalTimer::Orphan() { if (timer_handle_.has_value()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] WeightedChild %p %s: cancelling " "delayed removal timer", @@ -530,14 +528,14 @@ WeightedTargetLb::WeightedChild::WeightedChild( : weighted_target_policy_(std::move(weighted_target_policy)), name_(name), picker_(MakeRefCounted(nullptr)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] created WeightedChild %p for %s", weighted_target_policy_.get(), this, name_.c_str()); } } WeightedTargetLb::WeightedChild::~WeightedChild() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] WeightedChild %p %s: destroying child", weighted_target_policy_.get(), this, name_.c_str()); @@ -546,7 +544,7 @@ WeightedTargetLb::WeightedChild::~WeightedChild() { } void WeightedTargetLb::WeightedChild::Orphan() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] WeightedChild %p %s: shutting down child", weighted_target_policy_.get(), this, name_.c_str()); @@ -574,8 +572,8 @@ WeightedTargetLb::WeightedChild::CreateChildPolicyLocked( std::make_unique(this->Ref(DEBUG_LOCATION, "Helper")); OrphanablePtr lb_policy = MakeOrphanable(std::move(lb_policy_args), - &grpc_lb_weighted_target_trace); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + &weighted_target_lb_trace); + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] WeightedChild %p %s: Created new child " "policy handler %p", @@ -597,15 +595,14 @@ absl::Status WeightedTargetLb::WeightedChild::UpdateLocked( const std::string& resolution_note, ChannelArgs args) { if (weighted_target_policy_->shutting_down_) return absl::OkStatus(); // Update child weight. - if (weight_ != config.weight && - GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (weight_ != config.weight && GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] WeightedChild %p %s: weight=%u", weighted_target_policy_.get(), this, name_.c_str(), config.weight); } weight_ = config.weight; // Reactivate if needed. if (delayed_removal_timer_ != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] WeightedChild %p %s: reactivating", weighted_target_policy_.get(), this, name_.c_str()); @@ -624,7 +621,7 @@ absl::Status WeightedTargetLb::WeightedChild::UpdateLocked( update_args.resolution_note = resolution_note; update_args.args = std::move(args); // Update the policy. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] WeightedChild %p %s: Updating child " "policy handler %p", @@ -643,7 +640,7 @@ void WeightedTargetLb::WeightedChild::OnConnectivityStateUpdateLocked( RefCountedPtr picker) { // Cache the picker in the WeightedChild. picker_ = std::move(picker); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] WeightedChild %p %s: connectivity " "state update: state=%s (%s) picker=%p", @@ -667,7 +664,7 @@ void WeightedTargetLb::WeightedChild::OnConnectivityStateUpdateLocked( void WeightedTargetLb::WeightedChild::DeactivateLocked() { // If already deactivated, don't do that again. if (weight_ == 0) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_weighted_target_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(weighted_target_lb)) { gpr_log(GPR_INFO, "[weighted_target_lb %p] WeightedChild %p %s: deactivating", weighted_target_policy_.get(), this, name_.c_str()); diff --git a/src/core/load_balancing/xds/cds.cc b/src/core/load_balancing/xds/cds.cc index 88813f87d78..2ab3cda35c7 100644 --- a/src/core/load_balancing/xds/cds.cc +++ b/src/core/load_balancing/xds/cds.cc @@ -67,8 +67,6 @@ namespace grpc_core { -TraceFlag grpc_cds_lb_trace(false, "cds_lb"); - namespace { // TODO(roth): Remove this after the 1.63 release. @@ -185,19 +183,19 @@ class CdsLb final : public LoadBalancingPolicy { // CdsLb::CdsLb(Args args) : LoadBalancingPolicy(std::move(args)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(cds_lb)) { gpr_log(GPR_INFO, "[cdslb %p] created", this); } } CdsLb::~CdsLb() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(cds_lb)) { gpr_log(GPR_INFO, "[cdslb %p] destroying cds LB policy", this); } } void CdsLb::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(cds_lb)) { gpr_log(GPR_INFO, "[cdslb %p] shutting down", this); } shutting_down_ = true; @@ -282,7 +280,7 @@ class PriorityEndpointIterator final : public EndpointAddressesIterator { absl::Status CdsLb::UpdateLocked(UpdateArgs args) { // Get new config. auto new_config = args.config.TakeAsSubclass(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(cds_lb)) { gpr_log(GPR_INFO, "[cdslb %p] received update: cluster=%s is_dynamic=%d", this, new_config->cluster().c_str(), new_config->is_dynamic()); } @@ -296,7 +294,7 @@ absl::Status CdsLb::UpdateLocked(UpdateArgs args) { } // Start dynamic subscription if needed. if (new_config->is_dynamic() && subscription_ == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(cds_lb)) { gpr_log(GPR_INFO, "[cdslb %p] obtaining dynamic subscription for cluster %s", this, cluster_name_.c_str()); @@ -327,7 +325,7 @@ absl::Status CdsLb::UpdateLocked(UpdateArgs args) { // If we are already subscribed, it's possible that we just // recently subscribed but another update came through before we // got the new cluster, in which case it will still be missing. - if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(cds_lb)) { gpr_log(GPR_INFO, "[cdslb %p] xDS config has no entry for dynamic cluster %s, " "waiting for subsequent update", @@ -454,7 +452,7 @@ absl::Status CdsLb::UpdateLocked(UpdateArgs args) { } grpc_pollset_set_add_pollset_set(child_policy_->interested_parties(), interested_parties()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(cds_lb)) { gpr_log(GPR_INFO, "[cdslb %p] created child policy %s (%p)", this, std::string((*child_config)->name()).c_str(), child_policy_.get()); @@ -664,7 +662,7 @@ Json CdsLb::CreateChildPolicyConfigForLeafCluster( {"outlier_detection_experimental", Json::FromObject(std::move(outlier_detection_config))}, })}); - if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(cds_lb)) { gpr_log(GPR_INFO, "[cdslb %p] generated config for child policy: %s", this, JsonDump(outlier_detection_policy, /*indent=*/1).c_str()); } @@ -697,7 +695,7 @@ Json CdsLb::CreateChildPolicyConfigForAggregateCluster( {"priorities", Json::FromArray(std::move(priority_priorities))}, })}, })}); - if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(cds_lb)) { gpr_log(GPR_INFO, "[cdslb %p] generated config for child policy: %s", this, JsonDump(json, /*indent=*/1).c_str()); } @@ -716,7 +714,7 @@ void CdsLb::ResetState() { } void CdsLb::ReportTransientFailure(absl::Status status) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(cds_lb)) { gpr_log(GPR_INFO, "[cdslb %p] reporting TRANSIENT_FAILURE: %s", this, status.ToString().c_str()); } diff --git a/src/core/load_balancing/xds/xds_cluster_impl.cc b/src/core/load_balancing/xds/xds_cluster_impl.cc index 25b6a0c464a..12f939d3e81 100644 --- a/src/core/load_balancing/xds/xds_cluster_impl.cc +++ b/src/core/load_balancing/xds/xds_cluster_impl.cc @@ -76,8 +76,6 @@ namespace grpc_core { -TraceFlag grpc_xds_cluster_impl_lb_trace(false, "xds_cluster_impl_lb"); - namespace { using XdsConfig = XdsDependencyManager::XdsConfig; @@ -397,7 +395,7 @@ XdsClusterImplLb::Picker::Picker(XdsClusterImplLb* xds_cluster_impl_lb, drop_config_(xds_cluster_impl_lb->drop_config_), drop_stats_(xds_cluster_impl_lb->drop_stats_), picker_(std::move(picker)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_impl_lb)) { gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] constructed new picker %p", xds_cluster_impl_lb, this); } @@ -479,14 +477,14 @@ LoadBalancingPolicy::PickResult XdsClusterImplLb::Picker::Pick( XdsClusterImplLb::XdsClusterImplLb(RefCountedPtr xds_client, Args args) : LoadBalancingPolicy(std::move(args)), xds_client_(std::move(xds_client)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_impl_lb)) { gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] created -- using xds client %p", this, xds_client_.get()); } } XdsClusterImplLb::~XdsClusterImplLb() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_impl_lb)) { gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] destroying xds_cluster_impl LB policy", this); @@ -494,7 +492,7 @@ XdsClusterImplLb::~XdsClusterImplLb() { } void XdsClusterImplLb::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_impl_lb)) { gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] shutting down", this); } shutting_down_ = true; @@ -517,7 +515,7 @@ void XdsClusterImplLb::ResetState() { } void XdsClusterImplLb::ReportTransientFailure(absl::Status status) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_impl_lb)) { gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] reporting TRANSIENT_FAILURE: %s", this, status.ToString().c_str()); @@ -545,7 +543,7 @@ std::string GetEdsResourceName(const XdsClusterResource& cluster_resource) { } absl::Status XdsClusterImplLb::UpdateLocked(UpdateArgs args) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_impl_lb)) { gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] Received update", this); } // Grab new LB policy config. @@ -707,7 +705,7 @@ void XdsClusterImplLb::MaybeUpdatePickerLocked() { // whether) the child has reported. if (drop_config_ != nullptr && drop_config_->drop_all()) { auto drop_picker = MakeRefCounted(this, picker_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_impl_lb)) { gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] updating connectivity (drop all): " "state=READY picker=%p", @@ -720,7 +718,7 @@ void XdsClusterImplLb::MaybeUpdatePickerLocked() { // Otherwise, update only if we have a child picker. if (picker_ != nullptr) { auto drop_picker = MakeRefCounted(this, picker_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_impl_lb)) { gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] updating connectivity: state=%s " "status=(%s) picker=%p", @@ -741,8 +739,8 @@ OrphanablePtr XdsClusterImplLb::CreateChildPolicyLocked( RefAsSubclass(DEBUG_LOCATION, "Helper")); OrphanablePtr lb_policy = MakeOrphanable(std::move(lb_policy_args), - &grpc_xds_cluster_impl_lb_trace); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) { + &xds_cluster_impl_lb_trace); + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_impl_lb)) { gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] Created new child policy handler %p", this, lb_policy.get()); @@ -770,7 +768,7 @@ absl::Status XdsClusterImplLb::UpdateChildPolicyLocked( update_args.args = args.Set(GRPC_ARG_XDS_CLUSTER_NAME, config_->cluster_name()); // Update the policy. - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_impl_lb)) { gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] Updating child policy handler %p", this, child_policy_.get()); @@ -825,7 +823,7 @@ void XdsClusterImplLb::Helper::UpdateState( grpc_connectivity_state state, const absl::Status& status, RefCountedPtr picker) { if (parent()->shutting_down_) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_impl_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_impl_lb)) { gpr_log(GPR_INFO, "[xds_cluster_impl_lb %p] child connectivity state update: " "state=%s (%s) picker=%p", diff --git a/src/core/load_balancing/xds/xds_cluster_manager.cc b/src/core/load_balancing/xds/xds_cluster_manager.cc index 5c4b8e641bc..6163d66c922 100644 --- a/src/core/load_balancing/xds/xds_cluster_manager.cc +++ b/src/core/load_balancing/xds/xds_cluster_manager.cc @@ -63,8 +63,6 @@ namespace grpc_core { -TraceFlag grpc_xds_cluster_manager_lb_trace(false, "xds_cluster_manager_lb"); - namespace { using ::grpc_event_engine::experimental::EventEngine; @@ -251,7 +249,7 @@ XdsClusterManagerLb::XdsClusterManagerLb(Args args) : LoadBalancingPolicy(std::move(args)) {} XdsClusterManagerLb::~XdsClusterManagerLb() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_manager_lb)) { gpr_log( GPR_INFO, "[xds_cluster_manager_lb %p] destroying xds_cluster_manager LB policy", @@ -260,7 +258,7 @@ XdsClusterManagerLb::~XdsClusterManagerLb() { } void XdsClusterManagerLb::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_manager_lb)) { gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] shutting down", this); } shutting_down_ = true; @@ -277,7 +275,7 @@ void XdsClusterManagerLb::ResetBackoffLocked() { absl::Status XdsClusterManagerLb::UpdateLocked(UpdateArgs args) { if (shutting_down_) return absl::OkStatus(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_manager_lb)) { gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] Received update", this); } update_in_progress_ = true; @@ -370,7 +368,7 @@ void XdsClusterManagerLb::UpdateStateLocked() { } else { connectivity_state = GRPC_CHANNEL_TRANSIENT_FAILURE; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_manager_lb)) { gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] connectivity changed to %s", this, ConnectivityStateName(connectivity_state)); } @@ -380,7 +378,7 @@ void XdsClusterManagerLb::UpdateStateLocked() { RefCountedPtr& child_picker = cluster_map[cluster_name]; child_picker = children_[cluster_name]->picker(); if (child_picker == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_manager_lb)) { gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] child %s has not yet returned a " "picker; creating a QueuePicker.", @@ -410,7 +408,7 @@ XdsClusterManagerLb::ClusterChild::ClusterChild( : xds_cluster_manager_policy_(std::move(xds_cluster_manager_policy)), name_(name), picker_(MakeRefCounted(nullptr)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_manager_lb)) { gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] created ClusterChild %p for %s", xds_cluster_manager_policy_.get(), this, name_.c_str()); @@ -418,7 +416,7 @@ XdsClusterManagerLb::ClusterChild::ClusterChild( } XdsClusterManagerLb::ClusterChild::~ClusterChild() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_manager_lb)) { gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] ClusterChild %p: destroying " "child", @@ -428,7 +426,7 @@ XdsClusterManagerLb::ClusterChild::~ClusterChild() { } void XdsClusterManagerLb::ClusterChild::Orphan() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_manager_lb)) { gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] ClusterChild %p %s: " "shutting down child", @@ -463,8 +461,8 @@ XdsClusterManagerLb::ClusterChild::CreateChildPolicyLocked( std::make_unique(this->Ref(DEBUG_LOCATION, "Helper")); OrphanablePtr lb_policy = MakeOrphanable(std::move(lb_policy_args), - &grpc_xds_cluster_manager_lb_trace); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) { + &xds_cluster_manager_lb_trace); + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_manager_lb)) { gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] ClusterChild %p %s: Created " "new child " @@ -504,7 +502,7 @@ absl::Status XdsClusterManagerLb::ClusterChild::UpdateLocked( update_args.addresses = addresses; update_args.args = args; // Update the policy. - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_manager_lb)) { gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] ClusterChild %p %s: " "Updating child " @@ -558,7 +556,7 @@ void XdsClusterManagerLb::ClusterChild::OnDelayedRemovalTimerLocked() { void XdsClusterManagerLb::ClusterChild::Helper::UpdateState( grpc_connectivity_state state, const absl::Status& status, RefCountedPtr picker) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_cluster_manager_lb)) { gpr_log( GPR_INFO, "[xds_cluster_manager_lb %p] child %s: received update: state=%s (%s) " diff --git a/src/core/load_balancing/xds/xds_override_host.cc b/src/core/load_balancing/xds/xds_override_host.cc index 06b73fc509f..b2fd8c2c3af 100644 --- a/src/core/load_balancing/xds/xds_override_host.cc +++ b/src/core/load_balancing/xds/xds_override_host.cc @@ -88,8 +88,6 @@ namespace grpc_core { using ::grpc_event_engine::experimental::EventEngine; -TraceFlag grpc_lb_xds_override_host_trace(false, "xds_override_host_lb"); - namespace { template struct PtrLessThan { @@ -467,7 +465,7 @@ XdsOverrideHostLb::Picker::Picker( : policy_(std::move(xds_override_host_lb)), picker_(std::move(picker)), override_host_health_status_set_(override_host_health_status_set) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] constructed new picker %p", policy_.get(), this); } @@ -490,7 +488,7 @@ XdsOverrideHostLb::Picker::PickOverridenHost( if (it == policy_->subchannel_map_.end()) continue; if (!override_host_health_status_set_.Contains( it->second->eds_health_status())) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "Subchannel %s health status is not overridden (%s)", std::string(address).c_str(), @@ -500,7 +498,7 @@ XdsOverrideHostLb::Picker::PickOverridenHost( } auto subchannel = it->second->GetSubchannelRef(); if (subchannel == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "No subchannel for %s", std::string(address).c_str()); } @@ -513,7 +511,7 @@ XdsOverrideHostLb::Picker::PickOverridenHost( if (connectivity_state == GRPC_CHANNEL_READY) { // Found a READY subchannel. Pass back the actual address list // and return the subchannel. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "Picker override found READY subchannel %s", std::string(address).c_str()); } @@ -530,7 +528,7 @@ XdsOverrideHostLb::Picker::PickOverridenHost( // No READY subchannel found. If we found an IDLE subchannel, trigger // a connection attempt and queue the pick until that attempt completes. if (idle_subchannel != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { LOG(INFO) << "Picker override found IDLE subchannel"; } // Deletes itself after the connection is requested. @@ -540,7 +538,7 @@ XdsOverrideHostLb::Picker::PickOverridenHost( // No READY or IDLE subchannels. If we found a CONNECTING subchannel, // queue the pick and wait for the connection attempt to complete. if (found_connecting) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { LOG(INFO) << "Picker override found CONNECTING subchannel"; } return PickResult::Queue(); @@ -549,7 +547,7 @@ XdsOverrideHostLb::Picker::PickOverridenHost( // entry that has no subchannel, then queue the pick and trigger // creation of a subchannel for that entry. if (!address_with_no_subchannel.empty()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { LOG(INFO) << "Picker override found entry with no subchannel"; } if (!IsWorkSerializerDispatchEnabled()) { @@ -611,7 +609,7 @@ XdsOverrideHostLb::IdleTimer::IdleTimer(RefCountedPtr policy, // Min time between timer runs is 5s so that we don't kill ourselves // with lock contention and CPU usage due to sweeps over the map. duration = std::max(duration, Duration::Seconds(5)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] idle timer %p: subchannel cleanup " "pass will run in %s", @@ -630,7 +628,7 @@ XdsOverrideHostLb::IdleTimer::IdleTimer(RefCountedPtr policy, void XdsOverrideHostLb::IdleTimer::Orphan() { if (timer_handle_.has_value()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] idle timer %p: cancelling", policy_.get(), this); } @@ -643,7 +641,7 @@ void XdsOverrideHostLb::IdleTimer::Orphan() { void XdsOverrideHostLb::IdleTimer::OnTimerLocked() { if (timer_handle_.has_value()) { timer_handle_.reset(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] idle timer %p: timer fired", policy_.get(), this); } @@ -657,13 +655,13 @@ void XdsOverrideHostLb::IdleTimer::OnTimerLocked() { XdsOverrideHostLb::XdsOverrideHostLb(Args args) : LoadBalancingPolicy(std::move(args)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] created", this); } } XdsOverrideHostLb::~XdsOverrideHostLb() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] destroying xds_override_host LB policy", this); @@ -671,7 +669,7 @@ XdsOverrideHostLb::~XdsOverrideHostLb() { } void XdsOverrideHostLb::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] shutting down", this); } shutting_down_ = true; @@ -704,7 +702,7 @@ void XdsOverrideHostLb::ResetState() { } void XdsOverrideHostLb::ReportTransientFailure(absl::Status status) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] reporting TRANSIENT_FAILURE: %s", this, status.ToString().c_str()); @@ -742,7 +740,7 @@ class ChildEndpointIterator final : public EndpointAddressesIterator { parent_it_->ForEach([&](const EndpointAddresses& endpoint) { XdsHealthStatus status = GetEndpointHealthStatus(endpoint); if (status.status() != XdsHealthStatus::kDraining) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] endpoint %s: not draining, " "passing to child", @@ -758,7 +756,7 @@ class ChildEndpointIterator final : public EndpointAddressesIterator { }; absl::Status XdsOverrideHostLb::UpdateLocked(UpdateArgs args) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] Received update", this); } // Grab new LB policy config. @@ -788,7 +786,7 @@ absl::Status XdsOverrideHostLb::UpdateLocked(UpdateArgs args) { args_ = std::move(args.args); override_host_status_set_ = it->second->cluster->override_host_statuses; connection_idle_timeout_ = it->second->cluster->connection_idle_timeout; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] override host status set: %s " "connection idle timeout: %s", @@ -801,7 +799,7 @@ absl::Status XdsOverrideHostLb::UpdateLocked(UpdateArgs args) { args.addresses = std::make_shared(std::move(*args.addresses)); } else { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] address error: %s", this, args.addresses.status().ToString().c_str()); } @@ -816,7 +814,7 @@ absl::Status XdsOverrideHostLb::UpdateLocked(UpdateArgs args) { update_args.resolution_note = std::move(args.resolution_note); update_args.config = new_config->child_config(); update_args.args = args_; - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] Updating child policy handler %p", this, child_policy_.get()); @@ -828,7 +826,7 @@ void XdsOverrideHostLb::MaybeUpdatePickerLocked() { if (picker_ != nullptr) { auto xds_override_host_picker = MakeRefCounted( RefAsSubclass(), picker_, override_host_status_set_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] updating connectivity: state=%s " "status=(%s) picker=%p", @@ -849,8 +847,8 @@ OrphanablePtr XdsOverrideHostLb::CreateChildPolicyLocked( RefAsSubclass(DEBUG_LOCATION, "Helper")); OrphanablePtr lb_policy = MakeOrphanable(std::move(lb_policy_args), - &grpc_lb_xds_override_host_trace); - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + &xds_override_host_lb_trace); + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] Created new child policy handler %p", this, lb_policy.get()); @@ -878,7 +876,7 @@ void XdsOverrideHostLb::UpdateAddressMap( // Skip draining hosts if not in the override status set. if (status.status() == XdsHealthStatus::kDraining && !override_host_status_set_.Contains(status)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] endpoint %s: draining but not in " "override_host_status set -- ignoring", @@ -891,7 +889,7 @@ void XdsOverrideHostLb::UpdateAddressMap( for (const auto& address : endpoint.addresses()) { auto key = grpc_sockaddr_to_string(&address, /*normalize=*/false); if (!key.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] no key for endpoint address; " "not adding to map", @@ -923,7 +921,7 @@ void XdsOverrideHostLb::UpdateAddressMap( MutexLock lock(&mu_); for (auto it = subchannel_map_.begin(); it != subchannel_map_.end();) { if (addresses_for_map.find(it->first) == addresses_for_map.end()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] removing map key %s", this, it->first.c_str()); } @@ -938,14 +936,14 @@ void XdsOverrideHostLb::UpdateAddressMap( auto& address_info = p.second; auto it = subchannel_map_.find(address); if (it == subchannel_map_.end()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] adding map key %s", this, address.c_str()); } it = subchannel_map_.emplace(address, MakeRefCounted()) .first; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] map key %s: setting " "eds_health_status=%s address_list=%s", @@ -990,7 +988,7 @@ XdsOverrideHostLb::AdoptSubchannel( } void XdsOverrideHostLb::CreateSubchannelForAddress(absl::string_view address) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] creating owned subchannel for %s", this, std::string(address).c_str()); @@ -1034,7 +1032,7 @@ void XdsOverrideHostLb::CleanupSubchannels() { if (p.second->last_used_time() <= idle_threshold) { auto subchannel = p.second->TakeOwnedSubchannel(); if (subchannel != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] dropping subchannel for %s", this, p.first.c_str()); @@ -1061,7 +1059,7 @@ void XdsOverrideHostLb::CleanupSubchannels() { RefCountedPtr XdsOverrideHostLb::Helper::CreateSubchannel( const grpc_resolved_address& address, const ChannelArgs& per_address_args, const ChannelArgs& args) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { auto key = grpc_sockaddr_to_string(&address, /*normalize=*/false); gpr_log(GPR_INFO, "[xds_override_host_lb %p] creating subchannel for %s, " @@ -1114,7 +1112,7 @@ void XdsOverrideHostLb::SubchannelWrapper::CancelConnectivityStateWatch( } void XdsOverrideHostLb::SubchannelWrapper::Orphaned() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb %p] subchannel wrapper %p orphaned", policy_.get(), this); @@ -1228,7 +1226,7 @@ void XdsOverrideHostLb::SubchannelEntry::OnSubchannelWrapperOrphan( auto* subchannel = GetSubchannel(); if (subchannel != wrapper) return; if (last_used_time_ < (Timestamp::Now() - connection_idle_timeout)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb] removing unowned subchannel wrapper %p", subchannel); @@ -1239,7 +1237,7 @@ void XdsOverrideHostLb::SubchannelEntry::OnSubchannelWrapperOrphan( // is still within its idle timeout, so we make a new copy of // the wrapper with the same underlying subchannel, and we hold // our own ref to it. - if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_override_host_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_override_host_lb)) { gpr_log(GPR_INFO, "[xds_override_host_lb] subchannel wrapper %p: cloning " "to gain ownership", diff --git a/src/core/load_balancing/xds/xds_wrr_locality.cc b/src/core/load_balancing/xds/xds_wrr_locality.cc index 0d2ea0472b2..85cc5e6f9c0 100644 --- a/src/core/load_balancing/xds/xds_wrr_locality.cc +++ b/src/core/load_balancing/xds/xds_wrr_locality.cc @@ -54,8 +54,6 @@ namespace grpc_core { -TraceFlag grpc_xds_wrr_locality_lb_trace(false, "xds_wrr_locality_lb"); - namespace { constexpr absl::string_view kXdsWrrLocality = "xds_wrr_locality_experimental"; @@ -137,13 +135,13 @@ XdsWrrLocalityLb::XdsWrrLocalityLb(Args args) : LoadBalancingPolicy(std::move(args)) {} XdsWrrLocalityLb::~XdsWrrLocalityLb() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_wrr_locality_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_wrr_locality_lb)) { gpr_log(GPR_INFO, "[xds_wrr_locality_lb %p] destroying", this); } } void XdsWrrLocalityLb::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_wrr_locality_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_wrr_locality_lb)) { gpr_log(GPR_INFO, "[xds_wrr_locality_lb %p] shutting down", this); } if (child_policy_ != nullptr) { @@ -162,7 +160,7 @@ void XdsWrrLocalityLb::ResetBackoffLocked() { } absl::Status XdsWrrLocalityLb::UpdateLocked(UpdateArgs args) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_wrr_locality_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_wrr_locality_lb)) { gpr_log(GPR_INFO, "[xds_wrr_locality_lb %p] Received update", this); } auto config = args.config.TakeAsSubclass(); @@ -204,7 +202,7 @@ absl::Status XdsWrrLocalityLb::UpdateLocked(UpdateArgs args) { })}, }), }); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_wrr_locality_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_wrr_locality_lb)) { gpr_log(GPR_INFO, "[xds_wrr_locality_lb %p] generated child policy config: %s", this, JsonDump(child_config_json, /*indent=*/1).c_str()); @@ -240,7 +238,7 @@ absl::Status XdsWrrLocalityLb::UpdateLocked(UpdateArgs args) { update_args.resolution_note = std::move(args.resolution_note); update_args.args = std::move(args.args); // Update the policy. - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_wrr_locality_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_wrr_locality_lb)) { gpr_log(GPR_INFO, "[xds_wrr_locality_lb %p] updating child policy %p", this, child_policy_.get()); } @@ -257,7 +255,7 @@ OrphanablePtr XdsWrrLocalityLb::CreateChildPolicyLocked( auto lb_policy = CoreConfiguration::Get().lb_policy_registry().CreateLoadBalancingPolicy( "weighted_target_experimental", std::move(lb_policy_args)); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_wrr_locality_lb_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_wrr_locality_lb)) { gpr_log(GPR_INFO, "[xds_wrr_locality_lb %p] created new child policy %p", this, lb_policy.get()); } diff --git a/src/core/resolver/dns/c_ares/dns_resolver_ares.cc b/src/core/resolver/dns/c_ares/dns_resolver_ares.cc index 06b9985c948..3bb03ada824 100644 --- a/src/core/resolver/dns/c_ares/dns_resolver_ares.cc +++ b/src/core/resolver/dns/c_ares/dns_resolver_ares.cc @@ -205,7 +205,7 @@ AresClientChannelDNSResolver::AresClientChannelDNSResolver( .set_jitter(GRPC_DNS_RECONNECT_JITTER) .set_max_backoff(Duration::Milliseconds( GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)), - &grpc_trace_cares_resolver), + &cares_resolver_trace), request_service_config_( !channel_args() .GetBool(GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION) diff --git a/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc index 3cf577cb625..b4b1df2d5ae 100644 --- a/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -76,11 +76,6 @@ using grpc_core::EndpointAddresses; using grpc_core::EndpointAddressesList; -grpc_core::TraceFlag grpc_trace_cares_address_sorting(false, - "cares_address_sorting"); - -grpc_core::TraceFlag grpc_trace_cares_resolver(false, "cares_resolver"); - typedef struct fd_node { // default constructor exists only for linked list manipulation fd_node() : ev_driver(nullptr) {} @@ -572,7 +567,7 @@ static void log_address_sorting_list(const grpc_ares_request* r, void grpc_cares_wrapper_address_sorting_sort(const grpc_ares_request* r, EndpointAddressesList* addresses) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_cares_address_sorting)) { + if (GRPC_TRACE_FLAG_ENABLED(cares_address_sorting)) { log_address_sorting_list(r, *addresses, "input"); } address_sorting_sortable* sortables = static_cast( @@ -592,7 +587,7 @@ void grpc_cares_wrapper_address_sorting_sort(const grpc_ares_request* r, } gpr_free(sortables); *addresses = std::move(sorted); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_cares_address_sorting)) { + if (GRPC_TRACE_FLAG_ENABLED(cares_address_sorting)) { log_address_sorting_list(r, *addresses, "output"); } } diff --git a/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h b/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h index 9183fd59151..62a6d6471b8 100644 --- a/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h +++ b/src/core/resolver/dns/c_ares/grpc_ares_wrapper.h @@ -39,13 +39,9 @@ #define GRPC_DNS_ARES_DEFAULT_QUERY_TIMEOUT_MS 120000 -extern grpc_core::TraceFlag grpc_trace_cares_address_sorting; - -extern grpc_core::TraceFlag grpc_trace_cares_resolver; - #define GRPC_CARES_TRACE_LOG(format, ...) \ do { \ - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_cares_resolver)) { \ + if (GRPC_TRACE_FLAG_ENABLED(cares_resolver)) { \ gpr_log(GPR_DEBUG, "(c-ares resolver) " format, __VA_ARGS__); \ } \ } while (0) diff --git a/src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.cc b/src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.cc index 743422ab603..d01c4abebaf 100644 --- a/src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.cc +++ b/src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.cc @@ -78,14 +78,8 @@ using grpc_event_engine::experimental::EventEngine; // TODO(hork): Add a test that checks for proper authority from balancer // addresses. -// TODO(hork): replace this with `dns_resolver` when all other resolver -// implementations are removed. -TraceFlag grpc_event_engine_client_channel_resolver_trace( - false, "event_engine_client_channel_resolver"); - #define GRPC_EVENT_ENGINE_RESOLVER_TRACE(format, ...) \ - if (GRPC_TRACE_FLAG_ENABLED( \ - grpc_event_engine_client_channel_resolver_trace)) { \ + if (GRPC_TRACE_FLAG_ENABLED(event_engine_client_channel_resolver)) { \ gpr_log(GPR_DEBUG, "(event_engine client channel resolver) " format, \ __VA_ARGS__); \ } @@ -185,7 +179,7 @@ EventEngineClientChannelDNSResolver::EventEngineClientChannelDNSResolver( .set_jitter(GRPC_DNS_RECONNECT_JITTER) .set_max_backoff(Duration::Milliseconds( GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)), - &grpc_event_engine_client_channel_resolver_trace), + &event_engine_client_channel_resolver_trace), request_service_config_( !channel_args() .GetBool(GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION) diff --git a/src/core/resolver/dns/native/dns_resolver.cc b/src/core/resolver/dns/native/dns_resolver.cc index 8ecb92d4857..90432554059 100644 --- a/src/core/resolver/dns/native/dns_resolver.cc +++ b/src/core/resolver/dns/native/dns_resolver.cc @@ -57,8 +57,6 @@ namespace grpc_core { namespace { -TraceFlag grpc_trace_dns_resolver(false, "dns_resolver"); - class NativeClientChannelDNSResolver final : public PollingResolver { public: NativeClientChannelDNSResolver(ResolverArgs args, @@ -92,14 +90,14 @@ NativeClientChannelDNSResolver::NativeClientChannelDNSResolver( .set_jitter(GRPC_DNS_RECONNECT_JITTER) .set_max_backoff(Duration::Milliseconds( GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)), - &grpc_trace_dns_resolver) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_dns_resolver)) { + &dns_resolver_trace) { + if (GRPC_TRACE_FLAG_ENABLED(dns_resolver)) { gpr_log(GPR_DEBUG, "[dns_resolver=%p] created", this); } } NativeClientChannelDNSResolver::~NativeClientChannelDNSResolver() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_dns_resolver)) { + if (GRPC_TRACE_FLAG_ENABLED(dns_resolver)) { gpr_log(GPR_DEBUG, "[dns_resolver=%p] destroyed", this); } } @@ -110,7 +108,7 @@ OrphanablePtr NativeClientChannelDNSResolver::StartRequest() { absl::bind_front(&NativeClientChannelDNSResolver::OnResolved, this), name_to_resolve(), kDefaultSecurePort, kDefaultDNSRequestTimeout, interested_parties(), /*name_server=*/""); - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_dns_resolver)) { + if (GRPC_TRACE_FLAG_ENABLED(dns_resolver)) { gpr_log(GPR_DEBUG, "[dns_resolver=%p] starting request=%p", this, DNSResolver::HandleToString(dns_request_handle).c_str()); } @@ -119,7 +117,7 @@ OrphanablePtr NativeClientChannelDNSResolver::StartRequest() { void NativeClientChannelDNSResolver::OnResolved( absl::StatusOr> addresses_or) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_dns_resolver)) { + if (GRPC_TRACE_FLAG_ENABLED(dns_resolver)) { gpr_log(GPR_DEBUG, "[dns_resolver=%p] request complete, status=\"%s\"", this, addresses_or.status().ToString().c_str()); } diff --git a/src/core/resolver/resolver.cc b/src/core/resolver/resolver.cc index f4910a70d5c..b33889bee17 100644 --- a/src/core/resolver/resolver.cc +++ b/src/core/resolver/resolver.cc @@ -20,9 +20,6 @@ #include -grpc_core::DebugOnlyTraceFlag grpc_trace_resolver_refcount(false, - "resolver_refcount"); - namespace grpc_core { // @@ -30,8 +27,7 @@ namespace grpc_core { // Resolver::Resolver() - : InternallyRefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_trace_resolver_refcount) - ? "Resolver" - : nullptr) {} + : InternallyRefCounted( + GRPC_TRACE_FLAG_ENABLED(resolver_refcount) ? "Resolver" : nullptr) {} } // namespace grpc_core diff --git a/src/core/resolver/resolver.h b/src/core/resolver/resolver.h index 99108a63b38..82638da595a 100644 --- a/src/core/resolver/resolver.h +++ b/src/core/resolver/resolver.h @@ -33,8 +33,6 @@ #include "src/core/resolver/server_address.h" // IWYU pragma: keep #include "src/core/service_config/service_config.h" -extern grpc_core::DebugOnlyTraceFlag grpc_trace_resolver_refcount; - // Name associated with individual address, if available. #define GRPC_ARG_ADDRESS_NAME "grpc.address_name" diff --git a/src/core/resolver/xds/xds_dependency_manager.cc b/src/core/resolver/xds/xds_dependency_manager.cc index 566e16059ce..66b6426b98e 100644 --- a/src/core/resolver/xds/xds_dependency_manager.cc +++ b/src/core/resolver/xds/xds_dependency_manager.cc @@ -27,7 +27,6 @@ #include "src/core/lib/gprpp/match.h" #include "src/core/load_balancing/xds/xds_channel_args.h" #include "src/core/resolver/fake/fake_resolver.h" -#include "src/core/resolver/xds/xds_resolver_trace.h" #include "src/core/xds/grpc/xds_routing.h" namespace grpc_core { @@ -360,7 +359,7 @@ XdsDependencyManager::XdsDependencyManager( listener_resource_name_(std::move(listener_resource_name)), args_(std::move(args)), interested_parties_(interested_parties) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] starting watch for listener %s", this, listener_resource_name_.c_str()); @@ -372,7 +371,7 @@ XdsDependencyManager::XdsDependencyManager( } void XdsDependencyManager::Orphan() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] shutting down", this); } if (listener_watcher_ != nullptr) { @@ -405,7 +404,7 @@ void XdsDependencyManager::Orphan() { void XdsDependencyManager::OnListenerUpdate( std::shared_ptr listener) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] received Listener update", this); } @@ -438,7 +437,7 @@ void XdsDependencyManager::OnListenerUpdate( } // Start watch for the new RDS resource name. route_config_name_ = rds_name; - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log( GPR_INFO, "[XdsDependencyManager %p] starting watch for route config %s", @@ -526,7 +525,7 @@ absl::flat_hash_set GetClustersFromVirtualHost( void XdsDependencyManager::OnRouteConfigUpdate( const std::string& name, std::shared_ptr route_config) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] received RouteConfig update for %s", this, name.empty() ? "" : name.c_str()); @@ -561,7 +560,7 @@ void XdsDependencyManager::OnRouteConfigUpdate( } void XdsDependencyManager::OnError(std::string context, absl::Status status) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] received Listener or RouteConfig " "error: %s %s", @@ -573,7 +572,7 @@ void XdsDependencyManager::OnError(std::string context, absl::Status status) { } void XdsDependencyManager::OnResourceDoesNotExist(std::string context) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] %s", this, context.c_str()); } if (xds_client_ == nullptr) return; @@ -584,7 +583,7 @@ void XdsDependencyManager::OnResourceDoesNotExist(std::string context) { void XdsDependencyManager::OnClusterUpdate( const std::string& name, std::shared_ptr cluster) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] received Cluster update: %s", this, name.c_str()); } @@ -597,7 +596,7 @@ void XdsDependencyManager::OnClusterUpdate( void XdsDependencyManager::OnClusterError(const std::string& name, absl::Status status) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] received Cluster error: %s %s", this, name.c_str(), status.ToString().c_str()); } @@ -612,7 +611,7 @@ void XdsDependencyManager::OnClusterError(const std::string& name, } void XdsDependencyManager::OnClusterDoesNotExist(const std::string& name) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] Cluster does not exist: %s", this, name.c_str()); } @@ -627,7 +626,7 @@ void XdsDependencyManager::OnClusterDoesNotExist(const std::string& name) { void XdsDependencyManager::OnEndpointUpdate( const std::string& name, std::shared_ptr endpoint) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] received Endpoint update: %s", this, name.c_str()); } @@ -659,7 +658,7 @@ void XdsDependencyManager::OnEndpointUpdate( void XdsDependencyManager::OnEndpointError(const std::string& name, absl::Status status) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] received Endpoint error: %s %s", this, name.c_str(), status.ToString().c_str()); @@ -675,7 +674,7 @@ void XdsDependencyManager::OnEndpointError(const std::string& name, } void XdsDependencyManager::OnEndpointDoesNotExist(const std::string& name) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] Endpoint does not exist: %s", this, name.c_str()); } @@ -690,7 +689,7 @@ void XdsDependencyManager::OnEndpointDoesNotExist(const std::string& name) { void XdsDependencyManager::OnDnsResult(const std::string& dns_name, Resolver::Result result) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] received DNS update: %s", this, dns_name.c_str()); } @@ -749,7 +748,7 @@ bool XdsDependencyManager::PopulateClusterConfigMap( // Create a new watcher if needed. if (state.watcher == nullptr) { auto watcher = MakeRefCounted(Ref(), name); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] starting watch for cluster %s", this, std::string(name).c_str()); @@ -777,7 +776,7 @@ bool XdsDependencyManager::PopulateClusterConfigMap( // Start EDS watch if needed. auto& eds_state = endpoint_watchers_[eds_resource_name]; if (eds_state.watcher == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] starting watch for endpoint %s", this, std::string(eds_resource_name).c_str()); @@ -806,7 +805,7 @@ bool XdsDependencyManager::PopulateClusterConfigMap( // Start DNS resolver if needed. auto& dns_state = dns_resolvers_[logical_dns.hostname]; if (dns_state.resolver == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] starting DNS resolver for %s", this, logical_dns.hostname.c_str()); @@ -974,7 +973,7 @@ void XdsDependencyManager::MaybeReportUpdate() { ++it; continue; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] cancelling watch for cluster %s", this, cluster_name.c_str()); @@ -993,7 +992,7 @@ void XdsDependencyManager::MaybeReportUpdate() { ++it; continue; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] cancelling watch for EDS resource %s", this, eds_resource_name.c_str()); @@ -1011,7 +1010,7 @@ void XdsDependencyManager::MaybeReportUpdate() { ++it; continue; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] shutting down DNS resolver for %s", this, dns_name.c_str()); @@ -1020,14 +1019,14 @@ void XdsDependencyManager::MaybeReportUpdate() { } // If we have all the data we need, then send an update. if (!have_all_resources) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] missing data -- NOT returning config", this); } return; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[XdsDependencyManager %p] returning config: %s", this, config->ToString().c_str()); } diff --git a/src/core/resolver/xds/xds_resolver.cc b/src/core/resolver/xds/xds_resolver.cc index 0d5d631838c..5f582bc63f8 100644 --- a/src/core/resolver/xds/xds_resolver.cc +++ b/src/core/resolver/xds/xds_resolver.cc @@ -82,7 +82,6 @@ #include "src/core/resolver/resolver_factory.h" #include "src/core/resolver/xds/xds_dependency_manager.h" #include "src/core/resolver/xds/xds_resolver_attributes.h" -#include "src/core/resolver/xds/xds_resolver_trace.h" #include "src/core/service_config/service_config.h" #include "src/core/service_config/service_config_impl.h" #include "src/core/xds/grpc/xds_bootstrap_grpc.h" @@ -111,7 +110,7 @@ class XdsResolver final : public Resolver { uri_(std::move(args.uri)), data_plane_authority_(std::move(data_plane_authority)), channel_id_(absl::Uniform(absl::BitGen())) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log( GPR_INFO, "[xds_resolver %p] created for URI %s; data plane authority is %s", @@ -120,7 +119,7 @@ class XdsResolver final : public Resolver { } ~XdsResolver() override { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[xds_resolver %p] destroyed", this); } } @@ -533,7 +532,7 @@ XdsResolver::RouteConfigData::CreateMethodConfig( absl::Status XdsResolver::RouteConfigData::AddRouteEntry( XdsResolver* resolver, const XdsRouteConfigResource::Route& route, const Duration& default_max_stream_duration) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[xds_resolver %p] XdsConfigSelector %p: route: %s", resolver, this, route.ToString().c_str()); } @@ -625,7 +624,7 @@ XdsResolver::XdsConfigSelector::XdsConfigSelector( RefCountedPtr route_config_data) : resolver_(std::move(resolver)), route_config_data_(std::move(route_config_data)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[xds_resolver %p] creating XdsConfigSelector %p", resolver_.get(), this); } @@ -651,7 +650,7 @@ XdsResolver::XdsConfigSelector::XdsConfigSelector( } XdsResolver::XdsConfigSelector::~XdsConfigSelector() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[xds_resolver %p] destroying XdsConfigSelector %p", resolver_.get(), this); } @@ -935,7 +934,7 @@ void XdsResolver::StartLocked() { lds_resource_name_ = absl::StrReplaceAll(name_template, {{"%s", resource_name_fragment}}); } - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[xds_resolver %p] Started with lds_resource_name %s.", this, lds_resource_name_.c_str()); } @@ -947,7 +946,7 @@ void XdsResolver::StartLocked() { } void XdsResolver::ShutdownLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[xds_resolver %p] shutting down", this); } if (xds_client_ != nullptr) { @@ -960,7 +959,7 @@ void XdsResolver::ShutdownLocked() { void XdsResolver::OnUpdate( RefCountedPtr config) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[xds_resolver %p] received updated xDS config", this); } if (xds_client_ == nullptr) return; @@ -1059,7 +1058,7 @@ void XdsResolver::GenerateResult() { Result result; result.addresses.emplace(); result.service_config = CreateServiceConfig(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) { gpr_log(GPR_INFO, "[xds_resolver %p] generated service config: %s", this, result.service_config.ok() ? std::string((*result.service_config)->json_string()).c_str() diff --git a/src/core/resolver/xds/xds_resolver_trace.cc b/src/core/resolver/xds/xds_resolver_trace.cc deleted file mode 100644 index e9986e2cef7..00000000000 --- a/src/core/resolver/xds/xds_resolver_trace.cc +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright 2019 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#include "src/core/resolver/xds/xds_resolver_trace.h" - -#include - -namespace grpc_core { - -TraceFlag grpc_xds_resolver_trace(false, "xds_resolver"); - -} // namespace grpc_core diff --git a/src/core/server/server.cc b/src/core/server/server.cc index 82e3f5b4f1f..c4796d6ae9b 100644 --- a/src/core/server/server.cc +++ b/src/core/server/server.cc @@ -88,8 +88,6 @@ namespace grpc_core { -TraceFlag grpc_server_channel_trace(false, "server_channel"); - // // Server::RegisteredMethod // @@ -1493,9 +1491,7 @@ void Server::ChannelData::Destroy() { "Server::ChannelData::Destroy"); GRPC_CLOSURE_INIT(&finish_destroy_channel_closure_, FinishDestroy, this, grpc_schedule_on_exec_ctx); - if (GRPC_TRACE_FLAG_ENABLED(grpc_server_channel_trace)) { - LOG(INFO) << "Disconnected client"; - } + GRPC_TRACE_LOG(server_channel, INFO) << "Disconnected client"; grpc_transport_op* op = grpc_make_transport_op(&finish_destroy_channel_closure_); op->set_accept_stream = true; diff --git a/src/core/server/server.h b/src/core/server/server.h index 72cffdfee9a..974fbea5814 100644 --- a/src/core/server/server.h +++ b/src/core/server/server.h @@ -80,8 +80,6 @@ namespace experimental { class PassiveListenerImpl; } // namespace experimental -extern TraceFlag grpc_server_channel_trace; - class Server : public ServerInterface, public InternallyRefCounted, public CppImplOf { diff --git a/src/core/server/xds_server_config_fetcher.cc b/src/core/server/xds_server_config_fetcher.cc index 885e21120ba..ddf2273176b 100644 --- a/src/core/server/xds_server_config_fetcher.cc +++ b/src/core/server/xds_server_config_fetcher.cc @@ -95,9 +95,6 @@ namespace { using ReadDelayHandle = XdsClient::ReadDelayHandle; -TraceFlag grpc_xds_server_config_fetcher_trace(false, - "xds_server_config_fetcher"); - // A server config fetcher that fetches the information for configuring server // listeners from the xDS control plane. class XdsServerConfigFetcher final : public grpc_server_config_fetcher { @@ -587,7 +584,7 @@ XdsServerConfigFetcher::ListenerWatcher::ListenerWatcher( void XdsServerConfigFetcher::ListenerWatcher::OnResourceChanged( std::shared_ptr listener, RefCountedPtr /* read_delay_handle */) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_server_config_fetcher_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_server_config_fetcher)) { gpr_log(GPR_INFO, "[ListenerWatcher %p] Received LDS update from xds client %p: %s", this, xds_client_.get(), listener->ToString().c_str()); diff --git a/src/core/tsi/fake_transport_security.cc b/src/core/tsi/fake_transport_security.cc index 2fffb042bb8..6e58d5ea415 100644 --- a/src/core/tsi/fake_transport_security.cc +++ b/src/core/tsi/fake_transport_security.cc @@ -640,7 +640,7 @@ static tsi_result fake_handshaker_get_bytes_to_send_to_peer( if (next_message_to_send > TSI_FAKE_HANDSHAKE_MESSAGE_MAX) { next_message_to_send = TSI_FAKE_HANDSHAKE_MESSAGE_MAX; } - if (GRPC_TRACE_FLAG_ENABLED(tsi_tracing_enabled)) { + if (GRPC_TRACE_FLAG_ENABLED(tsi)) { gpr_log(GPR_INFO, "%s prepared %s.", impl->is_client ? "Client" : "Server", tsi_fake_handshake_message_to_string(impl->next_message_to_send)); @@ -653,9 +653,7 @@ static tsi_result fake_handshaker_get_bytes_to_send_to_peer( if (!impl->is_client && impl->next_message_to_send == TSI_FAKE_HANDSHAKE_MESSAGE_MAX) { // We're done. - if (GRPC_TRACE_FLAG_ENABLED(tsi_tracing_enabled)) { - LOG(INFO) << "Server is done."; - } + GRPC_TRACE_LOG(tsi, INFO) << "Server is done."; impl->result = TSI_OK; } else { impl->needs_incoming_message = 1; @@ -694,17 +692,15 @@ static tsi_result fake_handshaker_process_bytes_from_peer( tsi_fake_handshake_message_to_string(received_msg), tsi_fake_handshake_message_to_string(expected_msg)); } - if (GRPC_TRACE_FLAG_ENABLED(tsi_tracing_enabled)) { - LOG(INFO) << (impl->is_client ? "Client" : "Server") << " received " - << tsi_fake_handshake_message_to_string(received_msg); - } + GRPC_TRACE_LOG(tsi, INFO) + << (impl->is_client ? "Client" : "Server") << " received " + << tsi_fake_handshake_message_to_string(received_msg); tsi_fake_frame_reset(&impl->incoming_frame, 0 /* needs_draining */); impl->needs_incoming_message = 0; if (impl->next_message_to_send == TSI_FAKE_HANDSHAKE_MESSAGE_MAX) { // We're done. - if (GRPC_TRACE_FLAG_ENABLED(tsi_tracing_enabled)) { - LOG(INFO) << (impl->is_client ? "Client" : "Server") << " is done."; - } + GRPC_TRACE_LOG(tsi, INFO) + << (impl->is_client ? "Client" : "Server") << " is done."; impl->result = TSI_OK; } return TSI_OK; diff --git a/src/core/tsi/ssl_transport_security.cc b/src/core/tsi/ssl_transport_security.cc index 6ec4e0a2546..fcd1b0658b1 100644 --- a/src/core/tsi/ssl_transport_security.cc +++ b/src/core/tsi/ssl_transport_security.cc @@ -227,7 +227,7 @@ static void init_openssl(void) { // TODO(jboeuf): Remove when we are past the debugging phase with this code. static void ssl_log_where_info(const SSL* ssl, int where, int flag, const char* msg) { - if ((where & flag) && GRPC_TRACE_FLAG_ENABLED(tsi_tracing_enabled)) { + if ((where & flag) && GRPC_TRACE_FLAG_ENABLED(tsi)) { gpr_log(GPR_INFO, "%20.20s - %30.30s - %5.10s", msg, SSL_state_string_long(ssl), SSL_state_string(ssl)); } diff --git a/src/core/tsi/transport_security.cc b/src/core/tsi/transport_security.cc index 065987b3271..72ad63df90e 100644 --- a/src/core/tsi/transport_security.cc +++ b/src/core/tsi/transport_security.cc @@ -25,10 +25,6 @@ #include #include -// --- Tracing. --- - -grpc_core::TraceFlag tsi_tracing_enabled(false, "tsi"); - // --- tsi_result common implementation. --- const char* tsi_result_to_string(tsi_result result) { diff --git a/src/core/tsi/transport_security.h b/src/core/tsi/transport_security.h index 19482fba176..5fce3e15768 100644 --- a/src/core/tsi/transport_security.h +++ b/src/core/tsi/transport_security.h @@ -26,8 +26,6 @@ #include "src/core/lib/debug/trace.h" #include "src/core/tsi/transport_security_interface.h" -extern grpc_core::TraceFlag tsi_tracing_enabled; - // Base for tsi_frame_protector implementations. // See transport_security_interface.h for documentation. // All methods must be implemented. diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h index 186bb683f18..d0b2e03386a 100644 --- a/src/core/tsi/transport_security_interface.h +++ b/src/core/tsi/transport_security_interface.h @@ -96,10 +96,6 @@ typedef enum { const char* tsi_result_to_string(tsi_result result); const char* tsi_security_level_to_string(tsi_security_level security_level); -// --- tsi tracing --- - -extern grpc_core::TraceFlag tsi_tracing_enabled; - // -- tsi_zero_copy_grpc_protector object -- // This object protects and unprotects grpc slice buffers with zero or minimized diff --git a/src/core/util/gcp_metadata_query.cc b/src/core/util/gcp_metadata_query.cc index 1281134f042..db2c382bead 100644 --- a/src/core/util/gcp_metadata_query.cc +++ b/src/core/util/gcp_metadata_query.cc @@ -46,8 +46,6 @@ namespace grpc_core { -TraceFlag grpc_metadata_query_trace(false, "metadata_query"); - constexpr const char GcpMetadataQuery::kZoneAttribute[]; constexpr const char GcpMetadataQuery::kClusterNameAttribute[]; constexpr const char GcpMetadataQuery::kRegionAttribute[]; @@ -102,11 +100,10 @@ void GcpMetadataQuery::Orphan() { void GcpMetadataQuery::OnDone(void* arg, grpc_error_handle error) { auto* self = static_cast(arg); - if (GRPC_TRACE_FLAG_ENABLED(grpc_metadata_query_trace)) { - gpr_log(GPR_INFO, "MetadataServer Query for %s: HTTP status: %d, error: %s", - self->attribute_.c_str(), self->response_.status, - StatusToString(error).c_str()); - } + GRPC_TRACE_LOG(metadata_query, INFO) + << "MetadataServer Query for " << self->attribute_ + << ": HTTP status: " << self->response_.status + << ", error: " << StatusToString(error); absl::StatusOr result; if (!error.ok()) { result = absl::UnavailableError(absl::StrFormat( @@ -123,9 +120,7 @@ void GcpMetadataQuery::OnDone(void* arg, grpc_error_handle error) { result = absl::UnavailableError( absl::StrFormat("MetadataServer Could not parse zone: %s", std::string(body).c_str())); - if (GRPC_TRACE_FLAG_ENABLED(grpc_metadata_query_trace)) { - LOG(INFO) << result.status().ToString(); - } + GRPC_TRACE_LOG(metadata_query, INFO) << result.status(); } else { result = std::string(body.substr(pos + 1)); } diff --git a/src/core/util/http_client/parser.cc b/src/core/util/http_client/parser.cc index c344f438cf3..d0388b3b1b8 100644 --- a/src/core/util/http_client/parser.cc +++ b/src/core/util/http_client/parser.cc @@ -30,8 +30,6 @@ #include #include -grpc_core::TraceFlag grpc_http1_trace(false, "http1"); - static char* buf2str(void* buffer, size_t length) { char* out = static_cast(gpr_malloc(length + 1)); memcpy(out, buffer, length); @@ -378,7 +376,7 @@ static grpc_error_handle addbyte(grpc_http_parser* parser, uint8_t byte, case GRPC_HTTP_HEADERS: case GRPC_HTTP_TRAILERS: if (parser->cur_line_length >= GRPC_HTTP_PARSER_MAX_HEADER_LENGTH) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_http1_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(http1)) { gpr_log(GPR_ERROR, "HTTP header max line length (%d) exceeded", GRPC_HTTP_PARSER_MAX_HEADER_LENGTH); } diff --git a/src/core/util/http_client/parser.h b/src/core/util/http_client/parser.h index cfd1ed7ab3a..01727e0e4df 100644 --- a/src/core/util/http_client/parser.h +++ b/src/core/util/http_client/parser.h @@ -125,6 +125,4 @@ grpc_error_handle 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::TraceFlag grpc_http1_trace; - #endif // GRPC_SRC_CORE_UTIL_HTTP_CLIENT_PARSER_H diff --git a/src/core/xds/grpc/xds_client_grpc.cc b/src/core/xds/grpc/xds_client_grpc.cc index 6855e7fa6d8..63aa9c7a8a9 100644 --- a/src/core/xds/grpc/xds_client_grpc.cc +++ b/src/core/xds/grpc/xds_client_grpc.cc @@ -198,7 +198,7 @@ absl::StatusOr GetBootstrapContents(const char* fallback_config) { // First, try GRPC_XDS_BOOTSTRAP env var. auto path = GetEnv("GRPC_XDS_BOOTSTRAP"); if (path.has_value()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "Got bootstrap file location from GRPC_XDS_BOOTSTRAP " "environment variable: %s", @@ -211,7 +211,7 @@ absl::StatusOr GetBootstrapContents(const char* fallback_config) { // Next, try GRPC_XDS_BOOTSTRAP_CONFIG env var. auto env_config = GetEnv("GRPC_XDS_BOOTSTRAP_CONFIG"); if (env_config.has_value()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "Got bootstrap contents from GRPC_XDS_BOOTSTRAP_CONFIG " "environment variable"); @@ -220,9 +220,8 @@ absl::StatusOr GetBootstrapContents(const char* fallback_config) { } // Finally, try fallback config. if (fallback_config != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { - LOG(INFO) << "Got bootstrap contents from fallback config"; - } + GRPC_TRACE_LOG(xds_client, INFO) + << "Got bootstrap contents from fallback config"; return fallback_config; } // No bootstrap config found. @@ -261,7 +260,7 @@ absl::StatusOr> GrpcXdsClient::GetOrCreate( // Find bootstrap contents. auto bootstrap_contents = GetBootstrapContents(g_fallback_bootstrap_config); if (!bootstrap_contents.ok()) return bootstrap_contents.status(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "xDS bootstrap contents: %s", bootstrap_contents->c_str()); } @@ -274,7 +273,7 @@ absl::StatusOr> GrpcXdsClient::GetOrCreate( key, std::move(*bootstrap), channel_args, MakeOrphanable(channel_args)); g_xds_client_map->emplace(xds_client->key(), xds_client.get()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] Created xDS client for key %s", xds_client.get(), std::string(key).c_str()); } diff --git a/src/core/xds/grpc/xds_cluster.cc b/src/core/xds/grpc/xds_cluster.cc index d7ad16ae66c..d9670594f6b 100644 --- a/src/core/xds/grpc/xds_cluster.cc +++ b/src/core/xds/grpc/xds_cluster.cc @@ -754,7 +754,7 @@ absl::StatusOr> CdsResourceParse( void MaybeLogCluster(const XdsResourceType::DecodeContext& context, const envoy_config_cluster_v3_Cluster* cluster) { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) && + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer) && gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { const upb_MessageDef* msg_type = envoy_config_cluster_v3_Cluster_getmsgdef(context.symtab); @@ -785,14 +785,14 @@ XdsResourceType::DecodeResult XdsClusterResourceType::Decode( UpbStringToStdString(envoy_config_cluster_v3_Cluster_name(resource)); auto cds_resource = CdsResourceParse(context, resource); if (!cds_resource.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer)) { gpr_log(GPR_ERROR, "[xds_client %p] invalid Cluster %s: %s", context.client, result.name->c_str(), cds_resource.status().ToString().c_str()); } result.resource = cds_resource.status(); } else { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer)) { gpr_log(GPR_INFO, "[xds_client %p] parsed Cluster %s: %s", context.client, result.name->c_str(), (*cds_resource)->ToString().c_str()); } diff --git a/src/core/xds/grpc/xds_endpoint.cc b/src/core/xds/grpc/xds_endpoint.cc index c689a57d515..6c44a2dd238 100644 --- a/src/core/xds/grpc/xds_endpoint.cc +++ b/src/core/xds/grpc/xds_endpoint.cc @@ -156,7 +156,7 @@ namespace { void MaybeLogClusterLoadAssignment( const XdsResourceType::DecodeContext& context, const envoy_config_endpoint_v3_ClusterLoadAssignment* cla) { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) && + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer) && gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { const upb_MessageDef* msg_type = envoy_config_endpoint_v3_ClusterLoadAssignment_getmsgdef( @@ -497,14 +497,14 @@ XdsResourceType::DecodeResult XdsEndpointResourceType::Decode( envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(resource)); auto eds_resource = EdsResourceParse(context, resource); if (!eds_resource.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer)) { gpr_log(GPR_ERROR, "[xds_client %p] invalid ClusterLoadAssignment %s: %s", context.client, result.name->c_str(), eds_resource.status().ToString().c_str()); } result.resource = eds_resource.status(); } else { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer)) { gpr_log(GPR_INFO, "[xds_client %p] parsed ClusterLoadAssignment %s: %s", context.client, result.name->c_str(), (*eds_resource)->ToString().c_str()); diff --git a/src/core/xds/grpc/xds_listener.cc b/src/core/xds/grpc/xds_listener.cc index c071fd9882c..b781e18f64c 100644 --- a/src/core/xds/grpc/xds_listener.cc +++ b/src/core/xds/grpc/xds_listener.cc @@ -285,7 +285,7 @@ void MaybeLogHttpConnectionManager( const XdsResourceType::DecodeContext& context, const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* http_connection_manager_config) { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) && + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer) && gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { const upb_MessageDef* msg_type = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_getmsgdef( @@ -1091,7 +1091,7 @@ absl::StatusOr> LdsResourceParse( void MaybeLogListener(const XdsResourceType::DecodeContext& context, const envoy_config_listener_v3_Listener* listener) { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) && + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer) && gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { const upb_MessageDef* msg_type = envoy_config_listener_v3_Listener_getmsgdef(context.symtab); @@ -1122,14 +1122,14 @@ XdsResourceType::DecodeResult XdsListenerResourceType::Decode( UpbStringToStdString(envoy_config_listener_v3_Listener_name(resource)); auto listener = LdsResourceParse(context, resource); if (!listener.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer)) { gpr_log(GPR_ERROR, "[xds_client %p] invalid Listener %s: %s", context.client, result.name->c_str(), listener.status().ToString().c_str()); } result.resource = listener.status(); } else { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer)) { gpr_log(GPR_INFO, "[xds_client %p] parsed Listener %s: %s", context.client, result.name->c_str(), (*listener)->ToString().c_str()); diff --git a/src/core/xds/grpc/xds_route_config.cc b/src/core/xds/grpc/xds_route_config.cc index c3ab477ac88..4cb6c001e6f 100644 --- a/src/core/xds/grpc/xds_route_config.cc +++ b/src/core/xds/grpc/xds_route_config.cc @@ -704,7 +704,7 @@ XdsRouteConfigResource::RetryPolicy RetryPolicyParse( } else if (code == "unavailable") { retry_policy.retry_on.Add(GRPC_STATUS_UNAVAILABLE); } else { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer)) { gpr_log(GPR_INFO, "Unsupported retry_on policy %s.", std::string(code).c_str()); } @@ -1143,7 +1143,7 @@ namespace { void MaybeLogRouteConfiguration( const XdsResourceType::DecodeContext& context, const envoy_config_route_v3_RouteConfiguration* route_config) { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) && + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer) && gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { const upb_MessageDef* msg_type = envoy_config_route_v3_RouteConfiguration_getmsgdef(context.symtab); @@ -1179,13 +1179,13 @@ XdsResourceType::DecodeResult XdsRouteConfigResourceType::Decode( absl::Status status = errors.status(absl::StatusCode::kInvalidArgument, "errors validating RouteConfiguration resource"); - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer)) { gpr_log(GPR_ERROR, "[xds_client %p] invalid RouteConfiguration %s: %s", context.client, result.name->c_str(), status.ToString().c_str()); } result.resource = std::move(status); } else { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) { + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer)) { gpr_log(GPR_INFO, "[xds_client %p] parsed RouteConfiguration %s: %s", context.client, result.name->c_str(), rds_update->ToString().c_str()); diff --git a/src/core/xds/xds_client/xds_api.cc b/src/core/xds/xds_client/xds_api.cc index 5c1b9418a60..40bd50e411c 100644 --- a/src/core/xds/xds_client/xds_api.cc +++ b/src/core/xds/xds_client/xds_api.cc @@ -130,7 +130,7 @@ void PopulateMetadataValue(google_protobuf_Value* value_pb, const Json& value, void MaybeLogDiscoveryRequest( const XdsApiContext& context, const envoy_service_discovery_v3_DiscoveryRequest* request) { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) && + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer) && gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { const upb_MessageDef* msg_type = envoy_service_discovery_v3_DiscoveryRequest_getmsgdef(context.def_pool); @@ -262,7 +262,7 @@ namespace { void MaybeLogDiscoveryResponse( const XdsApiContext& context, const envoy_service_discovery_v3_DiscoveryResponse* response) { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) && + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer) && gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { const upb_MessageDef* msg_type = envoy_service_discovery_v3_DiscoveryResponse_getmsgdef( @@ -351,7 +351,7 @@ namespace { void MaybeLogLrsRequest( const XdsApiContext& context, const envoy_service_load_stats_v3_LoadStatsRequest* request) { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) && + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer) && gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { const upb_MessageDef* msg_type = envoy_service_load_stats_v3_LoadStatsRequest_getmsgdef( @@ -513,7 +513,7 @@ namespace { void MaybeLogLrsResponse( const XdsApiContext& context, const envoy_service_load_stats_v3_LoadStatsResponse* response) { - if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) && + if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer) && gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) { const upb_MessageDef* msg_type = envoy_service_load_stats_v3_LoadStatsResponse_getmsgdef( diff --git a/src/core/xds/xds_client/xds_client.cc b/src/core/xds/xds_client/xds_client.cc index a5f0c44300b..d3620aac696 100644 --- a/src/core/xds/xds_client/xds_client.cc +++ b/src/core/xds/xds_client/xds_client.cc @@ -68,9 +68,6 @@ namespace grpc_core { using ::grpc_event_engine::experimental::EventEngine; -TraceFlag grpc_xds_client_trace(false, "xds_client"); -TraceFlag grpc_xds_client_refcount_trace(false, "xds_client_refcount"); - // // Internal class declarations // @@ -253,7 +250,7 @@ class XdsClient::XdsChannel::AdsCall final } void OnTimer() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] xds server %s: timeout obtaining resource " "{type=%s name=%s} from xds server", @@ -456,12 +453,12 @@ class XdsClient::XdsChannel::LrsCall final XdsClient::XdsChannel::XdsChannel(WeakRefCountedPtr xds_client, const XdsBootstrap::XdsServer& server) - : DualRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace) ? "XdsChannel" - : nullptr), + : DualRefCounted(GRPC_TRACE_FLAG_ENABLED(xds_client_refcount) + ? "XdsChannel" + : nullptr), xds_client_(std::move(xds_client)), server_(server) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] creating channel %p for server %s", xds_client_.get(), this, server.server_uri().c_str()); } @@ -478,7 +475,7 @@ XdsClient::XdsChannel::XdsChannel(WeakRefCountedPtr xds_client, } XdsClient::XdsChannel::~XdsChannel() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] destroying xds channel %p for server %s", xds_client(), this, server_.server_uri().c_str()); } @@ -490,7 +487,7 @@ XdsClient::XdsChannel::~XdsChannel() { // called from DualRefCounted::Unref, which cannot have a lock annotation for // a lock in this subclass. void XdsClient::XdsChannel::Orphaned() ABSL_NO_THREAD_SAFETY_ANALYSIS { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] orphaning xds channel %p for server %s", xds_client(), this, server_.server_uri().c_str()); } @@ -578,7 +575,7 @@ bool XdsClient::XdsChannel::MaybeFallbackLocked( type_resource.first, {authority, key_state.first}); } } - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] authority %s: added fallback server %s (%s)", xds_client_.get(), authority.c_str(), @@ -587,7 +584,7 @@ bool XdsClient::XdsChannel::MaybeFallbackLocked( } if (authority_state.xds_channels.back()->status().ok()) return true; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] authority %s: No fallback server", xds_client_.get(), authority.c_str()); } @@ -607,7 +604,7 @@ void XdsClient::XdsChannel::SetHealthyLocked() { auto channel_it = std::find(channels.begin(), channels.end(), this); // Skip if this is not on the list if (channel_it != channels.end()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] authority %s: Falling forward to %s", xds_client_.get(), authority.first.c_str(), server_.server_uri().c_str()); @@ -720,7 +717,7 @@ void XdsClient::XdsChannel::RetryableCall::StartNewCallLocked() { if (shutting_down_) return; CHECK(xds_channel_->transport_ != nullptr); CHECK(call_ == nullptr); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] xds server %s: start new call from retryable " "call %p", @@ -737,7 +734,7 @@ void XdsClient::XdsChannel::RetryableCall::StartRetryTimerLocked() { const Timestamp next_attempt_time = backoff_.NextAttemptTime(); const Duration timeout = std::max(next_attempt_time - Timestamp::Now(), Duration::Zero()); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] xds server %s: call attempt failed; " "retry timer will fire in %" PRId64 "ms.", @@ -759,7 +756,7 @@ void XdsClient::XdsChannel::RetryableCall::OnRetryTimer() { if (timer_handle_.has_value()) { timer_handle_.reset(); if (shutting_down_) return; - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] xds server %s: retry timer fired (retryable " "call: %p)", @@ -797,7 +794,7 @@ class XdsClient::XdsChannel::AdsCall::AdsReadDelayHandle final absl::Status XdsClient::XdsChannel::AdsCall::AdsResponseParser::ProcessAdsResponseFields( AdsResponseFields fields) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log( GPR_INFO, "[xds_client %p] xds server %s: received ADS response: type_url=%s, " @@ -863,7 +860,7 @@ void XdsClient::XdsChannel::AdsCall::AdsResponseParser::ParseResource( } // Parse the resource. XdsResourceType::DecodeContext context = { - xds_client(), ads_call_->xds_channel()->server_, &grpc_xds_client_trace, + xds_client(), ads_call_->xds_channel()->server_, &xds_client_trace, xds_client()->def_pool_.ptr(), arena}; XdsResourceType::DecodeResult decode_result = result_.type->Decode(context, serialized_resource); @@ -964,7 +961,7 @@ void XdsClient::XdsChannel::AdsCall::AdsResponseParser::ParseResource( if (resource_state.resource != nullptr && result_.type->ResourcesEqual(resource_state.resource.get(), decode_result.resource->get())) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] %s resource %s identical to current, ignoring.", xds_client(), result_.type_url.c_str(), @@ -1003,8 +1000,7 @@ void XdsClient::XdsChannel::AdsCall::AdsResponseParser:: XdsClient::XdsChannel::AdsCall::AdsCall( RefCountedPtr> retryable_call) : InternallyRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace) ? "AdsCall" - : nullptr), + GRPC_TRACE_FLAG_ENABLED(xds_client_refcount) ? "AdsCall" : nullptr), retryable_call_(std::move(retryable_call)) { CHECK_NE(xds_client(), nullptr); // Init the ADS call. @@ -1018,7 +1014,7 @@ XdsClient::XdsChannel::AdsCall::AdsCall( RefCountedPtr(this))); CHECK(streaming_call_ != nullptr); // Start the call. - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] xds server %s: starting ADS call " "(ads_call: %p, streaming_call: %p)", @@ -1072,7 +1068,7 @@ void XdsClient::XdsChannel::AdsCall::SendMessageLocked( state.nonce, ResourceNamesForRequest(type), state.status, !sent_initial_message_); sent_initial_message_ = true; - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] xds server %s: sending ADS request: type=%s " "version=%s nonce=%s error=%s", @@ -1262,7 +1258,7 @@ void XdsClient::XdsChannel::AdsCall::OnRecvMessage(absl::string_view payload) { void XdsClient::XdsChannel::AdsCall::OnStatusReceived(absl::Status status) { { MutexLock lock(&xds_client()->mu_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] xds server %s: ADS call status received " "(xds_channel=%p, ads_call=%p, streaming_call=%p): %s", @@ -1335,7 +1331,7 @@ void XdsClient::XdsChannel::LrsCall::Timer::Orphan() { } void XdsClient::XdsChannel::LrsCall::Timer::ScheduleNextReportLocked() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] xds server %s: scheduling next load report in %s", xds_client(), @@ -1364,8 +1360,7 @@ void XdsClient::XdsChannel::LrsCall::Timer::OnNextReportTimer() { XdsClient::XdsChannel::LrsCall::LrsCall( RefCountedPtr> retryable_call) : InternallyRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace) ? "LrsCall" - : nullptr), + GRPC_TRACE_FLAG_ENABLED(xds_client_refcount) ? "LrsCall" : nullptr), retryable_call_(std::move(retryable_call)) { // Init the LRS call. Note that the call will progress every time there's // activity in xds_client()->interested_parties_, which is comprised of @@ -1380,7 +1375,7 @@ XdsClient::XdsChannel::LrsCall::LrsCall( RefCountedPtr(this))); CHECK(streaming_call_ != nullptr); // Start the call. - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] xds server %s: starting LRS call (lrs_call=%p, " "streaming_call=%p)", @@ -1494,7 +1489,7 @@ void XdsClient::XdsChannel::LrsCall::OnRecvMessage(absl::string_view payload) { return; } seen_response_ = true; - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log( GPR_INFO, "[xds_client %p] xds server %s: LRS response received, %" PRIuPTR @@ -1513,7 +1508,7 @@ void XdsClient::XdsChannel::LrsCall::OnRecvMessage(absl::string_view payload) { Duration::Milliseconds(GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS)) { new_load_reporting_interval = Duration::Milliseconds(GRPC_XDS_MIN_CLIENT_LOAD_REPORTING_INTERVAL_MS); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] xds server %s: increased load_report_interval " "to minimum value %dms", @@ -1525,7 +1520,7 @@ void XdsClient::XdsChannel::LrsCall::OnRecvMessage(absl::string_view payload) { if (send_all_clusters == send_all_clusters_ && cluster_names_ == new_cluster_names && load_reporting_interval_ == new_load_reporting_interval) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] xds server %s: incoming LRS response identical " "to current, ignoring.", @@ -1549,7 +1544,7 @@ void XdsClient::XdsChannel::LrsCall::OnRecvMessage(absl::string_view payload) { void XdsClient::XdsChannel::LrsCall::OnStatusReceived(absl::Status status) { MutexLock lock(&xds_client()->mu_); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] xds server %s: LRS call status received " "(xds_channel=%p, lrs_call=%p, streaming_call=%p): %s", @@ -1585,18 +1580,17 @@ XdsClient::XdsClient( std::string user_agent_name, std::string user_agent_version, Duration resource_request_timeout) : DualRefCounted( - GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace) ? "XdsClient" - : nullptr), + GRPC_TRACE_FLAG_ENABLED(xds_client_refcount) ? "XdsClient" : nullptr), bootstrap_(std::move(bootstrap)), transport_factory_(std::move(transport_factory)), request_timeout_(resource_request_timeout), xds_federation_enabled_(XdsFederationEnabled()), - api_(this, &grpc_xds_client_trace, bootstrap_->node(), &def_pool_, + api_(this, &xds_client_trace, bootstrap_->node(), &def_pool_, std::move(user_agent_name), std::move(user_agent_version)), work_serializer_(engine), engine_(std::move(engine)), metrics_reporter_(std::move(metrics_reporter)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this); } CHECK(bootstrap_ != nullptr); @@ -1607,13 +1601,13 @@ XdsClient::XdsClient( } XdsClient::~XdsClient() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] destroying xds client", this); } } void XdsClient::Orphaned() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] shutting down xds client", this); } MutexLock lock(&mu_); @@ -1735,7 +1729,7 @@ void XdsClient::WatchResource(const XdsResourceType* type, // If we already have a cached value for the resource, notify the new // watcher immediately. if (resource_state.resource != nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] returning cached listener data for %s", this, std::string(name).c_str()); @@ -1749,7 +1743,7 @@ void XdsClient::WatchResource(const XdsResourceType* type, DEBUG_LOCATION); } else if (resource_state.meta.client_status == XdsApi::ResourceMetadata::DOES_NOT_EXIST) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] reporting cached does-not-exist for %s", this, std::string(name).c_str()); @@ -1761,7 +1755,7 @@ void XdsClient::WatchResource(const XdsResourceType* type, DEBUG_LOCATION); } else if (resource_state.meta.client_status == XdsApi::ResourceMetadata::NACKED) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log( GPR_INFO, "[xds_client %p] reporting cached validation failure for %s: %s", @@ -1786,7 +1780,7 @@ void XdsClient::WatchResource(const XdsResourceType* type, } absl::Status channel_status = authority_state.xds_channels.back()->status(); if (!channel_status.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] returning cached channel error for %s: %s", this, std::string(name).c_str(), @@ -2091,7 +2085,7 @@ void XdsClient::NotifyWatchersOnResourceDoesNotExist( XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked( const XdsBootstrap::XdsServer& xds_server, bool send_all_clusters, const std::set& clusters) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] start building load report", this); } XdsApi::ClusterLoadReportMap snapshot_map; @@ -2118,7 +2112,7 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked( if (load_report.drop_stats != nullptr) { snapshot.dropped_requests += load_report.drop_stats->GetSnapshotAndReset(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] cluster=%s eds_service_name=%s drop_stats=%p", this, cluster_key.first.c_str(), cluster_key.second.c_str(), @@ -2136,7 +2130,7 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked( if (locality_state.locality_stats != nullptr) { locality_snapshot += locality_state.locality_stats->GetSnapshotAndReset(); - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] cluster=%s eds_service_name=%s " "locality=%s locality_stats=%p", diff --git a/src/core/xds/xds_client/xds_client.h b/src/core/xds/xds_client/xds_client.h index a16fe6ed5f2..0535984afc2 100644 --- a/src/core/xds/xds_client/xds_client.h +++ b/src/core/xds/xds_client/xds_client.h @@ -55,9 +55,6 @@ namespace testing { class XdsClientTestPeer; } -extern TraceFlag grpc_xds_client_trace; -extern TraceFlag grpc_xds_client_refcount_trace; - class XdsClient : public DualRefCounted { public: // The authority reported for old-style (non-xdstp) resource names. diff --git a/src/core/xds/xds_client/xds_client_stats.cc b/src/core/xds/xds_client/xds_client_stats.cc index 508a50eab63..c15ed4a6bc4 100644 --- a/src/core/xds/xds_client/xds_client_stats.cc +++ b/src/core/xds/xds_client/xds_client_stats.cc @@ -43,14 +43,14 @@ XdsClusterDropStats::XdsClusterDropStats(RefCountedPtr xds_client, absl::string_view lrs_server, absl::string_view cluster_name, absl::string_view eds_service_name) - : RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace) + : RefCounted(GRPC_TRACE_FLAG_ENABLED(xds_client_refcount) ? "XdsClusterDropStats" : nullptr), xds_client_(std::move(xds_client)), lrs_server_(lrs_server), cluster_name_(cluster_name), eds_service_name_(eds_service_name) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] created drop stats %p for {%s, %s, %s}", xds_client_.get(), this, std::string(lrs_server_).c_str(), std::string(cluster_name_).c_str(), @@ -59,7 +59,7 @@ XdsClusterDropStats::XdsClusterDropStats(RefCountedPtr xds_client, } XdsClusterDropStats::~XdsClusterDropStats() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log(GPR_INFO, "[xds_client %p] destroying drop stats %p for {%s, %s, %s}", xds_client_.get(), this, std::string(lrs_server_).c_str(), @@ -96,7 +96,7 @@ XdsClusterLocalityStats::XdsClusterLocalityStats( RefCountedPtr xds_client, absl::string_view lrs_server, absl::string_view cluster_name, absl::string_view eds_service_name, RefCountedPtr name) - : RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace) + : RefCounted(GRPC_TRACE_FLAG_ENABLED(xds_client_refcount) ? "XdsClusterLocalityStats" : nullptr), xds_client_(std::move(xds_client)), @@ -104,7 +104,7 @@ XdsClusterLocalityStats::XdsClusterLocalityStats( cluster_name_(cluster_name), eds_service_name_(eds_service_name), name_(std::move(name)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log( GPR_INFO, "[xds_client %p] created locality stats %p for {%s, %s, %s, %s}", @@ -116,7 +116,7 @@ XdsClusterLocalityStats::XdsClusterLocalityStats( } XdsClusterLocalityStats::~XdsClusterLocalityStats() { - if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(xds_client)) { gpr_log( GPR_INFO, "[xds_client %p] destroying locality stats %p for {%s, %s, %s, %s}", diff --git a/src/cpp/ext/gcp/environment_autodetect.cc b/src/cpp/ext/gcp/environment_autodetect.cc index 5d2307ceec6..e41435679a2 100644 --- a/src/cpp/ext/gcp/environment_autodetect.cc +++ b/src/cpp/ext/gcp/environment_autodetect.cc @@ -55,9 +55,6 @@ namespace internal { namespace { -grpc_core::TraceFlag grpc_environment_autodetect_trace( - false, "environment_autodetect"); - // This is not a definite method to get the namespace name for GKE, but it is // the best we have. std::string GetNamespaceName() { @@ -66,7 +63,7 @@ std::string GetNamespaceName() { "/var/run/secrets/kubernetes.io/serviceaccount/namespace"; auto namespace_name = grpc_core::LoadFile(filename, false); if (!namespace_name.ok()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_environment_autodetect_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(environment_autodetect)) { gpr_log(GPR_DEBUG, "Reading file %s failed: %s", filename, grpc_core::StatusToString(namespace_name.status()).c_str()); } @@ -251,7 +248,7 @@ class EnvironmentAutoDetectHelper queries_.push_back(grpc_core::MakeOrphanable( element.first, &pollent_, [this](std::string attribute, absl::StatusOr result) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_environment_autodetect_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(environment_autodetect)) { gpr_log( GPR_INFO, "Environment AutoDetect: Attribute: \"%s\" Result: \"%s\"", @@ -272,8 +269,7 @@ class EnvironmentAutoDetectHelper // If fetching from the MetadataServer failed and we were // assuming a GCE environment, fallback to "global". else if (assuming_gce_) { - if (GRPC_TRACE_FLAG_ENABLED( - grpc_environment_autodetect_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(environment_autodetect)) { gpr_log(GPR_INFO, "Environment Autodetect: Falling back to global " "resource type"); diff --git a/src/cpp/server/backend_metric_recorder.cc b/src/cpp/server/backend_metric_recorder.cc index 020a2db6efe..e4800849a1c 100644 --- a/src/cpp/server/backend_metric_recorder.cc +++ b/src/cpp/server/backend_metric_recorder.cc @@ -45,7 +45,6 @@ bool IsUtilizationValid(double utilization) { // Rate values (qps and eps) must be in [0, infy). bool IsRateValid(double rate) { return rate >= 0.0; } -grpc_core::TraceFlag grpc_backend_metric_trace(false, "backend_metric"); } // namespace namespace grpc { @@ -69,35 +68,35 @@ void ServerMetricRecorder::UpdateBackendMetricDataState( void ServerMetricRecorder::SetCpuUtilization(double value) { if (!IsUtilizationWithSoftLimitsValid(value)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] CPU utilization rejected: %f", this, value); } return; } UpdateBackendMetricDataState( [value](BackendMetricData* data) { data->cpu_utilization = value; }); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] CPU utilization set: %f", this, value); } } void ServerMetricRecorder::SetMemoryUtilization(double value) { if (!IsUtilizationValid(value)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Mem utilization rejected: %f", this, value); } return; } UpdateBackendMetricDataState( [value](BackendMetricData* data) { data->mem_utilization = value; }); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Mem utilization set: %f", this, value); } } void ServerMetricRecorder::SetApplicationUtilization(double value) { if (!IsUtilizationWithSoftLimitsValid(value)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Application utilization rejected: %f", this, value); } @@ -106,48 +105,48 @@ void ServerMetricRecorder::SetApplicationUtilization(double value) { UpdateBackendMetricDataState([value](BackendMetricData* data) { data->application_utilization = value; }); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Application utilization set: %f", this, value); } } void ServerMetricRecorder::SetQps(double value) { if (!IsRateValid(value)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] QPS rejected: %f", this, value); } return; } UpdateBackendMetricDataState( [value](BackendMetricData* data) { data->qps = value; }); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] QPS set: %f", this, value); } } void ServerMetricRecorder::SetEps(double value) { if (!IsRateValid(value)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] EPS rejected: %f", this, value); } return; } UpdateBackendMetricDataState( [value](BackendMetricData* data) { data->eps = value; }); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] EPS set: %f", this, value); } } void ServerMetricRecorder::SetNamedUtilization(string_ref name, double value) { if (!IsUtilizationValid(value)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Named utilization rejected: %f name: %s", this, value, std::string(name.data(), name.size()).c_str()); } return; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Named utilization set: %f name: %s", this, value, std::string(name.data(), name.size()).c_str()); } @@ -158,7 +157,7 @@ void ServerMetricRecorder::SetNamedUtilization(string_ref name, double value) { void ServerMetricRecorder::SetAllNamedUtilization( std::map named_utilization) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] All named utilization updated. size: %" PRIuPTR, this, named_utilization.size()); } @@ -175,7 +174,7 @@ void ServerMetricRecorder::SetAllNamedUtilization( void ServerMetricRecorder::ClearCpuUtilization() { UpdateBackendMetricDataState( [](BackendMetricData* data) { data->cpu_utilization = -1; }); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] CPU utilization cleared.", this); } } @@ -183,7 +182,7 @@ void ServerMetricRecorder::ClearCpuUtilization() { void ServerMetricRecorder::ClearMemoryUtilization() { UpdateBackendMetricDataState( [](BackendMetricData* data) { data->mem_utilization = -1; }); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Mem utilization cleared.", this); } } @@ -191,27 +190,27 @@ void ServerMetricRecorder::ClearMemoryUtilization() { void ServerMetricRecorder::ClearApplicationUtilization() { UpdateBackendMetricDataState( [](BackendMetricData* data) { data->application_utilization = -1; }); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Application utilization cleared.", this); } } void ServerMetricRecorder::ClearQps() { UpdateBackendMetricDataState([](BackendMetricData* data) { data->qps = -1; }); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] QPS utilization cleared.", this); } } void ServerMetricRecorder::ClearEps() { UpdateBackendMetricDataState([](BackendMetricData* data) { data->eps = -1; }); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] EPS utilization cleared.", this); } } void ServerMetricRecorder::ClearNamedUtilization(string_ref name) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Named utilization cleared. name: %s", this, std::string(name.data(), name.size()).c_str()); } @@ -232,7 +231,7 @@ ServerMetricRecorder::GetMetricsIfChanged() const { internal::MutexLock lock(&mu_); result = metric_state_; } - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { const auto& data = result->data; gpr_log(GPR_INFO, "[%p] GetMetrics() returned: seq:%" PRIu64 @@ -249,13 +248,13 @@ ServerMetricRecorder::GetMetricsIfChanged() const { experimental::CallMetricRecorder& BackendMetricState::RecordCpuUtilizationMetric(double value) { if (!IsUtilizationWithSoftLimitsValid(value)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] CPU utilization value rejected: %f", this, value); } return *this; } cpu_utilization_.store(value, std::memory_order_relaxed); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] CPU utilization recorded: %f", this, value); } return *this; @@ -264,13 +263,13 @@ BackendMetricState::RecordCpuUtilizationMetric(double value) { experimental::CallMetricRecorder& BackendMetricState::RecordMemoryUtilizationMetric(double value) { if (!IsUtilizationValid(value)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Mem utilization value rejected: %f", this, value); } return *this; } mem_utilization_.store(value, std::memory_order_relaxed); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Mem utilization recorded: %f", this, value); } return *this; @@ -279,14 +278,14 @@ BackendMetricState::RecordMemoryUtilizationMetric(double value) { experimental::CallMetricRecorder& BackendMetricState::RecordApplicationUtilizationMetric(double value) { if (!IsUtilizationWithSoftLimitsValid(value)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Application utilization value rejected: %f", this, value); } return *this; } application_utilization_.store(value, std::memory_order_relaxed); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Application utilization recorded: %f", this, value); } return *this; @@ -295,13 +294,13 @@ BackendMetricState::RecordApplicationUtilizationMetric(double value) { experimental::CallMetricRecorder& BackendMetricState::RecordQpsMetric( double value) { if (!IsRateValid(value)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] QPS value rejected: %f", this, value); } return *this; } qps_.store(value, std::memory_order_relaxed); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] QPS recorded: %f", this, value); } return *this; @@ -310,13 +309,13 @@ experimental::CallMetricRecorder& BackendMetricState::RecordQpsMetric( experimental::CallMetricRecorder& BackendMetricState::RecordEpsMetric( double value) { if (!IsRateValid(value)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] EPS value rejected: %f", this, value); } return *this; } eps_.store(value, std::memory_order_relaxed); - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] EPS recorded: %f", this, value); } return *this; @@ -325,7 +324,7 @@ experimental::CallMetricRecorder& BackendMetricState::RecordEpsMetric( experimental::CallMetricRecorder& BackendMetricState::RecordUtilizationMetric( string_ref name, double value) { if (!IsUtilizationValid(value)) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Utilization value rejected: %s %f", this, std::string(name.data(), name.length()).c_str(), value); } @@ -334,7 +333,7 @@ experimental::CallMetricRecorder& BackendMetricState::RecordUtilizationMetric( internal::MutexLock lock(&mu_); absl::string_view name_sv(name.data(), name.length()); utilization_[name_sv] = value; - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Utilization recorded: %s %f", this, std::string(name_sv).c_str(), value); } @@ -346,7 +345,7 @@ experimental::CallMetricRecorder& BackendMetricState::RecordRequestCostMetric( internal::MutexLock lock(&mu_); absl::string_view name_sv(name.data(), name.length()); request_cost_[name_sv] = value; - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Request cost recorded: %s %f", this, std::string(name_sv).c_str(), value); } @@ -358,7 +357,7 @@ experimental::CallMetricRecorder& BackendMetricState::RecordNamedMetric( internal::MutexLock lock(&mu_); absl::string_view name_sv(name.data(), name.length()); named_metrics_[name_sv] = value; - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Named metric recorded: %s %f", this, std::string(name_sv).c_str(), value); } @@ -406,7 +405,7 @@ BackendMetricData BackendMetricState::GetBackendMetricData() { data.named_metrics[r.first] = r.second; } } - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_trace)) { + if (GRPC_TRACE_FLAG_ENABLED(backend_metric)) { gpr_log(GPR_INFO, "[%p] Backend metric data returned: cpu:%f mem:%f qps:%f eps:%f " "utilization size:%" PRIuPTR " request_cost size:%" PRIuPTR diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 4e7f7b1dd9a..ae570fb582a 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -73,7 +73,6 @@ CORE_SOURCE_FILES = [ 'src/core/ext/transport/chttp2/transport/hpack_parser.cc', 'src/core/ext/transport/chttp2/transport/hpack_parser_table.cc', 'src/core/ext/transport/chttp2/transport/http2_settings.cc', - 'src/core/ext/transport/chttp2/transport/http_trace.cc', 'src/core/ext/transport/chttp2/transport/huffsyms.cc', 'src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc', 'src/core/ext/transport/chttp2/transport/parsing.cc', @@ -84,7 +83,6 @@ CORE_SOURCE_FILES = [ 'src/core/ext/transport/chttp2/transport/varint.cc', 'src/core/ext/transport/chttp2/transport/write_size_policy.cc', 'src/core/ext/transport/chttp2/transport/writing.cc', - 'src/core/ext/transport/inproc/inproc_plugin.cc', 'src/core/ext/transport/inproc/inproc_transport.cc', 'src/core/ext/transport/inproc/legacy_inproc_transport.cc', 'src/core/ext/upb-gen/envoy/admin/v3/certs.upb_minitable.c', @@ -422,7 +420,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/channel/channel_stack.cc', 'src/core/lib/channel/channel_stack_builder.cc', 'src/core/lib/channel/channel_stack_builder_impl.cc', - 'src/core/lib/channel/channel_stack_trace.cc', 'src/core/lib/channel/connected_channel.cc', 'src/core/lib/channel/promise_based_filter.cc', 'src/core/lib/channel/status_util.cc', @@ -435,6 +432,7 @@ CORE_SOURCE_FILES = [ 'src/core/lib/config/load_config.cc', 'src/core/lib/debug/event_log.cc', 'src/core/lib/debug/trace.cc', + 'src/core/lib/debug/trace_flags.cc', 'src/core/lib/event_engine/ares_resolver.cc', 'src/core/lib/event_engine/cf_engine/cf_engine.cc', 'src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc', @@ -473,7 +471,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/event_engine/thread_pool/work_stealing_thread_pool.cc', 'src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc', 'src/core/lib/event_engine/time_util.cc', - 'src/core/lib/event_engine/trace.cc', 'src/core/lib/event_engine/utils.cc', 'src/core/lib/event_engine/windows/grpc_polled_fd_windows.cc', 'src/core/lib/event_engine/windows/iocp.cc', @@ -489,6 +486,7 @@ CORE_SOURCE_FILES = [ 'src/core/lib/gprpp/dump_args.cc', 'src/core/lib/gprpp/examine_stack.cc', 'src/core/lib/gprpp/fork.cc', + 'src/core/lib/gprpp/glob.cc', 'src/core/lib/gprpp/host_port.cc', 'src/core/lib/gprpp/linux/env.cc', 'src/core/lib/gprpp/load_file.cc', @@ -528,7 +526,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_poll_posix.cc', 'src/core/lib/iomgr/ev_posix.cc', - 'src/core/lib/iomgr/ev_windows.cc', 'src/core/lib/iomgr/event_engine_shims/closure.cc', 'src/core/lib/iomgr/event_engine_shims/endpoint.cc', 'src/core/lib/iomgr/event_engine_shims/tcp_client.cc', @@ -593,7 +590,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/promise/activity.cc', 'src/core/lib/promise/party.cc', 'src/core/lib/promise/sleep.cc', - 'src/core/lib/promise/trace.cc', 'src/core/lib/resource_quota/api.cc', 'src/core/lib/resource_quota/arena.cc', 'src/core/lib/resource_quota/connection_quota.cc', @@ -601,7 +597,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/resource_quota/periodic_update.cc', 'src/core/lib/resource_quota/resource_quota.cc', 'src/core/lib/resource_quota/thread_quota.cc', - 'src/core/lib/resource_quota/trace.cc', 'src/core/lib/security/authorization/audit_logging.cc', 'src/core/lib/security/authorization/authorization_policy_provider_vtable.cc', 'src/core/lib/security/authorization/evaluate_args.cc', @@ -667,9 +662,7 @@ CORE_SOURCE_FILES = [ 'src/core/lib/slice/percent_encoding.cc', 'src/core/lib/slice/slice.cc', 'src/core/lib/slice/slice_buffer.cc', - 'src/core/lib/slice/slice_refcount.cc', 'src/core/lib/slice/slice_string_helpers.cc', - 'src/core/lib/surface/api_trace.cc', 'src/core/lib/surface/byte_buffer.cc', 'src/core/lib/surface/byte_buffer_reader.cc', 'src/core/lib/surface/call.cc', @@ -760,7 +753,6 @@ CORE_SOURCE_FILES = [ 'src/core/resolver/sockaddr/sockaddr_resolver.cc', 'src/core/resolver/xds/xds_dependency_manager.cc', 'src/core/resolver/xds/xds_resolver.cc', - 'src/core/resolver/xds/xds_resolver_trace.cc', 'src/core/server/server.cc', 'src/core/server/server_call_tracer_filter.cc', 'src/core/server/server_config_selector_filter.cc', diff --git a/src/python/grpcio_observability/observability_lib_deps.py b/src/python/grpcio_observability/observability_lib_deps.py index 9ae5ba98c89..904d260f4c7 100644 --- a/src/python/grpcio_observability/observability_lib_deps.py +++ b/src/python/grpcio_observability/observability_lib_deps.py @@ -19,10 +19,12 @@ CC_FILES=[ 'grpc_root/src/core/lib/config/config_vars_non_generated.cc', 'grpc_root/src/core/lib/config/load_config.cc', 'grpc_root/src/core/lib/debug/trace.cc', + 'grpc_root/src/core/lib/debug/trace_flags.cc', 'grpc_root/src/core/lib/event_engine/thread_local.cc', 'grpc_root/src/core/lib/gprpp/crash.cc', 'grpc_root/src/core/lib/gprpp/examine_stack.cc', 'grpc_root/src/core/lib/gprpp/fork.cc', + 'grpc_root/src/core/lib/gprpp/glob.cc', 'grpc_root/src/core/lib/gprpp/host_port.cc', 'grpc_root/src/core/lib/gprpp/linux/env.cc', 'grpc_root/src/core/lib/gprpp/mpscq.cc', @@ -37,7 +39,6 @@ CC_FILES=[ 'grpc_root/src/core/lib/gprpp/windows/stat.cc', 'grpc_root/src/core/lib/gprpp/windows/thd.cc', 'grpc_root/src/core/lib/slice/slice.cc', - 'grpc_root/src/core/lib/slice/slice_refcount.cc', 'grpc_root/src/core/lib/slice/slice_string_helpers.cc', 'grpc_root/src/core/util/alloc.cc', 'grpc_root/src/core/util/android/log.cc', diff --git a/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc b/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc index 7a71288f0b5..e67009b8a5b 100644 --- a/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc +++ b/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.cc @@ -48,9 +48,6 @@ extern gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type); -static grpc_core::TraceFlag trace_writes(false, "fuzzing_ee_writes"); -static grpc_core::TraceFlag trace_timers(false, "fuzzing_ee_timers"); - using namespace std::chrono_literals; namespace grpc_event_engine { @@ -317,10 +314,8 @@ bool FuzzingEventEngine::EndpointMiddle::Write(SliceBuffer* data, int index) { // If the write_len is zero, we still need to write something, so we write one // byte. if (write_len == 0) write_len = 1; - if (trace_writes.enabled()) { - gpr_log(GPR_INFO, "WRITE[%p:%d]: %" PRIdPTR " bytes", this, index, - write_len); - } + GRPC_TRACE_LOG(fuzzing_ee_writes, INFO) + << "WRITE[" << this << ":" << index << "]: " << write_len << " bytes"; // Expand the pending buffer. size_t prev_len = pending[index].size(); pending[index].resize(prev_len + write_len); @@ -577,14 +572,12 @@ EventEngine::TaskHandle FuzzingEventEngine::RunAfterLocked( now = now_; tasks_by_time_.emplace(final_time, std::move(task)); } - if (trace_timers.enabled()) { - gpr_log(GPR_INFO, - "Schedule timer %" PRIxPTR " @ %" PRIu64 " (now=%" PRIu64 - "; delay=%" PRIu64 "; fuzzing_added=%" PRIu64 "; type=%d)", - id, static_cast(final_time.time_since_epoch().count()), - now.time_since_epoch().count(), when.count(), delay_taken.count(), - static_cast(run_type)); - } + GRPC_TRACE_LOG(fuzzing_ee_timers, INFO) + << "Schedule timer " << id << " @ " + << static_cast(final_time.time_since_epoch().count()) + << " (now=" << now.time_since_epoch().count() + << "; delay=" << when.count() << "; fuzzing_added=" << delay_taken.count() + << "; type=" << static_cast(run_type) << ")"; return TaskHandle{id, kTaskHandleSalt}; } @@ -599,9 +592,7 @@ bool FuzzingEventEngine::Cancel(TaskHandle handle) { if (it->second->closure == nullptr) { return false; } - if (trace_timers.enabled()) { - gpr_log(GPR_INFO, "Cancel timer %" PRIxPTR, id); - } + GRPC_TRACE_LOG(fuzzing_ee_timers, INFO) << "Cancel timer " << id; it->second->closure = nullptr; return true; } diff --git a/test/core/gprpp/BUILD b/test/core/gprpp/BUILD index 4e9f12a8c37..f93529110ff 100644 --- a/test/core/gprpp/BUILD +++ b/test/core/gprpp/BUILD @@ -499,3 +499,17 @@ grpc_cc_test( "//test/core/test_util:grpc_test_util", ], ) + +grpc_cc_test( + name = "glob_test", + srcs = ["glob_test.cc"], + external_deps = ["gtest"], + language = "C++", + uses_event_engine = False, + uses_polling = False, + deps = [ + "//:gpr", + "//src/core:useful", + "//test/core/test_util:grpc_test_util", + ], +) diff --git a/test/core/gprpp/glob_test.cc b/test/core/gprpp/glob_test.cc new file mode 100644 index 00000000000..5233c666235 --- /dev/null +++ b/test/core/gprpp/glob_test.cc @@ -0,0 +1,83 @@ +// Copyright 2024 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "src/core/lib/gprpp/glob.h" + +#include "absl/strings/match.h" +#include "gtest/gtest.h" + +#include + +#include "test/core/test_util/test_config.h" + +namespace grpc_core { +namespace testing { + +TEST(GlobTest, DefaultsToStringMatching) { + EXPECT_TRUE(GlobMatch("arst", "arst")); +} + +TEST(GlobTest, AsteriskMatchesMultipleCharacters) { + EXPECT_TRUE(GlobMatch("a", "*")); + EXPECT_TRUE(GlobMatch("arst", "*")); +} + +TEST(GlobTest, QuestionMarkMatchesSingleCharacter) { + EXPECT_TRUE(GlobMatch("a", "?")); + EXPECT_FALSE(GlobMatch("arst", "?")); +} + +TEST(GlobTest, AsteriskMatchesEmpty) { EXPECT_TRUE(GlobMatch("", "*")); } + +TEST(GlobTest, QuestionMarkDoesNotMatcheEmpty) { + EXPECT_FALSE(GlobMatch("", "?")); +} + +TEST(GlobTest, EmbeddedAsterisk) { + EXPECT_TRUE(GlobMatch("arst", "a*t")); + EXPECT_TRUE(GlobMatch("arst", "*rst")); + EXPECT_TRUE(GlobMatch("arst", "ar*")); + EXPECT_TRUE(GlobMatch("arst", "*r*")); + EXPECT_FALSE(GlobMatch("arst", "*q*")); + EXPECT_FALSE(GlobMatch("*arst", "**q*")); +} + +TEST(GlobTest, EmbeddedQuestionMark) { + EXPECT_TRUE(GlobMatch("arst", "?rst")); + EXPECT_TRUE(GlobMatch("arst", "a?st")); + EXPECT_TRUE(GlobMatch("arst", "ar?t")); + EXPECT_TRUE(GlobMatch("arst", "ars?")); + EXPECT_TRUE(GlobMatch("arst", "??s?")); + EXPECT_TRUE(GlobMatch("?arst", "???s?")); + EXPECT_FALSE(GlobMatch("?arst", "arst")); +} + +TEST(GlobTest, BothWildcardsWorkTogether) { + EXPECT_TRUE(GlobMatch("arst", "?r*")); + EXPECT_TRUE(GlobMatch("arst", "*s?")); + EXPECT_TRUE(GlobMatch("arst", "a?*")); + EXPECT_TRUE(GlobMatch("arst", "*?t")); +} + +} // namespace testing +} // namespace grpc_core + +int main(int argc, char** argv) { + grpc::testing::TestEnvironment env(&argc, argv); + ::testing::InitGoogleTest(&argc, argv); + grpc_init(); + auto res = RUN_ALL_TESTS(); + grpc_shutdown(); + return res; +} diff --git a/test/core/handshake/client_ssl.cc b/test/core/handshake/client_ssl.cc index d59018f3a65..8eb2db12ea6 100644 --- a/test/core/handshake/client_ssl.cc +++ b/test/core/handshake/client_ssl.cc @@ -67,8 +67,6 @@ #define SSL_KEY_PATH "src/core/tsi/test_creds/server1.key" #define SSL_CA_PATH "src/core/tsi/test_creds/ca.pem" -grpc_core::TraceFlag client_ssl_tsi_tracing_enabled(false, "tsi"); - class SslLibraryInfo { public: SslLibraryInfo() {} @@ -175,11 +173,10 @@ static int alpn_select_cb(SSL* /*ssl*/, const uint8_t** out, uint8_t* out_len, static void ssl_log_where_info(const SSL* ssl, int where, int flag, const char* msg) { - if ((where & flag) && - GRPC_TRACE_FLAG_ENABLED(client_ssl_tsi_tracing_enabled)) { - LOG(INFO) << absl::StrFormat("%20.20s - %30.30s - %5.10s", msg, - SSL_state_string_long(ssl), - SSL_state_string(ssl)); + if ((where & flag) != 0) { + GRPC_TRACE_LOG(tsi, INFO) + << absl::StrFormat("%20.20s - %30.30s - %5.10s", msg, + SSL_state_string_long(ssl), SSL_state_string(ssl)); } } diff --git a/test/core/iomgr/timer_list_test.cc b/test/core/iomgr/timer_list_test.cc index aa1d545bea7..86223674e99 100644 --- a/test/core/iomgr/timer_list_test.cc +++ b/test/core/iomgr/timer_list_test.cc @@ -37,9 +37,6 @@ #define MAX_CB 30 -extern grpc_core::TraceFlag grpc_timer_trace; -extern grpc_core::TraceFlag grpc_timer_check_trace; - static int cb_called[MAX_CB][2]; static const int64_t kHoursIn25Days = 25 * 24; static const grpc_core::Duration k25Days = @@ -57,8 +54,8 @@ static void add_test(void) { LOG(INFO) << "add_test"; grpc_timer_list_init(); - grpc_core::testing::grpc_tracer_enable_flag(&grpc_timer_trace); - grpc_core::testing::grpc_tracer_enable_flag(&grpc_timer_check_trace); + grpc_core::testing::grpc_tracer_enable_flag(&grpc_core::timer_trace); + grpc_core::testing::grpc_tracer_enable_flag(&grpc_core::timer_check_trace); memset(cb_called, 0, sizeof(cb_called)); grpc_core::Timestamp start = grpc_core::Timestamp::Now(); @@ -127,8 +124,8 @@ void destruction_test(void) { grpc_core::ExecCtx::Get()->TestOnlySetNow( grpc_core::Timestamp::FromMillisecondsAfterProcessEpoch(0)); grpc_timer_list_init(); - grpc_core::testing::grpc_tracer_enable_flag(&grpc_timer_trace); - grpc_core::testing::grpc_tracer_enable_flag(&grpc_timer_check_trace); + grpc_core::testing::grpc_tracer_enable_flag(&grpc_core::timer_trace); + grpc_core::testing::grpc_tracer_enable_flag(&grpc_core::timer_check_trace); memset(cb_called, 0, sizeof(cb_called)); grpc_timer_init( @@ -184,8 +181,8 @@ void long_running_service_cleanup_test(void) { grpc_core::Timestamp now = grpc_core::Timestamp::Now(); CHECK(now.milliseconds_after_process_epoch() >= k25Days.millis()); grpc_timer_list_init(); - grpc_core::testing::grpc_tracer_enable_flag(&grpc_timer_trace); - grpc_core::testing::grpc_tracer_enable_flag(&grpc_timer_check_trace); + grpc_core::testing::grpc_tracer_enable_flag(&grpc_core::timer_trace); + grpc_core::testing::grpc_tracer_enable_flag(&grpc_core::timer_check_trace); memset(cb_called, 0, sizeof(cb_called)); grpc_timer_init( diff --git a/test/core/telemetry/BUILD b/test/core/telemetry/BUILD index ea9e61dd534..caa6705811e 100644 --- a/test/core/telemetry/BUILD +++ b/test/core/telemetry/BUILD @@ -68,3 +68,17 @@ grpc_cc_test( "//test/core/test_util:grpc_test_util", ], ) + +grpc_cc_test( + name = "trace_flags_test", + srcs = ["trace_flags_test.cc"], + external_deps = ["gtest"], + language = "C++", + uses_event_engine = False, + uses_polling = False, + deps = [ + "//:gpr", + "//src/core:useful", + "//test/core/test_util:grpc_test_util", + ], +) diff --git a/test/core/telemetry/trace_flags_test.cc b/test/core/telemetry/trace_flags_test.cc new file mode 100644 index 00000000000..06472794ba7 --- /dev/null +++ b/test/core/telemetry/trace_flags_test.cc @@ -0,0 +1,113 @@ +// Copyright 2024 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "absl/strings/match.h" +#include "gtest/gtest.h" + +#include + +#include "src/core/lib/debug/trace.h" +#include "test/core/test_util/test_config.h" + +class TraceFlags : public ::testing::Test { + public: + TraceFlags() {} + ~TraceFlags() override { saved_flags_.Restore(); } + + private: + grpc_core::SavedTraceFlags saved_flags_; +}; + +TEST_F(TraceFlags, ReturnsFalseWhenNotFound) { + ASSERT_FALSE(grpc_core::ParseTracers("arst")); +} + +TEST_F(TraceFlags, CanSetAValue) { + auto it = grpc_core::GetAllTraceFlags().find("api"); + ASSERT_NE(it, grpc_core::GetAllTraceFlags().end()); + EXPECT_TRUE(grpc_core::ParseTracers("api")); + EXPECT_TRUE(it->second->enabled()); + EXPECT_TRUE(grpc_core::ParseTracers("-api")); + EXPECT_FALSE(it->second->enabled()); +} + +TEST_F(TraceFlags, SpecialRefcountFlagWorks) { + for (const auto& flag : grpc_core::GetAllTraceFlags()) { + if (absl::StrContains(flag.first, "refcount")) { + EXPECT_FALSE(flag.second->enabled()); + } + } + EXPECT_TRUE(grpc_core::ParseTracers("refcount")); + for (const auto& flag : grpc_core::GetAllTraceFlags()) { + if (absl::StrContains(flag.first, "refcount")) { + EXPECT_TRUE(flag.second->enabled()); + } + } +} + +TEST_F(TraceFlags, SpecialAllFlagWorks) { + // Snapshot the trace flag state at the beginning + EXPECT_TRUE(grpc_core::ParseTracers("all")); + for (const auto& flag : grpc_core::GetAllTraceFlags()) { + EXPECT_TRUE(flag.second->enabled()) << flag.first << " was not enabled."; + } + EXPECT_TRUE(grpc_core::ParseTracers("-all")); + for (const auto& flag : grpc_core::GetAllTraceFlags()) { + EXPECT_FALSE(flag.second->enabled()) + << flag.first << " was still enabled after turning all flags off."; + } +} + +TEST_F(TraceFlags, GlobStarAllWorks) { + // Snapshot the trace flag state at the beginning + EXPECT_TRUE(grpc_core::ParseTracers("*")); + for (const auto& flag : grpc_core::GetAllTraceFlags()) { + EXPECT_TRUE(flag.second->enabled()) << flag.first << " was not enabled."; + } + EXPECT_TRUE(grpc_core::ParseTracers("-*")); + for (const auto& flag : grpc_core::GetAllTraceFlags()) { + EXPECT_FALSE(flag.second->enabled()) + << flag.first << " was still enabled after turning all flags off."; + } +} + +TEST_F(TraceFlags, SaveAndRestoreWorks) { + auto it = grpc_core::GetAllTraceFlags().find("api"); + ASSERT_NE(it, grpc_core::GetAllTraceFlags().end()); + EXPECT_FALSE(it->second->enabled()); + grpc_core::SavedTraceFlags saved_1; + EXPECT_TRUE(grpc_core::ParseTracers("all")); + EXPECT_TRUE(it->second->enabled()); + saved_1.Restore(); + EXPECT_FALSE(it->second->enabled()); +} + +TEST_F(TraceFlags, CApiStillWorks) { + auto it = grpc_core::GetAllTraceFlags().find("api"); + ASSERT_NE(it, grpc_core::GetAllTraceFlags().end()); + EXPECT_FALSE(it->second->enabled()); + EXPECT_TRUE(grpc_tracer_set_enabled("all", true)); + EXPECT_TRUE(it->second->enabled()); + EXPECT_TRUE(grpc_tracer_set_enabled("all", false)); + EXPECT_FALSE(it->second->enabled()); +} + +int main(int argc, char** argv) { + grpc::testing::TestEnvironment env(&argc, argv); + ::testing::InitGoogleTest(&argc, argv); + grpc_init(); + auto res = RUN_ALL_TESTS(); + grpc_shutdown(); + return res; +} diff --git a/test/core/transport/connectivity_state_test.cc b/test/core/transport/connectivity_state_test.cc index 138bce10d6b..40a2a653800 100644 --- a/test/core/transport/connectivity_state_test.cc +++ b/test/core/transport/connectivity_state_test.cc @@ -234,7 +234,7 @@ int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); grpc_init(); grpc_core::testing::grpc_tracer_enable_flag( - &grpc_core::grpc_connectivity_state_trace); + &grpc_core::connectivity_state_trace); int ret = RUN_ALL_TESTS(); grpc_shutdown(); return ret; diff --git a/test/core/xds/xds_cluster_resource_type_test.cc b/test/core/xds/xds_cluster_resource_type_test.cc index 34fce7801cf..adff21d6e31 100644 --- a/test/core/xds/xds_cluster_resource_type_test.cc +++ b/test/core/xds/xds_cluster_resource_type_test.cc @@ -78,9 +78,6 @@ namespace grpc_core { namespace testing { namespace { -TraceFlag xds_cluster_resource_type_test_trace( - true, "xds_cluster_resource_type_test"); - class XdsClusterTest : public ::testing::Test { protected: XdsClusterTest() diff --git a/test/core/xds/xds_common_types_test.cc b/test/core/xds/xds_common_types_test.cc index a83514a89a7..b934a977cb6 100644 --- a/test/core/xds/xds_common_types_test.cc +++ b/test/core/xds/xds_common_types_test.cc @@ -66,8 +66,6 @@ namespace grpc_core { namespace testing { namespace { -TraceFlag xds_common_types_test_trace(true, "xds_common_types_test"); - class XdsCommonTypesTest : public ::testing::Test { protected: XdsCommonTypesTest() diff --git a/test/core/xds/xds_endpoint_resource_type_test.cc b/test/core/xds/xds_endpoint_resource_type_test.cc index 31596773e43..676cea36cfc 100644 --- a/test/core/xds/xds_endpoint_resource_type_test.cc +++ b/test/core/xds/xds_endpoint_resource_type_test.cc @@ -64,9 +64,6 @@ namespace grpc_core { namespace testing { namespace { -TraceFlag xds_endpoint_resource_type_test_trace( - true, "xds_endpoint_resource_type_test"); - class XdsEndpointTest : public ::testing::Test { protected: XdsEndpointTest() diff --git a/test/core/xds/xds_listener_resource_type_test.cc b/test/core/xds/xds_listener_resource_type_test.cc index 6db6680c8ae..84f0158de41 100644 --- a/test/core/xds/xds_listener_resource_type_test.cc +++ b/test/core/xds/xds_listener_resource_type_test.cc @@ -78,9 +78,6 @@ namespace grpc_core { namespace testing { namespace { -TraceFlag xds_listener_resource_type_test_trace( - true, "xds_listener_resource_type_test"); - class XdsListenerTest : public ::testing::Test { protected: XdsListenerTest() diff --git a/test/core/xds/xds_route_config_resource_type_test.cc b/test/core/xds/xds_route_config_resource_type_test.cc index d28889e61bb..21ceb8d15d4 100644 --- a/test/core/xds/xds_route_config_resource_type_test.cc +++ b/test/core/xds/xds_route_config_resource_type_test.cc @@ -76,9 +76,6 @@ namespace grpc_core { namespace testing { namespace { -TraceFlag xds_route_config_resource_type_test_trace( - true, "xds_route_config_resource_type_test"); - class XdsRouteConfigTest : public ::testing::Test { protected: XdsRouteConfigTest() diff --git a/tools/codegen/core/gen_join.py b/tools/codegen/core/gen_join.py index fe6c3a108c9..ea8d5d7da45 100755 --- a/tools/codegen/core/gen_join.py +++ b/tools/codegen/core/gen_join.py @@ -69,11 +69,9 @@ struct JoinState { Poll PollOnce() { % for i in range(0,n): if (!ready.is_set(${i})) { - if (grpc_trace_promise_primitives.enabled()) { - VLOG(2) << "join[" << this << "]: begin poll joint ${i+1}/${n}"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: begin poll joint ${i+1}/${n}"; auto poll = promise${i}(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { auto* p = poll.value_if_ready(); VLOG(2) << "join[" << this << "]: joint ${i+1}/${n} " << (p != nullptr ? (Traits::IsOk(*p)? "ready" : "early-error") : "pending"); @@ -87,7 +85,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (grpc_trace_promise_primitives.enabled()) { + } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { VLOG(2) << "join[" << this << "]: joint ${i+1}/${n} already ready"; } % endfor @@ -111,6 +109,7 @@ front_matter = """ #include "absl/log/check.h" #include "absl/log/log.h" +#include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/construct_destruct.h" #include "src/core/lib/promise/detail/promise_like.h" #include "src/core/lib/promise/poll.h" @@ -118,7 +117,6 @@ front_matter = """ #include #include #include -#include "src/core/lib/promise/trace.h" namespace grpc_core { namespace promise_detail { diff --git a/tools/codegen/core/gen_seq.py b/tools/codegen/core/gen_seq.py index dc2566d2fe5..d81bd958b87 100755 --- a/tools/codegen/core/gen_seq.py +++ b/tools/codegen/core/gen_seq.py @@ -142,13 +142,13 @@ tail${i}: switch (state) { % for i in range(0,n-1): case State::kState${i}: { - if (grpc_trace_promise_primitives.enabled()) { - VLOG(2).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step ${i+1}/${n}"; } auto result = ${"prior."*(n-1-i)}current_promise(); PromiseResult${i}* p = result.value_if_ready(); - if (grpc_trace_promise_primitives.enabled()) { + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step ${i+1}/${n} gets " << (p != nullptr @@ -171,14 +171,14 @@ tail${i}: % endfor default: case State::kState${n-1}: { - if (grpc_trace_promise_primitives.enabled()) { - VLOG(2).AtLocation(whence.file(), whence.line()) + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step ${n}/${n}"; } auto result = current_promise(); - if (grpc_trace_promise_primitives.enabled()) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step ${n}/${n} gets " + if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + VLOG(2).AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step ${n}/${n} gets " << (result.ready()? "ready" : "pending"); } auto* p = result.value_if_ready(); @@ -194,7 +194,7 @@ front_matter = """ #ifndef GRPC_SRC_CORE_LIB_PROMISE_DETAIL_SEQ_STATE_H #define GRPC_SRC_CORE_LIB_PROMISE_DETAIL_SEQ_STATE_H -// This file is generated by tools/codegen/core/gen_seq.py +// This file is generated by tools/codegen/core/gen_join.py #include @@ -207,12 +207,12 @@ front_matter = """ #include "absl/base/attributes.h" #include "absl/strings/str_cat.h" +#include "src/core/lib/debug/trace.h" #include "src/core/lib/gprpp/construct_destruct.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/promise/detail/promise_factory.h" #include "src/core/lib/promise/detail/promise_like.h" #include "src/core/lib/promise/poll.h" -#include "src/core/lib/promise/trace.h" // A sequence under some traits for some set of callables P, Fs. // P should be a promise-like object that yields a value. diff --git a/tools/codegen/core/gen_trace_flags.py b/tools/codegen/core/gen_trace_flags.py new file mode 100755 index 00000000000..8b6ffbcba60 --- /dev/null +++ b/tools/codegen/core/gen_trace_flags.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 + +# Copyright 2024 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Uses trace_flags.yaml to auto-generate code for trace flags in gRPC-core, as +# well as the trace flag piece of doc/environment_variables.md. + +from io import StringIO +import os +import subprocess + +from absl import app +from absl import flags +from mako.lookup import TemplateLookup +from mako.runtime import Context +from mako.template import Template +import yaml + +_CHECK = flags.DEFINE_bool( + "check", default=False, help="Format and compare output using git diff." +) + +_FORMAT = flags.DEFINE_bool( + "format", default=False, help="Format the trace code after generating it." +) + +tmpl_dir_ = TemplateLookup(directories=["tools/codegen/core/templates/"]) + + +def render_source_file(tmpl_name, trace_flags): + header_template = tmpl_dir_.get_template(tmpl_name) + buf = StringIO() + ctx = Context(buf, trace_flags=trace_flags, absl_prefix="") + header_template.render_context(ctx) + return buf.getvalue() + + +def main(args): + with open("src/core/lib/debug/trace_flags.yaml") as f: + trace_flags = yaml.safe_load(f.read()) + with open("src/core/lib/debug/trace_flags.h", "w") as f: + f.write(render_source_file("trace_flags.h.mako", trace_flags)) + with open("src/core/lib/debug/trace_flags.cc", "w") as f: + f.write(render_source_file("trace_flags.cc.mako", trace_flags)) + with open("doc/trace_flags.md", "w") as f: + f.write(render_source_file("trace_flags.md.mako", trace_flags)) + if _CHECK.value or _FORMAT.value: + env = os.environ.copy() + env["CHANGED_FILES"] = "src/core/lib/debug/*" + env["TEST"] = "" + format_result = subprocess.run( + ["tools/distrib/clang_format_code.sh"], env=env, capture_output=True + ) + if format_result.returncode != 0: + raise app.Error("Format failed") + if _CHECK.value: + diff_result = subprocess.run(["git", "diff"], capture_output=True) + if len(diff_result.stdout) > 0 or len(diff_result.stderr) > 0: + print( + "Trace flags need to be generated. Please run tools/codegen/core/gen_trace_flags.py" + ) + print(diff_result.stdout.decode("utf-8")) + raise app.Error("diff found") + + +if __name__ == "__main__": + app.run(main) diff --git a/tools/codegen/core/gen_trace_flags_ci.sh b/tools/codegen/core/gen_trace_flags_ci.sh new file mode 100755 index 00000000000..3f47c622950 --- /dev/null +++ b/tools/codegen/core/gen_trace_flags_ci.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright 2024 The gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -ex +# cd to repo root +dir=$(dirname "${0}") +cd "${dir}/../../.." + +python3 -m pip install absl-py +python3 ${dir}/gen_trace_flags.py --check diff --git a/tools/codegen/core/templates/trace_flags.h.mako b/tools/codegen/core/templates/trace_flags.h.mako index 37cef8c9452..13b3aba493f 100644 --- a/tools/codegen/core/templates/trace_flags.h.mako +++ b/tools/codegen/core/templates/trace_flags.h.mako @@ -1,4 +1,4 @@ -// Copyright 2015 gRPC authors. +// Copyright 2024 gRPC authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ #include "src/core/lib/debug/trace_impl.h" - namespace grpc_core { % for flag, settings in trace_flags.items(): diff --git a/tools/distrib/check_redundant_namespace_qualifiers.py b/tools/distrib/check_redundant_namespace_qualifiers.py index 72a5d8b7a3c..e84591bda65 100755 --- a/tools/distrib/check_redundant_namespace_qualifiers.py +++ b/tools/distrib/check_redundant_namespace_qualifiers.py @@ -26,6 +26,9 @@ IGNORED_FILES = [ # for older gcc versions. "src/core/ext/transport/chttp2/server/chttp2_server.h", "src/core/server/server.h", + # generated code adds a necessary grpc_core:: for a logging macro which can + # be used anywhere. + "src/core/lib/debug/trace_impl.h", ] diff --git a/tools/distrib/sanitize.sh b/tools/distrib/sanitize.sh index eea6b397dba..84f44453fe6 100755 --- a/tools/distrib/sanitize.sh +++ b/tools/distrib/sanitize.sh @@ -30,6 +30,7 @@ tools/distrib/isort_code.sh tools/distrib/check_redundant_namespace_qualifiers.py || true tools/codegen/core/gen_grpc_tls_credentials_options.py tools/distrib/gen_experiments_and_format.sh +tools/codegen/core/gen_trace_flags.py # Formatters should always run last tools/distrib/clang_format_code.sh diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 299c480565d..01b0f97652a 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -797,6 +797,7 @@ doc/service_config.md \ doc/ssl-performance.md \ doc/status_ordering.md \ doc/statuscodes.md \ +doc/trace_flags.md \ doc/unit_testing.md \ doc/versioning.md \ doc/wait-for-ready.md \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index d0762b62874..49d88672e31 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -797,6 +797,7 @@ doc/service_config.md \ doc/ssl-performance.md \ doc/status_ordering.md \ doc/statuscodes.md \ +doc/trace_flags.md \ doc/unit_testing.md \ doc/versioning.md \ doc/wait-for-ready.md \ @@ -1242,8 +1243,6 @@ src/core/ext/transport/chttp2/transport/hpack_parser_table.cc \ src/core/ext/transport/chttp2/transport/hpack_parser_table.h \ src/core/ext/transport/chttp2/transport/http2_settings.cc \ src/core/ext/transport/chttp2/transport/http2_settings.h \ -src/core/ext/transport/chttp2/transport/http_trace.cc \ -src/core/ext/transport/chttp2/transport/http_trace.h \ src/core/ext/transport/chttp2/transport/huffsyms.cc \ src/core/ext/transport/chttp2/transport/huffsyms.h \ src/core/ext/transport/chttp2/transport/internal.h \ @@ -1263,7 +1262,6 @@ src/core/ext/transport/chttp2/transport/varint.h \ src/core/ext/transport/chttp2/transport/write_size_policy.cc \ src/core/ext/transport/chttp2/transport/write_size_policy.h \ src/core/ext/transport/chttp2/transport/writing.cc \ -src/core/ext/transport/inproc/inproc_plugin.cc \ src/core/ext/transport/inproc/inproc_transport.cc \ src/core/ext/transport/inproc/inproc_transport.h \ src/core/ext/transport/inproc/legacy_inproc_transport.cc \ @@ -2108,8 +2106,6 @@ src/core/lib/channel/channel_stack_builder.cc \ src/core/lib/channel/channel_stack_builder.h \ src/core/lib/channel/channel_stack_builder_impl.cc \ src/core/lib/channel/channel_stack_builder_impl.h \ -src/core/lib/channel/channel_stack_trace.cc \ -src/core/lib/channel/channel_stack_trace.h \ src/core/lib/channel/connected_channel.cc \ src/core/lib/channel/connected_channel.h \ src/core/lib/channel/promise_based_filter.cc \ @@ -2132,6 +2128,9 @@ src/core/lib/debug/event_log.cc \ src/core/lib/debug/event_log.h \ src/core/lib/debug/trace.cc \ src/core/lib/debug/trace.h \ +src/core/lib/debug/trace_flags.cc \ +src/core/lib/debug/trace_flags.h \ +src/core/lib/debug/trace_impl.h \ src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/ares_resolver.h \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ @@ -2224,7 +2223,6 @@ src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc \ src/core/lib/event_engine/thready_event_engine/thready_event_engine.h \ src/core/lib/event_engine/time_util.cc \ src/core/lib/event_engine/time_util.h \ -src/core/lib/event_engine/trace.cc \ src/core/lib/event_engine/trace.h \ src/core/lib/event_engine/utils.cc \ src/core/lib/event_engine/utils.h \ @@ -2267,6 +2265,8 @@ src/core/lib/gprpp/examine_stack.cc \ src/core/lib/gprpp/examine_stack.h \ src/core/lib/gprpp/fork.cc \ src/core/lib/gprpp/fork.h \ +src/core/lib/gprpp/glob.cc \ +src/core/lib/gprpp/glob.h \ src/core/lib/gprpp/host_port.cc \ src/core/lib/gprpp/host_port.h \ src/core/lib/gprpp/if_list.h \ @@ -2356,7 +2356,6 @@ src/core/lib/iomgr/ev_poll_posix.cc \ src/core/lib/iomgr/ev_poll_posix.h \ src/core/lib/iomgr/ev_posix.cc \ src/core/lib/iomgr/ev_posix.h \ -src/core/lib/iomgr/ev_windows.cc \ src/core/lib/iomgr/event_engine_shims/closure.cc \ src/core/lib/iomgr/event_engine_shims/closure.h \ src/core/lib/iomgr/event_engine_shims/endpoint.cc \ @@ -2499,8 +2498,6 @@ src/core/lib/promise/seq.h \ src/core/lib/promise/sleep.cc \ src/core/lib/promise/sleep.h \ src/core/lib/promise/status_flag.h \ -src/core/lib/promise/trace.cc \ -src/core/lib/promise/trace.h \ src/core/lib/promise/try_join.h \ src/core/lib/promise/try_seq.h \ src/core/lib/resource_quota/api.cc \ @@ -2517,8 +2514,6 @@ src/core/lib/resource_quota/resource_quota.cc \ src/core/lib/resource_quota/resource_quota.h \ src/core/lib/resource_quota/thread_quota.cc \ src/core/lib/resource_quota/thread_quota.h \ -src/core/lib/resource_quota/trace.cc \ -src/core/lib/resource_quota/trace.h \ src/core/lib/security/authorization/audit_logging.cc \ src/core/lib/security/authorization/audit_logging.h \ src/core/lib/security/authorization/authorization_engine.h \ @@ -2643,11 +2638,9 @@ src/core/lib/slice/slice.h \ src/core/lib/slice/slice_buffer.cc \ src/core/lib/slice/slice_buffer.h \ src/core/lib/slice/slice_internal.h \ -src/core/lib/slice/slice_refcount.cc \ src/core/lib/slice/slice_refcount.h \ src/core/lib/slice/slice_string_helpers.cc \ src/core/lib/slice/slice_string_helpers.h \ -src/core/lib/surface/api_trace.cc \ src/core/lib/surface/api_trace.h \ src/core/lib/surface/byte_buffer.cc \ src/core/lib/surface/byte_buffer_reader.cc \ @@ -2656,7 +2649,6 @@ src/core/lib/surface/call.h \ src/core/lib/surface/call_details.cc \ src/core/lib/surface/call_log_batch.cc \ src/core/lib/surface/call_test_only.h \ -src/core/lib/surface/call_trace.h \ src/core/lib/surface/call_utils.cc \ src/core/lib/surface/call_utils.h \ src/core/lib/surface/channel.cc \ @@ -2824,8 +2816,6 @@ src/core/resolver/xds/xds_dependency_manager.cc \ src/core/resolver/xds/xds_dependency_manager.h \ src/core/resolver/xds/xds_resolver.cc \ src/core/resolver/xds/xds_resolver_attributes.h \ -src/core/resolver/xds/xds_resolver_trace.cc \ -src/core/resolver/xds/xds_resolver_trace.h \ src/core/server/server.cc \ src/core/server/server.h \ src/core/server/server_call_tracer_filter.cc \ diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index 20b553dadfe..b8b53cf3caf 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -804,6 +804,7 @@ doc/service_config.md \ doc/ssl-performance.md \ doc/status_ordering.md \ doc/statuscodes.md \ +doc/trace_flags.md \ doc/unit_testing.md \ doc/versioning.md \ doc/wait-for-ready.md \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index e7be4ba2ddc..efd590756b0 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -804,6 +804,7 @@ doc/service_config.md \ doc/ssl-performance.md \ doc/status_ordering.md \ doc/statuscodes.md \ +doc/trace_flags.md \ doc/unit_testing.md \ doc/versioning.md \ doc/wait-for-ready.md \ @@ -1012,8 +1013,6 @@ src/core/ext/transport/chttp2/transport/hpack_parser_table.cc \ src/core/ext/transport/chttp2/transport/hpack_parser_table.h \ src/core/ext/transport/chttp2/transport/http2_settings.cc \ src/core/ext/transport/chttp2/transport/http2_settings.h \ -src/core/ext/transport/chttp2/transport/http_trace.cc \ -src/core/ext/transport/chttp2/transport/http_trace.h \ src/core/ext/transport/chttp2/transport/huffsyms.cc \ src/core/ext/transport/chttp2/transport/huffsyms.h \ src/core/ext/transport/chttp2/transport/internal.h \ @@ -1033,7 +1032,6 @@ src/core/ext/transport/chttp2/transport/varint.h \ src/core/ext/transport/chttp2/transport/write_size_policy.cc \ src/core/ext/transport/chttp2/transport/write_size_policy.h \ src/core/ext/transport/chttp2/transport/writing.cc \ -src/core/ext/transport/inproc/inproc_plugin.cc \ src/core/ext/transport/inproc/inproc_transport.cc \ src/core/ext/transport/inproc/inproc_transport.h \ src/core/ext/transport/inproc/legacy_inproc_transport.cc \ @@ -1880,8 +1878,6 @@ src/core/lib/channel/channel_stack_builder.cc \ src/core/lib/channel/channel_stack_builder.h \ src/core/lib/channel/channel_stack_builder_impl.cc \ src/core/lib/channel/channel_stack_builder_impl.h \ -src/core/lib/channel/channel_stack_trace.cc \ -src/core/lib/channel/channel_stack_trace.h \ src/core/lib/channel/connected_channel.cc \ src/core/lib/channel/connected_channel.h \ src/core/lib/channel/promise_based_filter.cc \ @@ -1904,6 +1900,9 @@ src/core/lib/debug/event_log.cc \ src/core/lib/debug/event_log.h \ src/core/lib/debug/trace.cc \ src/core/lib/debug/trace.h \ +src/core/lib/debug/trace_flags.cc \ +src/core/lib/debug/trace_flags.h \ +src/core/lib/debug/trace_impl.h \ src/core/lib/event_engine/ares_resolver.cc \ src/core/lib/event_engine/ares_resolver.h \ src/core/lib/event_engine/cf_engine/cf_engine.cc \ @@ -1996,7 +1995,6 @@ src/core/lib/event_engine/thready_event_engine/thready_event_engine.cc \ src/core/lib/event_engine/thready_event_engine/thready_event_engine.h \ src/core/lib/event_engine/time_util.cc \ src/core/lib/event_engine/time_util.h \ -src/core/lib/event_engine/trace.cc \ src/core/lib/event_engine/trace.h \ src/core/lib/event_engine/utils.cc \ src/core/lib/event_engine/utils.h \ @@ -2040,6 +2038,8 @@ src/core/lib/gprpp/examine_stack.cc \ src/core/lib/gprpp/examine_stack.h \ src/core/lib/gprpp/fork.cc \ src/core/lib/gprpp/fork.h \ +src/core/lib/gprpp/glob.cc \ +src/core/lib/gprpp/glob.h \ src/core/lib/gprpp/host_port.cc \ src/core/lib/gprpp/host_port.h \ src/core/lib/gprpp/if_list.h \ @@ -2130,7 +2130,6 @@ src/core/lib/iomgr/ev_poll_posix.cc \ src/core/lib/iomgr/ev_poll_posix.h \ src/core/lib/iomgr/ev_posix.cc \ src/core/lib/iomgr/ev_posix.h \ -src/core/lib/iomgr/ev_windows.cc \ src/core/lib/iomgr/event_engine_shims/closure.cc \ src/core/lib/iomgr/event_engine_shims/closure.h \ src/core/lib/iomgr/event_engine_shims/endpoint.cc \ @@ -2273,8 +2272,6 @@ src/core/lib/promise/seq.h \ src/core/lib/promise/sleep.cc \ src/core/lib/promise/sleep.h \ src/core/lib/promise/status_flag.h \ -src/core/lib/promise/trace.cc \ -src/core/lib/promise/trace.h \ src/core/lib/promise/try_join.h \ src/core/lib/promise/try_seq.h \ src/core/lib/resource_quota/api.cc \ @@ -2291,8 +2288,6 @@ src/core/lib/resource_quota/resource_quota.cc \ src/core/lib/resource_quota/resource_quota.h \ src/core/lib/resource_quota/thread_quota.cc \ src/core/lib/resource_quota/thread_quota.h \ -src/core/lib/resource_quota/trace.cc \ -src/core/lib/resource_quota/trace.h \ src/core/lib/security/authorization/audit_logging.cc \ src/core/lib/security/authorization/audit_logging.h \ src/core/lib/security/authorization/authorization_engine.h \ @@ -2417,12 +2412,10 @@ src/core/lib/slice/slice.h \ src/core/lib/slice/slice_buffer.cc \ src/core/lib/slice/slice_buffer.h \ src/core/lib/slice/slice_internal.h \ -src/core/lib/slice/slice_refcount.cc \ src/core/lib/slice/slice_refcount.h \ src/core/lib/slice/slice_string_helpers.cc \ src/core/lib/slice/slice_string_helpers.h \ src/core/lib/surface/README.md \ -src/core/lib/surface/api_trace.cc \ src/core/lib/surface/api_trace.h \ src/core/lib/surface/byte_buffer.cc \ src/core/lib/surface/byte_buffer_reader.cc \ @@ -2431,7 +2424,6 @@ src/core/lib/surface/call.h \ src/core/lib/surface/call_details.cc \ src/core/lib/surface/call_log_batch.cc \ src/core/lib/surface/call_test_only.h \ -src/core/lib/surface/call_trace.h \ src/core/lib/surface/call_utils.cc \ src/core/lib/surface/call_utils.h \ src/core/lib/surface/channel.cc \ @@ -2604,8 +2596,6 @@ src/core/resolver/xds/xds_dependency_manager.cc \ src/core/resolver/xds/xds_dependency_manager.h \ src/core/resolver/xds/xds_resolver.cc \ src/core/resolver/xds/xds_resolver_attributes.h \ -src/core/resolver/xds/xds_resolver_trace.cc \ -src/core/resolver/xds/xds_resolver_trace.h \ src/core/server/server.cc \ src/core/server/server.h \ src/core/server/server_call_tracer_filter.cc \ diff --git a/tools/doxygen/Doxyfile.objc b/tools/doxygen/Doxyfile.objc index db4efd59b92..b6d8167d0b8 100644 --- a/tools/doxygen/Doxyfile.objc +++ b/tools/doxygen/Doxyfile.objc @@ -795,6 +795,7 @@ doc/service_config.md \ doc/ssl-performance.md \ doc/status_ordering.md \ doc/statuscodes.md \ +doc/trace_flags.md \ doc/unit_testing.md \ doc/versioning.md \ doc/wait-for-ready.md \ diff --git a/tools/doxygen/Doxyfile.objc.internal b/tools/doxygen/Doxyfile.objc.internal index ee148b19cb2..9d397ef0336 100644 --- a/tools/doxygen/Doxyfile.objc.internal +++ b/tools/doxygen/Doxyfile.objc.internal @@ -795,6 +795,7 @@ doc/service_config.md \ doc/ssl-performance.md \ doc/status_ordering.md \ doc/statuscodes.md \ +doc/trace_flags.md \ doc/unit_testing.md \ doc/versioning.md \ doc/wait-for-ready.md \ diff --git a/tools/doxygen/Doxyfile.php b/tools/doxygen/Doxyfile.php index 7fcb47f12ec..ac527bd3115 100644 --- a/tools/doxygen/Doxyfile.php +++ b/tools/doxygen/Doxyfile.php @@ -795,6 +795,7 @@ doc/service_config.md \ doc/ssl-performance.md \ doc/status_ordering.md \ doc/statuscodes.md \ +doc/trace_flags.md \ doc/unit_testing.md \ doc/versioning.md \ doc/wait-for-ready.md \ diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index ff41de58ef8..0497e2e2ece 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -3953,6 +3953,30 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "glob_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": false + }, { "args": [], "benchmark": false, @@ -11131,6 +11155,30 @@ ], "uses_polling": true }, + { + "args": [], + "benchmark": false, + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "trace_flags_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "uses_polling": false + }, { "args": [], "benchmark": false, diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml index 3781183eee8..27df54ac199 100644 --- a/tools/run_tests/sanity/sanity_tests.yaml +++ b/tools/run_tests/sanity/sanity_tests.yaml @@ -30,6 +30,8 @@ - script: tools/codegen/core/gen_grpc_tls_credentials_options.py --test - script: tools/distrib/clang_format_code.sh cpu_cost: 1000 +- script: tools/codegen/core/gen_trace_flags_ci.sh + cpu_cost: 1000 - script: tools/distrib/gen_experiments_and_format.sh --check cpu_cost: 1000 - script: tools/distrib/pylint_code.sh From a07d3d09b7777e0796e0070f38c7416ae9d11641 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 7 Jun 2024 10:59:49 -0700 Subject: [PATCH 07/10] [yodel] Make fuzzing timeouts much more lenient (#36853) Fixes a fuzzing found "bug" in chaotic-good transport stress tests. Built on #36848 Closes #36853 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36853 from ctiller:f-cg2 96d663f8382cb2b0cf75d11dccc85f652c960d2c PiperOrigin-RevId: 641299634 --- test/core/call/yodel/yodel_test.cc | 5 +- ...mized-chaotic_good_fuzzer-5849222154354688 | 2283 +++++++++++++++++ 2 files changed, 2286 insertions(+), 2 deletions(-) create mode 100644 test/core/transport/test_suite/corpus/chaotic_good/clusterfuzz-testcase-minimized-chaotic_good_fuzzer-5849222154354688 diff --git a/test/core/call/yodel/yodel_test.cc b/test/core/call/yodel/yodel_test.cc index e60b357625f..4331c274b19 100644 --- a/test/core/call/yodel/yodel_test.cc +++ b/test/core/call/yodel/yodel_test.cc @@ -130,8 +130,9 @@ class YodelTest::WatchDog { private: YodelTest* const test_; grpc_event_engine::experimental::EventEngine::TaskHandle const timer_{ - test_->state_->event_engine->RunAfter(Duration::Minutes(5), - [this]() { test_->Timeout(); })}; + test_->state_->event_engine->RunAfter( + g_yodel_fuzzing ? Duration::Hours(24) : Duration::Minutes(5), + [this]() { test_->Timeout(); })}; }; /////////////////////////////////////////////////////////////////////////////// diff --git a/test/core/transport/test_suite/corpus/chaotic_good/clusterfuzz-testcase-minimized-chaotic_good_fuzzer-5849222154354688 b/test/core/transport/test_suite/corpus/chaotic_good/clusterfuzz-testcase-minimized-chaotic_good_fuzzer-5849222154354688 new file mode 100644 index 00000000000..2925e03ea06 --- /dev/null +++ b/test/core/transport/test_suite/corpus/chaotic_good/clusterfuzz-testcase-minimized-chaotic_good_fuzzer-5849222154354688 @@ -0,0 +1,2283 @@ +test_id: 668415 +event_engine_actions { + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 476741369856 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 476741369856 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 1 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 1 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 1610113451 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 51 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 1 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 50331648 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427880 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 427881 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 2048 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190079 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 427819008 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 193273528320 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 71776119061217280 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 0 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 427881 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 4278190080 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 64278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 427881 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 2048 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190079 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 8 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 18407619051946770423 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 427819008 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 71776119061217280 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 12105675798371893248 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 268863337 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 280379743272961 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 427881 + run_delay: 4278190081 + run_delay: 4278190208 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 4278190081 + run_delay: 6815744 + assign_ports: 4128768 + connections { + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 97 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 4 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1073741824 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 3607101440 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 67109376 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1048667 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 29696 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + } + connections { + write_size: 16 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 2147551745 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1702521088 + write_size: 4 + write_size: 1702256640 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 4 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1701409891 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 16 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1702257920 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 2046820352 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 256 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1702257920 + write_size: 1701995776 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + } + connections { + write_size: 0 + write_size: 0 + write_size: 2 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 51 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1701995776 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 51 + write_size: 0 + write_size: 7 + write_size: 0 + write_size: 0 + write_size: 7 + write_size: 0 + write_size: 7 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 4 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 2 + write_size: 2 + write_size: 2 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 115 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 7 + write_size: 2 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 67 + write_size: 0 + write_size: 0 + write_size: 1 + write_size: 4 + write_size: 0 + write_size: 3342387 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 4 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 2 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 2 + write_size: 2 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 7 + write_size: 4294967291 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 1701995776 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 2 + write_size: 0 + write_size: 2 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + write_size: 0 + } +} +config_vars { + experiments: 140737488355327 +} From 347f2a8a4baddf9cf566e182f372f64d5035e559 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 7 Jun 2024 11:03:49 -0700 Subject: [PATCH 08/10] [chaotic-good] Fix fuzzer found crash in server transport code (#36852) Closes #36852 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36852 from ctiller:f-st 5ffc88a71f2ef8ec8ab6bc8ebe1bb09330e1cffc PiperOrigin-RevId: 641300922 --- .../chaotic_good/server/chaotic_good_server.cc | 11 ++++------- ...zed-server_fuzzer_chaotic_good-5907858541051904 | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 test/core/end2end/fuzzers/server_fuzzer_chaotic_good_corpus/clusterfuzz-testcase-minimized-server_fuzzer_chaotic_good-5907858541051904 diff --git a/src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc b/src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc index 31f51a837cf..dd606c98bba 100644 --- a/src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc +++ b/src/core/ext/transport/chaotic_good/server/chaotic_good_server.cc @@ -443,13 +443,10 @@ void ChaoticGoodServerListener::ActiveConnection::HandshakingState:: Timestamp ChaoticGoodServerListener::ActiveConnection::HandshakingState:: GetConnectionDeadline() { - if (connection_->args().Contains(GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS)) { - return Timestamp::Now() + - connection_->args() - .GetDurationFromIntMillis(GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS) - .value(); - } - return Timestamp::Now() + kConnectionDeadline; + return Timestamp::Now() + + connection_->args() + .GetDurationFromIntMillis(GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS) + .value_or(kConnectionDeadline); } void ChaoticGoodServerListener::Orphan() { diff --git a/test/core/end2end/fuzzers/server_fuzzer_chaotic_good_corpus/clusterfuzz-testcase-minimized-server_fuzzer_chaotic_good-5907858541051904 b/test/core/end2end/fuzzers/server_fuzzer_chaotic_good_corpus/clusterfuzz-testcase-minimized-server_fuzzer_chaotic_good-5907858541051904 new file mode 100644 index 00000000000..a418ed45cec --- /dev/null +++ b/test/core/end2end/fuzzers/server_fuzzer_chaotic_good_corpus/clusterfuzz-testcase-minimized-server_fuzzer_chaotic_good-5907858541051904 @@ -0,0 +1,14 @@ +network_input { + input_segments { + segments { + header { + } + } + } +} +channel_args { + args { + key: "grpc.server_handshake_timeout_ms" + str: "65537" + } +} From 4f3fba65fbabca7ea3f9a02e63e23fb5bdb885d7 Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Fri, 7 Jun 2024 11:20:23 -0700 Subject: [PATCH 09/10] [Python CSM] Add example for CSM O11Y (#36829) Verified that when following User Guide, we're able to collect metrics and export to GCP. Images are available at: * `us-docker.pkg.dev/grpc-testing/examples/csm-o11y-example-python-client:latest` * `us-docker.pkg.dev/grpc-testing/examples/csm-o11y-example-python-server:latest` --- examples/python/observability/csm/BUILD.bazel | 46 ++++++ .../observability/csm/Dockerfile.client | 26 +++ .../observability/csm/Dockerfile.server | 26 +++ examples/python/observability/csm/README.md | 33 ++++ .../observability/csm/csm_greeter_client.py | 101 ++++++++++++ .../observability/csm/csm_greeter_server.py | 149 ++++++++++++++++++ 6 files changed, 381 insertions(+) create mode 100644 examples/python/observability/csm/BUILD.bazel create mode 100644 examples/python/observability/csm/Dockerfile.client create mode 100644 examples/python/observability/csm/Dockerfile.server create mode 100644 examples/python/observability/csm/README.md create mode 100644 examples/python/observability/csm/csm_greeter_client.py create mode 100644 examples/python/observability/csm/csm_greeter_server.py diff --git a/examples/python/observability/csm/BUILD.bazel b/examples/python/observability/csm/BUILD.bazel new file mode 100644 index 00000000000..58bbf7fe3ee --- /dev/null +++ b/examples/python/observability/csm/BUILD.bazel @@ -0,0 +1,46 @@ +# Copyright 2024 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@grpc_python_dependencies//:requirements.bzl", "requirement") + +# TODO(xuanwn): Instaed of using Bazel build, we should pip install all dependencies +# once we have a released version of grpcio-csm-observability. + +py_binary( + name = "csm_greeter_client", + srcs = ["csm_greeter_client.py"], + python_version = "PY3", + deps = [ + "//src/proto/grpc/testing:py_messages_proto", + "//src/proto/grpc/testing:py_test_proto", + "//src/proto/grpc/testing:test_py_pb2_grpc", + "//src/python/grpcio/grpc:grpcio", + "//src/python/grpcio_csm_observability/grpc_csm_observability:csm_observability", + requirement("opentelemetry-exporter-prometheus"), + ], +) + +py_binary( + name = "csm_greeter_server", + srcs = ["csm_greeter_server.py"], + python_version = "PY3", + deps = [ + "//src/proto/grpc/testing:py_messages_proto", + "//src/proto/grpc/testing:py_test_proto", + "//src/proto/grpc/testing:test_py_pb2_grpc", + "//src/python/grpcio/grpc:grpcio", + "//src/python/grpcio_csm_observability/grpc_csm_observability:csm_observability", + requirement("opentelemetry-exporter-prometheus"), + ], +) diff --git a/examples/python/observability/csm/Dockerfile.client b/examples/python/observability/csm/Dockerfile.client new file mode 100644 index 00000000000..b7793edf9cd --- /dev/null +++ b/examples/python/observability/csm/Dockerfile.client @@ -0,0 +1,26 @@ +FROM python:3.9-slim-bookworm + +RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang curl + +WORKDIR /workdir + +RUN ln -s /usr/bin/python3 /usr/bin/python +RUN mkdir /artifacts + +COPY . . +RUN tools/bazel build -c dbg //examples/python/observability/csm:csm_greeter_client +RUN cp -rL /workdir/bazel-bin/examples/python/observability/csm/csm_greeter_client* /artifacts/ + +FROM python:3.9-slim-bookworm + +RUN apt-get update -y \ + && apt-get install -y python3 \ + && apt-get -y autoremove \ + && apt-get install -y curl \ + && rm -rf /var/lib/apt/lists/* + +RUN ln -s /usr/bin/python3 /usr/bin/python + +COPY --from=0 /artifacts ./ + +ENTRYPOINT ["/csm_greeter_client"] diff --git a/examples/python/observability/csm/Dockerfile.server b/examples/python/observability/csm/Dockerfile.server new file mode 100644 index 00000000000..a10a762b846 --- /dev/null +++ b/examples/python/observability/csm/Dockerfile.server @@ -0,0 +1,26 @@ +FROM python:3.9-slim-bookworm + +RUN apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential clang curl + +WORKDIR /workdir + +RUN ln -s /usr/bin/python3 /usr/bin/python +RUN mkdir /artifacts + +COPY . . +RUN tools/bazel build -c dbg //examples/python/observability/csm:csm_greeter_server +RUN cp -rL /workdir/bazel-bin/examples/python/observability/csm/csm_greeter_server* /artifacts/ + +FROM python:3.9-slim-bookworm + +RUN apt-get update -y \ + && apt-get install -y python3 \ + && apt-get -y autoremove \ + && apt-get install -y curl \ + && rm -rf /var/lib/apt/lists/* + +RUN ln -s /usr/bin/python3 /usr/bin/python + +COPY --from=0 /artifacts ./ + +ENTRYPOINT ["/csm_greeter_server"] diff --git a/examples/python/observability/csm/README.md b/examples/python/observability/csm/README.md new file mode 100644 index 00000000000..20a76d3dc8a --- /dev/null +++ b/examples/python/observability/csm/README.md @@ -0,0 +1,33 @@ +# gRPC Python CSM Hello World Example + +This CSM example builds on the [Python xDS Example](https://github.com/grpc/grpc/tree/master/examples/python/xds) and changes the gRPC client and server to accept configuration from an xDS control plane and test CSM observability. + +## Configuration + +The client takes the following command-line arguments - +* `--target` - By default, the client tries to connect to the target "xds:///helloworld:50051" and gRPC would use xDS to resolve this target and connect to the server backend. This can be overriden to change the target. +* `--secure_mode` - Whether to use xDS to retrieve server credentials. Default value is False. +* `--prometheus_endpoint` - Endpoint used for prometheus. Default value is localhost:9464. + + +The server takes the following command-line arguments - +* `--port` - Port on which the Hello World service is run. Defaults to 50051. +* `--secure_mode` - Whether to use xDS to retrieve server credentials. Default value is False. +* `--server_id` - The server ID to return in responses. +* `--prometheus_endpoint` - Endpoint used for prometheus. Default value is `localhost:9464`. + +## Building + +From the gRPC workspace folder: + +Client: +``` +docker build -f examples/python/observability/csm/Dockerfile.client -t "us-docker.pkg.dev/grpc-testing/examples/csm-o11y-example-python-client" . +``` + +Server: +``` +docker build -f examples/python/observability/csm/Dockerfile.server -t "us-docker.pkg.dev/grpc-testing/examples/csm-o11y-example-python-server" . +``` + +And then push the tagged image using `docker push`. diff --git a/examples/python/observability/csm/csm_greeter_client.py b/examples/python/observability/csm/csm_greeter_client.py new file mode 100644 index 00000000000..0abdbf65fa3 --- /dev/null +++ b/examples/python/observability/csm/csm_greeter_client.py @@ -0,0 +1,101 @@ +# Copyright 2024 The gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import logging +import time + +import grpc +from grpc_csm_observability import CsmOpenTelemetryPlugin +from opentelemetry.exporter.prometheus import PrometheusMetricReader +from opentelemetry.sdk.metrics import MeterProvider +from prometheus_client import start_http_server + +from src.proto.grpc.testing import messages_pb2 +from src.proto.grpc.testing import test_pb2_grpc + +logger = logging.getLogger() +console_handler = logging.StreamHandler() +formatter = logging.Formatter(fmt="%(asctime)s: %(levelname)-8s %(message)s") +console_handler.setFormatter(formatter) +logger.addHandler(console_handler) + + +def _run(target: int, secure_mode: bool, prometheus_endpoint: int): + csm_plugin = _prepare_csm_observability_plugin(prometheus_endpoint) + csm_plugin.register_global() + if secure_mode: + fallback_creds = grpc.experimental.insecure_channel_credentials() + channel_creds = grpc.xds_channel_credentials(fallback_creds) + channel = grpc.secure_channel(target, channel_creds) + else: + channel = grpc.insecure_channel(target) + with channel: + stub = test_pb2_grpc.TestServiceStub(channel) + # Continuously send RPCs every second. + while True: + request = messages_pb2.SimpleRequest() + logger.info("Sending request to server") + stub.UnaryCall(request) + time.sleep(1) + csm_plugin.deregister_global() + + +def _prepare_csm_observability_plugin( + prometheus_endpoint: int, +) -> CsmOpenTelemetryPlugin: + # Start Prometheus client + start_http_server(port=prometheus_endpoint, addr="0.0.0.0") + reader = PrometheusMetricReader() + meter_provider = MeterProvider(metric_readers=[reader]) + csm_plugin = CsmOpenTelemetryPlugin( + meter_provider=meter_provider, + ) + return csm_plugin + + +def bool_arg(arg: str) -> bool: + if arg.lower() in ("true", "yes", "y"): + return True + elif arg.lower() in ("false", "no", "n"): + return False + else: + raise argparse.ArgumentTypeError(f"Could not parse '{arg}' as a bool.") + + +if __name__ == "__main__": + logging.basicConfig() + logger.setLevel(logging.INFO) + parser = argparse.ArgumentParser( + description="Run Python CSM Observability Test client." + ) + parser.add_argument( + "--target", + default="xds:///helloworld:50051", + help="The address of the server.", + ) + parser.add_argument( + "--secure_mode", + default="False", + type=bool_arg, + help="If specified, uses xDS credentials to connect to the server.", + ) + parser.add_argument( + "--prometheus_endpoint", + type=int, + default=9464, + help="Port for servers besides test server.", + ) + args = parser.parse_args() + _run(args.target, args.secure_mode, args.prometheus_endpoint) diff --git a/examples/python/observability/csm/csm_greeter_server.py b/examples/python/observability/csm/csm_greeter_server.py new file mode 100644 index 00000000000..2f5875d26c5 --- /dev/null +++ b/examples/python/observability/csm/csm_greeter_server.py @@ -0,0 +1,149 @@ +# Copyright 2024 The gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +from concurrent import futures +import logging +import socket + +import grpc +from grpc_csm_observability import CsmOpenTelemetryPlugin +from opentelemetry.exporter.prometheus import PrometheusMetricReader +from opentelemetry.sdk.metrics import MeterProvider +from prometheus_client import start_http_server + +from src.proto.grpc.testing import messages_pb2 +from src.proto.grpc.testing import test_pb2_grpc + +_LISTEN_HOST = "0.0.0.0" +_THREAD_POOL_SIZE = 256 + +logger = logging.getLogger() +console_handler = logging.StreamHandler() +formatter = logging.Formatter(fmt="%(asctime)s: %(levelname)-8s %(message)s") +console_handler.setFormatter(formatter) +logger.addHandler(console_handler) + + +class TestService(test_pb2_grpc.TestServiceServicer): + def __init__(self, server_id, hostname): + self._server_id = server_id + self._hostname = hostname + + def UnaryCall( + self, request: messages_pb2.SimpleRequest, context: grpc.ServicerContext + ) -> messages_pb2.SimpleResponse: + context.send_initial_metadata((("hostname", self._hostname),)) + if request.response_size > 0: + response = messages_pb2.SimpleResponse( + payload=messages_pb2.Payload(body=b"0" * request.response_size) + ) + else: + response = messages_pb2.SimpleResponse() + response.server_id = self._server_id + response.hostname = self._hostname + logger.info("Sending response to client") + return response + + +def _run( + port: int, + secure_mode: bool, + server_id: str, + prometheus_endpoint: int, +) -> None: + csm_plugin = _prepare_csm_observability_plugin(prometheus_endpoint) + csm_plugin.register_global() + server = grpc.server( + futures.ThreadPoolExecutor(max_workers=_THREAD_POOL_SIZE) + ) + _configure_test_server(server, port, secure_mode, server_id) + server.start() + logger.info("Test server listening on port %d", port) + server.wait_for_termination() + csm_plugin.deregister_global() + + +def _prepare_csm_observability_plugin( + prometheus_endpoint: int, +) -> CsmOpenTelemetryPlugin: + # Start Prometheus client + start_http_server(port=prometheus_endpoint, addr="0.0.0.0") + reader = PrometheusMetricReader() + meter_provider = MeterProvider(metric_readers=[reader]) + csm_plugin = CsmOpenTelemetryPlugin( + meter_provider=meter_provider, + ) + return csm_plugin + + +def _configure_test_server( + server: grpc.Server, port: int, secure_mode: bool, server_id: str +) -> None: + test_pb2_grpc.add_TestServiceServicer_to_server( + TestService(server_id, socket.gethostname()), server + ) + listen_address = f"{_LISTEN_HOST}:{port}" + if not secure_mode: + server.add_insecure_port(listen_address) + else: + logger.info("Running with xDS Server credentials") + server_fallback_creds = grpc.insecure_server_credentials() + server_creds = grpc.xds_server_credentials(server_fallback_creds) + server.add_secure_port(listen_address, server_creds) + + +def bool_arg(arg: str) -> bool: + if arg.lower() in ("true", "yes", "y"): + return True + elif arg.lower() in ("false", "no", "n"): + return False + else: + raise argparse.ArgumentTypeError(f"Could not parse '{arg}' as a bool.") + + +if __name__ == "__main__": + logging.basicConfig() + logger.setLevel(logging.INFO) + parser = argparse.ArgumentParser( + description="Run Python CSM Observability Test server." + ) + parser.add_argument( + "--port", type=int, default=50051, help="Port for test server." + ) + parser.add_argument( + "--secure_mode", + type=bool_arg, + default="False", + help="If specified, uses xDS to retrieve server credentials.", + ) + parser.add_argument( + "--server_id", + type=str, + default="python_server", + help="The server ID to return in responses.", + ) + parser.add_argument( + "--prometheus_endpoint", + type=int, + default=9464, + help="Port for servers besides test server.", + ) + args = parser.parse_args() + _run( + args.port, + args.secure_mode, + args.server_id, + args.prometheus_endpoint, + ) From b1c3b5ddfeb69dcb86e2c3afc37a0d82a27ee92e Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Fri, 7 Jun 2024 12:48:12 -0700 Subject: [PATCH 10/10] [CI] Add clang-cl build to CI (#36840) This adds a clang-cl Windows build to the set of Github presubmit jobs. It builds the codebase with strict warnings enabled, including thread annotation checks, and the rest of diagnostics we've been missing on Windows. Here's [a successful run](https://btx.cloud.google.com/invocations/448792b6-3cff-4987-975a-af5e19526fc0/targets/grpc%2Fcore%2Fpull_request%2Fwindows%2Fgrpc_basictests_c/log) of the script (hijacking the C basic tests kokoro job, ignore that bit) Closes #36840 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36840 from drfloob:kokoro-grpc-win-clangcl f15c8c56262422e5caa94684140d4d34faaf1f0a PiperOrigin-RevId: 641330117 --- bazel/copts.bzl | 3 ++ .../windows/grpc_build_clang_cl.bat | 48 +++++++++++++++++++ .../pull_request/grpc_build_clang_cl.cfg | 25 ++++++++++ 3 files changed, 76 insertions(+) create mode 100644 tools/internal_ci/windows/grpc_build_clang_cl.bat create mode 100644 tools/internal_ci/windows/pull_request/grpc_build_clang_cl.cfg diff --git a/bazel/copts.bzl b/bazel/copts.bzl index 6149e5cfba5..3044ce85c5f 100644 --- a/bazel/copts.bzl +++ b/bazel/copts.bzl @@ -110,6 +110,7 @@ GRPC_LLVM_WINDOWS_WARNING_FLAGS = GRPC_LLVM_WARNING_FLAGS + [ # TODO(hork): clean up EE offenses "-Wno-missing-field-initializers", "-Wno-non-virtual-dtor", + "-Wno-thread-safety-reference-return", # TODO(ctiller): offense: dump_args. signed to unsigned "-Wno-sign-conversion", @@ -145,9 +146,11 @@ GRPC_LLVM_WINDOWS_WARNING_FLAGS = GRPC_LLVM_WARNING_FLAGS + [ "-Wno-suggest-override", "-Wno-documentation", "-Wno-documentation-unknown-command", + "-Wno-unsafe-buffer-usage", ### possibly bad warnings for this codebase "-Wno-covered-switch-default", + "-Wno-switch-default", "-Wno-switch-enum", "-Wno-c99-extensions", "-Wno-unused-private-field", # GRPC_UNUSED does not appear to work for private fields diff --git a/tools/internal_ci/windows/grpc_build_clang_cl.bat b/tools/internal_ci/windows/grpc_build_clang_cl.bat new file mode 100644 index 00000000000..a4c94ce8b7c --- /dev/null +++ b/tools/internal_ci/windows/grpc_build_clang_cl.bat @@ -0,0 +1,48 @@ +@rem Copyright 2024 gRPC authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@rem Avoid slow finalization after the script has exited. +@rem See the script's prologue for info on the correct invocation pattern. +setlocal EnableDelayedExpansion +IF "%cd%"=="T:\src" ( + call %~dp0\..\..\..\tools\internal_ci\helper_scripts\move_src_tree_and_respawn_itself.bat %0 + echo respawn script has finished with exitcode !errorlevel! + exit /b !errorlevel! +) +endlocal + +@rem enter repo root +cd /d %~dp0\..\..\.. + +echo "!TIME!: Preparing for the Windows build" +call tools/internal_ci/helper_scripts/prepare_build_windows.bat || exit /b 1 + +@rem Install clang-cl +echo "!TIME!: Installing llvm" +choco install -y llvm --version=18.1.6 +set BAZEL_LLVM="C:\Program Files\LLVM" +clang-cl --version + +@rem Install bazel +@rem Side effect of the tools/bazel script is that it downloads the correct version of bazel binary. +echo "!TIME!: Installing bazel" +mkdir C:\bazel +bash -c "tools/bazel --version && cp tools/bazel-*.exe /c/bazel/bazel.exe" +set PATH=C:\bazel;%PATH% +bazel --version + +echo "!TIME!: Running the bazel build" +bazel build --config=clang-cl --config=windows_opt --build_tag_filters=-no_windows :all src/core:all + +echo "!TIME!: Job Finished" diff --git a/tools/internal_ci/windows/pull_request/grpc_build_clang_cl.cfg b/tools/internal_ci/windows/pull_request/grpc_build_clang_cl.cfg new file mode 100644 index 00000000000..b6ec15b9746 --- /dev/null +++ b/tools/internal_ci/windows/pull_request/grpc_build_clang_cl.cfg @@ -0,0 +1,25 @@ +# Copyright 2024 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/windows/grpc_build_clang_cl.bat" +timeout_mins: 120 +action { + define_artifacts { + regex: "**/*sponge_log.*" + regex: "github/grpc/reports/**" + } +}