From 6edaa28cc7671a5c8f15f62ef70170df69db1e35 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Tue, 14 May 2024 12:54:35 -0700 Subject: [PATCH 1/9] [test] Nerf WritesPerRpcTest due to timeout (#36612) With 1k iterations instead of 10k iterations, this test takes ~90s in the RBE environment. There must have been a regression somewhere, since this test did not used to fail every time. Closes #36612 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36612 from drfloob:nerf-writes-per-rpc 0ba8af41675c5560aa11cd18b57076ed279934db PiperOrigin-RevId: 633677652 --- .../fuzzing_event_engine.h | 7 ++++-- test/cpp/performance/writes_per_rpc_test.cc | 23 +++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h b/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h index 1bc85ee3ce5..f28cdca5251 100644 --- a/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h +++ b/test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h @@ -29,6 +29,7 @@ #include "absl/base/thread_annotations.h" #include "absl/functional/any_invocable.h" +#include "absl/log/log.h" #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/types/optional.h" @@ -314,8 +315,10 @@ class ThreadedFuzzingEventEngine : public FuzzingEventEngine { fuzzing_event_engine::Actions()), main_([this, max_time]() { while (!done_.load()) { - absl::SleepFor(absl::Milliseconds( - grpc_event_engine::experimental::Milliseconds(max_time))); + if (max_time > Duration::zero()) { + absl::SleepFor(absl::Milliseconds( + grpc_event_engine::experimental::Milliseconds(max_time))); + } Tick(); } }) {} diff --git a/test/cpp/performance/writes_per_rpc_test.cc b/test/cpp/performance/writes_per_rpc_test.cc index 7a24ebd917b..9bd8f009334 100644 --- a/test/cpp/performance/writes_per_rpc_test.cc +++ b/test/cpp/performance/writes_per_rpc_test.cc @@ -61,7 +61,7 @@ using grpc_event_engine::experimental::URIToResolvedAddress; void* tag(intptr_t x) { return reinterpret_cast(x); } -constexpr int kIterations = 10000; +constexpr int kIterations = 1000; constexpr int kSnapshotEvery = kIterations / 10; } // namespace @@ -216,17 +216,20 @@ static double UnaryPingPong(ThreadedFuzzingEventEngine* fuzzing_engine, EchoTestService::NewStub(fixture->channel())); auto baseline = grpc_core::global_stats().Collect(); auto snapshot = grpc_core::global_stats().Collect(); + auto last_snapshot = absl::Now(); for (int iteration = 0; iteration < kIterations; iteration++) { - if (iteration % kSnapshotEvery == 0) { + if (iteration > 0 && iteration % kSnapshotEvery == 0) { auto new_snapshot = grpc_core::global_stats().Collect(); auto diff = new_snapshot->Diff(*snapshot); - gpr_log(GPR_DEBUG, - " SNAPSHOT: UnaryPingPong(%d, %d): writes_per_iteration=%0.3f " - "(total=%lu, i=%d) pings=%lu", - request_size, response_size, - static_cast(diff->syscall_write) / - static_cast(kSnapshotEvery), - diff->syscall_write, iteration, diff->http2_pings_sent); + auto now = absl::Now(); + LOG(ERROR) << " SNAPSHOT: UnaryPingPong(" << request_size << ", " + << response_size << "): writes_per_iteration=" + << static_cast(diff->syscall_write) / + static_cast(kSnapshotEvery) + << " (total=" << diff->syscall_write << ", i=" << iteration + << ") pings=" << diff->http2_pings_sent + << "; duration=" << now - last_snapshot; + last_snapshot = now; snapshot = std::move(new_snapshot); } recv_response.Clear(); @@ -238,7 +241,7 @@ static double UnaryPingPong(ThreadedFuzzingEventEngine* fuzzing_engine, response_reader->Finish(&recv_response, &recv_status, tag(4)); CHECK(fixture->cq()->Next(&t, &ok)); CHECK(ok); - CHECK(t == tag(0) || t == tag(1)); + CHECK(t == tag(0) || t == tag(1)) << "Found unexpected tag " << t; intptr_t slot = reinterpret_cast(t); ServerEnv* senv = server_env[slot]; senv->response_writer.Finish(send_response, Status::OK, tag(3)); From befeeba0f57c6ed3608935d8317fd26289e7e080 Mon Sep 17 00:00:00 2001 From: Tanvi Jagtap <139093547+tanvi-jagtap@users.noreply.github.com> Date: Tue, 14 May 2024 19:14:20 -0700 Subject: [PATCH 2/9] [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log (#36594) [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log In this CL we are migrating from gRPCs own gpr logging mechanism to absl logging mechanism. The intention is to deprecate gpr_log in the future. We have the following mapping 1. gpr_log(GPR_INFO,...) -> LOG(INFO) 2. gpr_log(GPR_ERROR,...) -> LOG(ERROR) 3. gpr_log(GPR_DEBUG,...) -> VLOG(2) Reviewers need to check : 1. If the above mapping is correct. 2. The content of the log is as before. gpr_log format strings did not use string_view or std::string . absl LOG accepts these. So there will be some elimination of string_view and std::string related conversions. This is expected. Closes #36594 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36594 from tanvi-jagtap:regex_src_cpp d9c21d6456a79bf489262aeebec090988ab7b743 PiperOrigin-RevId: 633777020 --- src/cpp/client/secure_credentials.cc | 5 +- src/cpp/common/alts_util.cc | 10 ++-- src/cpp/common/completion_queue_cc.cc | 5 +- src/cpp/ext/gcp/observability_logging_sink.cc | 32 ++++++------- .../get_cpu_stats_unsupported.cc | 6 +-- src/cpp/server/load_reporter/util.cc | 5 +- src/cpp/server/server_builder.cc | 47 +++++++++---------- src/cpp/server/server_cc.cc | 9 ++-- src/cpp/thread_manager/thread_manager.cc | 5 +- 9 files changed, 58 insertions(+), 66 deletions(-) diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index 3b48e20dcf6..dabe0ce79ad 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -25,6 +25,7 @@ #include #include "absl/log/check.h" +#include "absl/log/log.h" #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/str_join.h" @@ -35,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -273,8 +273,7 @@ std::shared_ptr ServiceAccountJWTAccessCredentials( const std::string& json_key, long token_lifetime_seconds) { grpc::internal::GrpcLibrary init; // To call grpc_init(). if (token_lifetime_seconds <= 0) { - gpr_log(GPR_ERROR, - "Trying to create JWTCredentials with non-positive lifetime"); + LOG(ERROR) << "Trying to create JWTCredentials with non-positive lifetime"; return WrapCallCredentials(nullptr); } gpr_timespec lifetime = diff --git a/src/cpp/common/alts_util.cc b/src/cpp/common/alts_util.cc index 784b0157c42..df1a8a8cf5b 100644 --- a/src/cpp/common/alts_util.cc +++ b/src/cpp/common/alts_util.cc @@ -21,10 +21,10 @@ #include #include +#include "absl/log/log.h" #include "upb/mem/arena.hpp" #include -#include #include #include #include @@ -40,25 +40,25 @@ namespace experimental { std::unique_ptr GetAltsContextFromAuthContext( const std::shared_ptr& auth_context) { if (auth_context == nullptr) { - gpr_log(GPR_ERROR, "auth_context is nullptr."); + LOG(ERROR) << "auth_context is nullptr."; return nullptr; } std::vector ctx_vector = auth_context->FindPropertyValues(TSI_ALTS_CONTEXT); if (ctx_vector.size() != 1) { - gpr_log(GPR_ERROR, "contains zero or more than one ALTS context."); + LOG(ERROR) << "contains zero or more than one ALTS context."; return nullptr; } upb::Arena context_arena; grpc_gcp_AltsContext* ctx = grpc_gcp_AltsContext_parse( ctx_vector[0].data(), ctx_vector[0].size(), context_arena.ptr()); if (ctx == nullptr) { - gpr_log(GPR_ERROR, "fails to parse ALTS context."); + LOG(ERROR) << "fails to parse ALTS context."; return nullptr; } if (grpc_gcp_AltsContext_security_level(ctx) < GRPC_SECURITY_MIN || grpc_gcp_AltsContext_security_level(ctx) > GRPC_SECURITY_MAX) { - gpr_log(GPR_ERROR, "security_level is invalid."); + LOG(ERROR) << "security_level is invalid."; return nullptr; } return std::make_unique(AltsContext(ctx)); diff --git a/src/cpp/common/completion_queue_cc.cc b/src/cpp/common/completion_queue_cc.cc index 9c0b7d31bc0..231fb4469e3 100644 --- a/src/cpp/common/completion_queue_cc.cc +++ b/src/cpp/common/completion_queue_cc.cc @@ -19,10 +19,10 @@ #include "absl/base/thread_annotations.h" #include "absl/log/check.h" +#include "absl/log/log.h" #include #include -#include #include #include #include @@ -134,8 +134,7 @@ CompletionQueue::CompletionQueue(grpc_completion_queue* take) void CompletionQueue::Shutdown() { #ifndef NDEBUG if (!ServerListEmpty()) { - gpr_log(GPR_ERROR, - "CompletionQueue shutdown being shutdown before its server."); + LOG(ERROR) << "CompletionQueue shutdown being shutdown before its server."; } #endif CompleteAvalanching(); diff --git a/src/cpp/ext/gcp/observability_logging_sink.cc b/src/cpp/ext/gcp/observability_logging_sink.cc index 6d62c1e4079..e7f71d4f0e8 100644 --- a/src/cpp/ext/gcp/observability_logging_sink.cc +++ b/src/cpp/ext/gcp/observability_logging_sink.cc @@ -22,6 +22,7 @@ #include #include +#include "absl/log/log.h" #include "absl/numeric/int128.h" #include "absl/strings/escaping.h" #include "absl/strings/match.h" @@ -34,7 +35,6 @@ #include "google/protobuf/text_format.h" #include -#include #include #include #include @@ -360,22 +360,20 @@ void ObservabilityLoggingSink::FlushEntriesHelper( &(call->context), &(call->request), &(call->response), [this, call](Status status) { if (!status.ok()) { - gpr_log( - GPR_ERROR, - "GCP Observability Logging Error %d: %s. Dumping log entries.", - status.error_code(), status.error_message().c_str()); + LOG(ERROR) << "GCP Observability Logging Error " + << status.error_code() << ": " << status.error_message() + << ". Dumping log entries."; for (auto& entry : call->request.entries()) { std::string output; ::google::protobuf::TextFormat::PrintToString(entry.json_payload(), &output); - gpr_log( - GPR_INFO, "Log Entry recorded at time: %s : %s", - grpc_core::Timestamp::FromTimespecRoundUp( - gpr_timespec{entry.timestamp().seconds(), - entry.timestamp().nanos(), GPR_CLOCK_REALTIME}) - .ToString() - .c_str(), - output.c_str()); + LOG(INFO) << "Log Entry recorded at time: " + << grpc_core::Timestamp::FromTimespecRoundUp( + gpr_timespec{entry.timestamp().seconds(), + entry.timestamp().nanos(), + GPR_CLOCK_REALTIME}) + .ToString() + << " : " << output; } } delete call; @@ -414,16 +412,16 @@ void ObservabilityLoggingSink::MaybeTriggerFlushLocked() { if (entries_.empty()) return; if (entries_.size() > kMaxEntriesBeforeDump || entries_memory_footprint_ > kMaxMemoryFootprintBeforeDump) { - // Buffer limits have been reached. Dump entries with gpr_log - gpr_log(GPR_INFO, "Buffer limit reached. Dumping log entries."); + // Buffer limits have been reached. Dump entries with LOG + LOG(INFO) << "Buffer limit reached. Dumping log entries."; for (auto& entry : entries_) { google::protobuf::Struct proto; std::string timestamp = entry.timestamp.ToString(); EntryToJsonStructProto(std::move(entry), &proto); std::string output; ::google::protobuf::TextFormat::PrintToString(proto, &output); - gpr_log(GPR_INFO, "Log Entry recorded at time: %s : %s", - timestamp.c_str(), output.c_str()); + LOG(INFO) << "Log Entry recorded at time: " << timestamp << " : " + << output; } entries_.clear(); entries_memory_footprint_ = 0; diff --git a/src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc b/src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc index 83734b9c9d7..2744c66b25e 100644 --- a/src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc +++ b/src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc @@ -20,7 +20,7 @@ #if !defined(GPR_LINUX) && !defined(GPR_WINDOWS) && !defined(GPR_APPLE) -#include +#include "absl/log/log.h" #include "src/core/lib/gprpp/crash.h" #include "src/cpp/server/load_reporter/get_cpu_stats.h" @@ -30,8 +30,8 @@ namespace load_reporter { std::pair GetCpuStatsImpl() { uint64_t busy = 0, total = 0; - gpr_log(GPR_ERROR, - "Platforms other than Linux, Windows, and MacOS are not supported."); + LOG(ERROR) + << "Platforms other than Linux, Windows, and MacOS are not supported."; return std::make_pair(busy, total); } diff --git a/src/cpp/server/load_reporter/util.cc b/src/cpp/server/load_reporter/util.cc index 8daac576d73..043d4ebb480 100644 --- a/src/cpp/server/load_reporter/util.cc +++ b/src/cpp/server/load_reporter/util.cc @@ -21,8 +21,9 @@ #include #include +#include "absl/log/log.h" + #include -#include #include #include #include @@ -41,7 +42,7 @@ void AddLoadReportingCost(grpc::ServerContext* ctx, cost_name.size()); ctx->AddTrailingMetadata(GRPC_LB_COST_MD_KEY, buf); } else { - gpr_log(GPR_ERROR, "Call metric value is not normal."); + LOG(ERROR) << "Call metric value is not normal."; } } diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index b9f71915981..7f96f6c96cf 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -26,11 +26,11 @@ #include #include "absl/log/check.h" +#include "absl/log/log.h" #include #include #include -#include #include #include #include @@ -139,10 +139,9 @@ ServerBuilder& ServerBuilder::RegisterService(const std::string& host, ServerBuilder& ServerBuilder::RegisterAsyncGenericService( AsyncGenericService* service) { if (generic_service_ || callback_generic_service_) { - gpr_log(GPR_ERROR, - "Adding multiple generic services is unsupported for now. " - "Dropping the service %p", - service); + LOG(ERROR) << "Adding multiple generic services is unsupported for now. " + "Dropping the service " + << service; } else { generic_service_ = service; } @@ -152,10 +151,9 @@ ServerBuilder& ServerBuilder::RegisterAsyncGenericService( ServerBuilder& ServerBuilder::RegisterCallbackGenericService( CallbackGenericService* service) { if (generic_service_ || callback_generic_service_) { - gpr_log(GPR_ERROR, - "Adding multiple generic services is unsupported for now. " - "Dropping the service %p", - service); + LOG(ERROR) << "Adding multiple generic services is unsupported for now. " + "Dropping the service " + << service; } else { callback_generic_service_ = service; } @@ -391,16 +389,16 @@ std::unique_ptr ServerBuilder::BuildAndStart() { if (has_sync_methods) { // This is a Sync server - gpr_log(GPR_INFO, - "Synchronous server. Num CQs: %d, Min pollers: %d, Max Pollers: " - "%d, CQ timeout (msec): %d", - sync_server_settings_.num_cqs, sync_server_settings_.min_pollers, - sync_server_settings_.max_pollers, - sync_server_settings_.cq_timeout_msec); + LOG(INFO) << "Synchronous server. Num CQs: " + << sync_server_settings_.num_cqs + << ", Min pollers: " << sync_server_settings_.min_pollers + << ", Max Pollers: " << sync_server_settings_.max_pollers + << ", CQ timeout (msec): " + << sync_server_settings_.cq_timeout_msec; } if (has_callback_methods) { - gpr_log(GPR_INFO, "Callback server."); + LOG(INFO) << "Callback server."; } std::unique_ptr server(new grpc::Server( @@ -445,22 +443,22 @@ std::unique_ptr ServerBuilder::BuildAndStart() { if (passive_listener != nullptr) { auto* creds = unstarted_listener.credentials->c_creds(); if (creds == nullptr) { - gpr_log(GPR_ERROR, "Credentials missing for PassiveListener"); + LOG(ERROR) << "Credentials missing for PassiveListener"; return nullptr; } auto success = grpc_server_add_passive_listener( core_server, creds, std::move(passive_listener)); if (!success.ok()) { - gpr_log(GPR_ERROR, "Failed to create a passive listener: %s", - success.ToString().c_str()); + LOG(ERROR) << "Failed to create a passive listener: " + << success.ToString(); return nullptr; } } } if (!has_frequently_polled_cqs) { - gpr_log(GPR_ERROR, - "At least one of the completion queues must be frequently polled"); + LOG(ERROR) + << "At least one of the completion queues must be frequently polled"; return nullptr; } @@ -483,9 +481,8 @@ std::unique_ptr ServerBuilder::BuildAndStart() { } else { for (const auto& value : services_) { if (value->service->has_generic_methods()) { - gpr_log(GPR_ERROR, - "Some methods were marked generic but there is no " - "generic service registered."); + LOG(ERROR) << "Some methods were marked generic but there is no " + "generic service registered."; return nullptr; } } @@ -525,7 +522,7 @@ ServerBuilder& ServerBuilder::EnableWorkaround(grpc_workaround_list id) { case GRPC_WORKAROUND_ID_CRONET_COMPRESSION: return AddChannelArgument(GRPC_ARG_WORKAROUND_CRONET_COMPRESSION, 1); default: - gpr_log(GPR_ERROR, "Workaround %u does not exist or is obsolete.", id); + LOG(ERROR) << "Workaround " << id << " does not exist or is obsolete."; return *this; } } diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index ff3c3c7bdb3..099b8ca2141 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -30,13 +30,13 @@ #include #include "absl/log/check.h" +#include "absl/log/log.h" #include "absl/status/status.h" #include #include #include #include -#include #include #include #include @@ -446,7 +446,7 @@ class Server::SyncRequest final : public grpc::internal::CompletionQueueTag { deserialized_request_ = handler->Deserialize(call_, request_payload_, &request_status_, nullptr); if (!request_status_.ok()) { - gpr_log(GPR_DEBUG, "Failed to deserialize message."); + VLOG(2) << "Failed to deserialize message."; } request_payload_ = nullptr; interceptor_methods_.AddInterceptionHookPoint( @@ -689,7 +689,7 @@ class Server::CallbackRequest final req_->call_, req_->request_payload_, &req_->request_status_, &req_->handler_data_); if (!(req_->request_status_.ok())) { - gpr_log(GPR_DEBUG, "Failed to deserialize message."); + VLOG(2) << "Failed to deserialize message."; } req_->request_payload_ = nullptr; req_->interceptor_methods_.AddInterceptionHookPoint( @@ -1058,8 +1058,7 @@ bool Server::RegisterService(const std::string* addr, grpc::Service* service) { server_, method->name(), addr ? addr->c_str() : nullptr, PayloadHandlingForMethod(method.get()), 0); if (method_registration_tag == nullptr) { - gpr_log(GPR_DEBUG, "Attempt to register %s multiple times", - method->name()); + VLOG(2) << "Attempt to register " << method->name() << " multiple times"; return false; } diff --git a/src/cpp/thread_manager/thread_manager.cc b/src/cpp/thread_manager/thread_manager.cc index 1264bb3102e..1fd3ee20bc8 100644 --- a/src/cpp/thread_manager/thread_manager.cc +++ b/src/cpp/thread_manager/thread_manager.cc @@ -21,10 +21,9 @@ #include #include "absl/log/check.h" +#include "absl/log/log.h" #include "absl/strings/str_format.h" -#include - #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/thd.h" @@ -41,7 +40,7 @@ ThreadManager::WorkerThread::WorkerThread(ThreadManager* thd_mgr) [](void* th) { static_cast(th)->Run(); }, this, &created_); if (!created_) { - gpr_log(GPR_ERROR, "Could not create grpc_sync_server worker-thread"); + LOG(ERROR) << "Could not create grpc_sync_server worker-thread"; } } From bc5570bec81df8be6d352b4ca06c27aef2a3f8a8 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Wed, 15 May 2024 10:16:20 -0700 Subject: [PATCH 3/9] Revert "[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging - BUILD (#36607)" (#36625) This reverts commit 15850972ddba9c1262a9d51341da03bc607bd934. Breaks the bazel distribtests. https://source.cloud.google.com/results/invocations/da317d7c-5240-445f-8953-68a840ccc892/targets/%2F%2Ftools%2Fbazelify_tests%2Ftest:bazel_distribtest_6.5.0_buildtest/log Closes #36625 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36625 from drfloob:revert-36607 395191f9c700e9b5206cef3bb44d875924602898 PiperOrigin-RevId: 633995522 --- test/cpp/common/BUILD | 2 -- test/cpp/end2end/BUILD | 27 ------------------- test/cpp/end2end/xds/BUILD | 9 ------- test/cpp/ext/filters/logging/BUILD | 1 - test/cpp/interop/BUILD | 15 ----------- test/cpp/microbenchmarks/BUILD | 4 --- .../generate_resolver_component_tests.bzl | 3 --- test/cpp/performance/BUILD | 1 - test/cpp/qps/BUILD | 13 +-------- test/cpp/qps/qps_benchmark_script.bzl | 1 - test/cpp/server/BUILD | 1 - test/cpp/server/load_reporter/BUILD | 1 - test/cpp/thread_manager/BUILD | 1 - 13 files changed, 1 insertion(+), 78 deletions(-) diff --git a/test/cpp/common/BUILD b/test/cpp/common/BUILD index 3a296c6fc0e..7f6136fac2c 100644 --- a/test/cpp/common/BUILD +++ b/test/cpp/common/BUILD @@ -37,7 +37,6 @@ grpc_cc_test( srcs = ["timer_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], flaky = True, @@ -53,7 +52,6 @@ grpc_cc_test( srcs = ["time_jump_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], tags = [ diff --git a/test/cpp/end2end/BUILD b/test/cpp/end2end/BUILD index 180f631050b..6ada7da27c1 100644 --- a/test/cpp/end2end/BUILD +++ b/test/cpp/end2end/BUILD @@ -27,7 +27,6 @@ grpc_cc_library( srcs = ["test_service_impl.cc"], hdrs = ["test_service_impl.h"], external_deps = [ - "absl/log:log", "gtest", "absl/log:check", "absl/synchronization", @@ -66,7 +65,6 @@ grpc_cc_library( hdrs = ["connection_attempt_injector.h"], external_deps = [ "absl/log:check", - "absl/log:log", ], deps = [ "//:grpc", @@ -94,7 +92,6 @@ grpc_cc_library( srcs = ["rls_server.cc"], hdrs = ["rls_server.h"], external_deps = [ - "absl/log:log", "gtest", ], deps = [ @@ -109,7 +106,6 @@ grpc_cc_test( srcs = ["async_end2end_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], shard_count = 10, @@ -191,7 +187,6 @@ grpc_cc_binary( srcs = ["client_crash_test_server.cc"], external_deps = [ "absl/flags:flag", - "absl/log:log", "gtest", ], deps = [ @@ -212,7 +207,6 @@ grpc_cc_test( name = "client_fork_test", srcs = ["client_fork_test.cc"], external_deps = [ - "absl/log:log", "absl/strings", "gtest", ], @@ -238,7 +232,6 @@ grpc_cc_test( srcs = ["client_callback_end2end_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], tags = ["cpp_end2end_test"], @@ -378,7 +371,6 @@ grpc_cc_test( grpc_cc_test( name = "end2end_test", size = "large", - external_deps = ["absl/log:log"], flaky = True, # TODO(b/151704375) shard_count = 10, tags = [ @@ -456,7 +448,6 @@ grpc_cc_test( srcs = ["hybrid_end2end_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], tags = ["cpp_end2end_test"], @@ -498,7 +489,6 @@ grpc_cc_test( name = "mock_test", srcs = ["mock_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], tags = ["cpp_end2end_test"], @@ -575,7 +565,6 @@ grpc_cc_test( srcs = ["rls_end2end_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "absl/types:optional", "gtest", ], @@ -610,7 +599,6 @@ grpc_cc_test( srcs = ["service_config_end2end_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], tags = ["cpp_end2end_test"], @@ -711,7 +699,6 @@ grpc_cc_test( ], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], tags = [ @@ -738,7 +725,6 @@ grpc_cc_binary( external_deps = [ "absl/flags:flag", "absl/log:check", - "absl/log:log", "gtest", ], deps = [ @@ -778,7 +764,6 @@ grpc_cc_test( name = "server_load_reporting_end2end_test", srcs = ["server_load_reporting_end2end_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], tags = [ @@ -797,7 +782,6 @@ grpc_cc_test( name = "flaky_network_test", srcs = ["flaky_network_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], tags = [ @@ -825,7 +809,6 @@ grpc_cc_test( srcs = ["shutdown_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], tags = ["cpp_end2end_test"], @@ -845,7 +828,6 @@ grpc_cc_test( name = "streaming_throughput_test", srcs = ["streaming_throughput_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], tags = [ @@ -869,7 +851,6 @@ grpc_cc_test( size = "large", srcs = ["thread_stress_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], shard_count = 5, @@ -894,7 +875,6 @@ grpc_cc_test( srcs = ["cfstream_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], tags = [ @@ -924,7 +904,6 @@ grpc_cc_test( srcs = ["message_allocator_end2end_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], tags = ["cpp_end2end_test"], @@ -946,7 +925,6 @@ grpc_cc_test( srcs = ["context_allocator_end2end_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], tags = ["cpp_end2end_test"], @@ -968,7 +946,6 @@ grpc_cc_test( srcs = ["port_sharing_end2end_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], tags = ["cpp_end2end_test"], @@ -1058,7 +1035,6 @@ grpc_cc_test( name = "orca_service_end2end_test", srcs = ["orca_service_end2end_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], tags = ["cpp_end2end_test"], @@ -1104,7 +1080,6 @@ grpc_cc_test( "//src/core/tsi/test_creds:server1.pem", ], external_deps = [ - "absl/log:log", "gtest", ], tags = ["ssl_credentials_test"], @@ -1131,7 +1106,6 @@ grpc_cc_test( "//src/core/tsi/test_creds:server1.pem", ], external_deps = [ - "absl/log:log", "gtest", ], tags = ["tls_credentials_test"], @@ -1160,7 +1134,6 @@ grpc_cc_test( ], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], tags = ["crl_provider_test"], diff --git a/test/cpp/end2end/xds/BUILD b/test/cpp/end2end/xds/BUILD index c7b9e83a842..15afd38eb26 100644 --- a/test/cpp/end2end/xds/BUILD +++ b/test/cpp/end2end/xds/BUILD @@ -71,7 +71,6 @@ grpc_cc_library( hdrs = ["xds_end2end_test_lib.h"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], deps = [ @@ -116,7 +115,6 @@ grpc_cc_test( ], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], flaky = True, # TODO(b/144705388) @@ -164,7 +162,6 @@ grpc_cc_test( size = "large", srcs = ["xds_cluster_end2end_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], flaky = True, # TODO(b/144705388) @@ -193,7 +190,6 @@ grpc_cc_test( srcs = ["xds_cluster_type_end2end_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], flaky = True, # TODO(b/144705388) @@ -221,7 +217,6 @@ grpc_cc_test( size = "large", srcs = ["xds_core_end2end_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], flaky = True, @@ -248,7 +243,6 @@ grpc_cc_test( size = "large", srcs = ["xds_csds_end2end_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], linkstatic = True, # Fixes dyld error on MacOS @@ -330,7 +324,6 @@ grpc_cc_test( size = "large", srcs = ["xds_wrr_end2end_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], linkstatic = True, # Fixes dyld error on MacOS @@ -417,7 +410,6 @@ grpc_cc_test( size = "large", srcs = ["xds_routing_end2end_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], flaky = True, # TODO(b/144705388) @@ -466,7 +458,6 @@ grpc_cc_test( size = "large", srcs = ["xds_override_host_end2end_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], linkstatic = True, # Fixes dyld error on MacOS diff --git a/test/cpp/ext/filters/logging/BUILD b/test/cpp/ext/filters/logging/BUILD index 8edbf284d94..11a90473b8f 100644 --- a/test/cpp/ext/filters/logging/BUILD +++ b/test/cpp/ext/filters/logging/BUILD @@ -26,7 +26,6 @@ grpc_cc_library( srcs = ["library.cc"], hdrs = ["library.h"], external_deps = [ - "absl/log:log", "gtest", ], language = "C++", diff --git a/test/cpp/interop/BUILD b/test/cpp/interop/BUILD index 9b9708fe5cb..21d86d04971 100644 --- a/test/cpp/interop/BUILD +++ b/test/cpp/interop/BUILD @@ -69,7 +69,6 @@ grpc_cc_binary( external_deps = [ "absl/flags:flag", "absl/log:check", - "absl/log:log", ], language = "C++", deps = [ @@ -132,7 +131,6 @@ grpc_cc_library( ], external_deps = [ "absl/flags:flag", - "absl/log:log", ], language = "C++", deps = [ @@ -173,7 +171,6 @@ grpc_cc_binary( external_deps = [ "absl/flags:flag", "absl/log:check", - "absl/log:log", ], deps = [ ":client_helper_lib", @@ -190,7 +187,6 @@ grpc_cc_binary( external_deps = [ "absl/flags:flag", "absl/log:check", - "absl/log:log", ], language = "C++", deps = [ @@ -210,7 +206,6 @@ grpc_cc_binary( external_deps = [ "absl/flags:flag", "absl/log:check", - "absl/log:log", ], deps = [ ":client_helper_lib", @@ -229,7 +224,6 @@ grpc_cc_binary( ], external_deps = [ "absl/flags:flag", - "absl/log:log", ], tags = ["no_windows"], deps = [ @@ -290,7 +284,6 @@ grpc_cc_binary( external_deps = [ "absl/flags:flag", "absl/log:check", - "absl/log:log", "otel/exporters/prometheus:prometheus_exporter", "otel/sdk/src/metrics", ], @@ -320,7 +313,6 @@ grpc_cc_library( "pre_stop_hook_server.h", "xds_interop_server_lib.h", ], - external_deps = ["absl/log:log"], deps = [ "//:grpc++", "//:grpc++_reflection", @@ -340,7 +332,6 @@ grpc_cc_binary( ], external_deps = [ "absl/flags:flag", - "absl/log:log", "otel/exporters/prometheus:prometheus_exporter", "otel/sdk/src/metrics", ], @@ -390,7 +381,6 @@ grpc_cc_library( "istio_echo_server_lib.cc", ], hdrs = ["istio_echo_server_lib.h"], - external_deps = ["absl/log:log"], deps = [ "//:grpc++", "//src/proto/grpc/testing:istio_echo_proto", @@ -404,7 +394,6 @@ grpc_cc_binary( ], external_deps = [ "absl/flags:flag", - "absl/log:log", ], deps = [ ":istio_echo_server_lib", @@ -462,7 +451,6 @@ grpc_cc_binary( external_deps = [ "absl/flags:flag", "absl/log:check", - "absl/log:log", ], language = "C++", deps = [ @@ -479,7 +467,6 @@ grpc_cc_binary( ], external_deps = [ "absl/flags:flag", - "absl/log:log", ], language = "C++", tags = ["nobuilder"], @@ -498,7 +485,6 @@ grpc_cc_library( ], external_deps = [ "absl/flags:flag", - "absl/log:log", "otel/exporters/prometheus:prometheus_exporter", "otel/sdk/src/metrics", ], @@ -556,7 +542,6 @@ grpc_cc_library( ], external_deps = [ "absl/log:check", - "absl/log:log", ], language = "C++", tags = ["nobuilder"], diff --git a/test/cpp/microbenchmarks/BUILD b/test/cpp/microbenchmarks/BUILD index f4592f3f8ff..16ed135e3a0 100644 --- a/test/cpp/microbenchmarks/BUILD +++ b/test/cpp/microbenchmarks/BUILD @@ -253,7 +253,6 @@ grpc_cc_test( args = grpc_benchmark_args(), external_deps = [ "absl/log:check", - "absl/log:log", ], tags = [ "no_mac", @@ -369,7 +368,6 @@ grpc_cc_test( args = grpc_benchmark_args(), external_deps = [ "absl/log:check", - "absl/log:log", ], tags = [ "no_mac", @@ -402,7 +400,6 @@ grpc_cc_library( hdrs = ["callback_test_service.h"], external_deps = [ "absl/log:check", - "absl/log:log", "benchmark", ], deps = [ @@ -451,7 +448,6 @@ grpc_cc_library( ], external_deps = [ "absl/log:check", - "absl/log:log", ], deps = [ ":bm_callback_test_service_impl", diff --git a/test/cpp/naming/generate_resolver_component_tests.bzl b/test/cpp/naming/generate_resolver_component_tests.bzl index bd029947fa3..83f11db1943 100755 --- a/test/cpp/naming/generate_resolver_component_tests.bzl +++ b/test/cpp/naming/generate_resolver_component_tests.bzl @@ -33,7 +33,6 @@ def generate_resolver_component_tests(): ], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], deps = [ @@ -56,7 +55,6 @@ def generate_resolver_component_tests(): ], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], deps = [ @@ -80,7 +78,6 @@ def generate_resolver_component_tests(): external_deps = [ "absl/flags:flag", "absl/log:check", - "absl/log:log", "absl/strings", ], deps = [ diff --git a/test/cpp/performance/BUILD b/test/cpp/performance/BUILD index 8b476e58ec5..06909a1585e 100644 --- a/test/cpp/performance/BUILD +++ b/test/cpp/performance/BUILD @@ -23,7 +23,6 @@ grpc_cc_test( srcs = ["writes_per_rpc_test.cc"], external_deps = [ "absl/log:check", - "absl/log:log", "gtest", ], tags = ["no_windows"], diff --git a/test/cpp/qps/BUILD b/test/cpp/qps/BUILD index 0a9e77c17d1..554f29fea62 100644 --- a/test/cpp/qps/BUILD +++ b/test/cpp/qps/BUILD @@ -26,7 +26,6 @@ grpc_cc_library( hdrs = ["parse_json.h"], external_deps = [ "absl/log:check", - "absl/log:log", "protobuf", ], deps = ["//:grpc++"], @@ -50,10 +49,7 @@ grpc_cc_library( "qps_worker.h", "server.h", ], - external_deps = [ - "absl/log:check", - "absl/log:log", - ], + external_deps = ["absl/log:check"], deps = [ ":histogram", ":interarrival", @@ -137,7 +133,6 @@ grpc_cc_binary( external_deps = [ "absl/flags:flag", "absl/log:check", - "absl/log:log", ], deps = [ ":benchmark_config", @@ -151,7 +146,6 @@ grpc_cc_binary( grpc_cc_test( name = "inproc_sync_unary_ping_pong_test", srcs = ["inproc_sync_unary_ping_pong_test.cc"], - external_deps = ["absl/log:log"], deps = [ ":benchmark_config", ":driver_impl", @@ -188,7 +182,6 @@ grpc_cc_test( name = "qps_openloop_test", srcs = ["qps_openloop_test.cc"], exec_properties = LARGE_MACHINE, - external_deps = ["absl/log:log"], tags = ["no_windows"], # LARGE_MACHINE is not configured for windows RBE deps = [ ":benchmark_config", @@ -202,7 +195,6 @@ grpc_cc_test( grpc_cc_test( name = "secure_sync_unary_ping_pong_test", srcs = ["secure_sync_unary_ping_pong_test.cc"], - external_deps = ["absl/log:log"], deps = [ ":benchmark_config", ":driver_impl", @@ -216,7 +208,6 @@ grpc_cc_library( name = "usage_timer", srcs = ["usage_timer.cc"], hdrs = ["usage_timer.h"], - external_deps = ["absl/log:log"], deps = ["//:gpr"], ) @@ -225,7 +216,6 @@ grpc_cc_binary( srcs = ["worker.cc"], external_deps = [ "absl/flags:flag", - "absl/log:log", ], deps = [ ":qps_worker_impl", @@ -241,7 +231,6 @@ grpc_py_binary( testonly = True, srcs = ["scenario_runner.py"], data = ["scenario_runner_cc"], - external_deps = ["absl/log:log"], python_version = "PY3", ) diff --git a/test/cpp/qps/qps_benchmark_script.bzl b/test/cpp/qps/qps_benchmark_script.bzl index e81ca8710e2..90d543ceebe 100644 --- a/test/cpp/qps/qps_benchmark_script.bzl +++ b/test/cpp/qps/qps_benchmark_script.bzl @@ -85,7 +85,6 @@ def json_run_localhost_batch(): ], external_deps = [ "absl/log:check", - "absl/log:log", ], deps = [ "//:gpr", diff --git a/test/cpp/server/BUILD b/test/cpp/server/BUILD index edd722347dd..b65ec5c9e86 100644 --- a/test/cpp/server/BUILD +++ b/test/cpp/server/BUILD @@ -53,7 +53,6 @@ grpc_cc_test( name = "server_request_call_test", srcs = ["server_request_call_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], tags = ["no_windows"], diff --git a/test/cpp/server/load_reporter/BUILD b/test/cpp/server/load_reporter/BUILD index 77ee0657c24..31bbfcc423e 100644 --- a/test/cpp/server/load_reporter/BUILD +++ b/test/cpp/server/load_reporter/BUILD @@ -36,7 +36,6 @@ grpc_cc_test( external_deps = [ "absl/flags:flag", "absl/log:check", - "absl/log:log", "gtest", "opencensus-stats-test", ], diff --git a/test/cpp/thread_manager/BUILD b/test/cpp/thread_manager/BUILD index 16e94da1e8e..b39e9cff5b5 100644 --- a/test/cpp/thread_manager/BUILD +++ b/test/cpp/thread_manager/BUILD @@ -25,7 +25,6 @@ grpc_cc_test( name = "thread_manager_test", srcs = ["thread_manager_test.cc"], external_deps = [ - "absl/log:log", "gtest", ], deps = [ From 05ae7fb926b8b0cc089e84e9f0748e9fb722546e Mon Sep 17 00:00:00 2001 From: Oskar Bunyan Date: Wed, 15 May 2024 12:15:28 -0700 Subject: [PATCH 4/9] Maintain a strong reference to rpc_tasks. Only a weakref is kept in the loop. See python docs on creating tasks. https://docs.python.org/3/library/asyncio-task.html#creating-tasks This fixes an issue with request hangs when tasks were being garbage collected. PiperOrigin-RevId: 634035959 --- .../grpc/_cython/_cygrpc/aio/server.pyx.pxi | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi index d663b1c676f..8332c5a0d5b 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi @@ -780,6 +780,16 @@ async def _schedule_rpc_coro(object rpc_coro, ), name="HandleExceptions[%s]" % _decode(rpc_state.method())) _add_callback_handler(rpc_task, rpc_state) await _handle_cancellation_from_core(rpc_task, rpc_state, loop) + try: + # Propagate any errors not handled by _handle_exceptions. If not awaited + # there will be logs of the form "Task exception was never retrieved". + # Catching it here we can provide traceback and debugging logs. + await rpc_task + except: + _LOGGER.exception('Exception not handled by _handle_exceptions in servicer method [%s]' % ( + _decode(rpc_state.method()), + )) + traceback.print_exc() async def _handle_rpc(list generic_handlers, tuple interceptors, @@ -954,6 +964,7 @@ cdef class AioServer: self._server.start(backup_queue=False) cdef RPCState rpc_state server_started.set_result(True) + rpc_tasks = set() while True: # When shutdown begins, no more new connections. @@ -985,9 +996,15 @@ cdef class AioServer: rpc_coro, rpc_state, self._loop - ) + ), + name="rpc_task", ) + # loop.create_task only holds a weakref to the task. + # Maintain reference to tasks to avoid garbage collection. + rpc_tasks.add(rpc_task) + rpc_task.add_done_callback(rpc_tasks.discard) + if self._limiter is not None: self._limiter.decrease_once_finished(rpc_task) From 545bd5171d045f4b22c09aa529998e7c70761154 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 15 May 2024 15:23:30 -0700 Subject: [PATCH 5/9] [call-v3] Add client half close event edge to filters (#36598) Closes #36598 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36598 from ctiller:transport-refs-4 c4835a8249e1463f3634e91fa4bb47b960241ef0 PiperOrigin-RevId: 634093923 --- BUILD | 1 + build_autogenerated.yaml | 2 + .../backend_metrics/backend_metric_filter.cc | 1 + .../backend_metrics/backend_metric_filter.h | 1 + .../fault_injection/fault_injection_filter.cc | 1 + .../fault_injection/fault_injection_filter.h | 1 + .../filters/http/client/http_client_filter.cc | 1 + .../filters/http/client/http_client_filter.h | 1 + .../filters/http/client_authority_filter.cc | 1 + .../filters/http/client_authority_filter.h | 1 + .../message_compress/compression_filter.cc | 2 + .../message_compress/compression_filter.h | 2 + .../filters/http/server/http_server_filter.cc | 1 + .../filters/http/server/http_server_filter.h | 1 + .../server_load_reporting_filter.cc | 1 + .../server_load_reporting_filter.h | 1 + .../ext/filters/logging/logging_filter.cc | 491 ++++++++---------- src/core/ext/filters/logging/logging_filter.h | 77 ++- src/core/ext/filters/logging/logging_sink.h | 45 ++ .../message_size/message_size_filter.cc | 2 + .../message_size/message_size_filter.h | 2 + src/core/ext/filters/rbac/rbac_filter.cc | 1 + src/core/ext/filters/rbac/rbac_filter.h | 1 + .../stateful_session_filter.cc | 1 + .../stateful_session_filter.h | 1 + src/core/lib/channel/context.h | 7 + src/core/lib/channel/promise_based_filter.h | 301 ++++++++--- .../authorization/grpc_server_authz_filter.cc | 1 + .../authorization/grpc_server_authz_filter.h | 1 + .../lib/security/transport/auth_filters.h | 1 + .../security/transport/server_auth_filter.cc | 1 + src/core/lib/transport/call_filters.cc | 6 + src/core/lib/transport/call_filters.h | 71 ++- .../grpclb/client_load_reporting_filter.cc | 1 + .../grpclb/client_load_reporting_filter.h | 1 + src/core/resolver/xds/xds_resolver.cc | 3 + src/core/server/server_call_tracer_filter.cc | 2 + .../server/server_config_selector_filter.cc | 2 + .../service_config_channel_arg_filter.cc | 3 + test/core/surface/channel_init_test.cc | 2 + test/core/transport/call_filters_test.cc | 5 + .../core/transport/interception_chain_test.cc | 7 + test/cpp/ext/filters/logging/BUILD | 1 + test/cpp/ext/filters/logging/logging_test.cc | 3 +- 44 files changed, 689 insertions(+), 370 deletions(-) diff --git a/BUILD b/BUILD index 0978d4ee70e..53c241c3520 100644 --- a/BUILD +++ b/BUILD @@ -2083,6 +2083,7 @@ grpc_cc_library( "//src/core:call_final_info", "//src/core:call_finalization", "//src/core:call_spine", + "//src/core:cancel_callback", "//src/core:channel_args", "//src/core:channel_args_preconditioning", "//src/core:channel_fwd", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index b60ae5b5e2a..6b0439d0fc9 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -4611,6 +4611,7 @@ libs: - src/core/lib/promise/activity.h - src/core/lib/promise/all_ok.h - src/core/lib/promise/arena_promise.h + - src/core/lib/promise/cancel_callback.h - src/core/lib/promise/context.h - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/join_state.h @@ -11767,6 +11768,7 @@ targets: - src/core/lib/promise/activity.h - src/core/lib/promise/all_ok.h - src/core/lib/promise/arena_promise.h + - src/core/lib/promise/cancel_callback.h - src/core/lib/promise/context.h - src/core/lib/promise/detail/basic_seq.h - src/core/lib/promise/detail/join_state.h 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 c3ce55921d8..d9f02b41bf7 100644 --- a/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +++ b/src/core/ext/filters/backend_metrics/backend_metric_filter.cc @@ -52,6 +52,7 @@ 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; +const NoInterceptor BackendMetricFilter::Call::OnClientToServerHalfClose; const NoInterceptor BackendMetricFilter::Call::OnServerToClientMessage; const NoInterceptor BackendMetricFilter::Call::OnFinalize; diff --git a/src/core/ext/filters/backend_metrics/backend_metric_filter.h b/src/core/ext/filters/backend_metrics/backend_metric_filter.h index d97b0c8cb65..114fc3cc7bc 100644 --- a/src/core/ext/filters/backend_metrics/backend_metric_filter.h +++ b/src/core/ext/filters/backend_metrics/backend_metric_filter.h @@ -44,6 +44,7 @@ class BackendMetricFilter : public ImplementChannelFilter { static const NoInterceptor OnServerInitialMetadata; void OnServerTrailingMetadata(ServerMetadata& md); static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; }; 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 87d5a4d2f1f..ae64f83ddc8 100644 --- a/src/core/ext/filters/fault_injection/fault_injection_filter.cc +++ b/src/core/ext/filters/fault_injection/fault_injection_filter.cc @@ -58,6 +58,7 @@ 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; +const NoInterceptor FaultInjectionFilter::Call::OnClientToServerHalfClose; const NoInterceptor FaultInjectionFilter::Call::OnServerToClientMessage; const NoInterceptor FaultInjectionFilter::Call::OnFinalize; diff --git a/src/core/ext/filters/fault_injection/fault_injection_filter.h b/src/core/ext/filters/fault_injection/fault_injection_filter.h index b6b1b811cde..515df16a853 100644 --- a/src/core/ext/filters/fault_injection/fault_injection_filter.h +++ b/src/core/ext/filters/fault_injection/fault_injection_filter.h @@ -58,6 +58,7 @@ class FaultInjectionFilter static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; }; diff --git a/src/core/ext/filters/http/client/http_client_filter.cc b/src/core/ext/filters/http/client/http_client_filter.cc index 390df545efe..6af2b959be3 100644 --- a/src/core/ext/filters/http/client/http_client_filter.cc +++ b/src/core/ext/filters/http/client/http_client_filter.cc @@ -54,6 +54,7 @@ namespace grpc_core { const NoInterceptor HttpClientFilter::Call::OnServerToClientMessage; const NoInterceptor HttpClientFilter::Call::OnClientToServerMessage; +const NoInterceptor HttpClientFilter::Call::OnClientToServerHalfClose; const NoInterceptor HttpClientFilter::Call::OnFinalize; const grpc_channel_filter HttpClientFilter::kFilter = diff --git a/src/core/ext/filters/http/client/http_client_filter.h b/src/core/ext/filters/http/client/http_client_filter.h index f5d7875da5e..f985337f2ca 100644 --- a/src/core/ext/filters/http/client/http_client_filter.h +++ b/src/core/ext/filters/http/client/http_client_filter.h @@ -47,6 +47,7 @@ class HttpClientFilter : public ImplementChannelFilter { absl::Status OnServerInitialMetadata(ServerMetadata& md); absl::Status OnServerTrailingMetadata(ServerMetadata& md); static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; }; diff --git a/src/core/ext/filters/http/client_authority_filter.cc b/src/core/ext/filters/http/client_authority_filter.cc index 1d5258493e4..b6970d9ecb5 100644 --- a/src/core/ext/filters/http/client_authority_filter.cc +++ b/src/core/ext/filters/http/client_authority_filter.cc @@ -40,6 +40,7 @@ namespace grpc_core { const NoInterceptor ClientAuthorityFilter::Call::OnServerInitialMetadata; const NoInterceptor ClientAuthorityFilter::Call::OnServerTrailingMetadata; const NoInterceptor ClientAuthorityFilter::Call::OnClientToServerMessage; +const NoInterceptor ClientAuthorityFilter::Call::OnClientToServerHalfClose; const NoInterceptor ClientAuthorityFilter::Call::OnServerToClientMessage; const NoInterceptor ClientAuthorityFilter::Call::OnFinalize; diff --git a/src/core/ext/filters/http/client_authority_filter.h b/src/core/ext/filters/http/client_authority_filter.h index 44229c6cdde..da154fbac5d 100644 --- a/src/core/ext/filters/http/client_authority_filter.h +++ b/src/core/ext/filters/http/client_authority_filter.h @@ -52,6 +52,7 @@ class ClientAuthorityFilter final static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; }; 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 b688b866cf9..ed077de6e70 100644 --- a/src/core/ext/filters/http/message_compress/compression_filter.cc +++ b/src/core/ext/filters/http/message_compress/compression_filter.cc @@ -57,8 +57,10 @@ namespace grpc_core { +const NoInterceptor ServerCompressionFilter::Call::OnClientToServerHalfClose; const NoInterceptor ServerCompressionFilter::Call::OnServerTrailingMetadata; const NoInterceptor ServerCompressionFilter::Call::OnFinalize; +const NoInterceptor ClientCompressionFilter::Call::OnClientToServerHalfClose; const NoInterceptor ClientCompressionFilter::Call::OnServerTrailingMetadata; const NoInterceptor ClientCompressionFilter::Call::OnFinalize; diff --git a/src/core/ext/filters/http/message_compress/compression_filter.h b/src/core/ext/filters/http/message_compress/compression_filter.h index 99e57a0ac1d..5d82846d01d 100644 --- a/src/core/ext/filters/http/message_compress/compression_filter.h +++ b/src/core/ext/filters/http/message_compress/compression_filter.h @@ -129,6 +129,7 @@ class ClientCompressionFilter final absl::StatusOr OnServerToClientMessage( MessageHandle message, ClientCompressionFilter* filter); + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnFinalize; @@ -165,6 +166,7 @@ class ServerCompressionFilter final MessageHandle OnServerToClientMessage(MessageHandle message, ServerCompressionFilter* filter); + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnFinalize; 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 925cc73c23e..4d92cef6eaa 100644 --- a/src/core/ext/filters/http/server/http_server_filter.cc +++ b/src/core/ext/filters/http/server/http_server_filter.cc @@ -50,6 +50,7 @@ namespace grpc_core { const NoInterceptor HttpServerFilter::Call::OnClientToServerMessage; +const NoInterceptor HttpServerFilter::Call::OnClientToServerHalfClose; const NoInterceptor HttpServerFilter::Call::OnServerToClientMessage; const NoInterceptor HttpServerFilter::Call::OnFinalize; diff --git a/src/core/ext/filters/http/server/http_server_filter.h b/src/core/ext/filters/http/server/http_server_filter.h index 282973ddecd..a1f330e58bb 100644 --- a/src/core/ext/filters/http/server/http_server_filter.h +++ b/src/core/ext/filters/http/server/http_server_filter.h @@ -50,6 +50,7 @@ class HttpServerFilter : public ImplementChannelFilter { void OnServerInitialMetadata(ServerMetadata& md); void OnServerTrailingMetadata(ServerMetadata& md); static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; }; diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc index 7937ab6fe74..100584f5ba1 100644 --- a/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc +++ b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc @@ -74,6 +74,7 @@ constexpr char kEmptyAddressLengthString[] = "00"; const NoInterceptor ServerLoadReportingFilter::Call::OnServerInitialMetadata; const NoInterceptor ServerLoadReportingFilter::Call::OnClientToServerMessage; +const NoInterceptor ServerLoadReportingFilter::Call::OnClientToServerHalfClose; const NoInterceptor ServerLoadReportingFilter::Call::OnServerToClientMessage; absl::StatusOr> diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_filter.h b/src/core/ext/filters/load_reporting/server_load_reporting_filter.h index f11c8c38bcf..76684093a0b 100644 --- a/src/core/ext/filters/load_reporting/server_load_reporting_filter.h +++ b/src/core/ext/filters/load_reporting/server_load_reporting_filter.h @@ -54,6 +54,7 @@ class ServerLoadReportingFilter void OnServerTrailingMetadata(ServerMetadata& md, ServerLoadReportingFilter* filter); static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; void OnFinalize(const grpc_call_final_info* final_info, ServerLoadReportingFilter* filter); diff --git a/src/core/ext/filters/logging/logging_filter.cc b/src/core/ext/filters/logging/logging_filter.cc index 587e87ff506..0aca4fe7568 100644 --- a/src/core/ext/filters/logging/logging_filter.cc +++ b/src/core/ext/filters/logging/logging_filter.cc @@ -73,6 +73,9 @@ namespace grpc_core { +const NoInterceptor ClientLoggingFilter::Call::OnFinalize; +const NoInterceptor ServerLoggingFilter::Call::OnFinalize; + namespace { LoggingSink* g_logging_sink = nullptr; @@ -195,152 +198,148 @@ void EncodeMessageToPayload(const SliceBuffer* message, uint32_t log_len, } } -class CallData { - public: - CallData(bool is_client, const CallArgs& call_args, - const std::string& authority) - : call_id_(GetCallId()) { - absl::string_view path; - if (auto* value = call_args.client_initial_metadata->get_pointer( - HttpPathMetadata())) { - path = value->as_string_view(); - } - std::vector parts = - absl::StrSplit(path, '/', absl::SkipEmpty()); - if (parts.size() == 2) { - service_name_ = std::move(parts[0]); - method_name_ = std::move(parts[1]); +} // namespace + +namespace logging_filter_detail { + +CallData::CallData(bool is_client, + const ClientMetadata& client_initial_metadata, + const std::string& authority) + : call_id_(GetCallId()) { + absl::string_view path; + if (auto* value = client_initial_metadata.get_pointer(HttpPathMetadata())) { + path = value->as_string_view(); + } + std::vector parts = absl::StrSplit(path, '/', absl::SkipEmpty()); + if (parts.size() == 2) { + service_name_ = std::move(parts[0]); + method_name_ = std::move(parts[1]); + } + config_ = g_logging_sink->FindMatch(is_client, service_name_, method_name_); + if (config_.ShouldLog()) { + if (auto* value = + client_initial_metadata.get_pointer(HttpAuthorityMetadata())) { + authority_ = std::string(value->as_string_view()); + } else { + authority_ = authority; } - config_ = g_logging_sink->FindMatch(is_client, service_name_, method_name_); - if (config_.ShouldLog()) { - if (auto* value = call_args.client_initial_metadata->get_pointer( - HttpAuthorityMetadata())) { - authority_ = std::string(value->as_string_view()); - } else { - authority_ = authority; - } + } +} + +void CallData::LogClientHeader(bool is_client, + CallTracerAnnotationInterface* tracer, + const ClientMetadata& metadata) { + LoggingSink::Entry entry; + if (!is_client) { + if (auto* value = metadata.get_pointer(PeerString())) { + peer_ = PeerStringToAddress(*value); } } + SetCommonEntryFields(&entry, is_client, tracer, + LoggingSink::Entry::EventType::kClientHeader); + MetadataEncoder encoder(&entry.payload, nullptr, + config_.max_metadata_bytes()); + metadata.Encode(&encoder); + entry.payload_truncated = encoder.truncated(); + g_logging_sink->LogEntry(std::move(entry)); +} - bool ShouldLog() { return config_.ShouldLog(); } +void CallData::LogClientHalfClose(bool is_client, + CallTracerAnnotationInterface* tracer) { + LoggingSink::Entry entry; + SetCommonEntryFields(&entry, is_client, tracer, + LoggingSink::Entry::EventType::kClientHalfClose); + g_logging_sink->LogEntry(std::move(entry)); +} - void LogClientHeader(bool is_client, CallTracerAnnotationInterface* tracer, - const ClientMetadataHandle& metadata) { - LoggingSink::Entry entry; - if (!is_client) { +void CallData::LogServerHeader(bool is_client, + CallTracerAnnotationInterface* tracer, + const ServerMetadata* metadata) { + LoggingSink::Entry entry; + if (metadata != nullptr) { + entry.is_trailer_only = metadata->get(GrpcTrailersOnly()).value_or(false); + if (is_client) { if (auto* value = metadata->get_pointer(PeerString())) { peer_ = PeerStringToAddress(*value); } } - SetCommonEntryFields(&entry, is_client, tracer, - LoggingSink::Entry::EventType::kClientHeader); + } + SetCommonEntryFields(&entry, is_client, tracer, + LoggingSink::Entry::EventType::kServerHeader); + if (metadata != nullptr) { MetadataEncoder encoder(&entry.payload, nullptr, config_.max_metadata_bytes()); metadata->Encode(&encoder); entry.payload_truncated = encoder.truncated(); - g_logging_sink->LogEntry(std::move(entry)); - } - - void LogClientHalfClose(bool is_client, - CallTracerAnnotationInterface* tracer) { - LoggingSink::Entry entry; - SetCommonEntryFields(&entry, is_client, tracer, - LoggingSink::Entry::EventType::kClientHalfClose); - g_logging_sink->LogEntry(std::move(entry)); - } - - void LogServerHeader(bool is_client, CallTracerAnnotationInterface* tracer, - const ServerMetadata* metadata) { - LoggingSink::Entry entry; - if (metadata != nullptr) { - entry.is_trailer_only = metadata->get(GrpcTrailersOnly()).value_or(false); - if (is_client) { - if (auto* value = metadata->get_pointer(PeerString())) { - peer_ = PeerStringToAddress(*value); - } - } - } - SetCommonEntryFields(&entry, is_client, tracer, - LoggingSink::Entry::EventType::kServerHeader); - if (metadata != nullptr) { - MetadataEncoder encoder(&entry.payload, nullptr, - config_.max_metadata_bytes()); - metadata->Encode(&encoder); - entry.payload_truncated = encoder.truncated(); - } - g_logging_sink->LogEntry(std::move(entry)); } + g_logging_sink->LogEntry(std::move(entry)); +} - void LogServerTrailer(bool is_client, CallTracerAnnotationInterface* tracer, - const ServerMetadata* metadata) { - LoggingSink::Entry entry; - SetCommonEntryFields(&entry, is_client, tracer, - LoggingSink::Entry::EventType::kServerTrailer); - if (metadata != nullptr) { - entry.is_trailer_only = metadata->get(GrpcTrailersOnly()).value_or(false); - MetadataEncoder encoder(&entry.payload, &entry.payload.status_details, - config_.max_metadata_bytes()); - metadata->Encode(&encoder); - entry.payload_truncated = encoder.truncated(); - } - g_logging_sink->LogEntry(std::move(entry)); +void CallData::LogServerTrailer(bool is_client, + CallTracerAnnotationInterface* tracer, + const ServerMetadata* metadata) { + LoggingSink::Entry entry; + SetCommonEntryFields(&entry, is_client, tracer, + LoggingSink::Entry::EventType::kServerTrailer); + if (metadata != nullptr) { + entry.is_trailer_only = metadata->get(GrpcTrailersOnly()).value_or(false); + MetadataEncoder encoder(&entry.payload, &entry.payload.status_details, + config_.max_metadata_bytes()); + metadata->Encode(&encoder); + entry.payload_truncated = encoder.truncated(); } + g_logging_sink->LogEntry(std::move(entry)); +} - void LogClientMessage(bool is_client, CallTracerAnnotationInterface* tracer, - const SliceBuffer* message) { - LoggingSink::Entry entry; - SetCommonEntryFields(&entry, is_client, tracer, - LoggingSink::Entry::EventType::kClientMessage); - EncodeMessageToPayload(message, config_.max_message_bytes(), &entry); - g_logging_sink->LogEntry(std::move(entry)); - } +void CallData::LogClientMessage(bool is_client, + CallTracerAnnotationInterface* tracer, + const SliceBuffer* message) { + LoggingSink::Entry entry; + SetCommonEntryFields(&entry, is_client, tracer, + LoggingSink::Entry::EventType::kClientMessage); + EncodeMessageToPayload(message, config_.max_message_bytes(), &entry); + g_logging_sink->LogEntry(std::move(entry)); +} - void LogServerMessage(bool is_client, CallTracerAnnotationInterface* tracer, - const SliceBuffer* message) { - LoggingSink::Entry entry; - SetCommonEntryFields(&entry, is_client, tracer, - LoggingSink::Entry::EventType::kServerMessage); - EncodeMessageToPayload(message, config_.max_message_bytes(), &entry); - g_logging_sink->LogEntry(std::move(entry)); - } +void CallData::LogServerMessage(bool is_client, + CallTracerAnnotationInterface* tracer, + const SliceBuffer* message) { + LoggingSink::Entry entry; + SetCommonEntryFields(&entry, is_client, tracer, + LoggingSink::Entry::EventType::kServerMessage); + EncodeMessageToPayload(message, config_.max_message_bytes(), &entry); + g_logging_sink->LogEntry(std::move(entry)); +} - void LogCancel(bool is_client, CallTracerAnnotationInterface* tracer) { - LoggingSink::Entry entry; - SetCommonEntryFields(&entry, is_client, tracer, - LoggingSink::Entry::EventType::kCancel); - g_logging_sink->LogEntry(std::move(entry)); - } +void CallData::LogCancel(bool is_client, + CallTracerAnnotationInterface* tracer) { + LoggingSink::Entry entry; + SetCommonEntryFields(&entry, is_client, tracer, + LoggingSink::Entry::EventType::kCancel); + g_logging_sink->LogEntry(std::move(entry)); +} - private: - void SetCommonEntryFields(LoggingSink::Entry* entry, bool is_client, - CallTracerAnnotationInterface* tracer, - LoggingSink::Entry::EventType event_type) { - entry->call_id = call_id_; - entry->sequence_id = sequence_id_++; - entry->type = event_type; - entry->logger = is_client ? LoggingSink::Entry::Logger::kClient - : LoggingSink::Entry::Logger::kServer; - entry->authority = authority_; - entry->peer = peer_; - entry->service_name = service_name_; - entry->method_name = method_name_; - entry->timestamp = Timestamp::Now(); - if (tracer != nullptr) { - entry->trace_id = tracer->TraceId(); - entry->span_id = tracer->SpanId(); - entry->is_sampled = tracer->IsSampled(); - } +void CallData::SetCommonEntryFields(LoggingSink::Entry* entry, bool is_client, + CallTracerAnnotationInterface* tracer, + LoggingSink::Entry::EventType event_type) { + entry->call_id = call_id_; + entry->sequence_id = sequence_id_++; + entry->type = event_type; + entry->logger = is_client ? LoggingSink::Entry::Logger::kClient + : LoggingSink::Entry::Logger::kServer; + entry->authority = authority_; + entry->peer = peer_; + entry->service_name = service_name_; + entry->method_name = method_name_; + entry->timestamp = Timestamp::Now(); + if (tracer != nullptr) { + entry->trace_id = tracer->TraceId(); + entry->span_id = tracer->SpanId(); + entry->is_sampled = tracer->IsSampled(); } - absl::uint128 call_id_; - uint32_t sequence_id_ = 0; - std::string service_name_; - std::string method_name_; - std::string authority_; - LoggingSink::Entry::Address peer_; - LoggingSink::Config config_; -}; +} -} // namespace +} // namespace logging_filter_detail absl::StatusOr> ClientLoggingFilter::Create(const ChannelArgs& args, @@ -361,84 +360,55 @@ ClientLoggingFilter::Create(const ChannelArgs& args, return std::make_unique(""); } -// Construct a promise for one call. -ArenaPromise ClientLoggingFilter::MakeCallPromise( - CallArgs call_args, NextPromiseFactory next_promise_factory) { - CallData* calld = GetContext()->ManagedNew( - true, call_args, default_authority_); - if (!calld->ShouldLog()) { - return next_promise_factory(std::move(call_args)); +void ClientLoggingFilter::Call::OnClientInitialMetadata( + ClientMetadata& md, ClientLoggingFilter* filter) { + call_data_.emplace(true, md, filter->default_authority_); + if (!call_data_->ShouldLog()) { + call_data_.reset(); + return; + } + call_data_->LogClientHeader( + /*is_client=*/true, GetContext(), md); +} + +void ClientLoggingFilter::Call::OnServerInitialMetadata(ServerMetadata& md) { + if (!call_data_.has_value()) return; + call_data_->LogServerHeader( + /*is_client=*/true, GetContext(), &md); +} + +void ClientLoggingFilter::Call::OnServerTrailingMetadata(ServerMetadata& md) { + if (!call_data_.has_value()) return; + if (md.get(GrpcCallWasCancelled()).value_or(false) && + md.get(GrpcStatusMetadata()) == GRPC_STATUS_CANCELLED) { + call_data_->LogCancel( + /*is_client=*/true, GetContext()); + return; } - calld->LogClientHeader( - /*is_client=*/true, - static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value), - call_args.client_initial_metadata); - call_args.server_initial_metadata->InterceptAndMap( - [calld](ServerMetadataHandle metadata) { - calld->LogServerHeader( - /*is_client=*/true, - static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value), - metadata.get()); - return metadata; - }); - call_args.client_to_server_messages->InterceptAndMapWithHalfClose( - [calld](MessageHandle message) { - calld->LogClientMessage( - /*is_client=*/true, - static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value), - message->payload()); - return message; - }, - [calld] { - calld->LogClientHalfClose( - /*is_client=*/true, - static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value)); - }); - call_args.server_to_client_messages->InterceptAndMap( - [calld](MessageHandle message) { - calld->LogServerMessage( - /*is_client=*/true, - static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value), - message->payload()); - return message; - }); - return OnCancel( - Map(next_promise_factory(std::move(call_args)), - [calld](ServerMetadataHandle md) { - calld->LogServerTrailer( - /*is_client=*/true, - static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value), - md.get()); - return md; - }), - // TODO(yashykt/ctiller): GetContext is not - // valid for the cancellation function requiring us to capture it here. - // This ought to be easy to fix once client side promises are completely - // rolled out. - [calld, ctx = GetContext()]() { - calld->LogCancel( - /*is_client=*/true, - static_cast( - ctx[GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE].value)); - }); + call_data_->LogServerTrailer( + /*is_client=*/true, GetContext(), &md); +} + +void ClientLoggingFilter::Call::OnClientToServerMessage( + const Message& message) { + if (!call_data_.has_value()) return; + call_data_->LogClientMessage( + /*is_client=*/true, GetContext(), + message.payload()); +} + +void ClientLoggingFilter::Call::OnClientToServerHalfClose() { + if (!call_data_.has_value()) return; + call_data_->LogClientHalfClose( + /*is_client=*/true, GetContext()); +} + +void ClientLoggingFilter::Call::OnServerToClientMessage( + const Message& message) { + if (!call_data_.has_value()) return; + call_data_->LogServerMessage( + /*is_client=*/true, GetContext(), + message.payload()); } const grpc_channel_filter ClientLoggingFilter::kFilter = @@ -454,79 +424,54 @@ ServerLoggingFilter::Create(const ChannelArgs& /*args*/, } // Construct a promise for one call. -ArenaPromise ServerLoggingFilter::MakeCallPromise( - CallArgs call_args, NextPromiseFactory next_promise_factory) { - CallData* calld = GetContext()->ManagedNew( - false, call_args, /*default_authority=*/""); - if (!calld->ShouldLog()) { - return next_promise_factory(std::move(call_args)); +void ServerLoggingFilter::Call::OnClientInitialMetadata(ClientMetadata& md) { + call_data_.emplace(false, md, ""); + if (!call_data_->ShouldLog()) { + call_data_.reset(); + return; } - auto* call_tracer = static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value); - calld->LogClientHeader( - /*is_client=*/false, call_tracer, call_args.client_initial_metadata); - call_args.server_initial_metadata->InterceptAndMap( - [calld](ServerMetadataHandle metadata) { - calld->LogServerHeader( - /*is_client=*/false, - static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value), - metadata.get()); - return metadata; - }); - call_args.client_to_server_messages->InterceptAndMapWithHalfClose( - [calld](MessageHandle message) { - calld->LogClientMessage( - /*is_client=*/false, - static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value), - message->payload()); - return message; - }, - [calld] { - calld->LogClientHalfClose( - /*is_client=*/false, - static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value)); - }); - call_args.server_to_client_messages->InterceptAndMap( - [calld](MessageHandle message) { - calld->LogServerMessage( - /*is_client=*/false, - static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value), - message->payload()); - return message; - }); - return OnCancel( - Map(next_promise_factory(std::move(call_args)), - [calld](ServerMetadataHandle md) { - calld->LogServerTrailer( - /*is_client=*/false, - static_cast( - GetContext() - [GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE] - .value), - md.get()); - return md; - }), - // TODO(yashykt/ctiller): GetContext is not - // valid for the cancellation function requiring us to capture - // call_tracer. - [calld, call_tracer]() { - calld->LogCancel( - /*is_client=*/false, call_tracer); - }); + call_data_->LogClientHeader( + /*is_client=*/false, GetContext(), md); +} + +void ServerLoggingFilter::Call::OnServerInitialMetadata(ServerMetadata& md) { + if (!call_data_.has_value()) return; + call_data_->LogServerHeader( + /*is_client=*/false, GetContext(), &md); +} + +void ServerLoggingFilter::Call::OnServerTrailingMetadata(ServerMetadata& md) { + if (!call_data_.has_value()) return; + if (md.get(GrpcCallWasCancelled()).value_or(false) && + md.get(GrpcStatusMetadata()) == GRPC_STATUS_CANCELLED) { + call_data_->LogCancel( + /*is_client=*/false, GetContext()); + return; + } + call_data_->LogServerTrailer( + /*is_client=*/false, GetContext(), &md); +} + +void ServerLoggingFilter::Call::OnClientToServerMessage( + const Message& message) { + if (!call_data_.has_value()) return; + call_data_->LogClientMessage( + /*is_client=*/false, GetContext(), + message.payload()); +} + +void ServerLoggingFilter::Call::OnClientToServerHalfClose() { + if (!call_data_.has_value()) return; + call_data_->LogClientHalfClose( + /*is_client=*/false, GetContext()); +} + +void ServerLoggingFilter::Call::OnServerToClientMessage( + const Message& message) { + if (!call_data_.has_value()) return; + call_data_->LogServerMessage( + /*is_client=*/false, GetContext(), + message.payload()); } const grpc_channel_filter ServerLoggingFilter::kFilter = diff --git a/src/core/ext/filters/logging/logging_filter.h b/src/core/ext/filters/logging/logging_filter.h index 7d42abbc337..30c28a5b57a 100644 --- a/src/core/ext/filters/logging/logging_filter.h +++ b/src/core/ext/filters/logging/logging_filter.h @@ -35,7 +35,46 @@ namespace grpc_core { -class ClientLoggingFilter final : public ChannelFilter { +namespace logging_filter_detail { + +class CallData { + public: + CallData(bool is_client, const ClientMetadata& client_initial_metadata, + const std::string& authority); + + bool ShouldLog() { return config_.ShouldLog(); } + + void LogClientHeader(bool is_client, CallTracerAnnotationInterface* tracer, + const ClientMetadata& metadata); + void LogClientHalfClose(bool is_client, + CallTracerAnnotationInterface* tracer); + void LogServerHeader(bool is_client, CallTracerAnnotationInterface* tracer, + const ServerMetadata* metadata); + void LogServerTrailer(bool is_client, CallTracerAnnotationInterface* tracer, + const ServerMetadata* metadata); + void LogClientMessage(bool is_client, CallTracerAnnotationInterface* tracer, + const SliceBuffer* message); + void LogServerMessage(bool is_client, CallTracerAnnotationInterface* tracer, + const SliceBuffer* message); + void LogCancel(bool is_client, CallTracerAnnotationInterface* tracer); + + private: + void SetCommonEntryFields(LoggingSink::Entry* entry, bool is_client, + CallTracerAnnotationInterface* tracer, + LoggingSink::Entry::EventType event_type); + absl::uint128 call_id_; + uint32_t sequence_id_ = 0; + std::string service_name_; + std::string method_name_; + std::string authority_; + LoggingSink::Entry::Address peer_; + LoggingSink::Config config_; +}; + +} // namespace logging_filter_detail + +class ClientLoggingFilter final + : public ImplementChannelFilter { public: static const grpc_channel_filter kFilter; @@ -45,24 +84,46 @@ class ClientLoggingFilter final : public ChannelFilter { explicit ClientLoggingFilter(std::string default_authority) : default_authority_(std::move(default_authority)) {} - // Construct a promise for one call. - ArenaPromise MakeCallPromise( - CallArgs call_args, NextPromiseFactory next_promise_factory) override; + class Call { + public: + void OnClientInitialMetadata(ClientMetadata& md, + ClientLoggingFilter* filter); + void OnServerInitialMetadata(ServerMetadata& md); + void OnServerTrailingMetadata(ServerMetadata& md); + void OnClientToServerMessage(const Message& message); + void OnClientToServerHalfClose(); + void OnServerToClientMessage(const Message& message); + static const NoInterceptor OnFinalize; + + private: + absl::optional call_data_; + }; private: const std::string default_authority_; }; -class ServerLoggingFilter final : public ChannelFilter { +class ServerLoggingFilter final + : public ImplementChannelFilter { public: static const grpc_channel_filter kFilter; static absl::StatusOr> Create( const ChannelArgs& args, ChannelFilter::Args /*filter_args*/); - // Construct a promise for one call. - ArenaPromise MakeCallPromise( - CallArgs call_args, NextPromiseFactory next_promise_factory) override; + class Call { + public: + void OnClientInitialMetadata(ClientMetadata& md); + void OnServerInitialMetadata(ServerMetadata& md); + void OnServerTrailingMetadata(ServerMetadata& md); + void OnClientToServerMessage(const Message& message); + void OnClientToServerHalfClose(); + void OnServerToClientMessage(const Message& message); + static const NoInterceptor OnFinalize; + + private: + absl::optional call_data_; + }; }; void RegisterLoggingFilter(LoggingSink* sink); diff --git a/src/core/ext/filters/logging/logging_sink.h b/src/core/ext/filters/logging/logging_sink.h index b4bf47b3c8c..b013cd9072e 100644 --- a/src/core/ext/filters/logging/logging_sink.h +++ b/src/core/ext/filters/logging/logging_sink.h @@ -27,6 +27,7 @@ #include #include "absl/numeric/int128.h" +#include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "src/core/lib/gprpp/time.h" @@ -73,8 +74,42 @@ class LoggingSink { kCancel }; + static std::string EventTypeString(EventType type) { + switch (type) { + case EventType::kUnknown: + return "UNKNOWN"; + case EventType::kClientHeader: + return "CLIENT_HEADER"; + case EventType::kServerHeader: + return "SERVER_HEADER"; + case EventType::kClientMessage: + return "CLIENT_MESSAGE"; + case EventType::kServerMessage: + return "SERVER_MESSAGE"; + case EventType::kClientHalfClose: + return "CLIENT_HALF_CLOSE"; + case EventType::kServerTrailer: + return "SERVER_TRAILER"; + case EventType::kCancel: + return "CANCEL"; + } + return absl::StrCat("INVALID(", static_cast(type), ")"); + } + enum class Logger { kUnknown = 0, kClient, kServer }; + static std::string LoggerString(Logger logger) { + switch (logger) { + case Logger::kUnknown: + return "UNKNOWN"; + case Logger::kClient: + return "CLIENT"; + case Logger::kServer: + return "SERVER"; + } + return absl::StrCat("INVALID(", static_cast(logger), ")"); + } + struct Payload { std::map metadata; Duration timeout; @@ -118,6 +153,16 @@ class LoggingSink { virtual void LogEntry(Entry entry) = 0; }; +inline std::ostream& operator<<(std::ostream& out, + const LoggingSink::Entry::EventType& type) { + return out << LoggingSink::Entry::EventTypeString(type); +} + +inline std::ostream& operator<<(std::ostream& out, + const LoggingSink::Entry::Logger& logger) { + return out << LoggingSink::Entry::LoggerString(logger); +} + } // namespace grpc_core #endif // GRPC_SRC_CORE_EXT_FILTERS_LOGGING_LOGGING_SINK_H 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 0933d633272..2c73c63a370 100644 --- a/src/core/ext/filters/message_size/message_size_filter.cc +++ b/src/core/ext/filters/message_size/message_size_filter.cc @@ -51,10 +51,12 @@ namespace grpc_core { const NoInterceptor ClientMessageSizeFilter::Call::OnClientInitialMetadata; const NoInterceptor ClientMessageSizeFilter::Call::OnServerInitialMetadata; const NoInterceptor ClientMessageSizeFilter::Call::OnServerTrailingMetadata; +const NoInterceptor ClientMessageSizeFilter::Call::OnClientToServerHalfClose; const NoInterceptor ClientMessageSizeFilter::Call::OnFinalize; const NoInterceptor ServerMessageSizeFilter::Call::OnClientInitialMetadata; const NoInterceptor ServerMessageSizeFilter::Call::OnServerInitialMetadata; const NoInterceptor ServerMessageSizeFilter::Call::OnServerTrailingMetadata; +const NoInterceptor ServerMessageSizeFilter::Call::OnClientToServerHalfClose; const NoInterceptor ServerMessageSizeFilter::Call::OnFinalize; // diff --git a/src/core/ext/filters/message_size/message_size_filter.h b/src/core/ext/filters/message_size/message_size_filter.h index 89d21201a5c..1637bfe3561 100644 --- a/src/core/ext/filters/message_size/message_size_filter.h +++ b/src/core/ext/filters/message_size/message_size_filter.h @@ -105,6 +105,7 @@ class ServerMessageSizeFilter final static const NoInterceptor OnFinalize; ServerMetadataHandle OnClientToServerMessage( const Message& message, ServerMessageSizeFilter* filter); + static const NoInterceptor OnClientToServerHalfClose; ServerMetadataHandle OnServerToClientMessage( const Message& message, ServerMessageSizeFilter* filter); }; @@ -133,6 +134,7 @@ class ClientMessageSizeFilter final static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnFinalize; ServerMetadataHandle OnClientToServerMessage(const Message& message); + static const NoInterceptor OnClientToServerHalfClose; ServerMetadataHandle OnServerToClientMessage(const Message& message); private: diff --git a/src/core/ext/filters/rbac/rbac_filter.cc b/src/core/ext/filters/rbac/rbac_filter.cc index 7c75f46ae7d..c89c6962e19 100644 --- a/src/core/ext/filters/rbac/rbac_filter.cc +++ b/src/core/ext/filters/rbac/rbac_filter.cc @@ -46,6 +46,7 @@ namespace grpc_core { const NoInterceptor RbacFilter::Call::OnServerInitialMetadata; const NoInterceptor RbacFilter::Call::OnServerTrailingMetadata; const NoInterceptor RbacFilter::Call::OnClientToServerMessage; +const NoInterceptor RbacFilter::Call::OnClientToServerHalfClose; const NoInterceptor RbacFilter::Call::OnServerToClientMessage; const NoInterceptor RbacFilter::Call::OnFinalize; diff --git a/src/core/ext/filters/rbac/rbac_filter.h b/src/core/ext/filters/rbac/rbac_filter.h index a4c41cbdd0b..d033b799d5f 100644 --- a/src/core/ext/filters/rbac/rbac_filter.h +++ b/src/core/ext/filters/rbac/rbac_filter.h @@ -55,6 +55,7 @@ class RbacFilter : public ImplementChannelFilter { static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; }; 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 5ae22cd864d..f383f3fb9ed 100644 --- a/src/core/ext/filters/stateful_session/stateful_session_filter.cc +++ b/src/core/ext/filters/stateful_session/stateful_session_filter.cc @@ -60,6 +60,7 @@ 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; const NoInterceptor StatefulSessionFilter::Call::OnFinalize; diff --git a/src/core/ext/filters/stateful_session/stateful_session_filter.h b/src/core/ext/filters/stateful_session/stateful_session_filter.h index 5cd534843aa..64c488bce33 100644 --- a/src/core/ext/filters/stateful_session/stateful_session_filter.h +++ b/src/core/ext/filters/stateful_session/stateful_session_filter.h @@ -86,6 +86,7 @@ class StatefulSessionFilter void OnServerInitialMetadata(ServerMetadata& md); void OnServerTrailingMetadata(ServerMetadata& md); static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; diff --git a/src/core/lib/channel/context.h b/src/core/lib/channel/context.h index ddcd01395a9..95ce62240bf 100644 --- a/src/core/lib/channel/context.h +++ b/src/core/lib/channel/context.h @@ -72,6 +72,7 @@ struct grpc_call_context_element { namespace grpc_core { class Call; +class CallTracerAnnotationInterface; // Bind the legacy context array into the new style structure // TODO(ctiller): remove as we migrate these contexts to the new system. @@ -89,6 +90,12 @@ struct OldStyleContext { static constexpr grpc_context_index kIndex = GRPC_CONTEXT_CALL; }; +template <> +struct OldStyleContext { + static constexpr grpc_context_index kIndex = + GRPC_CONTEXT_CALL_TRACER_ANNOTATION_INTERFACE; +}; + template class Context::kIndex)>> { public: diff --git a/src/core/lib/channel/promise_based_filter.h b/src/core/lib/channel/promise_based_filter.h index c0735c45e61..5379bb6f66a 100644 --- a/src/core/lib/channel/promise_based_filter.h +++ b/src/core/lib/channel/promise_based_filter.h @@ -59,6 +59,7 @@ #include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/promise/activity.h" #include "src/core/lib/promise/arena_promise.h" +#include "src/core/lib/promise/cancel_callback.h" #include "src/core/lib/promise/context.h" #include "src/core/lib/promise/pipe.h" #include "src/core/lib/promise/poll.h" @@ -354,31 +355,72 @@ template auto MapResult(absl::Status (Derived::Call::*fn)(ServerMetadata&), Promise x, FilterCallData* call_data) { DCHECK(fn == &Derived::Call::OnServerTrailingMetadata); - return Map(std::move(x), [call_data](ServerMetadataHandle md) { - auto status = call_data->call.OnServerTrailingMetadata(*md); - if (!status.ok()) return ServerMetadataFromStatus(status); - return md; - }); + return OnCancel( + Map(std::move(x), + [call_data](ServerMetadataHandle md) { + auto status = call_data->call.OnServerTrailingMetadata(*md); + if (!status.ok()) { + return ServerMetadataFromStatus(status); + } + return md; + }), + // TODO(yashykt/ctiller): GetContext is not + // valid for the cancellation function requiring us to capture it here. + // This ought to be easy to fix once client side promises are completely + // rolled out. + [call_data, ctx = GetContext()]() { + grpc_metadata_batch b; + b.Set(GrpcStatusMetadata(), GRPC_STATUS_CANCELLED); + b.Set(GrpcCallWasCancelled(), true); + promise_detail::Context context(ctx); + call_data->call.OnServerTrailingMetadata(b).IgnoreError(); + }); } template auto MapResult(void (Derived::Call::*fn)(ServerMetadata&), Promise x, FilterCallData* call_data) { DCHECK(fn == &Derived::Call::OnServerTrailingMetadata); - return Map(std::move(x), [call_data](ServerMetadataHandle md) { - call_data->call.OnServerTrailingMetadata(*md); - return md; - }); + return OnCancel( + Map(std::move(x), + [call_data](ServerMetadataHandle md) { + call_data->call.OnServerTrailingMetadata(*md); + return md; + }), + // TODO(yashykt/ctiller): GetContext is not + // valid for the cancellation function requiring us to capture it here. + // This ought to be easy to fix once client side promises are completely + // rolled out. + [call_data, ctx = GetContext()]() { + grpc_metadata_batch b; + b.Set(GrpcStatusMetadata(), GRPC_STATUS_CANCELLED); + b.Set(GrpcCallWasCancelled(), true); + promise_detail::Context context(ctx); + call_data->call.OnServerTrailingMetadata(b); + }); } template auto MapResult(void (Derived::Call::*fn)(ServerMetadata&, Derived*), Promise x, FilterCallData* call_data) { DCHECK(fn == &Derived::Call::OnServerTrailingMetadata); - return Map(std::move(x), [call_data](ServerMetadataHandle md) { - call_data->call.OnServerTrailingMetadata(*md, call_data->channel); - return md; - }); + return OnCancel( + Map(std::move(x), + [call_data](ServerMetadataHandle md) { + call_data->call.OnServerTrailingMetadata(*md, call_data->channel); + return md; + }), + // TODO(yashykt/ctiller): GetContext is not + // valid for the cancellation function requiring us to capture it here. + // This ought to be easy to fix once client side promises are completely + // rolled out. + [call_data, ctx = GetContext()]() { + grpc_metadata_batch b; + b.Set(GrpcStatusMetadata(), GRPC_STATUS_CANCELLED); + b.Set(GrpcCallWasCancelled(), true); + promise_detail::Context context(ctx); + call_data->call.OnServerTrailingMetadata(b, call_data->channel); + }); } template @@ -492,130 +534,193 @@ auto RunCall(Interceptor interceptor, CallArgs call_args, std::move(call_args), std::move(next_promise_factory), call_data); } -inline void InterceptClientToServerMessage(const NoInterceptor*, void*, - const CallArgs&) {} +template +inline auto InterceptClientToServerMessageHandler( + void (Derived::Call::*fn)(const Message&), + FilterCallData* call_data, const CallArgs&) { + DCHECK(fn == &Derived::Call::OnClientToServerMessage); + return [call_data](MessageHandle msg) -> absl::optional { + call_data->call.OnClientToServerMessage(*msg); + return std::move(msg); + }; +} template -inline void InterceptClientToServerMessage( +inline auto InterceptClientToServerMessageHandler( ServerMetadataHandle (Derived::Call::*fn)(const Message&), - FilterCallData* call_data, const CallArgs& call_args) { + FilterCallData* call_data, const CallArgs&) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); - call_args.client_to_server_messages->InterceptAndMap( - [call_data](MessageHandle msg) -> absl::optional { - auto return_md = call_data->call.OnClientToServerMessage(*msg); - if (return_md == nullptr) return std::move(msg); - if (call_data->error_latch.is_set()) return absl::nullopt; - call_data->error_latch.Set(std::move(return_md)); - return absl::nullopt; - }); + return [call_data](MessageHandle msg) -> absl::optional { + auto return_md = call_data->call.OnClientToServerMessage(*msg); + if (return_md == nullptr) return std::move(msg); + if (call_data->error_latch.is_set()) return absl::nullopt; + call_data->error_latch.Set(std::move(return_md)); + return absl::nullopt; + }; } template -inline void InterceptClientToServerMessage( +inline auto InterceptClientToServerMessageHandler( ServerMetadataHandle (Derived::Call::*fn)(const Message&, Derived*), - FilterCallData* call_data, const CallArgs& call_args) { + FilterCallData* call_data, const CallArgs&) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); - call_args.client_to_server_messages->InterceptAndMap( - [call_data](MessageHandle msg) -> absl::optional { - auto return_md = - call_data->call.OnClientToServerMessage(*msg, call_data->channel); - if (return_md == nullptr) return std::move(msg); - if (call_data->error_latch.is_set()) return absl::nullopt; - call_data->error_latch.Set(std::move(return_md)); - return absl::nullopt; - }); + return [call_data](MessageHandle msg) -> absl::optional { + auto return_md = + call_data->call.OnClientToServerMessage(*msg, call_data->channel); + if (return_md == nullptr) return std::move(msg); + if (call_data->error_latch.is_set()) return absl::nullopt; + call_data->error_latch.Set(std::move(return_md)); + return absl::nullopt; + }; } template -inline void InterceptClientToServerMessage( +inline auto InterceptClientToServerMessageHandler( MessageHandle (Derived::Call::*fn)(MessageHandle, Derived*), - FilterCallData* call_data, const CallArgs& call_args) { + FilterCallData* call_data, const CallArgs&) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); - call_args.client_to_server_messages->InterceptAndMap( - [call_data](MessageHandle msg) -> absl::optional { - return call_data->call.OnClientToServerMessage(std::move(msg), - call_data->channel); - }); + return [call_data](MessageHandle msg) -> absl::optional { + return call_data->call.OnClientToServerMessage(std::move(msg), + call_data->channel); + }; } template -inline void InterceptClientToServerMessage( +inline auto InterceptClientToServerMessageHandler( absl::StatusOr (Derived::Call::*fn)(MessageHandle, Derived*), - FilterCallData* call_data, const CallArgs& call_args) { + FilterCallData* call_data, const CallArgs&) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); + return [call_data](MessageHandle msg) -> absl::optional { + auto r = call_data->call.OnClientToServerMessage(std::move(msg), + call_data->channel); + if (r.ok()) return std::move(*r); + if (call_data->error_latch.is_set()) return absl::nullopt; + call_data->error_latch.Set(ServerMetadataFromStatus(r.status())); + return absl::nullopt; + }; +} + +template +inline void InterceptClientToServerMessage(HookFunction hook, + const NoInterceptor*, + FilterCallData* call_data, + const CallArgs& call_args) { call_args.client_to_server_messages->InterceptAndMap( - [call_data](MessageHandle msg) -> absl::optional { - auto r = call_data->call.OnClientToServerMessage(std::move(msg), - call_data->channel); - if (r.ok()) return std::move(*r); - if (call_data->error_latch.is_set()) return absl::nullopt; - call_data->error_latch.Set(ServerMetadataFromStatus(r.status())); - return absl::nullopt; - }); + InterceptClientToServerMessageHandler(hook, call_data, call_args)); } -inline void InterceptClientToServerMessage(const NoInterceptor*, void*, void*, - CallSpineInterface*) {} +template +inline void InterceptClientToServerMessage(HookFunction hook, + void (Derived::Call::*)(), + FilterCallData* call_data, + const CallArgs& call_args) { + call_args.client_to_server_messages->InterceptAndMapWithHalfClose( + InterceptClientToServerMessageHandler(hook, call_data, call_args), + [call_data]() { call_data->call.OnClientToServerHalfClose(); }); +} template -inline void InterceptClientToServerMessage( +inline void InterceptClientToServerMessage(const NoInterceptor*, + const NoInterceptor*, + FilterCallData*, + const CallArgs&) {} + +template +inline auto InterceptClientToServerMessageHandler( ServerMetadataHandle (Derived::Call::*fn)(const Message&), typename Derived::Call* call, Derived*, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); - call_spine->client_to_server_messages().receiver.InterceptAndMap( + return [call, call_spine](MessageHandle msg) -> absl::optional { auto return_md = call->OnClientToServerMessage(*msg); if (return_md == nullptr) return std::move(msg); call_spine->PushServerTrailingMetadata(std::move(return_md)); return absl::nullopt; - }); + }; } template -inline void InterceptClientToServerMessage( +inline auto InterceptClientToServerMessageHandler( + void (Derived::Call::*fn)(const Message&), typename Derived::Call* call, + Derived*, PipeBasedCallSpine*) { + DCHECK(fn == &Derived::Call::OnClientToServerMessage); + return [call](MessageHandle msg) -> absl::optional { + call->OnClientToServerMessage(*msg); + return std::move(msg); + }; +} + +template +inline auto InterceptClientToServerMessageHandler( ServerMetadataHandle (Derived::Call::*fn)(const Message&, Derived*), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); - call_spine->client_to_server_messages().receiver.InterceptAndMap( - [call, call_spine, - channel](MessageHandle msg) -> absl::optional { - auto return_md = call->OnClientToServerMessage(*msg, channel); - if (return_md == nullptr) return std::move(msg); - call_spine->PushServerTrailingMetadata(std::move(return_md)); - return absl::nullopt; - }); + return [call, call_spine, + channel](MessageHandle msg) -> absl::optional { + auto return_md = call->OnClientToServerMessage(*msg, channel); + if (return_md == nullptr) return std::move(msg); + call_spine->PushServerTrailingMetadata(std::move(return_md)); + return absl::nullopt; + }; } template -inline void InterceptClientToServerMessage( +inline auto InterceptClientToServerMessageHandler( MessageHandle (Derived::Call::*fn)(MessageHandle, Derived*), - typename Derived::Call* call, Derived* channel, - PipeBasedCallSpine* call_spine) { + typename Derived::Call* call, Derived* channel, PipeBasedCallSpine*) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); - call_spine->client_to_server_messages().receiver.InterceptAndMap( - [call, channel](MessageHandle msg) { - return call->OnClientToServerMessage(std::move(msg), channel); - }); + return [call, channel](MessageHandle msg) { + return call->OnClientToServerMessage(std::move(msg), channel); + }; } template -inline void InterceptClientToServerMessage( +inline auto InterceptClientToServerMessageHandler( absl::StatusOr (Derived::Call::*fn)(MessageHandle, Derived*), typename Derived::Call* call, Derived* channel, PipeBasedCallSpine* call_spine) { DCHECK(fn == &Derived::Call::OnClientToServerMessage); + return [call, call_spine, + channel](MessageHandle msg) -> absl::optional { + auto r = call->OnClientToServerMessage(std::move(msg), channel); + if (r.ok()) return std::move(*r); + call_spine->PushServerTrailingMetadata( + ServerMetadataFromStatus(r.status())); + return absl::nullopt; + }; +} + +template +inline void InterceptClientToServerMessage(HookFunction fn, + const NoInterceptor*, + typename Derived::Call* call, + Derived* channel, + PipeBasedCallSpine* call_spine) { + DCHECK(fn == &Derived::Call::OnClientToServerMessage); call_spine->client_to_server_messages().receiver.InterceptAndMap( - [call, call_spine, - channel](MessageHandle msg) -> absl::optional { - auto r = call->OnClientToServerMessage(std::move(msg), channel); - if (r.ok()) return std::move(*r); - call_spine->PushServerTrailingMetadata( - ServerMetadataFromStatus(r.status())); - return absl::nullopt; - }); + InterceptClientToServerMessageHandler(fn, call, channel, call_spine)); } +template +inline void InterceptClientToServerMessage(HookFunction fn, + void (Derived::Call::*half_close)(), + typename Derived::Call* call, + Derived* channel, + PipeBasedCallSpine* call_spine) { + DCHECK(fn == &Derived::Call::OnClientToServerMessage); + DCHECK(half_close == &Derived::Call::OnClientToServerHalfClose); + call_spine->client_to_server_messages().receiver.InterceptAndMapWithHalfClose( + InterceptClientToServerMessageHandler(fn, call, channel, call_spine), + [call]() { call->OnClientToServerHalfClose(); }); +} + +template +inline void InterceptClientToServerMessage(const NoInterceptor*, + const NoInterceptor*, + typename Derived::Call*, Derived*, + PipeBasedCallSpine*) {} + inline void InterceptClientInitialMetadata(const NoInterceptor*, void*, void*, PipeBasedCallSpine*) {} @@ -861,6 +966,18 @@ inline void InterceptServerInitialMetadata( inline void InterceptServerToClientMessage(const NoInterceptor*, void*, const CallArgs&) {} +template +inline void InterceptServerToClientMessage( + void (Derived::Call::*fn)(const Message&), + FilterCallData* call_data, const CallArgs& call_args) { + DCHECK(fn == &Derived::Call::OnServerToClientMessage); + call_args.server_to_client_messages->InterceptAndMap( + [call_data](MessageHandle msg) -> absl::optional { + call_data->call.OnServerToClientMessage(*msg); + return std::move(msg); + }); +} + template inline void InterceptServerToClientMessage( ServerMetadataHandle (Derived::Call::*fn)(const Message&), @@ -923,6 +1040,18 @@ inline void InterceptServerToClientMessage( inline void InterceptServerToClientMessage(const NoInterceptor*, void*, void*, CallSpineInterface*) {} +template +inline void InterceptServerToClientMessage( + void (Derived::Call::*fn)(const Message&), typename Derived::Call* call, + Derived*, PipeBasedCallSpine* call_spine) { + DCHECK(fn == &Derived::Call::OnServerToClientMessage); + call_spine->server_to_client_messages().sender.InterceptAndMap( + [call](MessageHandle msg) -> absl::optional { + call->OnServerToClientMessage(*msg); + return std::move(msg); + }); +} + template inline void InterceptServerToClientMessage( ServerMetadataHandle (Derived::Call::*fn)(const Message&), @@ -1120,7 +1249,8 @@ class ImplementChannelFilter : public ChannelFilter, promise_filter_detail::InterceptClientInitialMetadata( &Derived::Call::OnClientInitialMetadata, call, d, c); promise_filter_detail::InterceptClientToServerMessage( - &Derived::Call::OnClientToServerMessage, call, d, c); + &Derived::Call::OnClientToServerMessage, + &Derived::Call::OnClientToServerHalfClose, call, d, c); promise_filter_detail::InterceptServerInitialMetadata( &Derived::Call::OnServerInitialMetadata, call, d, c); promise_filter_detail::InterceptServerToClientMessage( @@ -1139,7 +1269,8 @@ class ImplementChannelFilter : public ChannelFilter, auto* call = promise_filter_detail::MakeFilterCall( static_cast(this)); promise_filter_detail::InterceptClientToServerMessage( - &Derived::Call::OnClientToServerMessage, call, call_args); + &Derived::Call::OnClientToServerMessage, + &Derived::Call::OnClientToServerHalfClose, call, call_args); promise_filter_detail::InterceptServerInitialMetadata( &Derived::Call::OnServerInitialMetadata, call, call_args); promise_filter_detail::InterceptServerToClientMessage( 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 5474847701a..7207b3897fa 100644 --- a/src/core/lib/security/authorization/grpc_server_authz_filter.cc +++ b/src/core/lib/security/authorization/grpc_server_authz_filter.cc @@ -41,6 +41,7 @@ TraceFlag grpc_authz_trace(false, "grpc_authz_api"); const NoInterceptor GrpcServerAuthzFilter::Call::OnServerInitialMetadata; const NoInterceptor GrpcServerAuthzFilter::Call::OnServerTrailingMetadata; const NoInterceptor GrpcServerAuthzFilter::Call::OnClientToServerMessage; +const NoInterceptor GrpcServerAuthzFilter::Call::OnClientToServerHalfClose; const NoInterceptor GrpcServerAuthzFilter::Call::OnServerToClientMessage; const NoInterceptor GrpcServerAuthzFilter::Call::OnFinalize; diff --git a/src/core/lib/security/authorization/grpc_server_authz_filter.h b/src/core/lib/security/authorization/grpc_server_authz_filter.h index b4b0a7463cd..742b3979d88 100644 --- a/src/core/lib/security/authorization/grpc_server_authz_filter.h +++ b/src/core/lib/security/authorization/grpc_server_authz_filter.h @@ -51,6 +51,7 @@ class GrpcServerAuthzFilter final static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; }; diff --git a/src/core/lib/security/transport/auth_filters.h b/src/core/lib/security/transport/auth_filters.h index 06b8b6e6fae..3970ae1e4f3 100644 --- a/src/core/lib/security/transport/auth_filters.h +++ b/src/core/lib/security/transport/auth_filters.h @@ -115,6 +115,7 @@ class ServerAuthFilter final : public ImplementChannelFilter { } static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnFinalize; diff --git a/src/core/lib/security/transport/server_auth_filter.cc b/src/core/lib/security/transport/server_auth_filter.cc index 4b6ef0a1f10..bfbfeb2d8ae 100644 --- a/src/core/lib/security/transport/server_auth_filter.cc +++ b/src/core/lib/security/transport/server_auth_filter.cc @@ -68,6 +68,7 @@ const grpc_channel_filter ServerAuthFilter::kFilter = "server-auth"); const NoInterceptor ServerAuthFilter::Call::OnClientToServerMessage; +const NoInterceptor ServerAuthFilter::Call::OnClientToServerHalfClose; const NoInterceptor ServerAuthFilter::Call::OnServerToClientMessage; const NoInterceptor ServerAuthFilter::Call::OnServerInitialMetadata; const NoInterceptor ServerAuthFilter::Call::OnServerTrailingMetadata; diff --git a/src/core/lib/transport/call_filters.cc b/src/core/lib/transport/call_filters.cc index d4792c02bfe..2b89babdde4 100644 --- a/src/core/lib/transport/call_filters.cc +++ b/src/core/lib/transport/call_filters.cc @@ -29,6 +29,12 @@ void* Offset(void* base, size_t amt) { return static_cast(base) + amt; } namespace filters_detail { +void RunHalfClose(absl::Span ops, void* call_data) { + for (const auto& op : ops) { + op.half_close(Offset(call_data, op.call_offset), op.channel_data); + } +} + template OperationExecutor::~OperationExecutor() { if (promise_data_ != nullptr) { diff --git a/src/core/lib/transport/call_filters.h b/src/core/lib/transport/call_filters.h index d637b6fb0de..fd267fd1685 100644 --- a/src/core/lib/transport/call_filters.h +++ b/src/core/lib/transport/call_filters.h @@ -43,6 +43,7 @@ // - OnServerInitialMetadata - $VALUE_TYPE = ServerMetadata // - OnServerToClientMessage - $VALUE_TYPE = Message // - OnClientToServerMessage - $VALUE_TYPE = Message +// - OnClientToServerHalfClose - no value // - OnServerTrailingMetadata - $VALUE_TYPE = ServerMetadata // - OnFinalize - special, see below // These members define an interception point for a particular event in @@ -192,6 +193,16 @@ struct Operator { void (*early_destroy)(void* promise_data); }; +struct HalfCloseOperator { + // Pointer to corresponding channel data for this filter + void* channel_data; + // Offset of the call data for this filter within the call data memory + size_t call_offset; + void (*half_close)(void* call_data, void* channel_data); +}; + +void RunHalfClose(absl::Span ops, void* call_data); + // We divide operations into fallible and infallible. // Fallible operations can fail, and that failure terminates the call. // Infallible operations cannot fail. @@ -265,6 +276,32 @@ void AddOp(FilterType* channel_data, size_t call_offset, to); } +template +void AddHalfClose(FilterType* channel_data, size_t call_offset, + void (FilterType::Call::*)(), + std::vector& to) { + to.push_back( + HalfCloseOperator{channel_data, call_offset, [](void* call_data, void*) { + static_cast(call_data) + ->OnClientToServerHalfClose(); + }}); +} + +template +void AddHalfClose(FilterType* channel_data, size_t call_offset, + void (FilterType::Call::*)(FilterType*), + std::vector& to) { + to.push_back(HalfCloseOperator{ + channel_data, call_offset, [](void* call_data, void* channel_data) { + static_cast(call_data) + ->OnClientToServerHalfClose(static_cast(channel_data)); + }}); +} + +template +void AddHalfClose(FilterType*, size_t, const NoInterceptor*, + std::vector&) {} + // const NoInterceptor $EVENT // These do nothing, and specifically DO NOT add an operation to the layout. // Supported for fallible & infallible operations. @@ -852,6 +889,7 @@ struct StackData { Layout> client_initial_metadata; Layout> server_initial_metadata; Layout> client_to_server_messages; + std::vector client_to_server_half_close; Layout> server_to_client_messages; Layout> server_trailing_metadata; // A list of finalizers for this call. @@ -972,6 +1010,14 @@ struct StackData { channel_data, call_offset, client_to_server_messages); } + template + void AddClientToServerHalfClose(FilterType* channel_data, + size_t call_offset) { + AddHalfClose(channel_data, call_offset, + &FilterType::Call::OnClientToServerHalfClose, + client_to_server_half_close); + } + template void AddServerToClientMessageOp(FilterType* channel_data, size_t call_offset) { @@ -1217,6 +1263,7 @@ class ServerTrailingMetadataInterceptor { static const NoInterceptor OnClientInitialMetadata; static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; void OnServerTrailingMetadata(ServerMetadata& md, @@ -1240,6 +1287,9 @@ template const NoInterceptor ServerTrailingMetadataInterceptor::Call::OnClientToServerMessage; template +const NoInterceptor + ServerTrailingMetadataInterceptor::Call::OnClientToServerHalfClose; +template const NoInterceptor ServerTrailingMetadataInterceptor::Call::OnServerToClientMessage; template @@ -1256,6 +1306,7 @@ class ClientInitialMetadataInterceptor { } static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnFinalize; @@ -1273,6 +1324,9 @@ template const NoInterceptor ClientInitialMetadataInterceptor::Call::OnClientToServerMessage; template +const NoInterceptor + ClientInitialMetadataInterceptor::Call::OnClientToServerHalfClose; +template const NoInterceptor ClientInitialMetadataInterceptor::Call::OnServerToClientMessage; template @@ -1319,6 +1373,7 @@ class CallFilters { data_.AddClientInitialMetadataOp(filter, call_offset); data_.AddServerInitialMetadataOp(filter, call_offset); data_.AddClientToServerMessageOp(filter, call_offset); + data_.AddClientToServerHalfClose(filter, call_offset); data_.AddServerToClientMessageOp(filter, call_offset); data_.AddServerTrailingMetadataOp(filter, call_offset); data_.AddFinalizer(filter, call_offset, &FilterType::Call::OnFinalize); @@ -1593,6 +1648,8 @@ class CallFilters { filters_detail::OperationExecutor executor_; }; + template ( + filters_detail::StackData::*half_close_layout_ptr)> class PullMessage { public: explicit PullMessage(CallFilters* filters) : filters_(filters) {} @@ -1637,7 +1694,14 @@ class CallFilters { filters_->CancelDueToFailedPipeOperation(); return Failure{}; } - if (!**r) return absl::nullopt; + if (!**r) { + if (half_close_layout_ptr != nullptr) { + filters_detail::RunHalfClose( + filters_->stack_->data_.*half_close_layout_ptr, + filters_->call_data_); + } + return absl::nullopt; + } CHECK(filters_ != nullptr); return FinishOperationExecutor(executor_.Start( layout(), push()->TakeValue(), filters_->call_data_)); @@ -1865,7 +1929,8 @@ inline auto CallFilters::PushClientToServerMessage(MessageHandle message) { } inline auto CallFilters::PullClientToServerMessage() { - return ClientToServerMessagePromises::PullMessage{this}; + return ClientToServerMessagePromises::PullMessage< + &filters_detail::StackData::client_to_server_half_close>{this}; } inline auto CallFilters::PushServerToClientMessage(MessageHandle message) { @@ -1875,7 +1940,7 @@ inline auto CallFilters::PushServerToClientMessage(MessageHandle message) { } inline auto CallFilters::PullServerToClientMessage() { - return ServerToClientMessagePromises::PullMessage{this}; + return ServerToClientMessagePromises::PullMessage{this}; } inline auto CallFilters::PullServerTrailingMetadata() { diff --git a/src/core/load_balancing/grpclb/client_load_reporting_filter.cc b/src/core/load_balancing/grpclb/client_load_reporting_filter.cc index c3de43e4b94..e03fe8d70ce 100644 --- a/src/core/load_balancing/grpclb/client_load_reporting_filter.cc +++ b/src/core/load_balancing/grpclb/client_load_reporting_filter.cc @@ -41,6 +41,7 @@ namespace grpc_core { const NoInterceptor ClientLoadReportingFilter::Call::OnServerToClientMessage; const NoInterceptor ClientLoadReportingFilter::Call::OnClientToServerMessage; +const NoInterceptor ClientLoadReportingFilter::Call::OnClientToServerHalfClose; const NoInterceptor ClientLoadReportingFilter::Call::OnFinalize; const grpc_channel_filter ClientLoadReportingFilter::kFilter = diff --git a/src/core/load_balancing/grpclb/client_load_reporting_filter.h b/src/core/load_balancing/grpclb/client_load_reporting_filter.h index 941b97abf99..f8c5b7fbcc4 100644 --- a/src/core/load_balancing/grpclb/client_load_reporting_filter.h +++ b/src/core/load_balancing/grpclb/client_load_reporting_filter.h @@ -43,6 +43,7 @@ class ClientLoadReportingFilter final void OnServerTrailingMetadata(ServerMetadata& server_trailing_metadata); static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnFinalize; private: diff --git a/src/core/resolver/xds/xds_resolver.cc b/src/core/resolver/xds/xds_resolver.cc index 1b062981a2d..6e51ab1d856 100644 --- a/src/core/resolver/xds/xds_resolver.cc +++ b/src/core/resolver/xds/xds_resolver.cc @@ -330,6 +330,7 @@ class XdsResolver final : public Resolver { static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; }; @@ -383,6 +384,8 @@ const NoInterceptor XdsResolver::ClusterSelectionFilter::Call::OnServerTrailingMetadata; const NoInterceptor XdsResolver::ClusterSelectionFilter::Call::OnClientToServerMessage; +const NoInterceptor + XdsResolver::ClusterSelectionFilter::Call::OnClientToServerHalfClose; const NoInterceptor XdsResolver::ClusterSelectionFilter::Call::OnServerToClientMessage; const NoInterceptor XdsResolver::ClusterSelectionFilter::Call::OnFinalize; diff --git a/src/core/server/server_call_tracer_filter.cc b/src/core/server/server_call_tracer_filter.cc index 6966b4ccc05..6ceb637d481 100644 --- a/src/core/server/server_call_tracer_filter.cc +++ b/src/core/server/server_call_tracer_filter.cc @@ -80,6 +80,7 @@ class ServerCallTracerFilter } static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; private: @@ -92,6 +93,7 @@ class ServerCallTracerFilter }; const NoInterceptor ServerCallTracerFilter::Call::OnClientToServerMessage; +const NoInterceptor ServerCallTracerFilter::Call::OnClientToServerHalfClose; const NoInterceptor ServerCallTracerFilter::Call::OnServerToClientMessage; const grpc_channel_filter ServerCallTracerFilter::kFilter = diff --git a/src/core/server/server_config_selector_filter.cc b/src/core/server/server_config_selector_filter.cc index 4da3b75398c..b4acec5329e 100644 --- a/src/core/server/server_config_selector_filter.cc +++ b/src/core/server/server_config_selector_filter.cc @@ -72,6 +72,7 @@ class ServerConfigSelectorFilter final static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; }; @@ -158,6 +159,7 @@ absl::Status ServerConfigSelectorFilter::Call::OnClientInitialMetadata( const NoInterceptor ServerConfigSelectorFilter::Call::OnServerInitialMetadata; const NoInterceptor ServerConfigSelectorFilter::Call::OnServerTrailingMetadata; const NoInterceptor ServerConfigSelectorFilter::Call::OnClientToServerMessage; +const NoInterceptor ServerConfigSelectorFilter::Call::OnClientToServerHalfClose; const NoInterceptor ServerConfigSelectorFilter::Call::OnServerToClientMessage; const NoInterceptor ServerConfigSelectorFilter::Call::OnFinalize; diff --git a/src/core/service_config/service_config_channel_arg_filter.cc b/src/core/service_config/service_config_channel_arg_filter.cc index a2c9a973129..c73e9dd450e 100644 --- a/src/core/service_config/service_config_channel_arg_filter.cc +++ b/src/core/service_config/service_config_channel_arg_filter.cc @@ -83,6 +83,7 @@ class ServiceConfigChannelArgFilter final static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; }; @@ -97,6 +98,8 @@ const NoInterceptor ServiceConfigChannelArgFilter::Call::OnServerTrailingMetadata; const NoInterceptor ServiceConfigChannelArgFilter::Call::OnClientToServerMessage; +const NoInterceptor + ServiceConfigChannelArgFilter::Call::OnClientToServerHalfClose; const NoInterceptor ServiceConfigChannelArgFilter::Call::OnServerToClientMessage; const NoInterceptor ServiceConfigChannelArgFilter::Call::OnFinalize; diff --git a/test/core/surface/channel_init_test.cc b/test/core/surface/channel_init_test.cc index a90777973c3..a548b221eac 100644 --- a/test/core/surface/channel_init_test.cc +++ b/test/core/surface/channel_init_test.cc @@ -229,6 +229,7 @@ class TestFilter1 { static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnFinalize; }; @@ -245,6 +246,7 @@ const NoInterceptor TestFilter1::Call::OnClientInitialMetadata; const NoInterceptor TestFilter1::Call::OnServerInitialMetadata; const NoInterceptor TestFilter1::Call::OnServerTrailingMetadata; const NoInterceptor TestFilter1::Call::OnClientToServerMessage; +const NoInterceptor TestFilter1::Call::OnClientToServerHalfClose; const NoInterceptor TestFilter1::Call::OnServerToClientMessage; const NoInterceptor TestFilter1::Call::OnFinalize; diff --git a/test/core/transport/call_filters_test.cc b/test/core/transport/call_filters_test.cc index 8044aa85610..750f16b2ec1 100644 --- a/test/core/transport/call_filters_test.cc +++ b/test/core/transport/call_filters_test.cc @@ -1331,6 +1331,7 @@ TEST(CallFiltersTest, CanBuildStack) { void OnClientInitialMetadata(ClientMetadata&) {} void OnServerInitialMetadata(ServerMetadata&) {} void OnClientToServerMessage(Message&) {} + void OnClientToServerHalfClose() {} void OnServerToClientMessage(Message&) {} void OnServerTrailingMetadata(ServerMetadata&) {} void OnFinalize(const grpc_call_final_info*) {} @@ -1355,6 +1356,10 @@ TEST(CallFiltersTest, UnaryCall) { void OnClientToServerMessage(Message&, Filter* f) { f->steps.push_back(absl::StrCat(f->label, ":OnClientToServerMessage")); } + void OnClientToServerHalfClose(Filter* f) { + f->steps.push_back( + absl::StrCat(f->label, ":OnClientToServerHalfClose")); + } void OnServerToClientMessage(Message&, Filter* f) { f->steps.push_back(absl::StrCat(f->label, ":OnServerToClientMessage")); } diff --git a/test/core/transport/interception_chain_test.cc b/test/core/transport/interception_chain_test.cc index f8ed661febe..ba0b42d7f99 100644 --- a/test/core/transport/interception_chain_test.cc +++ b/test/core/transport/interception_chain_test.cc @@ -81,6 +81,7 @@ class TestFilter { } static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnFinalize; @@ -101,6 +102,8 @@ const NoInterceptor TestFilter::Call::OnServerInitialMetadata; template const NoInterceptor TestFilter::Call::OnClientToServerMessage; template +const NoInterceptor TestFilter::Call::OnClientToServerHalfClose; +template const NoInterceptor TestFilter::Call::OnServerToClientMessage; template const NoInterceptor TestFilter::Call::OnServerTrailingMetadata; @@ -118,6 +121,7 @@ class FailsToInstantiateFilter { static const NoInterceptor OnClientInitialMetadata; static const NoInterceptor OnServerInitialMetadata; static const NoInterceptor OnClientToServerMessage; + static const NoInterceptor OnClientToServerHalfClose; static const NoInterceptor OnServerToClientMessage; static const NoInterceptor OnServerTrailingMetadata; static const NoInterceptor OnFinalize; @@ -137,6 +141,9 @@ const NoInterceptor FailsToInstantiateFilter::Call::OnServerInitialMetadata; template const NoInterceptor FailsToInstantiateFilter::Call::OnClientToServerMessage; template +const NoInterceptor + FailsToInstantiateFilter::Call::OnClientToServerHalfClose; +template const NoInterceptor FailsToInstantiateFilter::Call::OnServerToClientMessage; template const NoInterceptor FailsToInstantiateFilter::Call::OnServerTrailingMetadata; diff --git a/test/cpp/ext/filters/logging/BUILD b/test/cpp/ext/filters/logging/BUILD index 11a90473b8f..8767e687423 100644 --- a/test/cpp/ext/filters/logging/BUILD +++ b/test/cpp/ext/filters/logging/BUILD @@ -57,6 +57,7 @@ grpc_cc_test( deps = [ ":logging_test_library", "//:grpc++", + "//src/core:dump_args", "//src/core:logging_filter", "//src/cpp/ext/gcp:observability_logging_sink", "//src/proto/grpc/testing:echo_proto", diff --git a/test/cpp/ext/filters/logging/logging_test.cc b/test/cpp/ext/filters/logging/logging_test.cc index 2e40e17efd8..09df6f7f906 100644 --- a/test/cpp/ext/filters/logging/logging_test.cc +++ b/test/cpp/ext/filters/logging/logging_test.cc @@ -29,6 +29,7 @@ #include #include "src/core/ext/filters/logging/logging_filter.h" +#include "src/core/lib/gprpp/dump_args.h" #include "src/core/lib/gprpp/sync.h" #include "src/cpp/ext/gcp/observability_logging_sink.h" #include "src/proto/grpc/testing/echo.grpc.pb.h" @@ -843,7 +844,7 @@ TEST_F(LoggingTest, CancelledRpc) { break; } std::this_thread::sleep_for(std::chrono::milliseconds(10)); - EXPECT_LT(absl::Now() - initial_time, absl::Seconds(10)); + ASSERT_LT(absl::Now() - initial_time, absl::Seconds(10)); } } From f1dbb32f0af99bc5745a277bce1a8e5480308a99 Mon Sep 17 00:00:00 2001 From: Yijie Ma Date: Wed, 15 May 2024 15:42:29 -0700 Subject: [PATCH 6/9] [chore] Add yijiem to maintainer list (#36629) Closes #36629 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36629 from yijiem:maintainer-list-update b377bc91df7c7ad36cf9cda6c806ff10066741ec PiperOrigin-RevId: 634099967 --- MAINTAINERS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 6d868d6bc27..5c36c24f156 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -40,6 +40,7 @@ for general contribution guidelines. - [vishalpowar](https://github.com/vishalpowar), Google LLC - [wenbozhu](https://github.com/wenbozhu), Google LLC - [yashykt](https://github.com/yashykt), Google LLC +- [yijiem](https://github.com/yijiem), Google LLC - [ZhouyihaiDing](https://github.com/ZhouyihaiDing), Google LLC From 58a4b9c922113c374d5e339e9e0488c472c36a17 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 15 May 2024 16:28:46 -0700 Subject: [PATCH 7/9] [reorg] move src/core/lib/gpr -> src/core/util (#36543) Closes #36543 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36543 from markdroth:reorg_util_gpr ba84e186beb1ec50d09bcf91ebd16e88b8e225aa PiperOrigin-RevId: 634113744 --- BUILD | 64 +++++----- CMakeLists.txt | 68 +++++----- Makefile | 52 ++++---- Package.swift | 64 +++++----- build_autogenerated.yaml | 118 +++++++++--------- config.m4 | 66 +++++----- config.w32 | 66 +++++----- gRPC-C++.podspec | 24 ++-- gRPC-Core.podspec | 78 ++++++------ grpc.gemspec | 64 +++++----- package.xml | 64 +++++----- src/core/BUILD | 6 +- src/core/channelz/channel_trace.cc | 2 +- src/core/channelz/channelz.cc | 4 +- src/core/channelz/channelz.h | 4 +- .../client_channel/client_channel_filter.cc | 2 +- .../client_channel/client_channel_filter.h | 2 +- src/core/client_channel/config_selector.cc | 2 +- src/core/client_channel/config_selector.h | 2 +- src/core/client_channel/dynamic_filters.cc | 2 +- src/core/client_channel/dynamic_filters.h | 2 +- src/core/client_channel/retry_filter.h | 2 +- .../retry_filter_legacy_call_data.cc | 2 +- src/core/client_channel/subchannel.cc | 4 +- src/core/client_channel/subchannel.h | 2 +- .../subchannel_pool_interface.h | 2 +- .../subchannel_stream_client.cc | 2 +- src/core/ext/transport/chttp2/alpn/alpn.cc | 2 +- .../chttp2/transport/chttp2_transport.cc | 4 +- .../chttp2/transport/flow_control.cc | 2 +- .../chttp2/transport/frame_settings.cc | 2 +- .../chttp2/transport/http2_settings.cc | 2 +- .../chttp2/transport/http2_settings.h | 2 +- .../ext/transport/chttp2/transport/writing.cc | 2 +- .../http_connect/http_connect_handshaker.cc | 2 +- .../http_connect/http_proxy_mapper.cc | 2 +- .../handshaker/security/secure_endpoint.cc | 2 +- src/core/lib/address_utils/parse_address.cc | 2 +- src/core/lib/avl/avl.h | 2 +- src/core/lib/channel/channel_args.cc | 2 +- src/core/lib/channel/channel_args.h | 2 +- src/core/lib/channel/channel_stack.cc | 2 +- src/core/lib/channel/channel_stack.h | 2 +- src/core/lib/channel/connected_channel.cc | 2 +- src/core/lib/channel/status_util.cc | 2 +- src/core/lib/compression/compression.cc | 2 +- src/core/lib/debug/event_log.h | 2 +- .../posix_engine/native_posix_dns_resolver.cc | 2 +- .../event_engine/posix_engine/posix_engine.cc | 2 +- .../posix_engine/tcp_socket_utils.cc | 2 +- .../lib/event_engine/posix_engine/timer.cc | 2 +- .../event_engine/thread_pool/thread_count.h | 2 +- src/core/lib/gprpp/bitset.h | 2 +- src/core/lib/gprpp/per_cpu.cc | 2 +- src/core/lib/gprpp/posix/thd.cc | 2 +- src/core/lib/gprpp/time.h | 4 +- src/core/lib/gprpp/unique_type_name.h | 2 +- src/core/lib/iomgr/endpoint_cfstream.cc | 2 +- src/core/lib/iomgr/endpoint_pair_posix.cc | 2 +- src/core/lib/iomgr/error.cc | 2 +- src/core/lib/iomgr/error.h | 2 +- src/core/lib/iomgr/ev_epoll1_linux.cc | 4 +- src/core/lib/iomgr/ev_poll_posix.cc | 2 +- src/core/lib/iomgr/ev_posix.cc | 2 +- .../lib/iomgr/event_engine_shims/endpoint.cc | 2 +- src/core/lib/iomgr/exec_ctx.h | 2 +- src/core/lib/iomgr/executor.cc | 2 +- src/core/lib/iomgr/executor.h | 2 +- src/core/lib/iomgr/iomgr.cc | 4 +- src/core/lib/iomgr/resolve_address_posix.cc | 4 +- src/core/lib/iomgr/resolve_address_windows.cc | 2 +- src/core/lib/iomgr/socket_factory_posix.cc | 2 +- src/core/lib/iomgr/socket_mutator.cc | 2 +- .../lib/iomgr/socket_utils_common_posix.cc | 2 +- src/core/lib/iomgr/tcp_client_posix.cc | 2 +- src/core/lib/iomgr/tcp_posix.cc | 4 +- src/core/lib/iomgr/tcp_windows.cc | 4 +- src/core/lib/iomgr/timer_generic.cc | 4 +- src/core/lib/iomgr/timer_heap.cc | 2 +- src/core/lib/iomgr/unix_sockets_posix.cc | 2 +- src/core/lib/iomgr/vsock.cc | 2 +- src/core/lib/resource_quota/arena.cc | 2 +- src/core/lib/resource_quota/arena.h | 2 +- src/core/lib/resource_quota/memory_quota.cc | 2 +- src/core/lib/resource_quota/memory_quota.h | 2 +- .../lib/resource_quota/periodic_update.cc | 2 +- src/core/lib/resource_quota/resource_quota.h | 2 +- .../authorization_policy_provider.h | 2 +- .../authorization_policy_provider_vtable.cc | 2 +- .../security/authorization/rbac_translator.cc | 2 +- .../lib/security/context/security_context.h | 2 +- .../credentials/alts/alts_credentials.h | 2 +- .../composite/composite_credentials.h | 2 +- .../lib/security/credentials/credentials.cc | 2 +- .../credentials/fake/fake_credentials.h | 2 +- .../google_default_credentials.h | 2 +- .../credentials/iam/iam_credentials.h | 2 +- .../credentials/jwt/jwt_credentials.h | 2 +- .../security/credentials/jwt/jwt_verifier.cc | 2 +- .../credentials/local/local_credentials.h | 2 +- .../credentials/oauth2/oauth2_credentials.h | 2 +- .../credentials/plugin/plugin_credentials.h | 2 +- .../credentials/ssl/ssl_credentials.h | 2 +- .../tls/grpc_tls_certificate_provider.h | 2 +- .../tls/grpc_tls_certificate_verifier.h | 2 +- .../credentials/tls/tls_credentials.cc | 2 +- .../credentials/xds/xds_credentials.cc | 2 +- .../fake/fake_security_connector.cc | 4 +- .../load_system_roots_supported.cc | 2 +- .../load_system_roots_windows.cc | 2 +- .../security_connector/security_connector.cc | 2 +- .../security/security_connector/ssl_utils.cc | 2 +- src/core/lib/slice/slice.h | 2 +- src/core/lib/slice/slice_string_helpers.cc | 2 +- src/core/lib/surface/call.cc | 6 +- src/core/lib/surface/call.h | 2 +- src/core/lib/surface/call_log_batch.cc | 2 +- src/core/lib/surface/completion_queue.cc | 2 +- src/core/lib/surface/lame_client.cc | 2 +- src/core/load_balancing/grpclb/grpclb.cc | 4 +- .../grpclb/grpclb_balancer_addresses.cc | 2 +- .../load_balancing/pick_first/pick_first.cc | 2 +- .../dns/c_ares/grpc_ares_ev_driver_windows.cc | 2 +- .../resolver/dns/c_ares/grpc_ares_wrapper.cc | 2 +- .../dns/c_ares/grpc_ares_wrapper_windows.cc | 2 +- src/core/resolver/endpoint_addresses.cc | 2 +- src/core/resolver/fake/fake_resolver.cc | 2 +- src/core/resolver/fake/fake_resolver.h | 2 +- src/core/server/server.cc | 2 +- src/core/server/server_config_selector.h | 2 +- src/core/server/xds_channel_stack_modifier.cc | 2 +- src/core/server/xds_channel_stack_modifier.h | 2 +- src/core/service_config/service_config.h | 2 +- .../alts_grpc_record_protocol_common.cc | 2 +- src/core/tsi/fake_transport_security.cc | 2 +- src/core/tsi/ssl_transport_security.cc | 2 +- src/core/{lib/gpr => util}/.clang-format | 0 src/core/{lib/gpr => util}/README.md | 0 src/core/{lib/gpr => util}/alloc.cc | 0 src/core/{lib/gpr => util}/alloc.h | 6 +- src/core/{lib/gpr => util}/android/log.cc | 0 src/core/{lib/gpr => util}/atm.cc | 2 +- src/core/{lib/gpr => util}/iphone/cpu.cc | 0 src/core/{lib/gpr => util}/linux/cpu.cc | 0 src/core/{lib/gpr => util}/linux/log.cc | 0 src/core/{lib/gpr => util}/log.cc | 2 +- src/core/{lib/gpr => util}/msys/tmpfile.cc | 4 +- src/core/{lib/gpr => util}/posix/cpu.cc | 2 +- src/core/{lib/gpr => util}/posix/log.cc | 0 src/core/{lib/gpr => util}/posix/string.cc | 0 src/core/{lib/gpr => util}/posix/sync.cc | 0 src/core/{lib/gpr => util}/posix/time.cc | 2 +- src/core/{lib/gpr => util}/posix/tmpfile.cc | 4 +- src/core/{lib/gpr => util}/spinlock.h | 6 +- src/core/{lib/gpr => util}/string.cc | 4 +- src/core/{lib/gpr => util}/string.h | 6 +- src/core/{lib/gpr => util}/subprocess.h | 6 +- .../{lib/gpr => util}/subprocess_posix.cc | 2 +- .../{lib/gpr => util}/subprocess_windows.cc | 4 +- src/core/{lib/gpr => util}/sync.cc | 0 src/core/{lib/gpr => util}/sync_abseil.cc | 0 src/core/{lib/gpr => util}/time.cc | 0 src/core/{lib/gpr => util}/time_precise.cc | 2 +- src/core/{lib/gpr => util}/time_precise.h | 6 +- src/core/{lib/gpr => util}/tmpfile.h | 6 +- src/core/{lib/gpr => util}/useful.h | 6 +- src/core/{lib/gpr => util}/windows/cpu.cc | 0 src/core/{lib/gpr => util}/windows/log.cc | 2 +- src/core/{lib/gpr => util}/windows/string.cc | 2 +- .../{lib/gpr => util}/windows/string_util.cc | 2 +- src/core/{lib/gpr => util}/windows/sync.cc | 0 src/core/{lib/gpr => util}/windows/time.cc | 2 +- src/core/{lib/gpr => util}/windows/tmpfile.cc | 2 +- .../xds/grpc/certificate_provider_store.h | 2 +- src/core/xds/grpc/xds_bootstrap_grpc.cc | 2 +- src/core/xds/grpc/xds_certificate_provider.h | 2 +- src/core/xds/grpc/xds_client_grpc.h | 2 +- src/core/xds/grpc/xds_endpoint.cc | 2 +- src/core/xds/grpc/xds_http_rbac_filter.cc | 2 +- src/core/xds/grpc/xds_route_config.cc | 2 +- src/core/xds/xds_client/xds_bootstrap.cc | 2 +- src/core/xds/xds_client/xds_client_stats.h | 2 +- src/cpp/common/completion_queue_cc.cc | 2 +- src/cpp/server/server_builder.cc | 4 +- .../tests/CronetTests/CronetUnitTests.mm | 4 +- src/python/grpcio/grpc_core_dependencies.py | 52 ++++---- .../observability_lib_deps.py | 52 ++++---- templates/gRPC-Core.podspec.template | 2 +- test/core/bad_client/bad_client.cc | 2 +- test/core/bad_ssl/bad_ssl_test.cc | 2 +- test/core/bad_ssl/servers/alpn.cc | 2 +- test/core/channel/channel_args_test.cc | 2 +- test/core/channelz/channelz_test.cc | 2 +- test/core/compression/compression_test.cc | 2 +- .../core/compression/message_compress_test.cc | 2 +- test/core/end2end/bad_server_response_test.cc | 2 +- test/core/end2end/fuzzers/network_input.cc | 2 +- test/core/end2end/h2_ssl_cert_test.cc | 2 +- .../core/end2end/h2_ssl_session_reuse_test.cc | 2 +- ...ls_peer_property_external_verifier_test.cc | 2 +- .../fuzzing_event_engine.cc | 2 +- .../posix/tcp_posix_socket_utils_test.cc | 2 +- .../posix/traced_buffer_list_test.cc | 2 +- test/core/filters/client_auth_filter_test.cc | 2 +- test/core/gpr/spinlock_test.cc | 2 +- test/core/gpr/string_test.cc | 2 +- test/core/gpr/useful_test.cc | 2 +- test/core/gprpp/load_file_test.cc | 2 +- test/core/gprpp/mpscq_test.cc | 2 +- test/core/gprpp/stat_test.cc | 2 +- test/core/http/httpcli_test.cc | 2 +- test/core/http/httpcli_test_util.cc | 2 +- test/core/http/httpcli_test_util.h | 2 +- test/core/http/httpscli_test.cc | 2 +- test/core/http/parser_test.cc | 2 +- test/core/iomgr/buffer_list_test.cc | 2 +- test/core/iomgr/combiner_test.cc | 2 +- test/core/iomgr/endpoint_pair_test.cc | 2 +- test/core/iomgr/endpoint_tests.cc | 2 +- test/core/iomgr/resolve_address_posix_test.cc | 4 +- test/core/iomgr/resolve_address_test.cc | 2 +- test/core/iomgr/socket_utils_test.cc | 2 +- test/core/iomgr/tcp_posix_test.cc | 2 +- test/core/iomgr/timer_heap_test.cc | 2 +- test/core/memory_usage/client.cc | 2 +- test/core/memory_usage/memory_usage_test.cc | 2 +- .../network_benchmarks/low_level_ping_pong.cc | 2 +- .../resource_quota/memory_quota_fuzzer.cc | 2 +- test/core/security/auth_context_test.cc | 2 +- .../check_gcp_environment_linux_test.cc | 2 +- .../check_gcp_environment_windows_test.cc | 2 +- test/core/security/credentials_test.cc | 4 +- .../grpc_tls_certificate_provider_test.cc | 2 +- .../grpc_tls_certificate_verifier_test.cc | 2 +- .../grpc_tls_credentials_options_test.cc | 2 +- .../print_google_default_creds_token.cc | 2 +- test/core/security/secure_endpoint_test.cc | 2 +- test/core/security/security_connector_test.cc | 4 +- test/core/security/system_roots_test.cc | 2 +- test/core/slice/percent_encoding_test.cc | 2 +- test/core/slice/slice_string_helpers_test.cc | 2 +- test/core/surface/completion_queue_test.cc | 2 +- .../completion_queue_threading_test.cc | 2 +- test/core/surface/server_test.cc | 2 +- test/core/test_util/cmdline_test.cc | 2 +- test/core/test_util/histogram.cc | 2 +- test/core/test_util/tls_utils.cc | 2 +- .../core/transport/chttp2/bin_decoder_test.cc | 2 +- .../core/transport/chttp2/bin_encoder_test.cc | 2 +- .../transport/chttp2/flow_control_fuzzer.cc | 2 +- .../transport/chttp2/flow_control_test.cc | 2 +- .../chttp2/graceful_shutdown_test.cc | 2 +- .../transport/chttp2/streams_not_seen_test.cc | 2 +- .../transport/chttp2/too_many_pings_test.cc | 2 +- test/core/transport/timeout_encoding_test.cc | 2 +- .../frame_protector/frame_handler_test.cc | 2 +- .../alts_concurrent_connectivity_test.cc | 2 +- test/core/tsi/transport_security_test.cc | 4 +- test/core/xds/xds_bootstrap_test.cc | 2 +- .../core/xds/xds_certificate_provider_test.cc | 2 +- test/cpp/client/credentials_test.cc | 2 +- test/cpp/common/channel_arguments_test.cc | 2 +- test/cpp/end2end/tls_key_export_test.cc | 2 +- test/cpp/end2end/xds/xds_end2end_test.cc | 6 +- test/cpp/end2end/xds/xds_end2end_test_lib.cc | 2 +- test/cpp/end2end/xds/xds_utils.cc | 2 +- test/cpp/ext/csm/mesh_id_test.cc | 2 +- test/cpp/ext/csm/metadata_exchange_test.cc | 2 +- test/cpp/ext/gcp/observability_config_test.cc | 2 +- test/cpp/interop/client.cc | 2 +- test/cpp/interop/grpclb_fallback_test.cc | 2 +- test/cpp/interop/http2_client.cc | 4 +- test/cpp/interop/interop_server.cc | 2 +- test/cpp/interop/interop_test.cc | 2 +- test/cpp/interop/observability_client.cc | 2 +- test/cpp/interop/xds_federation_client.cc | 2 +- test/cpp/microbenchmarks/bm_closure.cc | 2 +- test/cpp/microbenchmarks/bm_thread_pool.cc | 2 +- test/cpp/naming/address_sorting_test.cc | 2 +- test/cpp/naming/cancel_ares_query_test.cc | 2 +- test/cpp/naming/resolver_component_test.cc | 2 +- test/cpp/util/subprocess.cc | 2 +- tools/doxygen/Doxyfile.c++.internal | 64 +++++----- tools/doxygen/Doxyfile.core.internal | 66 +++++----- tools/run_tests/sanity/check_absl_mutex.sh | 2 +- 285 files changed, 780 insertions(+), 780 deletions(-) rename src/core/{lib/gpr => util}/.clang-format (100%) rename src/core/{lib/gpr => util}/README.md (100%) rename src/core/{lib/gpr => util}/alloc.cc (100%) rename src/core/{lib/gpr => util}/alloc.h (87%) rename src/core/{lib/gpr => util}/android/log.cc (100%) rename src/core/{lib/gpr => util}/atm.cc (96%) rename src/core/{lib/gpr => util}/iphone/cpu.cc (100%) rename src/core/{lib/gpr => util}/linux/cpu.cc (100%) rename src/core/{lib/gpr => util}/linux/log.cc (100%) rename src/core/{lib/gpr => util}/log.cc (99%) rename src/core/{lib/gpr => util}/msys/tmpfile.cc (94%) rename src/core/{lib/gpr => util}/posix/cpu.cc (98%) rename src/core/{lib/gpr => util}/posix/log.cc (100%) rename src/core/{lib/gpr => util}/posix/string.cc (100%) rename src/core/{lib/gpr => util}/posix/sync.cc (100%) rename src/core/{lib/gpr => util}/posix/time.cc (98%) rename src/core/{lib/gpr => util}/posix/tmpfile.cc (96%) rename src/core/{lib/gpr => util}/spinlock.h (93%) rename src/core/{lib/gpr => util}/string.cc (99%) rename src/core/{lib/gpr => util}/string.h (97%) rename src/core/{lib/gpr => util}/subprocess.h (92%) rename src/core/{lib/gpr => util}/subprocess_posix.cc (99%) rename src/core/{lib/gpr => util}/subprocess_windows.cc (97%) rename src/core/{lib/gpr => util}/sync.cc (100%) rename src/core/{lib/gpr => util}/sync_abseil.cc (100%) rename src/core/{lib/gpr => util}/time.cc (100%) rename src/core/{lib/gpr => util}/time_precise.cc (99%) rename src/core/{lib/gpr => util}/time_precise.h (93%) rename src/core/{lib/gpr => util}/tmpfile.h (88%) rename src/core/{lib/gpr => util}/useful.h (97%) rename src/core/{lib/gpr => util}/windows/cpu.cc (100%) rename src/core/{lib/gpr => util}/windows/log.cc (98%) rename src/core/{lib/gpr => util}/windows/string.cc (97%) rename src/core/{lib/gpr => util}/windows/string_util.cc (97%) rename src/core/{lib/gpr => util}/windows/sync.cc (100%) rename src/core/{lib/gpr => util}/windows/time.cc (98%) rename src/core/{lib/gpr => util}/windows/tmpfile.cc (98%) diff --git a/BUILD b/BUILD index 53c241c3520..0c611f2db1e 100644 --- a/BUILD +++ b/BUILD @@ -734,31 +734,6 @@ grpc_cc_library( grpc_cc_library( name = "gpr", srcs = [ - "//src/core:lib/gpr/alloc.cc", - "//src/core:lib/gpr/android/log.cc", - "//src/core:lib/gpr/iphone/cpu.cc", - "//src/core:lib/gpr/linux/cpu.cc", - "//src/core:lib/gpr/linux/log.cc", - "//src/core:lib/gpr/log.cc", - "//src/core:lib/gpr/msys/tmpfile.cc", - "//src/core:lib/gpr/posix/cpu.cc", - "//src/core:lib/gpr/posix/log.cc", - "//src/core:lib/gpr/posix/string.cc", - "//src/core:lib/gpr/posix/sync.cc", - "//src/core:lib/gpr/posix/time.cc", - "//src/core:lib/gpr/posix/tmpfile.cc", - "//src/core:lib/gpr/string.cc", - "//src/core:lib/gpr/sync.cc", - "//src/core:lib/gpr/sync_abseil.cc", - "//src/core:lib/gpr/time.cc", - "//src/core:lib/gpr/time_precise.cc", - "//src/core:lib/gpr/windows/cpu.cc", - "//src/core:lib/gpr/windows/log.cc", - "//src/core:lib/gpr/windows/string.cc", - "//src/core:lib/gpr/windows/string_util.cc", - "//src/core:lib/gpr/windows/sync.cc", - "//src/core:lib/gpr/windows/time.cc", - "//src/core:lib/gpr/windows/tmpfile.cc", "//src/core:lib/gprpp/crash.cc", "//src/core:lib/gprpp/fork.cc", "//src/core:lib/gprpp/host_port.cc", @@ -768,12 +743,33 @@ grpc_cc_library( "//src/core:lib/gprpp/time_util.cc", "//src/core:lib/gprpp/windows/stat.cc", "//src/core:lib/gprpp/windows/thd.cc", + "//src/core:util/alloc.cc", + "//src/core:util/android/log.cc", + "//src/core:util/iphone/cpu.cc", + "//src/core:util/linux/cpu.cc", + "//src/core:util/linux/log.cc", + "//src/core:util/log.cc", + "//src/core:util/msys/tmpfile.cc", + "//src/core:util/posix/cpu.cc", + "//src/core:util/posix/log.cc", + "//src/core:util/posix/string.cc", + "//src/core:util/posix/sync.cc", + "//src/core:util/posix/time.cc", + "//src/core:util/posix/tmpfile.cc", + "//src/core:util/string.cc", + "//src/core:util/sync.cc", + "//src/core:util/sync_abseil.cc", + "//src/core:util/time.cc", + "//src/core:util/time_precise.cc", + "//src/core:util/windows/cpu.cc", + "//src/core:util/windows/log.cc", + "//src/core:util/windows/string.cc", + "//src/core:util/windows/string_util.cc", + "//src/core:util/windows/sync.cc", + "//src/core:util/windows/time.cc", + "//src/core:util/windows/tmpfile.cc", ], hdrs = [ - "//src/core:lib/gpr/alloc.h", - "//src/core:lib/gpr/string.h", - "//src/core:lib/gpr/time_precise.h", - "//src/core:lib/gpr/tmpfile.h", "//src/core:lib/gprpp/crash.h", "//src/core:lib/gprpp/fork.h", "//src/core:lib/gprpp/host_port.h", @@ -783,6 +779,10 @@ grpc_cc_library( "//src/core:lib/gprpp/sync.h", "//src/core:lib/gprpp/thd.h", "//src/core:lib/gprpp/time_util.h", + "//src/core:util/alloc.h", + "//src/core:util/string.h", + "//src/core:util/time_precise.h", + "//src/core:util/tmpfile.h", ], external_deps = [ "absl/base", @@ -4906,11 +4906,11 @@ grpc_cc_library( grpc_cc_library( name = "subprocess", srcs = [ - "//src/core:lib/gpr/subprocess_posix.cc", - "//src/core:lib/gpr/subprocess_windows.cc", + "//src/core:util/subprocess_posix.cc", + "//src/core:util/subprocess_windows.cc", ], hdrs = [ - "//src/core:lib/gpr/subprocess.h", + "//src/core:util/subprocess.h", ], external_deps = [ "absl/log:check", diff --git a/CMakeLists.txt b/CMakeLists.txt index 3499823786a..7128fd2f552 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1661,32 +1661,6 @@ add_library(gpr src/core/lib/config/config_vars_non_generated.cc src/core/lib/config/load_config.cc src/core/lib/event_engine/thread_local.cc - src/core/lib/gpr/alloc.cc - src/core/lib/gpr/android/log.cc - src/core/lib/gpr/atm.cc - src/core/lib/gpr/iphone/cpu.cc - src/core/lib/gpr/linux/cpu.cc - src/core/lib/gpr/linux/log.cc - src/core/lib/gpr/log.cc - src/core/lib/gpr/msys/tmpfile.cc - src/core/lib/gpr/posix/cpu.cc - src/core/lib/gpr/posix/log.cc - src/core/lib/gpr/posix/string.cc - src/core/lib/gpr/posix/sync.cc - src/core/lib/gpr/posix/time.cc - src/core/lib/gpr/posix/tmpfile.cc - src/core/lib/gpr/string.cc - src/core/lib/gpr/sync.cc - src/core/lib/gpr/sync_abseil.cc - src/core/lib/gpr/time.cc - src/core/lib/gpr/time_precise.cc - src/core/lib/gpr/windows/cpu.cc - src/core/lib/gpr/windows/log.cc - src/core/lib/gpr/windows/string.cc - src/core/lib/gpr/windows/string_util.cc - src/core/lib/gpr/windows/sync.cc - src/core/lib/gpr/windows/time.cc - src/core/lib/gpr/windows/tmpfile.cc src/core/lib/gprpp/crash.cc src/core/lib/gprpp/examine_stack.cc src/core/lib/gprpp/fork.cc @@ -1702,6 +1676,32 @@ add_library(gpr src/core/lib/gprpp/windows/env.cc src/core/lib/gprpp/windows/stat.cc src/core/lib/gprpp/windows/thd.cc + src/core/util/alloc.cc + src/core/util/android/log.cc + src/core/util/atm.cc + src/core/util/iphone/cpu.cc + src/core/util/linux/cpu.cc + src/core/util/linux/log.cc + src/core/util/log.cc + src/core/util/msys/tmpfile.cc + src/core/util/posix/cpu.cc + src/core/util/posix/log.cc + src/core/util/posix/string.cc + src/core/util/posix/sync.cc + src/core/util/posix/time.cc + src/core/util/posix/tmpfile.cc + src/core/util/string.cc + src/core/util/sync.cc + src/core/util/sync_abseil.cc + src/core/util/time.cc + src/core/util/time_precise.cc + src/core/util/windows/cpu.cc + src/core/util/windows/log.cc + src/core/util/windows/string.cc + src/core/util/windows/string_util.cc + src/core/util/windows/sync.cc + src/core/util/windows/time.cc + src/core/util/windows/tmpfile.cc ) target_compile_features(gpr PUBLIC cxx_std_14) @@ -4737,8 +4737,8 @@ endif() if(gRPC_BUILD_TESTS) add_library(grpc++_test_util - src/core/lib/gpr/subprocess_posix.cc - src/core/lib/gpr/subprocess_windows.cc + src/core/util/subprocess_posix.cc + src/core/util/subprocess_windows.cc test/core/end2end/data/client_certs.cc test/core/end2end/data/server1_cert.cc test/core/end2end/data/server1_key.cc @@ -6089,8 +6089,8 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_executable(address_sorting_test_unsecure - src/core/lib/gpr/subprocess_posix.cc - src/core/lib/gpr/subprocess_windows.cc + src/core/util/subprocess_posix.cc + src/core/util/subprocess_windows.cc test/core/test_util/cmdline.cc test/core/test_util/fuzzer_util.cc test/core/test_util/grpc_profiler.cc @@ -7624,8 +7624,8 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_executable(bad_ssl_alpn_test - src/core/lib/gpr/subprocess_posix.cc - src/core/lib/gpr/subprocess_windows.cc + src/core/util/subprocess_posix.cc + src/core/util/subprocess_windows.cc test/core/bad_ssl/bad_ssl_test.cc test/core/end2end/cq_verifier.cc test/core/test_util/cmdline.cc @@ -7680,8 +7680,8 @@ if(gRPC_BUILD_TESTS) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) add_executable(bad_ssl_cert_test - src/core/lib/gpr/subprocess_posix.cc - src/core/lib/gpr/subprocess_windows.cc + src/core/util/subprocess_posix.cc + src/core/util/subprocess_windows.cc test/core/bad_ssl/bad_ssl_test.cc test/core/end2end/cq_verifier.cc test/core/test_util/cmdline.cc diff --git a/Makefile b/Makefile index 22625964566..5e22b66b5ee 100644 --- a/Makefile +++ b/Makefile @@ -1141,32 +1141,6 @@ LIBGRPC_SRC = \ src/core/lib/event_engine/work_queue/basic_work_queue.cc \ src/core/lib/experiments/config.cc \ src/core/lib/experiments/experiments.cc \ - src/core/lib/gpr/alloc.cc \ - src/core/lib/gpr/android/log.cc \ - src/core/lib/gpr/atm.cc \ - src/core/lib/gpr/iphone/cpu.cc \ - src/core/lib/gpr/linux/cpu.cc \ - src/core/lib/gpr/linux/log.cc \ - src/core/lib/gpr/log.cc \ - src/core/lib/gpr/msys/tmpfile.cc \ - src/core/lib/gpr/posix/cpu.cc \ - src/core/lib/gpr/posix/log.cc \ - src/core/lib/gpr/posix/string.cc \ - src/core/lib/gpr/posix/sync.cc \ - src/core/lib/gpr/posix/time.cc \ - src/core/lib/gpr/posix/tmpfile.cc \ - src/core/lib/gpr/string.cc \ - src/core/lib/gpr/sync.cc \ - src/core/lib/gpr/sync_abseil.cc \ - src/core/lib/gpr/time.cc \ - src/core/lib/gpr/time_precise.cc \ - src/core/lib/gpr/windows/cpu.cc \ - src/core/lib/gpr/windows/log.cc \ - src/core/lib/gpr/windows/string.cc \ - src/core/lib/gpr/windows/string_util.cc \ - src/core/lib/gpr/windows/sync.cc \ - src/core/lib/gpr/windows/time.cc \ - src/core/lib/gpr/windows/tmpfile.cc \ src/core/lib/gprpp/crash.cc \ src/core/lib/gprpp/examine_stack.cc \ src/core/lib/gprpp/fork.cc \ @@ -1485,6 +1459,32 @@ LIBGRPC_SRC = \ src/core/tsi/ssl_transport_security_utils.cc \ src/core/tsi/transport_security.cc \ src/core/tsi/transport_security_grpc.cc \ + src/core/util/alloc.cc \ + src/core/util/android/log.cc \ + src/core/util/atm.cc \ + src/core/util/iphone/cpu.cc \ + src/core/util/linux/cpu.cc \ + src/core/util/linux/log.cc \ + src/core/util/log.cc \ + src/core/util/msys/tmpfile.cc \ + src/core/util/posix/cpu.cc \ + src/core/util/posix/log.cc \ + src/core/util/posix/string.cc \ + src/core/util/posix/sync.cc \ + src/core/util/posix/time.cc \ + src/core/util/posix/tmpfile.cc \ + src/core/util/string.cc \ + src/core/util/sync.cc \ + src/core/util/sync_abseil.cc \ + src/core/util/time.cc \ + src/core/util/time_precise.cc \ + src/core/util/windows/cpu.cc \ + src/core/util/windows/log.cc \ + src/core/util/windows/string.cc \ + src/core/util/windows/string_util.cc \ + src/core/util/windows/sync.cc \ + src/core/util/windows/time.cc \ + src/core/util/windows/tmpfile.cc \ src/core/xds/grpc/certificate_provider_store.cc \ src/core/xds/grpc/file_watcher_certificate_provider_factory.cc \ src/core/xds/grpc/xds_audit_logger_registry.cc \ diff --git a/Package.swift b/Package.swift index c4405cf775f..2cfe0e1798e 100644 --- a/Package.swift +++ b/Package.swift @@ -1255,38 +1255,6 @@ let package = Package( "src/core/lib/experiments/config.h", "src/core/lib/experiments/experiments.cc", "src/core/lib/experiments/experiments.h", - "src/core/lib/gpr/alloc.cc", - "src/core/lib/gpr/alloc.h", - "src/core/lib/gpr/android/log.cc", - "src/core/lib/gpr/atm.cc", - "src/core/lib/gpr/iphone/cpu.cc", - "src/core/lib/gpr/linux/cpu.cc", - "src/core/lib/gpr/linux/log.cc", - "src/core/lib/gpr/log.cc", - "src/core/lib/gpr/msys/tmpfile.cc", - "src/core/lib/gpr/posix/cpu.cc", - "src/core/lib/gpr/posix/log.cc", - "src/core/lib/gpr/posix/string.cc", - "src/core/lib/gpr/posix/sync.cc", - "src/core/lib/gpr/posix/time.cc", - "src/core/lib/gpr/posix/tmpfile.cc", - "src/core/lib/gpr/spinlock.h", - "src/core/lib/gpr/string.cc", - "src/core/lib/gpr/string.h", - "src/core/lib/gpr/sync.cc", - "src/core/lib/gpr/sync_abseil.cc", - "src/core/lib/gpr/time.cc", - "src/core/lib/gpr/time_precise.cc", - "src/core/lib/gpr/time_precise.h", - "src/core/lib/gpr/tmpfile.h", - "src/core/lib/gpr/useful.h", - "src/core/lib/gpr/windows/cpu.cc", - "src/core/lib/gpr/windows/log.cc", - "src/core/lib/gpr/windows/string.cc", - "src/core/lib/gpr/windows/string_util.cc", - "src/core/lib/gpr/windows/sync.cc", - "src/core/lib/gpr/windows/time.cc", - "src/core/lib/gpr/windows/tmpfile.cc", "src/core/lib/gprpp/atomic_utils.h", "src/core/lib/gprpp/bitset.h", "src/core/lib/gprpp/chunked_vector.h", @@ -1956,6 +1924,38 @@ let package = Package( "src/core/tsi/transport_security_grpc.cc", "src/core/tsi/transport_security_grpc.h", "src/core/tsi/transport_security_interface.h", + "src/core/util/alloc.cc", + "src/core/util/alloc.h", + "src/core/util/android/log.cc", + "src/core/util/atm.cc", + "src/core/util/iphone/cpu.cc", + "src/core/util/linux/cpu.cc", + "src/core/util/linux/log.cc", + "src/core/util/log.cc", + "src/core/util/msys/tmpfile.cc", + "src/core/util/posix/cpu.cc", + "src/core/util/posix/log.cc", + "src/core/util/posix/string.cc", + "src/core/util/posix/sync.cc", + "src/core/util/posix/time.cc", + "src/core/util/posix/tmpfile.cc", + "src/core/util/spinlock.h", + "src/core/util/string.cc", + "src/core/util/string.h", + "src/core/util/sync.cc", + "src/core/util/sync_abseil.cc", + "src/core/util/time.cc", + "src/core/util/time_precise.cc", + "src/core/util/time_precise.h", + "src/core/util/tmpfile.h", + "src/core/util/useful.h", + "src/core/util/windows/cpu.cc", + "src/core/util/windows/log.cc", + "src/core/util/windows/string.cc", + "src/core/util/windows/string_util.cc", + "src/core/util/windows/sync.cc", + "src/core/util/windows/time.cc", + "src/core/util/windows/tmpfile.cc", "src/core/xds/grpc/certificate_provider_store.cc", "src/core/xds/grpc/certificate_provider_store.h", "src/core/xds/grpc/file_watcher_certificate_provider_factory.cc", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 6b0439d0fc9..70180718c9d 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -55,11 +55,6 @@ libs: - src/core/lib/config/config_vars.h - src/core/lib/config/load_config.h - src/core/lib/event_engine/thread_local.h - - src/core/lib/gpr/alloc.h - - src/core/lib/gpr/string.h - - src/core/lib/gpr/time_precise.h - - src/core/lib/gpr/tmpfile.h - - src/core/lib/gpr/useful.h - src/core/lib/gprpp/construct_destruct.h - src/core/lib/gprpp/crash.h - src/core/lib/gprpp/debug_location.h @@ -76,37 +71,16 @@ libs: - src/core/lib/gprpp/tchar.h - src/core/lib/gprpp/thd.h - src/core/lib/gprpp/time_util.h + - src/core/util/alloc.h + - src/core/util/string.h + - src/core/util/time_precise.h + - src/core/util/tmpfile.h + - src/core/util/useful.h src: - src/core/lib/config/config_vars.cc - src/core/lib/config/config_vars_non_generated.cc - src/core/lib/config/load_config.cc - src/core/lib/event_engine/thread_local.cc - - src/core/lib/gpr/alloc.cc - - src/core/lib/gpr/android/log.cc - - src/core/lib/gpr/atm.cc - - src/core/lib/gpr/iphone/cpu.cc - - src/core/lib/gpr/linux/cpu.cc - - src/core/lib/gpr/linux/log.cc - - src/core/lib/gpr/log.cc - - src/core/lib/gpr/msys/tmpfile.cc - - src/core/lib/gpr/posix/cpu.cc - - src/core/lib/gpr/posix/log.cc - - src/core/lib/gpr/posix/string.cc - - src/core/lib/gpr/posix/sync.cc - - src/core/lib/gpr/posix/time.cc - - src/core/lib/gpr/posix/tmpfile.cc - - src/core/lib/gpr/string.cc - - src/core/lib/gpr/sync.cc - - src/core/lib/gpr/sync_abseil.cc - - src/core/lib/gpr/time.cc - - src/core/lib/gpr/time_precise.cc - - src/core/lib/gpr/windows/cpu.cc - - src/core/lib/gpr/windows/log.cc - - src/core/lib/gpr/windows/string.cc - - src/core/lib/gpr/windows/string_util.cc - - src/core/lib/gpr/windows/sync.cc - - src/core/lib/gpr/windows/time.cc - - src/core/lib/gpr/windows/tmpfile.cc - src/core/lib/gprpp/crash.cc - src/core/lib/gprpp/examine_stack.cc - src/core/lib/gprpp/fork.cc @@ -122,6 +96,32 @@ libs: - src/core/lib/gprpp/windows/env.cc - src/core/lib/gprpp/windows/stat.cc - src/core/lib/gprpp/windows/thd.cc + - src/core/util/alloc.cc + - src/core/util/android/log.cc + - src/core/util/atm.cc + - src/core/util/iphone/cpu.cc + - src/core/util/linux/cpu.cc + - src/core/util/linux/log.cc + - src/core/util/log.cc + - src/core/util/msys/tmpfile.cc + - src/core/util/posix/cpu.cc + - src/core/util/posix/log.cc + - src/core/util/posix/string.cc + - src/core/util/posix/sync.cc + - src/core/util/posix/time.cc + - src/core/util/posix/tmpfile.cc + - src/core/util/string.cc + - src/core/util/sync.cc + - src/core/util/sync_abseil.cc + - src/core/util/time.cc + - src/core/util/time_precise.cc + - src/core/util/windows/cpu.cc + - src/core/util/windows/log.cc + - src/core/util/windows/string.cc + - src/core/util/windows/string_util.cc + - src/core/util/windows/sync.cc + - src/core/util/windows/time.cc + - src/core/util/windows/tmpfile.cc deps: - absl/base:base - absl/base:core_headers @@ -882,7 +882,6 @@ libs: - src/core/lib/event_engine/work_queue/work_queue.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - - src/core/lib/gpr/spinlock.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/chunked_vector.h @@ -1214,6 +1213,7 @@ libs: - src/core/tsi/transport_security.h - src/core/tsi/transport_security_grpc.h - src/core/tsi/transport_security_interface.h + - src/core/util/spinlock.h - src/core/xds/grpc/certificate_provider_store.h - src/core/xds/grpc/file_watcher_certificate_provider_factory.h - src/core/xds/grpc/upb_utils.h @@ -2420,7 +2420,6 @@ libs: - src/core/lib/event_engine/work_queue/work_queue.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - - src/core/lib/gpr/spinlock.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/chunked_vector.h @@ -2684,6 +2683,7 @@ libs: - src/core/tsi/transport_security.h - src/core/tsi/transport_security_grpc.h - src/core/tsi/transport_security_interface.h + - src/core/util/spinlock.h - third_party/upb/upb/generated_code_support.h - third_party/upb/upb/mini_descriptor/build_enum.h - third_party/upb/upb/mini_descriptor/decode.h @@ -4015,7 +4015,7 @@ libs: language: c++ public_headers: [] headers: - - src/core/lib/gpr/subprocess.h + - src/core/util/subprocess.h - test/core/end2end/data/ssl_test_data.h - test/core/test_util/cmdline.h - test/core/test_util/evaluate_args_test_util.h @@ -4034,8 +4034,8 @@ libs: - test/cpp/util/subprocess.h - test/cpp/util/test_credentials_provider.h src: - - src/core/lib/gpr/subprocess_posix.cc - - src/core/lib/gpr/subprocess_windows.cc + - src/core/util/subprocess_posix.cc + - src/core/util/subprocess_windows.cc - test/core/end2end/data/client_certs.cc - test/core/end2end/data/server1_cert.cc - test/core/end2end/data/server1_key.cc @@ -4510,7 +4510,6 @@ libs: - src/core/lib/event_engine/work_queue/work_queue.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - - src/core/lib/gpr/spinlock.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/chunked_vector.h @@ -4731,6 +4730,7 @@ libs: - src/core/tsi/transport_security.h - src/core/tsi/transport_security_grpc.h - src/core/tsi/transport_security_interface.h + - src/core/util/spinlock.h - third_party/upb/upb/generated_code_support.h - third_party/upb/upb/mini_descriptor/build_enum.h - third_party/upb/upb/mini_descriptor/decode.h @@ -5282,7 +5282,7 @@ targets: build: test language: c++ headers: - - src/core/lib/gpr/subprocess.h + - src/core/util/subprocess.h - test/core/test_util/cmdline.h - test/core/test_util/evaluate_args_test_util.h - test/core/test_util/fuzzer_util.h @@ -5298,8 +5298,8 @@ targets: - test/cpp/util/string_ref_helper.h - test/cpp/util/subprocess.h src: - - src/core/lib/gpr/subprocess_posix.cc - - src/core/lib/gpr/subprocess_windows.cc + - src/core/util/subprocess_posix.cc + - src/core/util/subprocess_windows.cc - test/core/test_util/cmdline.cc - test/core/test_util/fuzzer_util.cc - test/core/test_util/grpc_profiler.cc @@ -5885,7 +5885,7 @@ targets: build: test language: c++ headers: - - src/core/lib/gpr/subprocess.h + - src/core/util/subprocess.h - test/core/end2end/cq_verifier.h - test/core/test_util/cmdline.h - test/core/test_util/evaluate_args_test_util.h @@ -5898,8 +5898,8 @@ targets: - test/core/test_util/slice_splitter.h - test/core/test_util/tracer_util.h src: - - src/core/lib/gpr/subprocess_posix.cc - - src/core/lib/gpr/subprocess_windows.cc + - src/core/util/subprocess_posix.cc + - src/core/util/subprocess_windows.cc - test/core/bad_ssl/bad_ssl_test.cc - test/core/end2end/cq_verifier.cc - test/core/test_util/cmdline.cc @@ -5923,7 +5923,7 @@ targets: build: test language: c++ headers: - - src/core/lib/gpr/subprocess.h + - src/core/util/subprocess.h - test/core/end2end/cq_verifier.h - test/core/test_util/cmdline.h - test/core/test_util/evaluate_args_test_util.h @@ -5936,8 +5936,8 @@ targets: - test/core/test_util/slice_splitter.h - test/core/test_util/tracer_util.h src: - - src/core/lib/gpr/subprocess_posix.cc - - src/core/lib/gpr/subprocess_windows.cc + - src/core/util/subprocess_posix.cc + - src/core/util/subprocess_windows.cc - test/core/bad_ssl/bad_ssl_test.cc - test/core/end2end/cq_verifier.cc - test/core/test_util/cmdline.cc @@ -6236,8 +6236,8 @@ targets: build: test language: c++ headers: - - src/core/lib/gpr/useful.h - src/core/lib/gprpp/bitset.h + - src/core/util/useful.h src: - test/core/gprpp/bitset_test.cc deps: @@ -6373,7 +6373,6 @@ targets: - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - - src/core/lib/gpr/spinlock.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/chunked_vector.h @@ -6439,6 +6438,7 @@ targets: - src/core/lib/transport/simple_slice_based_metadata.h - src/core/lib/transport/status_conversion.h - src/core/lib/transport/timeout_encoding.h + - src/core/util/spinlock.h - test/core/promise/poll_matcher.h - third_party/upb/upb/generated_code_support.h - third_party/upb/upb/mini_descriptor/build_enum.h @@ -7661,7 +7661,6 @@ targets: - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - - src/core/lib/gpr/spinlock.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/chunked_vector.h @@ -7705,6 +7704,7 @@ targets: - src/core/lib/slice/slice_internal.h - src/core/lib/slice/slice_refcount.h - src/core/lib/slice/slice_string_helpers.h + - src/core/util/spinlock.h - third_party/upb/upb/generated_code_support.h - third_party/upb/upb/mini_descriptor/build_enum.h - third_party/upb/upb/mini_descriptor/decode.h @@ -9174,7 +9174,6 @@ targets: - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - - src/core/lib/gpr/spinlock.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/down_cast.h @@ -9202,6 +9201,7 @@ targets: - src/core/lib/slice/slice_internal.h - src/core/lib/slice/slice_refcount.h - src/core/lib/slice/slice_string_helpers.h + - src/core/util/spinlock.h - third_party/upb/upb/generated_code_support.h - third_party/upb/upb/mini_descriptor/build_enum.h - third_party/upb/upb/mini_descriptor/decode.h @@ -9785,7 +9785,6 @@ targets: - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - - src/core/lib/gpr/spinlock.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/cpp_impl_of.h @@ -9830,6 +9829,7 @@ targets: - src/core/lib/slice/slice_string_helpers.h - src/core/lib/transport/bdp_estimator.h - src/core/lib/transport/http2_errors.h + - src/core/util/spinlock.h - third_party/upb/upb/generated_code_support.h - third_party/upb/upb/mini_descriptor/build_enum.h - third_party/upb/upb/mini_descriptor/decode.h @@ -9916,7 +9916,6 @@ targets: - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - - src/core/lib/gpr/spinlock.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/cpp_impl_of.h @@ -9968,6 +9967,7 @@ targets: - src/core/lib/slice/slice_internal.h - src/core/lib/slice/slice_refcount.h - src/core/lib/slice/slice_string_helpers.h + - src/core/util/spinlock.h - test/core/promise/test_wakeup_schedulers.h - third_party/upb/upb/generated_code_support.h - third_party/upb/upb/mini_descriptor/build_enum.h @@ -11669,7 +11669,6 @@ targets: - src/core/lib/event_engine/work_queue/work_queue.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - - src/core/lib/gpr/spinlock.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/chunked_vector.h @@ -11863,6 +11862,7 @@ targets: - src/core/service_config/service_config_call_data.h - src/core/service_config/service_config_parser.h - src/core/tsi/alts/handshaker/transport_security_common_api.h + - src/core/util/spinlock.h - test/core/promise/poll_matcher.h - third_party/upb/upb/generated_code_support.h - third_party/upb/upb/mini_descriptor/build_enum.h @@ -12162,7 +12162,6 @@ targets: - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - - src/core/lib/gpr/spinlock.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/cpp_impl_of.h @@ -12206,6 +12205,7 @@ targets: - src/core/lib/slice/slice_internal.h - src/core/lib/slice/slice_refcount.h - src/core/lib/slice/slice_string_helpers.h + - src/core/util/spinlock.h - test/core/promise/test_context.h - third_party/upb/upb/generated_code_support.h - third_party/upb/upb/mini_descriptor/build_enum.h @@ -12835,7 +12835,6 @@ targets: - src/core/lib/event_engine/event_engine_context.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - - src/core/lib/gpr/spinlock.h - src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/cpp_impl_of.h @@ -12887,6 +12886,7 @@ targets: - src/core/lib/slice/slice_internal.h - src/core/lib/slice/slice_refcount.h - src/core/lib/slice/slice_string_helpers.h + - src/core/util/spinlock.h - test/core/promise/test_wakeup_schedulers.h - third_party/upb/upb/generated_code_support.h - third_party/upb/upb/mini_descriptor/build_enum.h @@ -14076,7 +14076,6 @@ targets: - src/core/lib/debug/trace.h - src/core/lib/experiments/config.h - src/core/lib/experiments/experiments.h - - src/core/lib/gpr/spinlock.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/status_helper.h @@ -14093,6 +14092,7 @@ targets: - src/core/lib/slice/slice_internal.h - src/core/lib/slice/slice_refcount.h - src/core/lib/slice/slice_string_helpers.h + - src/core/util/spinlock.h - third_party/upb/upb/generated_code_support.h - third_party/upb/upb/mini_descriptor/build_enum.h - third_party/upb/upb/mini_descriptor/decode.h @@ -19056,9 +19056,9 @@ targets: build: test language: c++ headers: - - src/core/lib/gpr/useful.h - src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/table.h + - src/core/util/useful.h src: - test/core/gprpp/table_test.cc deps: @@ -20227,8 +20227,8 @@ targets: build: test language: c++ headers: - - src/core/lib/gpr/useful.h - src/core/lib/gprpp/unique_type_name.h + - src/core/util/useful.h src: - test/core/gprpp/unique_type_name_test.cc deps: @@ -20264,7 +20264,7 @@ targets: build: test language: c++ headers: - - src/core/lib/gpr/useful.h + - src/core/util/useful.h src: - test/core/gpr/useful_test.cc deps: diff --git a/config.m4 b/config.m4 index 4b72ff9577e..672e7101589 100644 --- a/config.m4 +++ b/config.m4 @@ -516,32 +516,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/event_engine/work_queue/basic_work_queue.cc \ src/core/lib/experiments/config.cc \ src/core/lib/experiments/experiments.cc \ - src/core/lib/gpr/alloc.cc \ - src/core/lib/gpr/android/log.cc \ - src/core/lib/gpr/atm.cc \ - src/core/lib/gpr/iphone/cpu.cc \ - src/core/lib/gpr/linux/cpu.cc \ - src/core/lib/gpr/linux/log.cc \ - src/core/lib/gpr/log.cc \ - src/core/lib/gpr/msys/tmpfile.cc \ - src/core/lib/gpr/posix/cpu.cc \ - src/core/lib/gpr/posix/log.cc \ - src/core/lib/gpr/posix/string.cc \ - src/core/lib/gpr/posix/sync.cc \ - src/core/lib/gpr/posix/time.cc \ - src/core/lib/gpr/posix/tmpfile.cc \ - src/core/lib/gpr/string.cc \ - src/core/lib/gpr/sync.cc \ - src/core/lib/gpr/sync_abseil.cc \ - src/core/lib/gpr/time.cc \ - src/core/lib/gpr/time_precise.cc \ - src/core/lib/gpr/windows/cpu.cc \ - src/core/lib/gpr/windows/log.cc \ - src/core/lib/gpr/windows/string.cc \ - src/core/lib/gpr/windows/string_util.cc \ - src/core/lib/gpr/windows/sync.cc \ - src/core/lib/gpr/windows/time.cc \ - src/core/lib/gpr/windows/tmpfile.cc \ src/core/lib/gprpp/crash.cc \ src/core/lib/gprpp/examine_stack.cc \ src/core/lib/gprpp/fork.cc \ @@ -860,6 +834,32 @@ if test "$PHP_GRPC" != "no"; then src/core/tsi/ssl_transport_security_utils.cc \ src/core/tsi/transport_security.cc \ src/core/tsi/transport_security_grpc.cc \ + src/core/util/alloc.cc \ + src/core/util/android/log.cc \ + src/core/util/atm.cc \ + src/core/util/iphone/cpu.cc \ + src/core/util/linux/cpu.cc \ + src/core/util/linux/log.cc \ + src/core/util/log.cc \ + src/core/util/msys/tmpfile.cc \ + src/core/util/posix/cpu.cc \ + src/core/util/posix/log.cc \ + src/core/util/posix/string.cc \ + src/core/util/posix/sync.cc \ + src/core/util/posix/time.cc \ + src/core/util/posix/tmpfile.cc \ + src/core/util/string.cc \ + src/core/util/sync.cc \ + src/core/util/sync_abseil.cc \ + src/core/util/time.cc \ + src/core/util/time_precise.cc \ + src/core/util/windows/cpu.cc \ + src/core/util/windows/log.cc \ + src/core/util/windows/string.cc \ + src/core/util/windows/string_util.cc \ + src/core/util/windows/sync.cc \ + src/core/util/windows/time.cc \ + src/core/util/windows/tmpfile.cc \ src/core/xds/grpc/certificate_provider_store.cc \ src/core/xds/grpc/file_watcher_certificate_provider_factory.cc \ src/core/xds/grpc/xds_audit_logger_registry.cc \ @@ -1526,13 +1526,6 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/event_engine/windows) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/event_engine/work_queue) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/experiments) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr/android) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr/iphone) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr/linux) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr/msys) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr/posix) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gpr/windows) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp/linux) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp/posix) @@ -1606,6 +1599,13 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/alts/zero_copy_frame_protector) PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/ssl/key_logging) PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/ssl/session_cache) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/util) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/android) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/iphone) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/linux) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/msys) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/posix) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/windows) PHP_ADD_BUILD_DIR($ext_builddir/src/core/xds/grpc) PHP_ADD_BUILD_DIR($ext_builddir/src/core/xds/xds_client) PHP_ADD_BUILD_DIR($ext_builddir/src/php/ext/grpc) diff --git a/config.w32 b/config.w32 index f71331b6d7d..c430f747c0a 100644 --- a/config.w32 +++ b/config.w32 @@ -481,32 +481,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\event_engine\\work_queue\\basic_work_queue.cc " + "src\\core\\lib\\experiments\\config.cc " + "src\\core\\lib\\experiments\\experiments.cc " + - "src\\core\\lib\\gpr\\alloc.cc " + - "src\\core\\lib\\gpr\\android\\log.cc " + - "src\\core\\lib\\gpr\\atm.cc " + - "src\\core\\lib\\gpr\\iphone\\cpu.cc " + - "src\\core\\lib\\gpr\\linux\\cpu.cc " + - "src\\core\\lib\\gpr\\linux\\log.cc " + - "src\\core\\lib\\gpr\\log.cc " + - "src\\core\\lib\\gpr\\msys\\tmpfile.cc " + - "src\\core\\lib\\gpr\\posix\\cpu.cc " + - "src\\core\\lib\\gpr\\posix\\log.cc " + - "src\\core\\lib\\gpr\\posix\\string.cc " + - "src\\core\\lib\\gpr\\posix\\sync.cc " + - "src\\core\\lib\\gpr\\posix\\time.cc " + - "src\\core\\lib\\gpr\\posix\\tmpfile.cc " + - "src\\core\\lib\\gpr\\string.cc " + - "src\\core\\lib\\gpr\\sync.cc " + - "src\\core\\lib\\gpr\\sync_abseil.cc " + - "src\\core\\lib\\gpr\\time.cc " + - "src\\core\\lib\\gpr\\time_precise.cc " + - "src\\core\\lib\\gpr\\windows\\cpu.cc " + - "src\\core\\lib\\gpr\\windows\\log.cc " + - "src\\core\\lib\\gpr\\windows\\string.cc " + - "src\\core\\lib\\gpr\\windows\\string_util.cc " + - "src\\core\\lib\\gpr\\windows\\sync.cc " + - "src\\core\\lib\\gpr\\windows\\time.cc " + - "src\\core\\lib\\gpr\\windows\\tmpfile.cc " + "src\\core\\lib\\gprpp\\crash.cc " + "src\\core\\lib\\gprpp\\examine_stack.cc " + "src\\core\\lib\\gprpp\\fork.cc " + @@ -825,6 +799,32 @@ if (PHP_GRPC != "no") { "src\\core\\tsi\\ssl_transport_security_utils.cc " + "src\\core\\tsi\\transport_security.cc " + "src\\core\\tsi\\transport_security_grpc.cc " + + "src\\core\\util\\alloc.cc " + + "src\\core\\util\\android\\log.cc " + + "src\\core\\util\\atm.cc " + + "src\\core\\util\\iphone\\cpu.cc " + + "src\\core\\util\\linux\\cpu.cc " + + "src\\core\\util\\linux\\log.cc " + + "src\\core\\util\\log.cc " + + "src\\core\\util\\msys\\tmpfile.cc " + + "src\\core\\util\\posix\\cpu.cc " + + "src\\core\\util\\posix\\log.cc " + + "src\\core\\util\\posix\\string.cc " + + "src\\core\\util\\posix\\sync.cc " + + "src\\core\\util\\posix\\time.cc " + + "src\\core\\util\\posix\\tmpfile.cc " + + "src\\core\\util\\string.cc " + + "src\\core\\util\\sync.cc " + + "src\\core\\util\\sync_abseil.cc " + + "src\\core\\util\\time.cc " + + "src\\core\\util\\time_precise.cc " + + "src\\core\\util\\windows\\cpu.cc " + + "src\\core\\util\\windows\\log.cc " + + "src\\core\\util\\windows\\string.cc " + + "src\\core\\util\\windows\\string_util.cc " + + "src\\core\\util\\windows\\sync.cc " + + "src\\core\\util\\windows\\time.cc " + + "src\\core\\util\\windows\\tmpfile.cc " + "src\\core\\xds\\grpc\\certificate_provider_store.cc " + "src\\core\\xds\\grpc\\file_watcher_certificate_provider_factory.cc " + "src\\core\\xds\\grpc\\xds_audit_logger_registry.cc " + @@ -1663,13 +1663,6 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\event_engine\\windows"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\event_engine\\work_queue"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\experiments"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr\\android"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr\\iphone"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr\\linux"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr\\msys"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr\\posix"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gpr\\windows"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp\\linux"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp\\posix"); @@ -1746,6 +1739,13 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl\\key_logging"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl\\session_cache"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\android"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\iphone"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\linux"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\msys"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\posix"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\windows"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\xds"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\xds\\grpc"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\xds\\xds_client"); diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 530f61b07aa..457103324f9 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -964,12 +964,6 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/work_queue/work_queue.h', 'src/core/lib/experiments/config.h', 'src/core/lib/experiments/experiments.h', - 'src/core/lib/gpr/alloc.h', - 'src/core/lib/gpr/spinlock.h', - 'src/core/lib/gpr/string.h', - 'src/core/lib/gpr/time_precise.h', - 'src/core/lib/gpr/tmpfile.h', - 'src/core/lib/gpr/useful.h', 'src/core/lib/gprpp/atomic_utils.h', 'src/core/lib/gprpp/bitset.h', 'src/core/lib/gprpp/chunked_vector.h', @@ -1317,6 +1311,12 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_grpc.h', 'src/core/tsi/transport_security_interface.h', + 'src/core/util/alloc.h', + 'src/core/util/spinlock.h', + 'src/core/util/string.h', + 'src/core/util/time_precise.h', + 'src/core/util/tmpfile.h', + 'src/core/util/useful.h', 'src/core/xds/grpc/certificate_provider_store.h', 'src/core/xds/grpc/file_watcher_certificate_provider_factory.h', 'src/core/xds/grpc/upb_utils.h', @@ -2235,12 +2235,6 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/work_queue/work_queue.h', 'src/core/lib/experiments/config.h', 'src/core/lib/experiments/experiments.h', - 'src/core/lib/gpr/alloc.h', - 'src/core/lib/gpr/spinlock.h', - 'src/core/lib/gpr/string.h', - 'src/core/lib/gpr/time_precise.h', - 'src/core/lib/gpr/tmpfile.h', - 'src/core/lib/gpr/useful.h', 'src/core/lib/gprpp/atomic_utils.h', 'src/core/lib/gprpp/bitset.h', 'src/core/lib/gprpp/chunked_vector.h', @@ -2588,6 +2582,12 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_grpc.h', 'src/core/tsi/transport_security_interface.h', + 'src/core/util/alloc.h', + 'src/core/util/spinlock.h', + 'src/core/util/string.h', + 'src/core/util/time_precise.h', + 'src/core/util/tmpfile.h', + 'src/core/util/useful.h', 'src/core/xds/grpc/certificate_provider_store.h', 'src/core/xds/grpc/file_watcher_certificate_provider_factory.h', 'src/core/xds/grpc/upb_utils.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index baff363da6c..2d2af17efc5 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -82,7 +82,7 @@ Pod::Spec.new do |s| ' "$(PODS_TARGET_SRCROOT)/third_party/utf8_range"'\ ' "$(PODS_TARGET_SRCROOT)/third_party/xxhash"', # If we don't set these two settings, `include/grpc/support/time.h` and - # `src/core/lib/gpr/string.h` shadow the system `` and ``, breaking the + # `src/core/util/string.h` shadow the system `` and ``, breaking the # build. 'USE_HEADERMAP' => 'NO', 'ALWAYS_SEARCH_USER_PATHS' => 'NO', @@ -1374,38 +1374,6 @@ Pod::Spec.new do |s| 'src/core/lib/experiments/config.h', 'src/core/lib/experiments/experiments.cc', 'src/core/lib/experiments/experiments.h', - 'src/core/lib/gpr/alloc.cc', - 'src/core/lib/gpr/alloc.h', - 'src/core/lib/gpr/android/log.cc', - 'src/core/lib/gpr/atm.cc', - 'src/core/lib/gpr/iphone/cpu.cc', - 'src/core/lib/gpr/linux/cpu.cc', - 'src/core/lib/gpr/linux/log.cc', - 'src/core/lib/gpr/log.cc', - 'src/core/lib/gpr/msys/tmpfile.cc', - 'src/core/lib/gpr/posix/cpu.cc', - 'src/core/lib/gpr/posix/log.cc', - 'src/core/lib/gpr/posix/string.cc', - 'src/core/lib/gpr/posix/sync.cc', - 'src/core/lib/gpr/posix/time.cc', - 'src/core/lib/gpr/posix/tmpfile.cc', - 'src/core/lib/gpr/spinlock.h', - 'src/core/lib/gpr/string.cc', - 'src/core/lib/gpr/string.h', - 'src/core/lib/gpr/sync.cc', - 'src/core/lib/gpr/sync_abseil.cc', - 'src/core/lib/gpr/time.cc', - 'src/core/lib/gpr/time_precise.cc', - 'src/core/lib/gpr/time_precise.h', - 'src/core/lib/gpr/tmpfile.h', - 'src/core/lib/gpr/useful.h', - 'src/core/lib/gpr/windows/cpu.cc', - 'src/core/lib/gpr/windows/log.cc', - 'src/core/lib/gpr/windows/string.cc', - 'src/core/lib/gpr/windows/string_util.cc', - 'src/core/lib/gpr/windows/sync.cc', - 'src/core/lib/gpr/windows/time.cc', - 'src/core/lib/gpr/windows/tmpfile.cc', 'src/core/lib/gprpp/atomic_utils.h', 'src/core/lib/gprpp/bitset.h', 'src/core/lib/gprpp/chunked_vector.h', @@ -2071,6 +2039,38 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security_grpc.cc', 'src/core/tsi/transport_security_grpc.h', 'src/core/tsi/transport_security_interface.h', + 'src/core/util/alloc.cc', + 'src/core/util/alloc.h', + 'src/core/util/android/log.cc', + 'src/core/util/atm.cc', + 'src/core/util/iphone/cpu.cc', + 'src/core/util/linux/cpu.cc', + 'src/core/util/linux/log.cc', + 'src/core/util/log.cc', + 'src/core/util/msys/tmpfile.cc', + 'src/core/util/posix/cpu.cc', + 'src/core/util/posix/log.cc', + 'src/core/util/posix/string.cc', + 'src/core/util/posix/sync.cc', + 'src/core/util/posix/time.cc', + 'src/core/util/posix/tmpfile.cc', + 'src/core/util/spinlock.h', + 'src/core/util/string.cc', + 'src/core/util/string.h', + 'src/core/util/sync.cc', + 'src/core/util/sync_abseil.cc', + 'src/core/util/time.cc', + 'src/core/util/time_precise.cc', + 'src/core/util/time_precise.h', + 'src/core/util/tmpfile.h', + 'src/core/util/useful.h', + 'src/core/util/windows/cpu.cc', + 'src/core/util/windows/log.cc', + 'src/core/util/windows/string.cc', + 'src/core/util/windows/string_util.cc', + 'src/core/util/windows/sync.cc', + 'src/core/util/windows/time.cc', + 'src/core/util/windows/tmpfile.cc', 'src/core/xds/grpc/certificate_provider_store.cc', 'src/core/xds/grpc/certificate_provider_store.h', 'src/core/xds/grpc/file_watcher_certificate_provider_factory.cc', @@ -3015,12 +3015,6 @@ Pod::Spec.new do |s| 'src/core/lib/event_engine/work_queue/work_queue.h', 'src/core/lib/experiments/config.h', 'src/core/lib/experiments/experiments.h', - 'src/core/lib/gpr/alloc.h', - 'src/core/lib/gpr/spinlock.h', - 'src/core/lib/gpr/string.h', - 'src/core/lib/gpr/time_precise.h', - 'src/core/lib/gpr/tmpfile.h', - 'src/core/lib/gpr/useful.h', 'src/core/lib/gprpp/atomic_utils.h', 'src/core/lib/gprpp/bitset.h', 'src/core/lib/gprpp/chunked_vector.h', @@ -3368,6 +3362,12 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_grpc.h', 'src/core/tsi/transport_security_interface.h', + 'src/core/util/alloc.h', + 'src/core/util/spinlock.h', + 'src/core/util/string.h', + 'src/core/util/time_precise.h', + 'src/core/util/tmpfile.h', + 'src/core/util/useful.h', 'src/core/xds/grpc/certificate_provider_store.h', 'src/core/xds/grpc/file_watcher_certificate_provider_factory.h', 'src/core/xds/grpc/upb_utils.h', diff --git a/grpc.gemspec b/grpc.gemspec index 4a58496ff43..7104853d64f 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -1261,38 +1261,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/experiments/config.h ) s.files += %w( src/core/lib/experiments/experiments.cc ) s.files += %w( src/core/lib/experiments/experiments.h ) - s.files += %w( src/core/lib/gpr/alloc.cc ) - s.files += %w( src/core/lib/gpr/alloc.h ) - s.files += %w( src/core/lib/gpr/android/log.cc ) - s.files += %w( src/core/lib/gpr/atm.cc ) - s.files += %w( src/core/lib/gpr/iphone/cpu.cc ) - s.files += %w( src/core/lib/gpr/linux/cpu.cc ) - s.files += %w( src/core/lib/gpr/linux/log.cc ) - s.files += %w( src/core/lib/gpr/log.cc ) - s.files += %w( src/core/lib/gpr/msys/tmpfile.cc ) - s.files += %w( src/core/lib/gpr/posix/cpu.cc ) - s.files += %w( src/core/lib/gpr/posix/log.cc ) - s.files += %w( src/core/lib/gpr/posix/string.cc ) - s.files += %w( src/core/lib/gpr/posix/sync.cc ) - s.files += %w( src/core/lib/gpr/posix/time.cc ) - s.files += %w( src/core/lib/gpr/posix/tmpfile.cc ) - s.files += %w( src/core/lib/gpr/spinlock.h ) - s.files += %w( src/core/lib/gpr/string.cc ) - s.files += %w( src/core/lib/gpr/string.h ) - s.files += %w( src/core/lib/gpr/sync.cc ) - s.files += %w( src/core/lib/gpr/sync_abseil.cc ) - s.files += %w( src/core/lib/gpr/time.cc ) - s.files += %w( src/core/lib/gpr/time_precise.cc ) - s.files += %w( src/core/lib/gpr/time_precise.h ) - s.files += %w( src/core/lib/gpr/tmpfile.h ) - s.files += %w( src/core/lib/gpr/useful.h ) - s.files += %w( src/core/lib/gpr/windows/cpu.cc ) - s.files += %w( src/core/lib/gpr/windows/log.cc ) - s.files += %w( src/core/lib/gpr/windows/string.cc ) - s.files += %w( src/core/lib/gpr/windows/string_util.cc ) - s.files += %w( src/core/lib/gpr/windows/sync.cc ) - s.files += %w( src/core/lib/gpr/windows/time.cc ) - s.files += %w( src/core/lib/gpr/windows/tmpfile.cc ) s.files += %w( src/core/lib/gprpp/atomic_utils.h ) s.files += %w( src/core/lib/gprpp/bitset.h ) s.files += %w( src/core/lib/gprpp/chunked_vector.h ) @@ -1958,6 +1926,38 @@ Gem::Specification.new do |s| s.files += %w( src/core/tsi/transport_security_grpc.cc ) s.files += %w( src/core/tsi/transport_security_grpc.h ) s.files += %w( src/core/tsi/transport_security_interface.h ) + s.files += %w( src/core/util/alloc.cc ) + s.files += %w( src/core/util/alloc.h ) + s.files += %w( src/core/util/android/log.cc ) + s.files += %w( src/core/util/atm.cc ) + s.files += %w( src/core/util/iphone/cpu.cc ) + s.files += %w( src/core/util/linux/cpu.cc ) + s.files += %w( src/core/util/linux/log.cc ) + s.files += %w( src/core/util/log.cc ) + s.files += %w( src/core/util/msys/tmpfile.cc ) + s.files += %w( src/core/util/posix/cpu.cc ) + s.files += %w( src/core/util/posix/log.cc ) + s.files += %w( src/core/util/posix/string.cc ) + s.files += %w( src/core/util/posix/sync.cc ) + s.files += %w( src/core/util/posix/time.cc ) + s.files += %w( src/core/util/posix/tmpfile.cc ) + s.files += %w( src/core/util/spinlock.h ) + s.files += %w( src/core/util/string.cc ) + s.files += %w( src/core/util/string.h ) + s.files += %w( src/core/util/sync.cc ) + s.files += %w( src/core/util/sync_abseil.cc ) + s.files += %w( src/core/util/time.cc ) + s.files += %w( src/core/util/time_precise.cc ) + s.files += %w( src/core/util/time_precise.h ) + s.files += %w( src/core/util/tmpfile.h ) + s.files += %w( src/core/util/useful.h ) + s.files += %w( src/core/util/windows/cpu.cc ) + s.files += %w( src/core/util/windows/log.cc ) + s.files += %w( src/core/util/windows/string.cc ) + s.files += %w( src/core/util/windows/string_util.cc ) + s.files += %w( src/core/util/windows/sync.cc ) + s.files += %w( src/core/util/windows/time.cc ) + s.files += %w( src/core/util/windows/tmpfile.cc ) s.files += %w( src/core/xds/grpc/certificate_provider_store.cc ) s.files += %w( src/core/xds/grpc/certificate_provider_store.h ) s.files += %w( src/core/xds/grpc/file_watcher_certificate_provider_factory.cc ) diff --git a/package.xml b/package.xml index 44f87605fa6..3cd01a87805 100644 --- a/package.xml +++ b/package.xml @@ -1243,38 +1243,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1940,6 +1908,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/core/BUILD b/src/core/BUILD index a9580c2aaa6..53457328bfd 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -238,7 +238,7 @@ grpc_cc_library( grpc_cc_library( name = "useful", - hdrs = ["lib/gpr/useful.h"], + hdrs = ["util/useful.h"], external_deps = [ "absl/strings", "absl/types:variant", @@ -263,7 +263,7 @@ grpc_cc_library( grpc_cc_library( name = "gpr_atm", srcs = [ - "lib/gpr/atm.cc", + "util/atm.cc", ], language = "c++", public_hdrs = [ @@ -299,7 +299,7 @@ grpc_cc_library( name = "gpr_spinlock", srcs = [], hdrs = [ - "lib/gpr/spinlock.h", + "util/spinlock.h", ], language = "c++", deps = [ diff --git a/src/core/channelz/channel_trace.cc b/src/core/channelz/channel_trace.cc index 60b0a937c96..6e6884cd703 100644 --- a/src/core/channelz/channel_trace.cc +++ b/src/core/channelz/channel_trace.cc @@ -28,10 +28,10 @@ #include #include "src/core/channelz/channelz.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/util/string.h" namespace grpc_core { namespace channelz { diff --git a/src/core/channelz/channelz.cc b/src/core/channelz/channelz.cc index 728976cb678..699ee188af6 100644 --- a/src/core/channelz/channelz.cc +++ b/src/core/channelz/channelz.cc @@ -37,12 +37,12 @@ #include "src/core/lib/address_utils/parse_address.h" #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/resolved_address.h" #include "src/core/lib/json/json_writer.h" #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/uri/uri_parser.h" +#include "src/core/util/string.h" +#include "src/core/util/useful.h" namespace grpc_core { namespace channelz { diff --git a/src/core/channelz/channelz.h b/src/core/channelz/channelz.h index 437c3f8d36e..5ecf702c845 100644 --- a/src/core/channelz/channelz.h +++ b/src/core/channelz/channelz.h @@ -38,13 +38,13 @@ #include #include "src/core/channelz/channel_trace.h" -#include "src/core/lib/gpr/time_precise.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/per_cpu.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/json/json.h" +#include "src/core/util/time_precise.h" +#include "src/core/util/useful.h" // Channel arg key for channelz node. #define GRPC_ARG_CHANNELZ_CHANNEL_NODE "grpc.internal.channelz_channel_node" diff --git a/src/core/client_channel/client_channel_filter.cc b/src/core/client_channel/client_channel_filter.cc index 1ffcfb5e4ca..10918a8cba7 100644 --- a/src/core/client_channel/client_channel_filter.cc +++ b/src/core/client_channel/client_channel_filter.cc @@ -68,7 +68,6 @@ #include "src/core/lib/config/core_configuration.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/manual_constructor.h" @@ -104,6 +103,7 @@ #include "src/core/resolver/resolver_registry.h" #include "src/core/service_config/service_config_call_data.h" #include "src/core/service_config/service_config_impl.h" +#include "src/core/util/useful.h" // // Client channel filter diff --git a/src/core/client_channel/client_channel_filter.h b/src/core/client_channel/client_channel_filter.h index 28c21d3280c..9e11e12d223 100644 --- a/src/core/client_channel/client_channel_filter.h +++ b/src/core/client_channel/client_channel_filter.h @@ -48,7 +48,6 @@ #include "src/core/lib/channel/channel_fwd.h" #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/context.h" -#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" @@ -71,6 +70,7 @@ #include "src/core/load_balancing/lb_policy.h" #include "src/core/resolver/resolver.h" #include "src/core/service_config/service_config.h" +#include "src/core/util/time_precise.h" // // Client channel filter diff --git a/src/core/client_channel/config_selector.cc b/src/core/client_channel/config_selector.cc index 2cba7a1a215..9264e4c1618 100644 --- a/src/core/client_channel/config_selector.cc +++ b/src/core/client_channel/config_selector.cc @@ -19,7 +19,7 @@ #include "src/core/client_channel/config_selector.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/client_channel/config_selector.h b/src/core/client_channel/config_selector.h index c6067e44f3b..0a0a6d54c80 100644 --- a/src/core/client_channel/config_selector.h +++ b/src/core/client_channel/config_selector.h @@ -33,13 +33,13 @@ #include "src/core/client_channel/client_channel_internal.h" #include "src/core/lib/channel/channel_fwd.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/resource_quota/arena.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/service_config/service_config.h" +#include "src/core/util/useful.h" // Channel arg key for ConfigSelector. #define GRPC_ARG_CONFIG_SELECTOR "grpc.internal.config_selector" diff --git a/src/core/client_channel/dynamic_filters.cc b/src/core/client_channel/dynamic_filters.cc index ce51dd2b2c2..a9c0f2cd4ff 100644 --- a/src/core/client_channel/dynamic_filters.cc +++ b/src/core/client_channel/dynamic_filters.cc @@ -32,10 +32,10 @@ #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack_builder_impl.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/alloc.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/surface/channel_stack_type.h" #include "src/core/lib/surface/lame_client.h" +#include "src/core/util/alloc.h" // Conversion between call and call stack. #define CALL_TO_CALL_STACK(call) \ diff --git a/src/core/client_channel/dynamic_filters.h b/src/core/client_channel/dynamic_filters.h index 5db94fa672f..d6aa9b4cf7e 100644 --- a/src/core/client_channel/dynamic_filters.h +++ b/src/core/client_channel/dynamic_filters.h @@ -28,7 +28,6 @@ #include "src/core/lib/channel/channel_fwd.h" #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/context.h" -#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" @@ -39,6 +38,7 @@ #include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/resource_quota/arena.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/time_precise.h" namespace grpc_core { diff --git a/src/core/client_channel/retry_filter.h b/src/core/client_channel/retry_filter.h index 4730015ecdb..0da23f845b2 100644 --- a/src/core/client_channel/retry_filter.h +++ b/src/core/client_channel/retry_filter.h @@ -40,10 +40,10 @@ #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/context.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/useful.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; 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 dffd5ddb4e2..8f1d48d48ae 100644 --- a/src/core/client_channel/retry_filter_legacy_call_data.cc +++ b/src/core/client_channel/retry_filter_legacy_call_data.cc @@ -35,7 +35,6 @@ #include "src/core/lib/channel/context.h" #include "src/core/lib/channel/status_util.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/construct_destruct.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/orphanable.h" @@ -54,6 +53,7 @@ #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/client_channel/subchannel.cc b/src/core/client_channel/subchannel.cc index e8ef1f5e861..f61ad752a9e 100644 --- a/src/core/client_channel/subchannel.cc +++ b/src/core/client_channel/subchannel.cc @@ -51,8 +51,6 @@ #include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats_data.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/alloc.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/status_helper.h" @@ -68,6 +66,8 @@ #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/alloc.h" +#include "src/core/util/useful.h" // Backoff parameters. #define GRPC_SUBCHANNEL_INITIAL_CONNECT_BACKOFF_SECONDS 1 diff --git a/src/core/client_channel/subchannel.h b/src/core/client_channel/subchannel.h index 6fbe389da5c..f59a3810208 100644 --- a/src/core/client_channel/subchannel.h +++ b/src/core/client_channel/subchannel.h @@ -37,7 +37,6 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_fwd.h" #include "src/core/lib/channel/context.h" -#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/dual_ref_counted.h" #include "src/core/lib/gprpp/orphanable.h" @@ -59,6 +58,7 @@ #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/time_precise.h" namespace grpc_core { diff --git a/src/core/client_channel/subchannel_pool_interface.h b/src/core/client_channel/subchannel_pool_interface.h index fa8e828c393..6c02214ccdc 100644 --- a/src/core/client_channel/subchannel_pool_interface.h +++ b/src/core/client_channel/subchannel_pool_interface.h @@ -27,10 +27,10 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/iomgr/resolved_address.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/client_channel/subchannel_stream_client.cc b/src/core/client_channel/subchannel_stream_client.cc index 89f4fd9e05d..2ee082ef1fa 100644 --- a/src/core/client_channel/subchannel_stream_client.cc +++ b/src/core/client_channel/subchannel_stream_client.cc @@ -29,7 +29,6 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/sync.h" @@ -37,6 +36,7 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/resource_quota/resource_quota.h" #include "src/core/lib/transport/error_utils.h" +#include "src/core/util/time_precise.h" #define SUBCHANNEL_STREAM_INITIAL_CONNECT_BACKOFF_SECONDS 1 #define SUBCHANNEL_STREAM_RECONNECT_BACKOFF_MULTIPLIER 1.6 diff --git a/src/core/ext/transport/chttp2/alpn/alpn.cc b/src/core/ext/transport/chttp2/alpn/alpn.cc index 70f576a4448..cb9c2d6e34d 100644 --- a/src/core/ext/transport/chttp2/alpn/alpn.cc +++ b/src/core/ext/transport/chttp2/alpn/alpn.cc @@ -23,7 +23,7 @@ #include #include -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" // in order of preference static const char* const supported_versions[] = {"h2"}; diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 4acd9b51b3f..10f1a35a946 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -80,8 +80,6 @@ #include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats_data.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/bitset.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/debug_location.h" @@ -110,6 +108,8 @@ #include "src/core/lib/transport/metadata_info.h" #include "src/core/lib/transport/status_conversion.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/string.h" +#include "src/core/util/useful.h" #ifdef GRPC_POSIX_SOCKET_TCP #include "src/core/lib/iomgr/ev_posix.h" diff --git a/src/core/ext/transport/chttp2/transport/flow_control.cc b/src/core/ext/transport/chttp2/transport/flow_control.cc index b7dbdb2f0a5..ea633e03a88 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.cc +++ b/src/core/ext/transport/chttp2/transport/flow_control.cc @@ -37,8 +37,8 @@ #include "src/core/ext/transport/chttp2/transport/http2_settings.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/resource_quota/memory_quota.h" +#include "src/core/util/useful.h" grpc_core::TraceFlag grpc_flowctl_trace(false, "flowctl"); diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.cc b/src/core/ext/transport/chttp2/transport/frame_settings.cc index eb3343d0c3d..2d8227057ad 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.cc +++ b/src/core/ext/transport/chttp2/transport/frame_settings.cc @@ -37,10 +37,10 @@ #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" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/slice/slice.h" +#include "src/core/util/useful.h" static uint8_t* fill_header(uint8_t* out, uint32_t length, uint8_t flags) { *out++ = static_cast(length >> 16); diff --git a/src/core/ext/transport/chttp2/transport/http2_settings.cc b/src/core/ext/transport/chttp2/transport/http2_settings.cc index b3a6ab25417..ac9c1553301 100644 --- a/src/core/ext/transport/chttp2/transport/http2_settings.cc +++ b/src/core/ext/transport/chttp2/transport/http2_settings.cc @@ -25,8 +25,8 @@ #include #include "src/core/ext/transport/chttp2/transport/frame.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/transport/http2_errors.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/ext/transport/chttp2/transport/http2_settings.h b/src/core/ext/transport/chttp2/transport/http2_settings.h index 8d65aa91085..b5debf96c7e 100644 --- a/src/core/ext/transport/chttp2/transport/http2_settings.h +++ b/src/core/ext/transport/chttp2/transport/http2_settings.h @@ -28,8 +28,8 @@ #include #include "src/core/ext/transport/chttp2/transport/frame.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/transport/http2_errors.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index e9962375b62..6b99d9deee8 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -59,7 +59,6 @@ #include "src/core/lib/debug/stats_data.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/match.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" @@ -73,6 +72,7 @@ #include "src/core/lib/transport/http2_errors.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/useful.h" // IWYU pragma: no_include "src/core/lib/gprpp/orphanable.h" diff --git a/src/core/handshaker/http_connect/http_connect_handshaker.cc b/src/core/handshaker/http_connect/http_connect_handshaker.cc index f8494e6cde1..32d218e06ea 100644 --- a/src/core/handshaker/http_connect/http_connect_handshaker.cc +++ b/src/core/handshaker/http_connect/http_connect_handshaker.cc @@ -41,7 +41,6 @@ #include "src/core/handshaker/handshaker_registry.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" @@ -53,6 +52,7 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/iomgr_fwd.h" #include "src/core/lib/iomgr/tcp_server.h" +#include "src/core/util/string.h" namespace grpc_core { diff --git a/src/core/handshaker/http_connect/http_proxy_mapper.cc b/src/core/handshaker/http_connect/http_proxy_mapper.cc index 5b150619e59..677c9ffa9a4 100644 --- a/src/core/handshaker/http_connect/http_proxy_mapper.cc +++ b/src/core/handshaker/http_connect/http_proxy_mapper.cc @@ -47,12 +47,12 @@ #include "src/core/lib/address_utils/parse_address.h" #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/uri/uri_parser.h" +#include "src/core/util/string.h" namespace grpc_core { namespace { diff --git a/src/core/handshaker/security/secure_endpoint.cc b/src/core/handshaker/security/secure_endpoint.cc index d020d56ebd2..922b111cab4 100644 --- a/src/core/handshaker/security/secure_endpoint.cc +++ b/src/core/handshaker/security/secure_endpoint.cc @@ -42,7 +42,6 @@ #include "src/core/handshaker/security/tsi_error.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" @@ -58,6 +57,7 @@ #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/tsi/transport_security_grpc.h" #include "src/core/tsi/transport_security_interface.h" +#include "src/core/util/string.h" #define STAGING_BUFFER_SIZE 8192 diff --git a/src/core/lib/address_utils/parse_address.cc b/src/core/lib/address_utils/parse_address.cc index 62d4839b6e3..0bdd541adfa 100644 --- a/src/core/lib/address_utils/parse_address.cc +++ b/src/core/lib/address_utils/parse_address.cc @@ -49,12 +49,12 @@ #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/iomgr/grpc_if_nametoindex.h" #include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/socket_utils.h" +#include "src/core/util/string.h" // IWYU pragma: no_include diff --git a/src/core/lib/avl/avl.h b/src/core/lib/avl/avl.h index e8b9539bee2..928db42ac93 100644 --- a/src/core/lib/avl/avl.h +++ b/src/core/lib/avl/avl.h @@ -23,9 +23,9 @@ #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/lib/channel/channel_args.cc b/src/core/lib/channel/channel_args.cc index f34408512c9..1e63ae38f9e 100644 --- a/src/core/lib/channel/channel_args.cc +++ b/src/core/lib/channel/channel_args.cc @@ -40,7 +40,7 @@ #include #include -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/lib/channel/channel_args.h b/src/core/lib/channel/channel_args.h index 97197f43715..31e0430a7c6 100644 --- a/src/core/lib/channel/channel_args.h +++ b/src/core/lib/channel/channel_args.h @@ -38,7 +38,6 @@ #include #include "src/core/lib/avl/avl.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/dual_ref_counted.h" #include "src/core/lib/gprpp/ref_counted.h" @@ -46,6 +45,7 @@ #include "src/core/lib/gprpp/ref_counted_string.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/surface/channel_stack_type.h" +#include "src/core/util/useful.h" // TODO(hork): When we're ready to allow setting via a channel arg from the // application, replace this with a macro in diff --git a/src/core/lib/channel/channel_stack.cc b/src/core/lib/channel/channel_stack.cc index c428bac0006..0a4dd15607a 100644 --- a/src/core/lib/channel/channel_stack.cc +++ b/src/core/lib/channel/channel_stack.cc @@ -31,8 +31,8 @@ #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/gpr/alloc.h" #include "src/core/lib/surface/channel_init.h" +#include "src/core/util/alloc.h" using grpc_event_engine::experimental::EventEngine; diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h index 030173fcd31..10b326e88d3 100644 --- a/src/core/lib/channel/channel_stack.h +++ b/src/core/lib/channel/channel_stack.h @@ -62,7 +62,6 @@ #include "src/core/lib/channel/context.h" #include "src/core/lib/channel/metrics.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gprpp/manual_constructor.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/time.h" @@ -74,6 +73,7 @@ #include "src/core/lib/resource_quota/arena.h" #include "src/core/lib/transport/call_final_info.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/time_precise.h" struct grpc_channel_element_args { grpc_channel_stack* channel_stack; diff --git a/src/core/lib/channel/connected_channel.cc b/src/core/lib/channel/connected_channel.cc index 48d8b7f25a7..bf6fe94471b 100644 --- a/src/core/lib/channel/connected_channel.cc +++ b/src/core/lib/channel/connected_channel.cc @@ -44,7 +44,6 @@ #include "src/core/lib/config/core_configuration.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/alloc.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" @@ -79,6 +78,7 @@ #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/alloc.h" typedef struct connected_channel_channel_data { grpc_core::Transport* transport; diff --git a/src/core/lib/channel/status_util.cc b/src/core/lib/channel/status_util.cc index f846e360edf..7c78ac5504a 100644 --- a/src/core/lib/channel/status_util.cc +++ b/src/core/lib/channel/status_util.cc @@ -27,7 +27,7 @@ #include -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" struct status_string_entry { const char* str; diff --git a/src/core/lib/compression/compression.cc b/src/core/lib/compression/compression.cc index c03c882fb9c..d3aa8878466 100644 --- a/src/core/lib/compression/compression.cc +++ b/src/core/lib/compression/compression.cc @@ -28,9 +28,9 @@ #include "src/core/lib/compression/compression_internal.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/surface/api_trace.h" +#include "src/core/util/useful.h" int grpc_compression_algorithm_is_message(grpc_compression_algorithm) { return 1; diff --git a/src/core/lib/debug/event_log.h b/src/core/lib/debug/event_log.h index 8e36b8869b4..dd8aa07aa3d 100644 --- a/src/core/lib/debug/event_log.h +++ b/src/core/lib/debug/event_log.h @@ -27,9 +27,9 @@ #include -#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gprpp/per_cpu.h" #include "src/core/lib/gprpp/sync.h" +#include "src/core/util/time_precise.h" namespace grpc_core { diff --git a/src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.cc b/src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.cc index 344471564e1..4e0f66fc1f7 100644 --- a/src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.cc +++ b/src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.cc @@ -34,8 +34,8 @@ #include "absl/strings/str_format.h" #include "src/core/lib/event_engine/posix_engine/native_posix_dns_resolver.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/host_port.h" +#include "src/core/util/useful.h" namespace grpc_event_engine { namespace experimental { 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 e4d5deb73dc..189866faa73 100644 --- a/src/core/lib/event_engine/posix_engine/posix_engine.cc +++ b/src/core/lib/event_engine/posix_engine/posix_engine.cc @@ -51,10 +51,10 @@ #include "src/core/lib/event_engine/tcp_socket_utils.h" #include "src/core/lib/event_engine/trace.h" #include "src/core/lib/event_engine/utils.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/no_destruct.h" #include "src/core/lib/gprpp/sync.h" +#include "src/core/util/useful.h" #ifdef GRPC_POSIX_SOCKET_TCP #include // IWYU pragma: keep diff --git a/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc b/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc index 4fd73bc80cc..d2cf5f6f426 100644 --- a/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +++ b/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc @@ -27,10 +27,10 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" // IWYU pragma: keep #include "src/core/lib/gprpp/time.h" #include "src/core/lib/iomgr/port.h" +#include "src/core/util/useful.h" #ifdef GRPC_POSIX_SOCKET_UTILS_COMMON #include // IWYU pragma: keep diff --git a/src/core/lib/event_engine/posix_engine/timer.cc b/src/core/lib/event_engine/posix_engine/timer.cc index 0473d3c0a6e..6f152ce494a 100644 --- a/src/core/lib/event_engine/posix_engine/timer.cc +++ b/src/core/lib/event_engine/posix_engine/timer.cc @@ -27,8 +27,8 @@ #include #include "src/core/lib/event_engine/posix_engine/timer_heap.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/time.h" +#include "src/core/util/useful.h" namespace grpc_event_engine { namespace experimental { diff --git a/src/core/lib/event_engine/thread_pool/thread_count.h b/src/core/lib/event_engine/thread_pool/thread_count.h index 4e8754095c5..a3842275e7e 100644 --- a/src/core/lib/event_engine/thread_pool/thread_count.h +++ b/src/core/lib/event_engine/thread_pool/thread_count.h @@ -26,9 +26,9 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/time.h" +#include "src/core/util/useful.h" namespace grpc_event_engine { namespace experimental { diff --git a/src/core/lib/gprpp/bitset.h b/src/core/lib/gprpp/bitset.h index 7cd96a4842a..ea941b0e10b 100644 --- a/src/core/lib/gprpp/bitset.h +++ b/src/core/lib/gprpp/bitset.h @@ -22,7 +22,7 @@ #include -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/lib/gprpp/per_cpu.cc b/src/core/lib/gprpp/per_cpu.cc index 688fe2483a5..4cd06fd6513 100644 --- a/src/core/lib/gprpp/per_cpu.cc +++ b/src/core/lib/gprpp/per_cpu.cc @@ -17,7 +17,7 @@ #include #include -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/lib/gprpp/posix/thd.cc b/src/core/lib/gprpp/posix/thd.cc index be3f8224ea0..149101103f9 100644 --- a/src/core/lib/gprpp/posix/thd.cc +++ b/src/core/lib/gprpp/posix/thd.cc @@ -39,11 +39,11 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/fork.h" #include "src/core/lib/gprpp/strerror.h" #include "src/core/lib/gprpp/thd.h" +#include "src/core/util/useful.h" namespace grpc_core { namespace { diff --git a/src/core/lib/gprpp/time.h b/src/core/lib/gprpp/time.h index 35b762963b3..96963753d38 100644 --- a/src/core/lib/gprpp/time.h +++ b/src/core/lib/gprpp/time.h @@ -27,8 +27,8 @@ #include #include -#include "src/core/lib/gpr/time_precise.h" -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/time_precise.h" +#include "src/core/util/useful.h" #define GRPC_LOG_EVERY_N_SEC(n, severity, format, ...) \ do { \ diff --git a/src/core/lib/gprpp/unique_type_name.h b/src/core/lib/gprpp/unique_type_name.h index 9b7330cc792..2e71ab73f07 100644 --- a/src/core/lib/gprpp/unique_type_name.h +++ b/src/core/lib/gprpp/unique_type_name.h @@ -23,7 +23,7 @@ #include -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" // Provides a type name that is unique by instance rather than by // string content. This is useful in cases where there are different diff --git a/src/core/lib/iomgr/endpoint_cfstream.cc b/src/core/lib/iomgr/endpoint_cfstream.cc index bdbbfc04861..631f310a2b4 100644 --- a/src/core/lib/iomgr/endpoint_cfstream.cc +++ b/src/core/lib/iomgr/endpoint_cfstream.cc @@ -31,7 +31,6 @@ #include #include "src/core/lib/address_utils/sockaddr_utils.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/iomgr/cfstream_handle.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/endpoint.h" @@ -41,6 +40,7 @@ #include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/util/string.h" extern grpc_core::TraceFlag grpc_tcp_trace; diff --git a/src/core/lib/iomgr/endpoint_pair_posix.cc b/src/core/lib/iomgr/endpoint_pair_posix.cc index 3c45720785e..42d0e7acdb6 100644 --- a/src/core/lib/iomgr/endpoint_pair_posix.cc +++ b/src/core/lib/iomgr/endpoint_pair_posix.cc @@ -37,13 +37,13 @@ #include #include "src/core/lib/event_engine/channel_args_endpoint_config.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/endpoint_pair.h" #include "src/core/lib/iomgr/socket_utils_posix.h" #include "src/core/lib/iomgr/tcp_posix.h" #include "src/core/lib/iomgr/unix_sockets_posix.h" #include "src/core/lib/resource_quota/api.h" +#include "src/core/util/string.h" static void create_sockets(int sv[2]) { int flags; diff --git a/src/core/lib/iomgr/error.cc b/src/core/lib/iomgr/error.cc index 95ea6c9c8d0..b070a764fb3 100644 --- a/src/core/lib/iomgr/error.cc +++ b/src/core/lib/iomgr/error.cc @@ -36,9 +36,9 @@ #endif #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/strerror.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/util/useful.h" grpc_core::DebugOnlyTraceFlag grpc_trace_error_refcount(false, "error_refcount"); diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index 66d7c552211..4d38a90c251 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -32,10 +32,10 @@ #include #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/spinlock.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/util/spinlock.h" /// Opaque representation of an error. diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc index 6461b10a6cb..d40b20a93b7 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.cc +++ b/src/core/lib/iomgr/ev_epoll1_linux.cc @@ -51,8 +51,6 @@ #include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats_data.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/manual_constructor.h" #include "src/core/lib/gprpp/strerror.h" #include "src/core/lib/iomgr/block_annotate.h" @@ -61,6 +59,8 @@ #include "src/core/lib/iomgr/iomgr_internal.h" #include "src/core/lib/iomgr/lockfree_event.h" #include "src/core/lib/iomgr/wakeup_fd_posix.h" +#include "src/core/util/string.h" +#include "src/core/util/useful.h" static grpc_wakeup_fd global_wakeup_fd; static bool g_is_shutdown = true; diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc index f4c417f7e0a..0752fd61657 100644 --- a/src/core/lib/iomgr/ev_poll_posix.cc +++ b/src/core/lib/iomgr/ev_poll_posix.cc @@ -42,13 +42,13 @@ #include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats_data.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/thd.h" #include "src/core/lib/iomgr/block_annotate.h" #include "src/core/lib/iomgr/ev_poll_posix.h" #include "src/core/lib/iomgr/iomgr_internal.h" #include "src/core/lib/iomgr/wakeup_fd_posix.h" +#include "src/core/util/useful.h" #define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker*)1) diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc index 5e10ae02ba4..3456a87c482 100644 --- a/src/core/lib/iomgr/ev_posix.cc +++ b/src/core/lib/iomgr/ev_posix.cc @@ -34,12 +34,12 @@ #include "src/core/lib/config/config_vars.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/ev_epoll1_linux.h" #include "src/core/lib/iomgr/ev_poll_posix.h" #include "src/core/lib/iomgr/ev_posix.h" #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 diff --git a/src/core/lib/iomgr/event_engine_shims/endpoint.cc b/src/core/lib/iomgr/event_engine_shims/endpoint.cc index 42bb4de4ace..dc0019efc12 100644 --- a/src/core/lib/iomgr/event_engine_shims/endpoint.cc +++ b/src/core/lib/iomgr/event_engine_shims/endpoint.cc @@ -37,7 +37,6 @@ #include "src/core/lib/event_engine/shim.h" #include "src/core/lib/event_engine/tcp_socket_utils.h" #include "src/core/lib/event_engine/trace.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/construct_destruct.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/sync.h" @@ -49,6 +48,7 @@ #include "src/core/lib/iomgr/port.h" #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/lib/transport/error_utils.h" +#include "src/core/util/string.h" extern grpc_core::TraceFlag grpc_tcp_trace; diff --git a/src/core/lib/iomgr/exec_ctx.h b/src/core/lib/iomgr/exec_ctx.h index c4932db76bf..68340c7df1c 100644 --- a/src/core/lib/iomgr/exec_ctx.h +++ b/src/core/lib/iomgr/exec_ctx.h @@ -36,12 +36,12 @@ #include #include -#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/fork.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/iomgr/closure.h" +#include "src/core/util/time_precise.h" #if !defined(_WIN32) || !defined(_DLL) #define EXEC_CTX exec_ctx_ diff --git a/src/core/lib/iomgr/executor.cc b/src/core/lib/iomgr/executor.cc index 6144b6128f1..827bfc10c9d 100644 --- a/src/core/lib/iomgr/executor.cc +++ b/src/core/lib/iomgr/executor.cc @@ -28,11 +28,11 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/iomgr_internal.h" +#include "src/core/util/useful.h" #define MAX_DEPTH 2 diff --git a/src/core/lib/iomgr/executor.h b/src/core/lib/iomgr/executor.h index 306cc2b3200..e20f2f0242e 100644 --- a/src/core/lib/iomgr/executor.h +++ b/src/core/lib/iomgr/executor.h @@ -21,9 +21,9 @@ #include -#include "src/core/lib/gpr/spinlock.h" #include "src/core/lib/gprpp/thd.h" #include "src/core/lib/iomgr/closure.h" +#include "src/core/util/spinlock.h" namespace grpc_core { diff --git a/src/core/lib/iomgr/iomgr.cc b/src/core/lib/iomgr/iomgr.cc index 5cda83c1f19..6acf40a66d2 100644 --- a/src/core/lib/iomgr/iomgr.cc +++ b/src/core/lib/iomgr/iomgr.cc @@ -29,8 +29,6 @@ #include #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/thd.h" #include "src/core/lib/iomgr/buffer_list.h" @@ -40,6 +38,8 @@ #include "src/core/lib/iomgr/iomgr_internal.h" #include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/timer_manager.h" +#include "src/core/util/string.h" +#include "src/core/util/useful.h" static gpr_mu g_mu; static gpr_cv g_rcv; diff --git a/src/core/lib/iomgr/resolve_address_posix.cc b/src/core/lib/iomgr/resolve_address_posix.cc index ee5f9092b9e..c9f2967b898 100644 --- a/src/core/lib/iomgr/resolve_address_posix.cc +++ b/src/core/lib/iomgr/resolve_address_posix.cc @@ -30,8 +30,6 @@ #include #include "src/core/lib/event_engine/default_event_engine.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/thd.h" @@ -44,6 +42,8 @@ #include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/unix_sockets_posix.h" #include "src/core/lib/transport/error_utils.h" +#include "src/core/util/string.h" +#include "src/core/util/useful.h" namespace grpc_core { namespace { diff --git a/src/core/lib/iomgr/resolve_address_windows.cc b/src/core/lib/iomgr/resolve_address_windows.cc index bb5b78de1c8..054f7423816 100644 --- a/src/core/lib/iomgr/resolve_address_windows.cc +++ b/src/core/lib/iomgr/resolve_address_windows.cc @@ -35,7 +35,6 @@ #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/event_engine/default_event_engine.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/thd.h" @@ -47,6 +46,7 @@ #include "src/core/lib/iomgr/resolve_address_windows.h" #include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/transport/error_utils.h" +#include "src/core/util/string.h" namespace grpc_core { namespace { diff --git a/src/core/lib/iomgr/socket_factory_posix.cc b/src/core/lib/iomgr/socket_factory_posix.cc index 0b511356a97..45a167dc4b2 100644 --- a/src/core/lib/iomgr/socket_factory_posix.cc +++ b/src/core/lib/iomgr/socket_factory_posix.cc @@ -26,8 +26,8 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/socket_factory_posix.h" +#include "src/core/util/useful.h" void grpc_socket_factory_init(grpc_socket_factory* factory, const grpc_socket_factory_vtable* vtable) { diff --git a/src/core/lib/iomgr/socket_mutator.cc b/src/core/lib/iomgr/socket_mutator.cc index fd909c3e5e6..428cc0bdf3f 100644 --- a/src/core/lib/iomgr/socket_mutator.cc +++ b/src/core/lib/iomgr/socket_mutator.cc @@ -24,8 +24,8 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" +#include "src/core/util/useful.h" void grpc_socket_mutator_init(grpc_socket_mutator* mutator, const grpc_socket_mutator_vtable* vtable) { diff --git a/src/core/lib/iomgr/socket_utils_common_posix.cc b/src/core/lib/iomgr/socket_utils_common_posix.cc index 2def9576b0c..ce4d7a3566c 100644 --- a/src/core/lib/iomgr/socket_utils_common_posix.cc +++ b/src/core/lib/iomgr/socket_utils_common_posix.cc @@ -51,10 +51,10 @@ #include #include "src/core/lib/address_utils/sockaddr_utils.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/strerror.h" #include "src/core/lib/iomgr/sockaddr.h" +#include "src/core/util/string.h" // set a socket to use zerocopy grpc_error_handle grpc_set_socket_zerocopy(int fd) { diff --git a/src/core/lib/iomgr/tcp_client_posix.cc b/src/core/lib/iomgr/tcp_client_posix.cc index 22ecb3e1ef0..2e5e8fd6b8e 100644 --- a/src/core/lib/iomgr/tcp_client_posix.cc +++ b/src/core/lib/iomgr/tcp_client_posix.cc @@ -39,7 +39,6 @@ #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/event_engine/resolved_address_internal.h" #include "src/core/lib/event_engine/shim.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/event_engine_shims/tcp_client.h" @@ -54,6 +53,7 @@ #include "src/core/lib/iomgr/unix_sockets_posix.h" #include "src/core/lib/iomgr/vsock.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/util/string.h" extern grpc_core::TraceFlag grpc_tcp_trace; diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index 46c54c9502e..07906b6889c 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -61,8 +61,6 @@ #include "src/core/lib/debug/stats_data.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/strerror.h" #include "src/core/lib/gprpp/sync.h" @@ -78,6 +76,8 @@ #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/util/string.h" +#include "src/core/util/useful.h" #ifndef SOL_TCP #define SOL_TCP IPPROTO_TCP diff --git a/src/core/lib/iomgr/tcp_windows.cc b/src/core/lib/iomgr/tcp_windows.cc index 53174721ba1..4ff54f374b3 100644 --- a/src/core/lib/iomgr/tcp_windows.cc +++ b/src/core/lib/iomgr/tcp_windows.cc @@ -33,8 +33,6 @@ #include #include "src/core/lib/address_utils/sockaddr_utils.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/iocp_windows.h" #include "src/core/lib/iomgr/sockaddr.h" @@ -45,6 +43,8 @@ #include "src/core/lib/iomgr/timer.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/util/string.h" +#include "src/core/util/useful.h" #if defined(__MSYS__) && defined(GPR_ARCH_64) // Nasty workaround for nasty bug when using the 64 bits msys compiler diff --git a/src/core/lib/iomgr/timer_generic.cc b/src/core/lib/iomgr/timer_generic.cc index bc6f47c2188..1b0ab4b71cc 100644 --- a/src/core/lib/iomgr/timer_generic.cc +++ b/src/core/lib/iomgr/timer_generic.cc @@ -31,8 +31,6 @@ #include #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/spinlock.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/manual_constructor.h" #include "src/core/lib/gprpp/time.h" @@ -41,6 +39,8 @@ #include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/timer_heap.h" +#include "src/core/util/spinlock.h" +#include "src/core/util/useful.h" #define INVALID_HEAP_INDEX 0xffffffffu diff --git a/src/core/lib/iomgr/timer_heap.cc b/src/core/lib/iomgr/timer_heap.cc index 9e3b47b31e5..8f7d950e699 100644 --- a/src/core/lib/iomgr/timer_heap.cc +++ b/src/core/lib/iomgr/timer_heap.cc @@ -23,8 +23,8 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/port.h" +#include "src/core/util/useful.h" // Adjusts a heap so as to move a hole at position i closer to the root, // until a suitable position is found for element t. Then, copies t into that diff --git a/src/core/lib/iomgr/unix_sockets_posix.cc b/src/core/lib/iomgr/unix_sockets_posix.cc index 52da21d84b1..15b2226b688 100644 --- a/src/core/lib/iomgr/unix_sockets_posix.cc +++ b/src/core/lib/iomgr/unix_sockets_posix.cc @@ -40,11 +40,11 @@ #include #include "src/core/lib/address_utils/parse_address.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/unix_sockets_posix.h" #include "src/core/lib/transport/error_utils.h" +#include "src/core/util/useful.h" void grpc_create_socketpair_if_unix(int sv[2]) { #ifdef GPR_WINDOWS diff --git a/src/core/lib/iomgr/vsock.cc b/src/core/lib/iomgr/vsock.cc index e28fed350f3..847dabe0f17 100644 --- a/src/core/lib/iomgr/vsock.cc +++ b/src/core/lib/iomgr/vsock.cc @@ -31,10 +31,10 @@ #include #include "src/core/lib/address_utils/parse_address.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/transport/error_utils.h" +#include "src/core/util/useful.h" absl::StatusOr> grpc_resolve_vsock_address( absl::string_view name) { diff --git a/src/core/lib/resource_quota/arena.cc b/src/core/lib/resource_quota/arena.cc index 7a0f9e752f0..a2969abe241 100644 --- a/src/core/lib/resource_quota/arena.cc +++ b/src/core/lib/resource_quota/arena.cc @@ -24,7 +24,7 @@ #include #include -#include "src/core/lib/gpr/alloc.h" +#include "src/core/util/alloc.h" namespace { diff --git a/src/core/lib/resource_quota/arena.h b/src/core/lib/resource_quota/arena.h index 5985c9220fb..813004087b7 100644 --- a/src/core/lib/resource_quota/arena.h +++ b/src/core/lib/resource_quota/arena.h @@ -35,10 +35,10 @@ #include #include -#include "src/core/lib/gpr/alloc.h" #include "src/core/lib/gprpp/construct_destruct.h" #include "src/core/lib/promise/context.h" #include "src/core/lib/resource_quota/memory_quota.h" +#include "src/core/util/alloc.h" #define GRPC_ARENA_POOLED_ALLOCATIONS_USE_MALLOC // #define GRPC_ARENA_TRACE_POOLED_ALLOCATIONS diff --git a/src/core/lib/resource_quota/memory_quota.cc b/src/core/lib/resource_quota/memory_quota.cc index d6240f4e1d9..79702ce7fff 100644 --- a/src/core/lib/resource_quota/memory_quota.cc +++ b/src/core/lib/resource_quota/memory_quota.cc @@ -34,7 +34,6 @@ #include #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/mpscq.h" #include "src/core/lib/promise/exec_ctx_wakeup_scheduler.h" #include "src/core/lib/promise/loop.h" @@ -43,6 +42,7 @@ #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" namespace grpc_core { diff --git a/src/core/lib/resource_quota/memory_quota.h b/src/core/lib/resource_quota/memory_quota.h index 1ccc6b246de..79de77cf793 100644 --- a/src/core/lib/resource_quota/memory_quota.h +++ b/src/core/lib/resource_quota/memory_quota.h @@ -39,7 +39,6 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" @@ -48,6 +47,7 @@ #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 { diff --git a/src/core/lib/resource_quota/periodic_update.cc b/src/core/lib/resource_quota/periodic_update.cc index b39ad44a44f..b4874fea1da 100644 --- a/src/core/lib/resource_quota/periodic_update.cc +++ b/src/core/lib/resource_quota/periodic_update.cc @@ -18,7 +18,7 @@ #include -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/lib/resource_quota/resource_quota.h b/src/core/lib/resource_quota/resource_quota.h index 37f1fa7c989..e17448f14eb 100644 --- a/src/core/lib/resource_quota/resource_quota.h +++ b/src/core/lib/resource_quota/resource_quota.h @@ -24,12 +24,12 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/cpp_impl_of.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/resource_quota/memory_quota.h" #include "src/core/lib/resource_quota/thread_quota.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/lib/security/authorization/authorization_policy_provider.h b/src/core/lib/security/authorization/authorization_policy_provider.h index cca363f38fd..a4dbc5e8a08 100644 --- a/src/core/lib/security/authorization/authorization_policy_provider.h +++ b/src/core/lib/security/authorization/authorization_policy_provider.h @@ -21,10 +21,10 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/dual_ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/security/authorization/authorization_engine.h" +#include "src/core/util/useful.h" struct grpc_authorization_policy_provider : public grpc_core::DualRefCounted { diff --git a/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc b/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc index ddf1a1201ad..8c8236e2367 100644 --- a/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc +++ b/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc @@ -16,9 +16,9 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/security/authorization/authorization_policy_provider.h" +#include "src/core/util/useful.h" namespace { diff --git a/src/core/lib/security/authorization/rbac_translator.cc b/src/core/lib/security/authorization/rbac_translator.cc index 44a910476b2..7ae89a4d7a8 100644 --- a/src/core/lib/security/authorization/rbac_translator.cc +++ b/src/core/lib/security/authorization/rbac_translator.cc @@ -37,11 +37,11 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/json/json.h" #include "src/core/lib/json/json_reader.h" #include "src/core/lib/matchers/matchers.h" #include "src/core/lib/security/authorization/audit_logging.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/lib/security/context/security_context.h b/src/core/lib/security/context/security_context.h index 1c1b85bfc63..f07b5b7cc19 100644 --- a/src/core/lib/security/context/security_context.h +++ b/src/core/lib/security/context/security_context.h @@ -33,12 +33,12 @@ #include #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/resource_quota/arena.h" #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; diff --git a/src/core/lib/security/credentials/alts/alts_credentials.h b/src/core/lib/security/credentials/alts/alts_credentials.h index 46a513a0026..e49ef34be4e 100644 --- a/src/core/lib/security/credentials/alts/alts_credentials.h +++ b/src/core/lib/security/credentials/alts/alts_credentials.h @@ -25,11 +25,11 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/unique_type_name.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/security_connector/security_connector.h" +#include "src/core/util/useful.h" // Main struct for grpc ALTS channel credential. class grpc_alts_credentials final : public grpc_channel_credentials { diff --git a/src/core/lib/security/credentials/composite/composite_credentials.h b/src/core/lib/security/credentials/composite/composite_credentials.h index 230706ed935..bcf2915abaa 100644 --- a/src/core/lib/security/credentials/composite/composite_credentials.h +++ b/src/core/lib/security/credentials/composite/composite_credentials.h @@ -33,13 +33,13 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/unique_type_name.h" #include "src/core/lib/promise/arena_promise.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/security_connector/security_connector.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/useful.h" // -- Composite channel credentials. -- diff --git a/src/core/lib/security/credentials/credentials.cc b/src/core/lib/security/credentials/credentials.cc index dc58615e26a..4220938e31a 100644 --- a/src/core/lib/security/credentials/credentials.cc +++ b/src/core/lib/security/credentials/credentials.cc @@ -28,10 +28,10 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/surface/api_trace.h" +#include "src/core/util/useful.h" // -- Common. -- diff --git a/src/core/lib/security/credentials/fake/fake_credentials.h b/src/core/lib/security/credentials/fake/fake_credentials.h index a18d90d0344..214d9b3ac3e 100644 --- a/src/core/lib/security/credentials/fake/fake_credentials.h +++ b/src/core/lib/security/credentials/fake/fake_credentials.h @@ -30,7 +30,6 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/unique_type_name.h" #include "src/core/lib/promise/arena_promise.h" @@ -38,6 +37,7 @@ #include "src/core/lib/security/security_connector/security_connector.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/useful.h" #define GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS \ "grpc.fake_security.expected_targets" diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.h b/src/core/lib/security/credentials/google_default/google_default_credentials.h index acf2fa6404b..8611cbdc254 100644 --- a/src/core/lib/security/credentials/google_default/google_default_credentials.h +++ b/src/core/lib/security/credentials/google_default/google_default_credentials.h @@ -26,11 +26,11 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/unique_type_name.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/security_connector/security_connector.h" +#include "src/core/util/useful.h" #define GRPC_GOOGLE_CLOUD_SDK_CONFIG_DIRECTORY "gcloud" #define GRPC_GOOGLE_WELL_KNOWN_CREDENTIALS_FILE \ diff --git a/src/core/lib/security/credentials/iam/iam_credentials.h b/src/core/lib/security/credentials/iam/iam_credentials.h index e5ed10316dc..592dffc4ebd 100644 --- a/src/core/lib/security/credentials/iam/iam_credentials.h +++ b/src/core/lib/security/credentials/iam/iam_credentials.h @@ -28,12 +28,12 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/unique_type_name.h" #include "src/core/lib/promise/arena_promise.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/useful.h" class grpc_google_iam_credentials : public grpc_call_credentials { public: diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.h b/src/core/lib/security/credentials/jwt/jwt_credentials.h index 50df9094d0e..91332098eeb 100644 --- a/src/core/lib/security/credentials/jwt/jwt_credentials.h +++ b/src/core/lib/security/credentials/jwt/jwt_credentials.h @@ -35,7 +35,6 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/unique_type_name.h" #include "src/core/lib/promise/arena_promise.h" @@ -43,6 +42,7 @@ #include "src/core/lib/security/credentials/jwt/json_token.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/useful.h" class grpc_service_account_jwt_access_credentials : public grpc_call_credentials { diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.cc b/src/core/lib/security/credentials/jwt/jwt_verifier.cc index 49cc8e21be1..100e09012eb 100644 --- a/src/core/lib/security/credentials/jwt/jwt_verifier.cc +++ b/src/core/lib/security/credentials/jwt/jwt_verifier.cc @@ -55,7 +55,6 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/manual_constructor.h" #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/gprpp/orphanable.h" @@ -73,6 +72,7 @@ #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/uri/uri_parser.h" #include "src/core/tsi/ssl_types.h" +#include "src/core/util/string.h" using grpc_core::Json; diff --git a/src/core/lib/security/credentials/local/local_credentials.h b/src/core/lib/security/credentials/local/local_credentials.h index 77765bc6242..9665db5d082 100644 --- a/src/core/lib/security/credentials/local/local_credentials.h +++ b/src/core/lib/security/credentials/local/local_credentials.h @@ -26,11 +26,11 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/unique_type_name.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/security_connector/security_connector.h" +#include "src/core/util/useful.h" // Main class for grpc local channel credential. class grpc_local_credentials final : public grpc_channel_credentials { diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h index 4bed299f406..491fbcb1768 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h @@ -32,7 +32,6 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" @@ -50,6 +49,7 @@ #include "src/core/lib/slice/slice.h" #include "src/core/lib/transport/transport.h" #include "src/core/lib/uri/uri_parser.h" +#include "src/core/util/useful.h" // Constants. #define GRPC_STS_POST_MINIMAL_BODY_FORMAT_STRING \ diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.h b/src/core/lib/security/credentials/plugin/plugin_credentials.h index 715d071e14e..a81dd171202 100644 --- a/src/core/lib/security/credentials/plugin/plugin_credentials.h +++ b/src/core/lib/security/credentials/plugin/plugin_credentials.h @@ -36,7 +36,6 @@ #include #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/unique_type_name.h" @@ -47,6 +46,7 @@ #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/useful.h" extern grpc_core::TraceFlag grpc_plugin_credentials_trace; diff --git a/src/core/lib/security/credentials/ssl/ssl_credentials.h b/src/core/lib/security/credentials/ssl/ssl_credentials.h index dea04657f23..6651e50202a 100644 --- a/src/core/lib/security/credentials/ssl/ssl_credentials.h +++ b/src/core/lib/security/credentials/ssl/ssl_credentials.h @@ -30,13 +30,13 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/unique_type_name.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/security_connector/security_connector.h" #include "src/core/lib/security/security_connector/ssl/ssl_security_connector.h" #include "src/core/tsi/ssl_transport_security.h" +#include "src/core/util/useful.h" class grpc_ssl_credentials : public grpc_channel_credentials { public: diff --git a/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h b/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h index fb5eaffaa38..d5908d974f0 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +++ b/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h @@ -33,7 +33,6 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" @@ -41,6 +40,7 @@ #include "src/core/lib/gprpp/unique_type_name.h" #include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h" #include "src/core/lib/security/security_connector/ssl_utils.h" +#include "src/core/util/useful.h" // Interface for a grpc_tls_certificate_provider that handles the process to // fetch credentials and validation contexts. Implementations are free to rely diff --git a/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h b/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h index 507464e3fe3..3cb2bba340c 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +++ b/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h @@ -30,10 +30,10 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/unique_type_name.h" +#include "src/core/util/useful.h" // An abstraction of the verifier that all verifier subclasses should extend. struct grpc_tls_certificate_verifier diff --git a/src/core/lib/security/credentials/tls/tls_credentials.cc b/src/core/lib/security/credentials/tls/tls_credentials.cc index 573d56da9f5..b62b3b352e5 100644 --- a/src/core/lib/security/credentials/tls/tls_credentials.cc +++ b/src/core/lib/security/credentials/tls/tls_credentials.cc @@ -31,11 +31,11 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h" #include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #include "src/core/lib/security/security_connector/tls/tls_security_connector.h" #include "src/core/tsi/ssl/session_cache/ssl_session_cache.h" +#include "src/core/util/useful.h" namespace { diff --git a/src/core/lib/security/credentials/xds/xds_credentials.cc b/src/core/lib/security/credentials/xds/xds_credentials.cc index d04cf39f335..7de65edb356 100644 --- a/src/core/lib/security/credentials/xds/xds_credentials.cc +++ b/src/core/lib/security/credentials/xds/xds_credentials.cc @@ -27,12 +27,12 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h" #include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" #include "src/core/lib/security/credentials/tls/tls_credentials.h" #include "src/core/lib/security/credentials/tls/tls_utils.h" #include "src/core/load_balancing/xds/xds_channel_args.h" +#include "src/core/util/useful.h" #include "src/core/xds/grpc/xds_certificate_provider.h" namespace grpc_core { diff --git a/src/core/lib/security/security_connector/fake/fake_security_connector.cc b/src/core/lib/security/security_connector/fake/fake_security_connector.cc index df335267390..21aa4bc62a5 100644 --- a/src/core/lib/security/security_connector/fake/fake_security_connector.cc +++ b/src/core/lib/security/security_connector/fake/fake_security_connector.cc @@ -41,8 +41,6 @@ #include "src/core/handshaker/handshaker.h" #include "src/core/handshaker/security/security_handshaker.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/host_port.h" @@ -60,6 +58,8 @@ #include "src/core/load_balancing/grpclb/grpclb.h" #include "src/core/tsi/fake_transport_security.h" #include "src/core/tsi/transport_security_interface.h" +#include "src/core/util/string.h" +#include "src/core/util/useful.h" namespace { class grpc_fake_channel_security_connector final diff --git a/src/core/lib/security/security_connector/load_system_roots_supported.cc b/src/core/lib/security/security_connector/load_system_roots_supported.cc index aaf72713a5f..5df3eac642f 100644 --- a/src/core/lib/security/security_connector/load_system_roots_supported.cc +++ b/src/core/lib/security/security_connector/load_system_roots_supported.cc @@ -36,11 +36,11 @@ #include #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/load_file.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/security/security_connector/load_system_roots.h" #include "src/core/lib/security/security_connector/load_system_roots_supported.h" +#include "src/core/util/useful.h" namespace grpc_core { namespace { diff --git a/src/core/lib/security/security_connector/load_system_roots_windows.cc b/src/core/lib/security/security_connector/load_system_roots_windows.cc index 280d0900410..74e5b664c6a 100644 --- a/src/core/lib/security/security_connector/load_system_roots_windows.cc +++ b/src/core/lib/security/security_connector/load_system_roots_windows.cc @@ -32,9 +32,9 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/security/security_connector/load_system_roots.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/util/useful.h" namespace grpc_core { namespace { diff --git a/src/core/lib/security/security_connector/security_connector.cc b/src/core/lib/security/security_connector/security_connector.cc index 2307ebb9bfe..3090ba61928 100644 --- a/src/core/lib/security/security_connector/security_connector.cc +++ b/src/core/lib/security/security_connector/security_connector.cc @@ -28,9 +28,9 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/debug_location.h" #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"); diff --git a/src/core/lib/security/security_connector/ssl_utils.cc b/src/core/lib/security/security_connector/ssl_utils.cc index ec48677eb2c..3c92255719f 100644 --- a/src/core/lib/security/security_connector/ssl_utils.cc +++ b/src/core/lib/security/security_connector/ssl_utils.cc @@ -43,7 +43,6 @@ #include "src/core/ext/transport/chttp2/alpn/alpn.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/load_file.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" @@ -51,6 +50,7 @@ #include "src/core/lib/security/security_connector/load_system_roots.h" #include "src/core/tsi/ssl_transport_security.h" #include "src/core/tsi/transport_security.h" +#include "src/core/util/useful.h" // -- Constants. -- diff --git a/src/core/lib/slice/slice.h b/src/core/lib/slice/slice.h index 06388adc19e..2dc1d4164c7 100644 --- a/src/core/lib/slice/slice.h +++ b/src/core/lib/slice/slice.h @@ -30,10 +30,10 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_refcount.h" +#include "src/core/util/string.h" // Herein lies grpc_core::Slice and its team of thin wrappers around grpc_slice. // They aim to keep you safe by providing strong guarantees around lifetime and diff --git a/src/core/lib/slice/slice_string_helpers.cc b/src/core/lib/slice/slice_string_helpers.cc index d56a7de8943..f2c4346cf25 100644 --- a/src/core/lib/slice/slice_string_helpers.cc +++ b/src/core/lib/slice/slice_string_helpers.cc @@ -20,7 +20,7 @@ #include -#include "src/core/lib/gpr/string.h" +#include "src/core/util/string.h" char* grpc_dump_slice(const grpc_slice& s, uint32_t flags) { return gpr_dump(reinterpret_cast GRPC_SLICE_START_PTR(s), diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index 53728c1d642..cd0a1ed7dd0 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -66,9 +66,6 @@ #include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats_data.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/alloc.h" -#include "src/core/lib/gpr/time_precise.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/bitset.h" #include "src/core/lib/gprpp/cpp_impl_of.h" #include "src/core/lib/gprpp/crash.h" @@ -107,6 +104,9 @@ #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" #include "src/core/server/server_interface.h" +#include "src/core/util/alloc.h" +#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"); diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h index 9388c142f67..c0ccaf842cc 100644 --- a/src/core/lib/surface/call.h +++ b/src/core/lib/surface/call.h @@ -38,7 +38,6 @@ #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/context.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/iomgr/closure.h" @@ -52,6 +51,7 @@ #include "src/core/lib/surface/channel.h" #include "src/core/lib/transport/transport.h" #include "src/core/server/server_interface.h" +#include "src/core/util/time_precise.h" typedef void (*grpc_ioreq_completion_func)(grpc_call* call, int success, void* user_data); diff --git a/src/core/lib/surface/call_log_batch.cc b/src/core/lib/surface/call_log_batch.cc index 6bb0abd0c24..dac553984d2 100644 --- a/src/core/lib/surface/call_log_batch.cc +++ b/src/core/lib/surface/call_log_batch.cc @@ -31,10 +31,10 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/lib/surface/call.h" +#include "src/core/util/string.h" static void add_metadata(const grpc_metadata* md, size_t count, std::vector* b) { diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc index 5d777b50741..92b52c4216e 100644 --- a/src/core/lib/surface/completion_queue.cc +++ b/src/core/lib/surface/completion_queue.cc @@ -42,7 +42,6 @@ #include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats_data.h" -#include "src/core/lib/gpr/spinlock.h" #include "src/core/lib/gprpp/atomic_utils.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/ref_counted.h" @@ -55,6 +54,7 @@ #include "src/core/lib/iomgr/pollset.h" #include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/event_string.h" +#include "src/core/util/spinlock.h" #ifdef GPR_WINDOWS #include "src/core/lib/experiments/experiments.h" diff --git a/src/core/lib/surface/lame_client.cc b/src/core/lib/surface/lame_client.cc index 8966f34ebf7..f573194a42e 100644 --- a/src/core/lib/surface/lame_client.cc +++ b/src/core/lib/surface/lame_client.cc @@ -36,7 +36,6 @@ #include "src/core/lib/channel/promise_based_filter.h" #include "src/core/lib/config/core_configuration.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" @@ -49,6 +48,7 @@ #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/useful.h" // Avoid some IWYU confusion: // IWYU pragma: no_include "src/core/lib/gprpp/orphanable.h" diff --git a/src/core/load_balancing/grpclb/grpclb.cc b/src/core/load_balancing/grpclb/grpclb.cc index d14b50af44f..fcc3034bf03 100644 --- a/src/core/load_balancing/grpclb/grpclb.cc +++ b/src/core/load_balancing/grpclb/grpclb.cc @@ -101,8 +101,6 @@ #include "src/core/lib/config/core_configuration.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/orphanable.h" @@ -143,6 +141,8 @@ #include "src/core/resolver/endpoint_addresses.h" #include "src/core/resolver/fake/fake_resolver.h" #include "src/core/resolver/resolver.h" +#include "src/core/util/string.h" +#include "src/core/util/useful.h" #define GRPC_GRPCLB_INITIAL_CONNECT_BACKOFF_SECONDS 1 #define GRPC_GRPCLB_RECONNECT_BACKOFF_MULTIPLIER 1.6 diff --git a/src/core/load_balancing/grpclb/grpclb_balancer_addresses.cc b/src/core/load_balancing/grpclb/grpclb_balancer_addresses.cc index 17f817eb7a1..a0552c57c70 100644 --- a/src/core/load_balancing/grpclb/grpclb_balancer_addresses.cc +++ b/src/core/load_balancing/grpclb/grpclb_balancer_addresses.cc @@ -23,7 +23,7 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" // Channel arg key for the list of balancer addresses. #define GRPC_ARG_GRPCLB_BALANCER_ADDRESSES \ diff --git a/src/core/load_balancing/pick_first/pick_first.cc b/src/core/load_balancing/pick_first/pick_first.cc index 2307128507e..ae5cb82489b 100644 --- a/src/core/load_balancing/pick_first/pick_first.cc +++ b/src/core/load_balancing/pick_first/pick_first.cc @@ -47,7 +47,6 @@ #include "src/core/lib/config/core_configuration.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/orphanable.h" @@ -66,6 +65,7 @@ #include "src/core/load_balancing/lb_policy_factory.h" #include "src/core/load_balancing/subchannel_interface.h" #include "src/core/resolver/endpoint_addresses.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc b/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc index 55d2711d909..ef70bfc5b67 100644 --- a/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +++ b/src/core/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc @@ -39,7 +39,6 @@ #include #include "src/core/lib/address_utils/sockaddr_utils.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/iomgr/iocp_windows.h" @@ -50,6 +49,7 @@ #include "src/core/lib/slice/slice_internal.h" #include "src/core/resolver/dns/c_ares/grpc_ares_ev_driver.h" #include "src/core/resolver/dns/c_ares/grpc_ares_wrapper.h" +#include "src/core/util/string.h" // TODO(apolcyn): remove this hack after fixing upstream. // Our grpc/c-ares code on Windows uses the ares_set_socket_functions API, 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 74ebe6d4054..e1f717cb9d4 100644 --- a/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -60,7 +60,6 @@ #include "src/core/lib/address_utils/parse_address.h" #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/time.h" @@ -71,6 +70,7 @@ #include "src/core/lib/iomgr/timer.h" #include "src/core/resolver/dns/c_ares/grpc_ares_ev_driver.h" #include "src/core/resolver/dns/c_ares/grpc_ares_wrapper.h" +#include "src/core/util/string.h" using grpc_core::EndpointAddresses; using grpc_core::EndpointAddressesList; diff --git a/src/core/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc b/src/core/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc index 9b87b56c1f1..22b56fdd42c 100644 --- a/src/core/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +++ b/src/core/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc @@ -25,10 +25,10 @@ #include #include "src/core/lib/address_utils/parse_address.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/iomgr/socket_windows.h" #include "src/core/resolver/dns/c_ares/grpc_ares_wrapper.h" #include "src/core/resolver/endpoint_addresses.h" +#include "src/core/util/string.h" bool grpc_ares_query_ipv6() { return grpc_ipv6_loopback_available(); } diff --git a/src/core/resolver/endpoint_addresses.cc b/src/core/resolver/endpoint_addresses.cc index 9746123bd3c..19fbfdfbc16 100644 --- a/src/core/resolver/endpoint_addresses.cc +++ b/src/core/resolver/endpoint_addresses.cc @@ -35,7 +35,7 @@ #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" // IWYU pragma: no_include diff --git a/src/core/resolver/fake/fake_resolver.cc b/src/core/resolver/fake/fake_resolver.cc index a5d1b53a929..99703f8a6ea 100644 --- a/src/core/resolver/fake/fake_resolver.cc +++ b/src/core/resolver/fake/fake_resolver.cc @@ -31,12 +31,12 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/work_serializer.h" #include "src/core/lib/uri/uri_parser.h" #include "src/core/resolver/resolver_factory.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/resolver/fake/fake_resolver.h b/src/core/resolver/fake/fake_resolver.h index c164c04ab38..75dc3ab0ca4 100644 --- a/src/core/resolver/fake/fake_resolver.h +++ b/src/core/resolver/fake/fake_resolver.h @@ -27,12 +27,12 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/notification.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/resolver/resolver.h" +#include "src/core/util/useful.h" #define GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR \ "grpc.fake_resolver.response_generator" diff --git a/src/core/server/server.cc b/src/core/server/server.cc index 40c87eda174..e66c3c5d232 100644 --- a/src/core/server/server.cc +++ b/src/core/server/server.cc @@ -53,7 +53,6 @@ #include "src/core/lib/config/core_configuration.h" #include "src/core/lib/debug/stats.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/mpscq.h" @@ -83,6 +82,7 @@ #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/interception_chain.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/server/server_config_selector.h b/src/core/server/server_config_selector.h index dbead559c11..c6274f49f35 100644 --- a/src/core/server/server_config_selector.h +++ b/src/core/server/server_config_selector.h @@ -24,13 +24,13 @@ #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/dual_ref_counted.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/service_config/service_config.h" #include "src/core/service_config/service_config_parser.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/server/xds_channel_stack_modifier.cc b/src/core/server/xds_channel_stack_modifier.cc index 2dfa03a1ed2..f9e280ea28a 100644 --- a/src/core/server/xds_channel_stack_modifier.cc +++ b/src/core/server/xds_channel_stack_modifier.cc @@ -27,9 +27,9 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/surface/channel_init.h" #include "src/core/lib/surface/channel_stack_type.h" +#include "src/core/util/useful.h" namespace grpc_core { namespace { diff --git a/src/core/server/xds_channel_stack_modifier.h b/src/core/server/xds_channel_stack_modifier.h index 78dc1db0b2c..4cea9e165e7 100644 --- a/src/core/server/xds_channel_stack_modifier.h +++ b/src/core/server/xds_channel_stack_modifier.h @@ -29,9 +29,9 @@ #include "src/core/lib/channel/channel_fwd.h" #include "src/core/lib/channel/channel_stack_builder.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/service_config/service_config.h b/src/core/service_config/service_config.h index 7935150fb2c..ba5fa8262ae 100644 --- a/src/core/service_config/service_config.h +++ b/src/core/service_config/service_config.h @@ -24,9 +24,9 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/service_config/service_config_parser.h" +#include "src/core/util/useful.h" // The main purpose of the code here is to parse the service config in // JSON form, which will look like this: diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc index bd1f1fc7fcd..da2eaf4bfad 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc @@ -26,10 +26,10 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/util/useful.h" const size_t kInitialIovecBufferSize = 8; diff --git a/src/core/tsi/fake_transport_security.cc b/src/core/tsi/fake_transport_security.cc index a2aca84009b..9c39f59fec3 100644 --- a/src/core/tsi/fake_transport_security.cc +++ b/src/core/tsi/fake_transport_security.cc @@ -27,11 +27,11 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/tsi/transport_security_grpc.h" +#include "src/core/util/useful.h" // --- Constants. --- #define TSI_FAKE_FRAME_HEADER_SIZE 4 diff --git a/src/core/tsi/ssl_transport_security.cc b/src/core/tsi/ssl_transport_security.cc index f955c2ec663..61ecc279534 100644 --- a/src/core/tsi/ssl_transport_security.cc +++ b/src/core/tsi/ssl_transport_security.cc @@ -58,7 +58,6 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/security/credentials/tls/grpc_tls_crl_provider.h" #include "src/core/tsi/ssl/key_logging/ssl_key_logging.h" @@ -66,6 +65,7 @@ #include "src/core/tsi/ssl_transport_security_utils.h" #include "src/core/tsi/ssl_types.h" #include "src/core/tsi/transport_security.h" +#include "src/core/util/useful.h" // --- Constants. --- diff --git a/src/core/lib/gpr/.clang-format b/src/core/util/.clang-format similarity index 100% rename from src/core/lib/gpr/.clang-format rename to src/core/util/.clang-format diff --git a/src/core/lib/gpr/README.md b/src/core/util/README.md similarity index 100% rename from src/core/lib/gpr/README.md rename to src/core/util/README.md diff --git a/src/core/lib/gpr/alloc.cc b/src/core/util/alloc.cc similarity index 100% rename from src/core/lib/gpr/alloc.cc rename to src/core/util/alloc.cc diff --git a/src/core/lib/gpr/alloc.h b/src/core/util/alloc.h similarity index 87% rename from src/core/lib/gpr/alloc.h rename to src/core/util/alloc.h index de2e5697385..a369feb3ddd 100644 --- a/src/core/lib/gpr/alloc.h +++ b/src/core/util/alloc.h @@ -16,8 +16,8 @@ // // -#ifndef GRPC_SRC_CORE_LIB_GPR_ALLOC_H -#define GRPC_SRC_CORE_LIB_GPR_ALLOC_H +#ifndef GRPC_SRC_CORE_UTIL_ALLOC_H +#define GRPC_SRC_CORE_UTIL_ALLOC_H #include @@ -25,4 +25,4 @@ #define GPR_ROUND_UP_TO_ALIGNMENT_SIZE(x) \ (((x) + GPR_MAX_ALIGNMENT - 1u) & ~(GPR_MAX_ALIGNMENT - 1u)) -#endif // GRPC_SRC_CORE_LIB_GPR_ALLOC_H +#endif // GRPC_SRC_CORE_UTIL_ALLOC_H diff --git a/src/core/lib/gpr/android/log.cc b/src/core/util/android/log.cc similarity index 100% rename from src/core/lib/gpr/android/log.cc rename to src/core/util/android/log.cc diff --git a/src/core/lib/gpr/atm.cc b/src/core/util/atm.cc similarity index 96% rename from src/core/lib/gpr/atm.cc rename to src/core/util/atm.cc index 73173539818..7e7a6834bb1 100644 --- a/src/core/lib/gpr/atm.cc +++ b/src/core/util/atm.cc @@ -20,7 +20,7 @@ #include -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" gpr_atm gpr_atm_no_barrier_clamped_add(gpr_atm* value, gpr_atm delta, gpr_atm min, gpr_atm max) { diff --git a/src/core/lib/gpr/iphone/cpu.cc b/src/core/util/iphone/cpu.cc similarity index 100% rename from src/core/lib/gpr/iphone/cpu.cc rename to src/core/util/iphone/cpu.cc diff --git a/src/core/lib/gpr/linux/cpu.cc b/src/core/util/linux/cpu.cc similarity index 100% rename from src/core/lib/gpr/linux/cpu.cc rename to src/core/util/linux/cpu.cc diff --git a/src/core/lib/gpr/linux/log.cc b/src/core/util/linux/log.cc similarity index 100% rename from src/core/lib/gpr/linux/log.cc rename to src/core/util/linux/log.cc diff --git a/src/core/lib/gpr/log.cc b/src/core/util/log.cc similarity index 99% rename from src/core/lib/gpr/log.cc rename to src/core/util/log.cc index f1cd2938137..9a6f68104e0 100644 --- a/src/core/lib/gpr/log.cc +++ b/src/core/util/log.cc @@ -31,8 +31,8 @@ #include #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" +#include "src/core/util/string.h" #ifndef GPR_DEFAULT_LOG_VERBOSITY_STRING #define GPR_DEFAULT_LOG_VERBOSITY_STRING "ERROR" diff --git a/src/core/lib/gpr/msys/tmpfile.cc b/src/core/util/msys/tmpfile.cc similarity index 94% rename from src/core/lib/gpr/msys/tmpfile.cc rename to src/core/util/msys/tmpfile.cc index 42372a5ce65..41a04f1c75d 100644 --- a/src/core/lib/gpr/msys/tmpfile.cc +++ b/src/core/util/msys/tmpfile.cc @@ -29,9 +29,9 @@ #include #include -#include "src/core/lib/gpr/string_windows.h" -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/crash.h" +#include "src/core/util/string_windows.h" +#include "src/core/util/tmpfile.h" FILE* gpr_tmpfile(const char* prefix, char** tmp_filename_out) { FILE* result = NULL; diff --git a/src/core/lib/gpr/posix/cpu.cc b/src/core/util/posix/cpu.cc similarity index 98% rename from src/core/lib/gpr/posix/cpu.cc rename to src/core/util/posix/cpu.cc index 4b58d869f68..9d7c638aa12 100644 --- a/src/core/lib/gpr/posix/cpu.cc +++ b/src/core/util/posix/cpu.cc @@ -29,8 +29,8 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" +#include "src/core/util/useful.h" static long ncpus = 0; diff --git a/src/core/lib/gpr/posix/log.cc b/src/core/util/posix/log.cc similarity index 100% rename from src/core/lib/gpr/posix/log.cc rename to src/core/util/posix/log.cc diff --git a/src/core/lib/gpr/posix/string.cc b/src/core/util/posix/string.cc similarity index 100% rename from src/core/lib/gpr/posix/string.cc rename to src/core/util/posix/string.cc diff --git a/src/core/lib/gpr/posix/sync.cc b/src/core/util/posix/sync.cc similarity index 100% rename from src/core/lib/gpr/posix/sync.cc rename to src/core/util/posix/sync.cc diff --git a/src/core/lib/gpr/posix/time.cc b/src/core/util/posix/time.cc similarity index 98% rename from src/core/lib/gpr/posix/time.cc rename to src/core/util/posix/time.cc index f292198fede..6624b0fd656 100644 --- a/src/core/lib/gpr/posix/time.cc +++ b/src/core/util/posix/time.cc @@ -18,7 +18,7 @@ #include -#include "src/core/lib/gpr/time_precise.h" +#include "src/core/util/time_precise.h" #ifdef GPR_POSIX_TIME diff --git a/src/core/lib/gpr/posix/tmpfile.cc b/src/core/util/posix/tmpfile.cc similarity index 96% rename from src/core/lib/gpr/posix/tmpfile.cc rename to src/core/util/posix/tmpfile.cc index cbc2b4cf3d8..dbf399dba63 100644 --- a/src/core/lib/gpr/posix/tmpfile.cc +++ b/src/core/util/posix/tmpfile.cc @@ -31,10 +31,10 @@ #include #include -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/strerror.h" +#include "src/core/util/string.h" +#include "src/core/util/tmpfile.h" FILE* gpr_tmpfile(const char* prefix, char** tmp_filename) { FILE* result = nullptr; diff --git a/src/core/lib/gpr/spinlock.h b/src/core/util/spinlock.h similarity index 93% rename from src/core/lib/gpr/spinlock.h rename to src/core/util/spinlock.h index 085ec8b37b1..b46db8e2a6f 100644 --- a/src/core/lib/gpr/spinlock.h +++ b/src/core/util/spinlock.h @@ -16,8 +16,8 @@ // // -#ifndef GRPC_SRC_CORE_LIB_GPR_SPINLOCK_H -#define GRPC_SRC_CORE_LIB_GPR_SPINLOCK_H +#ifndef GRPC_SRC_CORE_UTIL_SPINLOCK_H +#define GRPC_SRC_CORE_UTIL_SPINLOCK_H #include @@ -50,4 +50,4 @@ struct gpr_spinlock { do { \ } while (!gpr_spinlock_trylock((lock))) -#endif // GRPC_SRC_CORE_LIB_GPR_SPINLOCK_H +#endif // GRPC_SRC_CORE_UTIL_SPINLOCK_H diff --git a/src/core/lib/gpr/string.cc b/src/core/util/string.cc similarity index 99% rename from src/core/lib/gpr/string.cc rename to src/core/util/string.cc index 4d23c89c78b..7efbd09f51f 100644 --- a/src/core/lib/gpr/string.cc +++ b/src/core/util/string.cc @@ -18,7 +18,7 @@ #include -#include "src/core/lib/gpr/string.h" +#include "src/core/util/string.h" #include #include @@ -34,8 +34,8 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" +#include "src/core/util/useful.h" char* gpr_strdup(const char* src) { char* dst; diff --git a/src/core/lib/gpr/string.h b/src/core/util/string.h similarity index 97% rename from src/core/lib/gpr/string.h rename to src/core/util/string.h index 7f4fae9df30..66f3d0f8344 100644 --- a/src/core/lib/gpr/string.h +++ b/src/core/util/string.h @@ -16,8 +16,8 @@ // // -#ifndef GRPC_SRC_CORE_LIB_GPR_STRING_H -#define GRPC_SRC_CORE_LIB_GPR_STRING_H +#ifndef GRPC_SRC_CORE_UTIL_STRING_H +#define GRPC_SRC_CORE_UTIL_STRING_H #include @@ -109,4 +109,4 @@ void* gpr_memrchr(const void* s, int c, size_t n); // Otherwise, it returns false. bool gpr_parse_bool_value(const char* value, bool* dst); -#endif // GRPC_SRC_CORE_LIB_GPR_STRING_H +#endif // GRPC_SRC_CORE_UTIL_STRING_H diff --git a/src/core/lib/gpr/subprocess.h b/src/core/util/subprocess.h similarity index 92% rename from src/core/lib/gpr/subprocess.h rename to src/core/util/subprocess.h index 71d4796fde6..569f10a0309 100644 --- a/src/core/lib/gpr/subprocess.h +++ b/src/core/util/subprocess.h @@ -16,8 +16,8 @@ // // -#ifndef GRPC_SRC_CORE_LIB_GPR_SUBPROCESS_H -#define GRPC_SRC_CORE_LIB_GPR_SUBPROCESS_H +#ifndef GRPC_SRC_CORE_UTIL_SUBPROCESS_H +#define GRPC_SRC_CORE_UTIL_SUBPROCESS_H #include @@ -43,4 +43,4 @@ int gpr_subprocess_join(gpr_subprocess* p); void gpr_subprocess_interrupt(gpr_subprocess* p); int gpr_subprocess_get_process_id(gpr_subprocess* p); -#endif // GRPC_SRC_CORE_LIB_GPR_SUBPROCESS_H +#endif // GRPC_SRC_CORE_UTIL_SUBPROCESS_H diff --git a/src/core/lib/gpr/subprocess_posix.cc b/src/core/util/subprocess_posix.cc similarity index 99% rename from src/core/lib/gpr/subprocess_posix.cc rename to src/core/util/subprocess_posix.cc index 5dc73a3fac5..f7232d38229 100644 --- a/src/core/lib/gpr/subprocess_posix.cc +++ b/src/core/util/subprocess_posix.cc @@ -34,9 +34,9 @@ #include #include -#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/gprpp/strerror.h" +#include "src/core/util/subprocess.h" struct gpr_subprocess { int pid; diff --git a/src/core/lib/gpr/subprocess_windows.cc b/src/core/util/subprocess_windows.cc similarity index 97% rename from src/core/lib/gpr/subprocess_windows.cc rename to src/core/util/subprocess_windows.cc index 3efadd2a9b0..d85b04b8b58 100644 --- a/src/core/lib/gpr/subprocess_windows.cc +++ b/src/core/util/subprocess_windows.cc @@ -30,10 +30,10 @@ #include #include -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/tchar.h" +#include "src/core/util/string.h" +#include "src/core/util/subprocess.h" struct gpr_subprocess { PROCESS_INFORMATION pi; diff --git a/src/core/lib/gpr/sync.cc b/src/core/util/sync.cc similarity index 100% rename from src/core/lib/gpr/sync.cc rename to src/core/util/sync.cc diff --git a/src/core/lib/gpr/sync_abseil.cc b/src/core/util/sync_abseil.cc similarity index 100% rename from src/core/lib/gpr/sync_abseil.cc rename to src/core/util/sync_abseil.cc diff --git a/src/core/lib/gpr/time.cc b/src/core/util/time.cc similarity index 100% rename from src/core/lib/gpr/time.cc rename to src/core/util/time.cc diff --git a/src/core/lib/gpr/time_precise.cc b/src/core/util/time_precise.cc similarity index 99% rename from src/core/lib/gpr/time_precise.cc rename to src/core/util/time_precise.cc index 46efc61722e..b675777a19e 100644 --- a/src/core/lib/gpr/time_precise.cc +++ b/src/core/util/time_precise.cc @@ -28,8 +28,8 @@ #include #include -#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gprpp/crash.h" +#include "src/core/util/time_precise.h" #ifndef GPR_CYCLE_COUNTER_CUSTOM #if GPR_CYCLE_COUNTER_RDTSC_32 || GPR_CYCLE_COUNTER_RDTSC_64 diff --git a/src/core/lib/gpr/time_precise.h b/src/core/util/time_precise.h similarity index 93% rename from src/core/lib/gpr/time_precise.h rename to src/core/util/time_precise.h index 0afb01e84ca..9decb6d4cfd 100644 --- a/src/core/lib/gpr/time_precise.h +++ b/src/core/util/time_precise.h @@ -16,8 +16,8 @@ // // -#ifndef GRPC_SRC_CORE_LIB_GPR_TIME_PRECISE_H -#define GRPC_SRC_CORE_LIB_GPR_TIME_PRECISE_H +#ifndef GRPC_SRC_CORE_UTIL_TIME_PRECISE_H +#define GRPC_SRC_CORE_UTIL_TIME_PRECISE_H #include @@ -66,4 +66,4 @@ void gpr_precise_clock_now(gpr_timespec* clk); gpr_timespec gpr_cycle_counter_to_time(gpr_cycle_counter cycles); gpr_timespec gpr_cycle_counter_sub(gpr_cycle_counter a, gpr_cycle_counter b); -#endif // GRPC_SRC_CORE_LIB_GPR_TIME_PRECISE_H +#endif // GRPC_SRC_CORE_UTIL_TIME_PRECISE_H diff --git a/src/core/lib/gpr/tmpfile.h b/src/core/util/tmpfile.h similarity index 88% rename from src/core/lib/gpr/tmpfile.h rename to src/core/util/tmpfile.h index 54826b03e75..d1ed3d0558c 100644 --- a/src/core/lib/gpr/tmpfile.h +++ b/src/core/util/tmpfile.h @@ -16,8 +16,8 @@ // // -#ifndef GRPC_SRC_CORE_LIB_GPR_TMPFILE_H -#define GRPC_SRC_CORE_LIB_GPR_TMPFILE_H +#ifndef GRPC_SRC_CORE_UTIL_TMPFILE_H +#define GRPC_SRC_CORE_UTIL_TMPFILE_H #include @@ -29,4 +29,4 @@ // unless an error occurs in which case it will be set to NULL. FILE* gpr_tmpfile(const char* prefix, char** tmp_filename); -#endif // GRPC_SRC_CORE_LIB_GPR_TMPFILE_H +#endif // GRPC_SRC_CORE_UTIL_TMPFILE_H diff --git a/src/core/lib/gpr/useful.h b/src/core/util/useful.h similarity index 97% rename from src/core/lib/gpr/useful.h rename to src/core/util/useful.h index b1196d449c4..d3ff937561e 100644 --- a/src/core/lib/gpr/useful.h +++ b/src/core/util/useful.h @@ -16,8 +16,8 @@ // // -#ifndef GRPC_SRC_CORE_LIB_GPR_USEFUL_H -#define GRPC_SRC_CORE_LIB_GPR_USEFUL_H +#ifndef GRPC_SRC_CORE_UTIL_USEFUL_H +#define GRPC_SRC_CORE_UTIL_USEFUL_H #include @@ -181,4 +181,4 @@ inline uint32_t RoundUpToPowerOf2(uint32_t v) { #define GPR_ARRAY_SIZE(array) (sizeof(array) / sizeof(*(array))) -#endif // GRPC_SRC_CORE_LIB_GPR_USEFUL_H +#endif // GRPC_SRC_CORE_UTIL_USEFUL_H diff --git a/src/core/lib/gpr/windows/cpu.cc b/src/core/util/windows/cpu.cc similarity index 100% rename from src/core/lib/gpr/windows/cpu.cc rename to src/core/util/windows/cpu.cc diff --git a/src/core/lib/gpr/windows/log.cc b/src/core/util/windows/log.cc similarity index 98% rename from src/core/lib/gpr/windows/log.cc rename to src/core/util/windows/log.cc index e4f2d14f008..722e4bd9a83 100644 --- a/src/core/lib/gpr/windows/log.cc +++ b/src/core/util/windows/log.cc @@ -29,9 +29,9 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/examine_stack.h" +#include "src/core/util/string.h" void gpr_log(const char* file, int line, gpr_log_severity severity, const char* format, ...) { diff --git a/src/core/lib/gpr/windows/string.cc b/src/core/util/windows/string.cc similarity index 97% rename from src/core/lib/gpr/windows/string.cc rename to src/core/util/windows/string.cc index 603303120b1..c95c4b3fb16 100644 --- a/src/core/lib/gpr/windows/string.cc +++ b/src/core/util/windows/string.cc @@ -29,7 +29,7 @@ #include #include -#include "src/core/lib/gpr/string.h" +#include "src/core/util/string.h" int gpr_asprintf(char** strp, const char* format, ...) { va_list args; diff --git a/src/core/lib/gpr/windows/string_util.cc b/src/core/util/windows/string_util.cc similarity index 97% rename from src/core/lib/gpr/windows/string_util.cc rename to src/core/util/windows/string_util.cc index b56fdd17926..c39152e6037 100644 --- a/src/core/lib/gpr/windows/string_util.cc +++ b/src/core/util/windows/string_util.cc @@ -36,8 +36,8 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/tchar.h" +#include "src/core/util/string.h" char* gpr_format_message(int messageid) { LPTSTR tmessage; diff --git a/src/core/lib/gpr/windows/sync.cc b/src/core/util/windows/sync.cc similarity index 100% rename from src/core/lib/gpr/windows/sync.cc rename to src/core/util/windows/sync.cc diff --git a/src/core/lib/gpr/windows/time.cc b/src/core/util/windows/time.cc similarity index 98% rename from src/core/lib/gpr/windows/time.cc rename to src/core/util/windows/time.cc index 0aafa4a5959..b80a4a5a14b 100644 --- a/src/core/lib/gpr/windows/time.cc +++ b/src/core/util/windows/time.cc @@ -31,8 +31,8 @@ #include #include -#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gprpp/crash.h" +#include "src/core/util/time_precise.h" static LARGE_INTEGER g_start_time = []() { LARGE_INTEGER x; diff --git a/src/core/lib/gpr/windows/tmpfile.cc b/src/core/util/windows/tmpfile.cc similarity index 98% rename from src/core/lib/gpr/windows/tmpfile.cc rename to src/core/util/windows/tmpfile.cc index 37ac4f64bcb..cd3838bc4ee 100644 --- a/src/core/lib/gpr/windows/tmpfile.cc +++ b/src/core/util/windows/tmpfile.cc @@ -29,9 +29,9 @@ #include #include -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/tchar.h" +#include "src/core/util/tmpfile.h" FILE* gpr_tmpfile(const char* prefix, char** tmp_filename_out) { FILE* result = NULL; diff --git a/src/core/xds/grpc/certificate_provider_store.h b/src/core/xds/grpc/certificate_provider_store.h index 3099886f415..ffee3b0efba 100644 --- a/src/core/xds/grpc/certificate_provider_store.h +++ b/src/core/xds/grpc/certificate_provider_store.h @@ -29,7 +29,6 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" @@ -41,6 +40,7 @@ #include "src/core/lib/security/certificate_provider/certificate_provider_factory.h" #include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h" #include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/xds/grpc/xds_bootstrap_grpc.cc b/src/core/xds/grpc/xds_bootstrap_grpc.cc index ec1f44a3386..e6f97cdbfeb 100644 --- a/src/core/xds/grpc/xds_bootstrap_grpc.cc +++ b/src/core/xds/grpc/xds_bootstrap_grpc.cc @@ -37,7 +37,6 @@ #include #include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/json/json.h" @@ -45,6 +44,7 @@ #include "src/core/lib/json/json_reader.h" #include "src/core/lib/json/json_writer.h" #include "src/core/lib/security/credentials/channel_creds_registry.h" +#include "src/core/util/string.h" namespace grpc_core { diff --git a/src/core/xds/grpc/xds_certificate_provider.h b/src/core/xds/grpc/xds_certificate_provider.h index 482ff449313..14747d99c14 100644 --- a/src/core/xds/grpc/xds_certificate_provider.h +++ b/src/core/xds/grpc/xds_certificate_provider.h @@ -31,13 +31,13 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/unique_type_name.h" #include "src/core/lib/matchers/matchers.h" #include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h" #include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h" +#include "src/core/util/useful.h" namespace grpc_core { diff --git a/src/core/xds/grpc/xds_client_grpc.h b/src/core/xds/grpc/xds_client_grpc.h index 0ed5c327e17..9fdb9bccceb 100644 --- a/src/core/xds/grpc/xds_client_grpc.h +++ b/src/core/xds/grpc/xds_client_grpc.h @@ -27,11 +27,11 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/metrics.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/iomgr/iomgr_fwd.h" #include "src/core/resolver/endpoint_addresses.h" +#include "src/core/util/useful.h" #include "src/core/xds/grpc/certificate_provider_store.h" #include "src/core/xds/grpc/xds_bootstrap_grpc.h" #include "src/core/xds/xds_client/xds_client.h" diff --git a/src/core/xds/grpc/xds_endpoint.cc b/src/core/xds/grpc/xds_endpoint.cc index 78cd9a05613..c689a57d515 100644 --- a/src/core/xds/grpc/xds_endpoint.cc +++ b/src/core/xds/grpc/xds_endpoint.cc @@ -47,10 +47,10 @@ #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/validation_errors.h" #include "src/core/lib/iomgr/resolved_address.h" +#include "src/core/util/string.h" #include "src/core/xds/grpc/upb_utils.h" #include "src/core/xds/grpc/xds_health_status.h" #include "src/core/xds/xds_client/xds_resource_type.h" diff --git a/src/core/xds/grpc/xds_http_rbac_filter.cc b/src/core/xds/grpc/xds_http_rbac_filter.cc index c0560f09e9e..05055448a7d 100644 --- a/src/core/xds/grpc/xds_http_rbac_filter.cc +++ b/src/core/xds/grpc/xds_http_rbac_filter.cc @@ -46,10 +46,10 @@ #include "src/core/ext/filters/rbac/rbac_filter.h" #include "src/core/ext/filters/rbac/rbac_service_config_parser.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/json/json.h" #include "src/core/lib/json/json_writer.h" +#include "src/core/util/string.h" #include "src/core/xds/grpc/upb_utils.h" #include "src/core/xds/grpc/xds_audit_logger_registry.h" #include "src/core/xds/grpc/xds_bootstrap_grpc.h" diff --git a/src/core/xds/grpc/xds_route_config.cc b/src/core/xds/grpc/xds_route_config.cc index b03a539f628..f0c8de69739 100644 --- a/src/core/xds/grpc/xds_route_config.cc +++ b/src/core/xds/grpc/xds_route_config.cc @@ -61,7 +61,6 @@ #include "src/core/lib/channel/status_util.h" #include "src/core/lib/config/core_configuration.h" #include "src/core/lib/debug/trace.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/match.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" @@ -70,6 +69,7 @@ #include "src/core/lib/json/json_writer.h" #include "src/core/lib/matchers/matchers.h" #include "src/core/load_balancing/lb_policy_registry.h" +#include "src/core/util/string.h" #include "src/core/xds/grpc/upb_utils.h" #include "src/core/xds/grpc/xds_cluster_specifier_plugin.h" #include "src/core/xds/grpc/xds_common_types.h" diff --git a/src/core/xds/xds_client/xds_bootstrap.cc b/src/core/xds/xds_client/xds_bootstrap.cc index 1a979727780..65b70778ef3 100644 --- a/src/core/xds/xds_client/xds_bootstrap.cc +++ b/src/core/xds/xds_client/xds_bootstrap.cc @@ -20,8 +20,8 @@ #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/env.h" +#include "src/core/util/string.h" namespace grpc_core { diff --git a/src/core/xds/xds_client/xds_client_stats.h b/src/core/xds/xds_client/xds_client_stats.h index b8822ba1b3c..1bfc28c3f3e 100644 --- a/src/core/xds/xds_client/xds_client_stats.h +++ b/src/core/xds/xds_client/xds_client_stats.h @@ -32,12 +32,12 @@ #include #include "src/core/lib/channel/call_tracer.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/per_cpu.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/resolver/endpoint_addresses.h" +#include "src/core/util/useful.h" #include "src/core/xds/xds_client/xds_bootstrap.h" namespace grpc_core { diff --git a/src/cpp/common/completion_queue_cc.cc b/src/cpp/common/completion_queue_cc.cc index 231fb4469e3..b2c3463c053 100644 --- a/src/cpp/common/completion_queue_cc.cc +++ b/src/cpp/common/completion_queue_cc.cc @@ -29,9 +29,9 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/thd.h" +#include "src/core/util/useful.h" namespace grpc { namespace { diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index 7f96f6c96cf..708b2364897 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -49,9 +49,9 @@ #include #include "src/core/ext/transport/chttp2/server/chttp2_server.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/server/server.h" +#include "src/core/util/string.h" +#include "src/core/util/useful.h" #include "src/cpp/server/external_connection_acceptor_impl.h" namespace grpc { diff --git a/src/objective-c/tests/CronetTests/CronetUnitTests.mm b/src/objective-c/tests/CronetTests/CronetUnitTests.mm index 5d9f8d41123..c021e383eea 100644 --- a/src/objective-c/tests/CronetTests/CronetUnitTests.mm +++ b/src/objective-c/tests/CronetTests/CronetUnitTests.mm @@ -32,10 +32,10 @@ #import #import "src/core/lib/channel/channel_args.h" -#import "src/core/lib/gpr/string.h" -#import "src/core/lib/gpr/tmpfile.h" #import "src/core/lib/gprpp/env.h" #import "src/core/lib/gprpp/host_port.h" +#import "src/core/util/string.h" +#import "src/core/util/tmpfile.h" #import "test/core/end2end/data/ssl_test_data.h" #import "test/core/test_util/test_config.h" diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index f00614f2c35..a6e9be13ead 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -490,32 +490,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/event_engine/work_queue/basic_work_queue.cc', 'src/core/lib/experiments/config.cc', 'src/core/lib/experiments/experiments.cc', - 'src/core/lib/gpr/alloc.cc', - 'src/core/lib/gpr/android/log.cc', - 'src/core/lib/gpr/atm.cc', - 'src/core/lib/gpr/iphone/cpu.cc', - 'src/core/lib/gpr/linux/cpu.cc', - 'src/core/lib/gpr/linux/log.cc', - 'src/core/lib/gpr/log.cc', - 'src/core/lib/gpr/msys/tmpfile.cc', - 'src/core/lib/gpr/posix/cpu.cc', - 'src/core/lib/gpr/posix/log.cc', - 'src/core/lib/gpr/posix/string.cc', - 'src/core/lib/gpr/posix/sync.cc', - 'src/core/lib/gpr/posix/time.cc', - 'src/core/lib/gpr/posix/tmpfile.cc', - 'src/core/lib/gpr/string.cc', - 'src/core/lib/gpr/sync.cc', - 'src/core/lib/gpr/sync_abseil.cc', - 'src/core/lib/gpr/time.cc', - 'src/core/lib/gpr/time_precise.cc', - 'src/core/lib/gpr/windows/cpu.cc', - 'src/core/lib/gpr/windows/log.cc', - 'src/core/lib/gpr/windows/string.cc', - 'src/core/lib/gpr/windows/string_util.cc', - 'src/core/lib/gpr/windows/sync.cc', - 'src/core/lib/gpr/windows/time.cc', - 'src/core/lib/gpr/windows/tmpfile.cc', 'src/core/lib/gprpp/crash.cc', 'src/core/lib/gprpp/examine_stack.cc', 'src/core/lib/gprpp/fork.cc', @@ -834,6 +808,32 @@ CORE_SOURCE_FILES = [ 'src/core/tsi/ssl_transport_security_utils.cc', 'src/core/tsi/transport_security.cc', 'src/core/tsi/transport_security_grpc.cc', + 'src/core/util/alloc.cc', + 'src/core/util/android/log.cc', + 'src/core/util/atm.cc', + 'src/core/util/iphone/cpu.cc', + 'src/core/util/linux/cpu.cc', + 'src/core/util/linux/log.cc', + 'src/core/util/log.cc', + 'src/core/util/msys/tmpfile.cc', + 'src/core/util/posix/cpu.cc', + 'src/core/util/posix/log.cc', + 'src/core/util/posix/string.cc', + 'src/core/util/posix/sync.cc', + 'src/core/util/posix/time.cc', + 'src/core/util/posix/tmpfile.cc', + 'src/core/util/string.cc', + 'src/core/util/sync.cc', + 'src/core/util/sync_abseil.cc', + 'src/core/util/time.cc', + 'src/core/util/time_precise.cc', + 'src/core/util/windows/cpu.cc', + 'src/core/util/windows/log.cc', + 'src/core/util/windows/string.cc', + 'src/core/util/windows/string_util.cc', + 'src/core/util/windows/sync.cc', + 'src/core/util/windows/time.cc', + 'src/core/util/windows/tmpfile.cc', 'src/core/xds/grpc/certificate_provider_store.cc', 'src/core/xds/grpc/file_watcher_certificate_provider_factory.cc', 'src/core/xds/grpc/xds_audit_logger_registry.cc', diff --git a/src/python/grpcio_observability/observability_lib_deps.py b/src/python/grpcio_observability/observability_lib_deps.py index 15bd64b12bc..88eebda6fd2 100644 --- a/src/python/grpcio_observability/observability_lib_deps.py +++ b/src/python/grpcio_observability/observability_lib_deps.py @@ -20,32 +20,6 @@ CC_FILES=[ 'grpc_root/src/core/lib/config/load_config.cc', 'grpc_root/src/core/lib/debug/trace.cc', 'grpc_root/src/core/lib/event_engine/thread_local.cc', - 'grpc_root/src/core/lib/gpr/alloc.cc', - 'grpc_root/src/core/lib/gpr/android/log.cc', - 'grpc_root/src/core/lib/gpr/atm.cc', - 'grpc_root/src/core/lib/gpr/iphone/cpu.cc', - 'grpc_root/src/core/lib/gpr/linux/cpu.cc', - 'grpc_root/src/core/lib/gpr/linux/log.cc', - 'grpc_root/src/core/lib/gpr/log.cc', - 'grpc_root/src/core/lib/gpr/msys/tmpfile.cc', - 'grpc_root/src/core/lib/gpr/posix/cpu.cc', - 'grpc_root/src/core/lib/gpr/posix/log.cc', - 'grpc_root/src/core/lib/gpr/posix/string.cc', - 'grpc_root/src/core/lib/gpr/posix/sync.cc', - 'grpc_root/src/core/lib/gpr/posix/time.cc', - 'grpc_root/src/core/lib/gpr/posix/tmpfile.cc', - 'grpc_root/src/core/lib/gpr/string.cc', - 'grpc_root/src/core/lib/gpr/sync.cc', - 'grpc_root/src/core/lib/gpr/sync_abseil.cc', - 'grpc_root/src/core/lib/gpr/time.cc', - 'grpc_root/src/core/lib/gpr/time_precise.cc', - 'grpc_root/src/core/lib/gpr/windows/cpu.cc', - 'grpc_root/src/core/lib/gpr/windows/log.cc', - 'grpc_root/src/core/lib/gpr/windows/string.cc', - 'grpc_root/src/core/lib/gpr/windows/string_util.cc', - 'grpc_root/src/core/lib/gpr/windows/sync.cc', - 'grpc_root/src/core/lib/gpr/windows/time.cc', - 'grpc_root/src/core/lib/gpr/windows/tmpfile.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', @@ -64,6 +38,32 @@ CC_FILES=[ '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', + 'grpc_root/src/core/util/atm.cc', + 'grpc_root/src/core/util/iphone/cpu.cc', + 'grpc_root/src/core/util/linux/cpu.cc', + 'grpc_root/src/core/util/linux/log.cc', + 'grpc_root/src/core/util/log.cc', + 'grpc_root/src/core/util/msys/tmpfile.cc', + 'grpc_root/src/core/util/posix/cpu.cc', + 'grpc_root/src/core/util/posix/log.cc', + 'grpc_root/src/core/util/posix/string.cc', + 'grpc_root/src/core/util/posix/sync.cc', + 'grpc_root/src/core/util/posix/time.cc', + 'grpc_root/src/core/util/posix/tmpfile.cc', + 'grpc_root/src/core/util/string.cc', + 'grpc_root/src/core/util/sync.cc', + 'grpc_root/src/core/util/sync_abseil.cc', + 'grpc_root/src/core/util/time.cc', + 'grpc_root/src/core/util/time_precise.cc', + 'grpc_root/src/core/util/windows/cpu.cc', + 'grpc_root/src/core/util/windows/log.cc', + 'grpc_root/src/core/util/windows/string.cc', + 'grpc_root/src/core/util/windows/string_util.cc', + 'grpc_root/src/core/util/windows/sync.cc', + 'grpc_root/src/core/util/windows/time.cc', + 'grpc_root/src/core/util/windows/tmpfile.cc', 'third_party/abseil-cpp/absl/base/internal/cycleclock.cc', 'third_party/abseil-cpp/absl/base/internal/low_level_alloc.cc', 'third_party/abseil-cpp/absl/base/internal/raw_logging.cc', diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template index 5b7669aaacc..57716758103 100644 --- a/templates/gRPC-Core.podspec.template +++ b/templates/gRPC-Core.podspec.template @@ -158,7 +158,7 @@ ' "$(PODS_TARGET_SRCROOT)/third_party/utf8_range"'${"\\"} ' "$(PODS_TARGET_SRCROOT)/third_party/xxhash"', # If we don't set these two settings, `include/grpc/support/time.h` and - # `src/core/lib/gpr/string.h` shadow the system `` and ``, breaking the + # `src/core/util/string.h` shadow the system `` and ``, breaking the # build. 'USE_HEADERMAP' => 'NO', 'ALWAYS_SEARCH_USER_PATHS' => 'NO', diff --git a/test/core/bad_client/bad_client.cc b/test/core/bad_client/bad_client.cc index f11000ead0f..f47a79cccc3 100644 --- a/test/core/bad_client/bad_client.cc +++ b/test/core/bad_client/bad_client.cc @@ -35,7 +35,6 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args_preconditioning.h" #include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/thd.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/endpoint.h" @@ -45,6 +44,7 @@ #include "src/core/lib/surface/completion_queue.h" #include "src/core/lib/transport/transport.h" #include "src/core/server/server.h" +#include "src/core/util/string.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/bad_ssl/bad_ssl_test.cc b/test/core/bad_ssl/bad_ssl_test.cc index 988cea357a5..ade42a80c68 100644 --- a/test/core/bad_ssl/bad_ssl_test.cc +++ b/test/core/bad_ssl/bad_ssl_test.cc @@ -35,9 +35,9 @@ #include #include -#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/host_port.h" +#include "src/core/util/subprocess.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/test_util/port.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/bad_ssl/servers/alpn.cc b/test/core/bad_ssl/servers/alpn.cc index cc11af5ed42..b3894767b01 100644 --- a/test/core/bad_ssl/servers/alpn.cc +++ b/test/core/bad_ssl/servers/alpn.cc @@ -28,8 +28,8 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/error.h" +#include "src/core/util/useful.h" #include "test/core/bad_ssl/server_common.h" #include "test/core/test_util/tls_utils.h" diff --git a/test/core/channel/channel_args_test.cc b/test/core/channel/channel_args_test.cc index 1fe9f0937b1..09f65577f0e 100644 --- a/test/core/channel/channel_args_test.cc +++ b/test/core/channel/channel_args_test.cc @@ -30,11 +30,11 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/notification.h" #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" namespace grpc_core { diff --git a/test/core/channelz/channelz_test.cc b/test/core/channelz/channelz_test.cc index bd82d6c50f3..7c591711c6b 100644 --- a/test/core/channelz/channelz_test.cc +++ b/test/core/channelz/channelz_test.cc @@ -42,13 +42,13 @@ #include "src/core/channelz/channelz_registry.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/event_engine/default_event_engine.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/notification.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/json/json.h" #include "src/core/lib/json/json_reader.h" #include "src/core/lib/surface/channel.h" #include "src/core/server/server.h" +#include "src/core/util/useful.h" #include "test/core/event_engine/event_engine_test_utils.h" #include "test/core/test_util/test_config.h" #include "test/cpp/util/channel_trace_proto_helper.h" diff --git a/test/core/compression/compression_test.cc b/test/core/compression/compression_test.cc index 569a1d7e2ff..9ed5b61b042 100644 --- a/test/core/compression/compression_test.cc +++ b/test/core/compression/compression_test.cc @@ -27,7 +27,7 @@ #include #include -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" TEST(CompressionTest, CompressionAlgorithmParse) { diff --git a/test/core/compression/message_compress_test.cc b/test/core/compression/message_compress_test.cc index 5666ed3e477..9110456d054 100644 --- a/test/core/compression/message_compress_test.cc +++ b/test/core/compression/message_compress_test.cc @@ -29,8 +29,8 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/util/useful.h" #include "test/core/test_util/slice_splitter.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/end2end/bad_server_response_test.cc b/test/core/end2end/bad_server_response_test.cc index b2c38dba64a..03a7e937a9c 100644 --- a/test/core/end2end/bad_server_response_test.cc +++ b/test/core/end2end/bad_server_response_test.cc @@ -40,7 +40,6 @@ #include #include "src/core/lib/event_engine/shim.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/notification.h" #include "src/core/lib/gprpp/status_helper.h" @@ -52,6 +51,7 @@ #include "src/core/lib/iomgr/iomgr_fwd.h" #include "src/core/lib/iomgr/tcp_server.h" #include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/util/string.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/test_util/port.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/end2end/fuzzers/network_input.cc b/test/core/end2end/fuzzers/network_input.cc index 278fd0ffc69..31726db2fd8 100644 --- a/test/core/end2end/fuzzers/network_input.cc +++ b/test/core/end2end/fuzzers/network_input.cc @@ -37,10 +37,10 @@ #include "src/core/lib/config/core_configuration.h" #include "src/core/lib/event_engine/channel_args_endpoint_config.h" #include "src/core/lib/event_engine/tcp_socket_utils.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_buffer.h" +#include "src/core/util/useful.h" #include "test/core/end2end/fuzzers/fuzzer_input.pb.h" #include "test/core/test_util/mock_endpoint.h" diff --git a/test/core/end2end/h2_ssl_cert_test.cc b/test/core/end2end/h2_ssl_cert_test.cc index 3d1470194ec..1a674bde544 100644 --- a/test/core/end2end/h2_ssl_cert_test.cc +++ b/test/core/end2end/h2_ssl_cert_test.cc @@ -42,7 +42,7 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/tmpfile.h" +#include "src/core/util/tmpfile.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/end2end/data/ssl_test_data.h" #include "test/core/end2end/end2end_tests.h" diff --git a/test/core/end2end/h2_ssl_session_reuse_test.cc b/test/core/end2end/h2_ssl_session_reuse_test.cc index 99db3ab8594..e419096114d 100644 --- a/test/core/end2end/h2_ssl_session_reuse_test.cc +++ b/test/core/end2end/h2_ssl_session_reuse_test.cc @@ -38,10 +38,10 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/util/useful.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/test_util/port.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/end2end/h2_tls_peer_property_external_verifier_test.cc b/test/core/end2end/h2_tls_peer_property_external_verifier_test.cc index 054038aef19..e3982feaa4f 100644 --- a/test/core/end2end/h2_tls_peer_property_external_verifier_test.cc +++ b/test/core/end2end/h2_tls_peer_property_external_verifier_test.cc @@ -38,10 +38,10 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/util/useful.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/test_util/port.h" #include "test/core/test_util/test_config.h" 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 371d3972997..bba8a824651 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 @@ -33,9 +33,9 @@ #include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/trace.h" #include "src/core/lib/event_engine/tcp_socket_utils.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/iomgr/port.h" +#include "src/core/util/useful.h" #include "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.pb.h" #include "test/core/test_util/port.h" diff --git a/test/core/event_engine/posix/tcp_posix_socket_utils_test.cc b/test/core/event_engine/posix/tcp_posix_socket_utils_test.cc index d958b191cd0..0e1099b57aa 100644 --- a/test/core/event_engine/posix/tcp_posix_socket_utils_test.cc +++ b/test/core/event_engine/posix/tcp_posix_socket_utils_test.cc @@ -35,8 +35,8 @@ #include #include "src/core/lib/event_engine/posix_engine/tcp_socket_utils.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/socket_mutator.h" +#include "src/core/util/useful.h" namespace grpc_event_engine { namespace experimental { diff --git a/test/core/event_engine/posix/traced_buffer_list_test.cc b/test/core/event_engine/posix/traced_buffer_list_test.cc index 0d72ebcee80..1ae3a05cb94 100644 --- a/test/core/event_engine/posix/traced_buffer_list_test.cc +++ b/test/core/event_engine/posix/traced_buffer_list_test.cc @@ -25,10 +25,10 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/port.h" +#include "src/core/util/useful.h" #ifdef GRPC_LINUX_ERRQUEUE diff --git a/test/core/filters/client_auth_filter_test.cc b/test/core/filters/client_auth_filter_test.cc index bc06504b25f..2d842875d5a 100644 --- a/test/core/filters/client_auth_filter_test.cc +++ b/test/core/filters/client_auth_filter_test.cc @@ -28,7 +28,6 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/promise_based_filter.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/unique_type_name.h" #include "src/core/lib/promise/arena_promise.h" @@ -40,6 +39,7 @@ #include "src/core/lib/security/transport/auth_filters.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/useful.h" #include "test/core/filters/filter_test.h" // TODO(roth): Need to add a lot more tests here. I created this file diff --git a/test/core/gpr/spinlock_test.cc b/test/core/gpr/spinlock_test.cc index 12de438a26e..6e8be4a853e 100644 --- a/test/core/gpr/spinlock_test.cc +++ b/test/core/gpr/spinlock_test.cc @@ -18,7 +18,7 @@ // Test of gpr spin-lock support. -#include "src/core/lib/gpr/spinlock.h" +#include "src/core/util/spinlock.h" #include #include diff --git a/test/core/gpr/string_test.cc b/test/core/gpr/string_test.cc index 1a218c12973..4ca644d8090 100644 --- a/test/core/gpr/string_test.cc +++ b/test/core/gpr/string_test.cc @@ -16,7 +16,7 @@ // // -#include "src/core/lib/gpr/string.h" +#include "src/core/util/string.h" #include #include diff --git a/test/core/gpr/useful_test.cc b/test/core/gpr/useful_test.cc index b203226dbd4..b9c2f696212 100644 --- a/test/core/gpr/useful_test.cc +++ b/test/core/gpr/useful_test.cc @@ -16,7 +16,7 @@ // // -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" #include diff --git a/test/core/gprpp/load_file_test.cc b/test/core/gprpp/load_file_test.cc index 76988c354fe..180624c9eb4 100644 --- a/test/core/gprpp/load_file_test.cc +++ b/test/core/gprpp/load_file_test.cc @@ -23,7 +23,7 @@ #include -#include "src/core/lib/gpr/tmpfile.h" +#include "src/core/util/tmpfile.h" #include "test/core/test_util/test_config.h" static const char prefix[] = "file_test"; diff --git a/test/core/gprpp/mpscq_test.cc b/test/core/gprpp/mpscq_test.cc index daa3bb3401e..9e2cb410234 100644 --- a/test/core/gprpp/mpscq_test.cc +++ b/test/core/gprpp/mpscq_test.cc @@ -29,8 +29,8 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/thd.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" using grpc_core::MultiProducerSingleConsumerQueue; diff --git a/test/core/gprpp/stat_test.cc b/test/core/gprpp/stat_test.cc index 1c3a9d0022f..29536b4a0e6 100644 --- a/test/core/gprpp/stat_test.cc +++ b/test/core/gprpp/stat_test.cc @@ -24,7 +24,7 @@ #include -#include "src/core/lib/gpr/tmpfile.h" +#include "src/core/util/tmpfile.h" #include "test/core/test_util/test_config.h" namespace grpc_core { diff --git a/test/core/http/httpcli_test.cc b/test/core/http/httpcli_test.cc index 7a4eb1bf607..2c7d7ee2aa2 100644 --- a/test/core/http/httpcli_test.cc +++ b/test/core/http/httpcli_test.cc @@ -43,7 +43,6 @@ #include #include -#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/time_util.h" @@ -51,6 +50,7 @@ #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/resolver/dns/c_ares/grpc_ares_wrapper.h" +#include "src/core/util/subprocess.h" #include "test/core/http/httpcli_test_util.h" #include "test/core/test_util/fake_udp_and_tcp_server.h" #include "test/core/test_util/port.h" diff --git a/test/core/http/httpcli_test_util.cc b/test/core/http/httpcli_test_util.cc index 760b9d83b2a..e70c42858d6 100644 --- a/test/core/http/httpcli_test_util.cc +++ b/test/core/http/httpcli_test_util.cc @@ -33,7 +33,7 @@ #include #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/subprocess.h" +#include "src/core/util/subprocess.h" #include "test/core/test_util/port.h" namespace grpc_core { diff --git a/test/core/http/httpcli_test_util.h b/test/core/http/httpcli_test_util.h index 6007a4be203..cd475ebe2d5 100644 --- a/test/core/http/httpcli_test_util.h +++ b/test/core/http/httpcli_test_util.h @@ -19,7 +19,7 @@ #include -#include "src/core/lib/gpr/subprocess.h" +#include "src/core/util/subprocess.h" namespace grpc_core { namespace testing { diff --git a/test/core/http/httpscli_test.cc b/test/core/http/httpscli_test.cc index c273581083f..55a559240b4 100644 --- a/test/core/http/httpscli_test.cc +++ b/test/core/http/httpscli_test.cc @@ -42,7 +42,6 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/sync.h" @@ -59,6 +58,7 @@ #include "src/core/lib/iomgr/pollset.h" #include "src/core/lib/security/credentials/credentials.h" // IWYU pragma: keep #include "src/core/lib/uri/uri_parser.h" +#include "src/core/util/subprocess.h" #include "test/core/http/httpcli_test_util.h" #include "test/core/test_util/fake_udp_and_tcp_server.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/http/parser_test.cc b/test/core/http/parser_test.cc index 70b5aaa670d..183dc9eeae3 100644 --- a/test/core/http/parser_test.cc +++ b/test/core/http/parser_test.cc @@ -29,7 +29,7 @@ #include -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" #include "test/core/test_util/slice_splitter.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/iomgr/buffer_list_test.cc b/test/core/iomgr/buffer_list_test.cc index 4afd6d591f7..9994961a727 100644 --- a/test/core/iomgr/buffer_list_test.cc +++ b/test/core/iomgr/buffer_list_test.cc @@ -25,11 +25,11 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/internal_errqueue.h" #include "src/core/lib/iomgr/port.h" +#include "src/core/util/useful.h" #ifdef GRPC_LINUX_ERRQUEUE diff --git a/test/core/iomgr/combiner_test.cc b/test/core/iomgr/combiner_test.cc index 11b3b2d5cae..0a8c0a45066 100644 --- a/test/core/iomgr/combiner_test.cc +++ b/test/core/iomgr/combiner_test.cc @@ -26,10 +26,10 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/notification.h" #include "src/core/lib/gprpp/thd.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" TEST(CombinerTest, TestNoOp) { diff --git a/test/core/iomgr/endpoint_pair_test.cc b/test/core/iomgr/endpoint_pair_test.cc index 9d77ee44fe9..71b631fb184 100644 --- a/test/core/iomgr/endpoint_pair_test.cc +++ b/test/core/iomgr/endpoint_pair_test.cc @@ -35,10 +35,10 @@ #include "src/core/lib/event_engine/default_event_engine.h" #include "src/core/lib/event_engine/shim.h" #include "src/core/lib/event_engine/tcp_socket_utils.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/notification.h" #include "src/core/lib/iomgr/event_engine_shims/endpoint.h" #include "src/core/lib/resource_quota/memory_quota.h" +#include "src/core/util/useful.h" #include "test/core/iomgr/endpoint_tests.h" #include "test/core/test_util/port.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/iomgr/endpoint_tests.cc b/test/core/iomgr/endpoint_tests.cc index 62be76971f6..bd810dfcc82 100644 --- a/test/core/iomgr/endpoint_tests.cc +++ b/test/core/iomgr/endpoint_tests.cc @@ -29,11 +29,11 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" // diff --git a/test/core/iomgr/resolve_address_posix_test.cc b/test/core/iomgr/resolve_address_posix_test.cc index c0fb77e04d2..9cebdbfa87e 100644 --- a/test/core/iomgr/resolve_address_posix_test.cc +++ b/test/core/iomgr/resolve_address_posix_test.cc @@ -35,8 +35,6 @@ #include #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/thd.h" @@ -45,6 +43,8 @@ #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/iomgr/pollset.h" #include "src/core/lib/iomgr/resolve_address.h" +#include "src/core/util/string.h" +#include "src/core/util/useful.h" #include "test/core/test_util/cmdline.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/iomgr/resolve_address_test.cc b/test/core/iomgr/resolve_address_test.cc index f9e39608674..8dc158ddf9d 100644 --- a/test/core/iomgr/resolve_address_test.cc +++ b/test/core/iomgr/resolve_address_test.cc @@ -35,7 +35,6 @@ #include #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/time.h" @@ -43,6 +42,7 @@ #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/iomgr/pollset.h" #include "src/core/resolver/dns/c_ares/grpc_ares_wrapper.h" +#include "src/core/util/string.h" #include "test/core/test_util/cmdline.h" #include "test/core/test_util/fake_udp_and_tcp_server.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/iomgr/socket_utils_test.cc b/test/core/iomgr/socket_utils_test.cc index d28bc96adec..edec3943f7c 100644 --- a/test/core/iomgr/socket_utils_test.cc +++ b/test/core/iomgr/socket_utils_test.cc @@ -34,10 +34,10 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/socket_mutator.h" #include "src/core/lib/iomgr/socket_utils_posix.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" struct test_socket_mutator { diff --git a/test/core/iomgr/tcp_posix_test.cc b/test/core/iomgr/tcp_posix_test.cc index e7c246c99bc..9f50defcc42 100644 --- a/test/core/iomgr/tcp_posix_test.cc +++ b/test/core/iomgr/tcp_posix_test.cc @@ -47,7 +47,6 @@ #include "src/core/lib/event_engine/default_event_engine.h" #include "src/core/lib/event_engine/posix.h" #include "src/core/lib/event_engine/shim.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/buffer_list.h" #include "src/core/lib/iomgr/ev_posix.h" @@ -56,6 +55,7 @@ #include "src/core/lib/iomgr/socket_utils_posix.h" #include "src/core/lib/iomgr/tcp_posix.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/util/useful.h" #include "test/core/iomgr/endpoint_tests.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/iomgr/timer_heap_test.cc b/test/core/iomgr/timer_heap_test.cc index 9fef72bebe0..af4571a4031 100644 --- a/test/core/iomgr/timer_heap_test.cc +++ b/test/core/iomgr/timer_heap_test.cc @@ -27,9 +27,9 @@ #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/port.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" static gpr_atm random_deadline(void) { return rand(); } diff --git a/test/core/memory_usage/client.cc b/test/core/memory_usage/client.cc index 150ba4a1bec..3ba5ac650da 100644 --- a/test/core/memory_usage/client.cc +++ b/test/core/memory_usage/client.cc @@ -43,8 +43,8 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/util/useful.h" #include "test/core/memory_usage/memstats.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/memory_usage/memory_usage_test.cc b/test/core/memory_usage/memory_usage_test.cc index 70617c5bb36..9ca28321a72 100644 --- a/test/core/memory_usage/memory_usage_test.cc +++ b/test/core/memory_usage/memory_usage_test.cc @@ -46,8 +46,8 @@ #include #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/subprocess.h" #include "src/core/lib/gprpp/env.h" +#include "src/core/util/subprocess.h" #include "src/proto/grpc/testing/xds/v3/cluster.pb.h" #include "src/proto/grpc/testing/xds/v3/health_check.pb.h" #include "test/core/test_util/port.h" diff --git a/test/core/network_benchmarks/low_level_ping_pong.cc b/test/core/network_benchmarks/low_level_ping_pong.cc index df2c16d3a26..69b5228b362 100644 --- a/test/core/network_benchmarks/low_level_ping_pong.cc +++ b/test/core/network_benchmarks/low_level_ping_pong.cc @@ -41,11 +41,11 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/strerror.h" #include "src/core/lib/gprpp/thd.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/socket_utils_posix.h" +#include "src/core/util/useful.h" #include "test/core/test_util/cmdline.h" #include "test/core/test_util/histogram.h" diff --git a/test/core/resource_quota/memory_quota_fuzzer.cc b/test/core/resource_quota/memory_quota_fuzzer.cc index c94aa28e385..912e3508065 100644 --- a/test/core/resource_quota/memory_quota_fuzzer.cc +++ b/test/core/resource_quota/memory_quota_fuzzer.cc @@ -31,12 +31,12 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/experiments/config.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/resource_quota/memory_quota.h" +#include "src/core/util/useful.h" #include "src/libfuzzer/libfuzzer_macro.h" #include "test/core/resource_quota/call_checker.h" #include "test/core/resource_quota/memory_quota_fuzzer.pb.h" diff --git a/test/core/security/auth_context_test.cc b/test/core/security/auth_context_test.cc index 91ffb67f2b3..ea9be077e24 100644 --- a/test/core/security/auth_context_test.cc +++ b/test/core/security/auth_context_test.cc @@ -22,10 +22,10 @@ #include "absl/log/log.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/security/context/security_context.h" +#include "src/core/util/string.h" #include "test/core/test_util/test_config.h" TEST(AuthContextTest, EmptyContext) { diff --git a/test/core/security/check_gcp_environment_linux_test.cc b/test/core/security/check_gcp_environment_linux_test.cc index 83f5fc91889..1627aa67b67 100644 --- a/test/core/security/check_gcp_environment_linux_test.cc +++ b/test/core/security/check_gcp_environment_linux_test.cc @@ -25,9 +25,9 @@ #include #include -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/security/credentials/alts/check_gcp_environment.h" +#include "src/core/util/tmpfile.h" #if GPR_LINUX diff --git a/test/core/security/check_gcp_environment_windows_test.cc b/test/core/security/check_gcp_environment_windows_test.cc index 6270bdd913b..d046565d8ab 100644 --- a/test/core/security/check_gcp_environment_windows_test.cc +++ b/test/core/security/check_gcp_environment_windows_test.cc @@ -25,9 +25,9 @@ #include #include -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/security/credentials/alts/check_gcp_environment.h" +#include "src/core/util/tmpfile.h" #ifdef GPR_WINDOWS diff --git a/test/core/security/credentials_test.cc b/test/core/security/credentials_test.cc index ed7052922c8..d6eb7c74d0f 100644 --- a/test/core/security/credentials_test.cc +++ b/test/core/security/credentials_test.cc @@ -43,8 +43,6 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/host_port.h" @@ -73,6 +71,8 @@ #include "src/core/lib/security/transport/auth_filters.h" #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/uri/uri_parser.h" +#include "src/core/util/string.h" +#include "src/core/util/tmpfile.h" #include "test/core/test_util/test_config.h" namespace grpc_core { diff --git a/test/core/security/grpc_tls_certificate_provider_test.cc b/test/core/security/grpc_tls_certificate_provider_test.cc index 696f329e692..ed0621fef74 100644 --- a/test/core/security/grpc_tls_certificate_provider_test.cc +++ b/test/core/security/grpc_tls_certificate_provider_test.cc @@ -28,9 +28,9 @@ #include #include -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/util/tmpfile.h" #include "test/core/test_util/test_config.h" #include "test/core/test_util/tls_utils.h" diff --git a/test/core/security/grpc_tls_certificate_verifier_test.cc b/test/core/security/grpc_tls_certificate_verifier_test.cc index 80bb29ab851..e775fe7a847 100644 --- a/test/core/security/grpc_tls_certificate_verifier_test.cc +++ b/test/core/security/grpc_tls_certificate_verifier_test.cc @@ -27,10 +27,10 @@ #include #include -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/security/security_connector/tls/tls_security_connector.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/util/tmpfile.h" #include "test/core/test_util/test_config.h" #include "test/core/test_util/tls_utils.h" diff --git a/test/core/security/grpc_tls_credentials_options_test.cc b/test/core/security/grpc_tls_credentials_options_test.cc index 172def442ea..4dde2e18b97 100644 --- a/test/core/security/grpc_tls_credentials_options_test.cc +++ b/test/core/security/grpc_tls_credentials_options_test.cc @@ -28,10 +28,10 @@ #include #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/security/credentials/tls/tls_credentials.h" #include "src/core/lib/security/security_connector/tls/tls_security_connector.h" +#include "src/core/util/tmpfile.h" #include "test/core/test_util/test_config.h" #include "test/core/test_util/tls_utils.h" diff --git a/test/core/security/print_google_default_creds_token.cc b/test/core/security/print_google_default_creds_token.cc index 44bdc9cfd66..b1636f0b5d5 100644 --- a/test/core/security/print_google_default_creds_token.cc +++ b/test/core/security/print_google_default_creds_token.cc @@ -29,11 +29,11 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/security/credentials/composite/composite_credentials.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/util/string.h" #include "test/core/test_util/cmdline.h" typedef struct { diff --git a/test/core/security/secure_endpoint_test.cc b/test/core/security/secure_endpoint_test.cc index 80a4af278dc..80168ebdfb1 100644 --- a/test/core/security/secure_endpoint_test.cc +++ b/test/core/security/secure_endpoint_test.cc @@ -28,12 +28,12 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/endpoint_pair.h" #include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/tsi/fake_transport_security.h" +#include "src/core/util/useful.h" #include "test/core/iomgr/endpoint_tests.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/security/security_connector_test.cc b/test/core/security/security_connector_test.cc index db024f79ff5..63d14a065fc 100644 --- a/test/core/security/security_connector_test.cc +++ b/test/core/security/security_connector_test.cc @@ -31,8 +31,6 @@ #include #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/security/context/security_context.h" @@ -40,6 +38,8 @@ #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/tsi/ssl_transport_security.h" #include "src/core/tsi/transport_security.h" +#include "src/core/util/string.h" +#include "src/core/util/tmpfile.h" #include "test/core/test_util/test_config.h" #ifndef TSI_OPENSSL_ALPN_SUPPORT diff --git a/test/core/security/system_roots_test.cc b/test/core/security/system_roots_test.cc index d9b388e7265..7dfaae7b92d 100644 --- a/test/core/security/system_roots_test.cc +++ b/test/core/security/system_roots_test.cc @@ -34,7 +34,6 @@ #include #include -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/load_file.h" @@ -46,6 +45,7 @@ #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/tsi/ssl_transport_security.h" #include "src/core/tsi/transport_security.h" +#include "src/core/util/tmpfile.h" #include "test/core/test_util/test_config.h" namespace grpc { diff --git a/test/core/slice/percent_encoding_test.cc b/test/core/slice/percent_encoding_test.cc index b68adb6723c..891bfd9cd0d 100644 --- a/test/core/slice/percent_encoding_test.cc +++ b/test/core/slice/percent_encoding_test.cc @@ -28,8 +28,8 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/util/string.h" #include "test/core/test_util/test_config.h" #define TEST_VECTOR(raw, encoded, dict) \ diff --git a/test/core/slice/slice_string_helpers_test.cc b/test/core/slice/slice_string_helpers_test.cc index 3b045bccede..587548099f0 100644 --- a/test/core/slice/slice_string_helpers_test.cc +++ b/test/core/slice/slice_string_helpers_test.cc @@ -25,7 +25,7 @@ #include #include -#include "src/core/lib/gpr/string.h" +#include "src/core/util/string.h" #define LOG_TEST_NAME(x) gpr_log(GPR_INFO, "%s", x) diff --git a/test/core/surface/completion_queue_test.cc b/test/core/surface/completion_queue_test.cc index 27a1d61c335..0cb90259fa0 100644 --- a/test/core/surface/completion_queue_test.cc +++ b/test/core/surface/completion_queue_test.cc @@ -30,8 +30,8 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" #define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x) diff --git a/test/core/surface/completion_queue_threading_test.cc b/test/core/surface/completion_queue_threading_test.cc index 4d75ca8da07..3aebf747c13 100644 --- a/test/core/surface/completion_queue_threading_test.cc +++ b/test/core/surface/completion_queue_threading_test.cc @@ -30,11 +30,11 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/thd.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/surface/completion_queue.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" #define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x) diff --git a/test/core/surface/server_test.cc b/test/core/surface/server_test.cc index d180078b9ef..49777234a63 100644 --- a/test/core/surface/server_test.cc +++ b/test/core/surface/server_test.cc @@ -34,11 +34,11 @@ #include #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/resolved_address.h" #include "src/core/lib/security/credentials/fake/fake_credentials.h" +#include "src/core/util/useful.h" #include "test/core/test_util/port.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/test_util/cmdline_test.cc b/test/core/test_util/cmdline_test.cc index 1170cffce43..049676da1c8 100644 --- a/test/core/test_util/cmdline_test.cc +++ b/test/core/test_util/cmdline_test.cc @@ -24,7 +24,7 @@ #include -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" #define LOG_TEST() gpr_log(GPR_INFO, "test at %s:%d", __FILE__, __LINE__) diff --git a/test/core/test_util/histogram.cc b/test/core/test_util/histogram.cc index 8c8887d3e78..fae3d993347 100644 --- a/test/core/test_util/histogram.cc +++ b/test/core/test_util/histogram.cc @@ -27,7 +27,7 @@ #include #include -#include "src/core/lib/gpr/useful.h" +#include "src/core/util/useful.h" // Histograms are stored with exponentially increasing bucket sizes. // The first bucket is [0, m) where m = 1 + resolution diff --git a/test/core/test_util/tls_utils.cc b/test/core/test_util/tls_utils.cc index 56d4a344381..376ce9615ec 100644 --- a/test/core/test_util/tls_utils.cc +++ b/test/core/test_util/tls_utils.cc @@ -26,10 +26,10 @@ #include #include -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/load_file.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/slice/slice_internal.h" +#include "src/core/util/tmpfile.h" #include "test/core/test_util/test_config.h" namespace grpc_core { diff --git a/test/core/transport/chttp2/bin_decoder_test.cc b/test/core/transport/chttp2/bin_decoder_test.cc index 7a0b6b479ff..71f758cf6aa 100644 --- a/test/core/transport/chttp2/bin_decoder_test.cc +++ b/test/core/transport/chttp2/bin_decoder_test.cc @@ -28,9 +28,9 @@ #include #include "src/core/ext/transport/chttp2/transport/bin_encoder.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/util/string.h" #include "test/core/test_util/test_config.h" static int all_ok = 1; diff --git a/test/core/transport/chttp2/bin_encoder_test.cc b/test/core/transport/chttp2/bin_encoder_test.cc index 20247b7c45d..47e59745f9f 100644 --- a/test/core/transport/chttp2/bin_encoder_test.cc +++ b/test/core/transport/chttp2/bin_encoder_test.cc @@ -28,8 +28,8 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/util/string.h" #include "test/core/test_util/test_config.h" static int all_ok = 1; diff --git a/test/core/transport/chttp2/flow_control_fuzzer.cc b/test/core/transport/chttp2/flow_control_fuzzer.cc index 3e8ca29ecbe..de541fed56e 100644 --- a/test/core/transport/chttp2/flow_control_fuzzer.cc +++ b/test/core/transport/chttp2/flow_control_fuzzer.cc @@ -37,11 +37,11 @@ #include "src/core/ext/transport/chttp2/transport/flow_control.h" #include "src/core/lib/experiments/config.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/resource_quota/memory_quota.h" #include "src/core/lib/transport/bdp_estimator.h" +#include "src/core/util/useful.h" #include "src/libfuzzer/libfuzzer_macro.h" #include "test/core/test_util/fuzz_config_vars.h" #include "test/core/transport/chttp2/flow_control_fuzzer.pb.h" diff --git a/test/core/transport/chttp2/flow_control_test.cc b/test/core/transport/chttp2/flow_control_test.cc index 42cab0b8c2d..75652fcfb16 100644 --- a/test/core/transport/chttp2/flow_control_test.cc +++ b/test/core/transport/chttp2/flow_control_test.cc @@ -23,12 +23,12 @@ #include #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/resource_quota/resource_quota.h" #include "src/core/lib/transport/bdp_estimator.h" +#include "src/core/util/useful.h" extern gpr_timespec (*gpr_now_impl)(gpr_clock_type clock_type); diff --git a/test/core/transport/chttp2/graceful_shutdown_test.cc b/test/core/transport/chttp2/graceful_shutdown_test.cc index 1f2d5642d55..b817a2fccf1 100644 --- a/test/core/transport/chttp2/graceful_shutdown_test.cc +++ b/test/core/transport/chttp2/graceful_shutdown_test.cc @@ -49,7 +49,6 @@ #include "src/core/ext/transport/chttp2/transport/frame_goaway.h" #include "src/core/ext/transport/chttp2/transport/frame_ping.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/notification.h" #include "src/core/lib/gprpp/sync.h" @@ -62,6 +61,7 @@ #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/surface/completion_queue.h" #include "src/core/server/server.h" +#include "src/core/util/useful.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/transport/chttp2/streams_not_seen_test.cc b/test/core/transport/chttp2/streams_not_seen_test.cc index 5883ab35f10..dd859111bb9 100644 --- a/test/core/transport/chttp2/streams_not_seen_test.cc +++ b/test/core/transport/chttp2/streams_not_seen_test.cc @@ -56,7 +56,6 @@ #include "src/core/lib/channel/channel_fwd.h" #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/notification.h" @@ -73,6 +72,7 @@ #include "src/core/lib/surface/channel_stack_type.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" +#include "src/core/util/useful.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/test_util/port.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/transport/chttp2/too_many_pings_test.cc b/test/core/transport/chttp2/too_many_pings_test.cc index af914c73ef0..0beb9e2d0a8 100644 --- a/test/core/transport/chttp2/too_many_pings_test.cc +++ b/test/core/transport/chttp2/too_many_pings_test.cc @@ -47,7 +47,6 @@ #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/lib/address_utils/parse_address.h" #include "src/core/lib/channel/channel_args.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" @@ -59,6 +58,7 @@ #include "src/core/resolver/endpoint_addresses.h" #include "src/core/resolver/fake/fake_resolver.h" #include "src/core/resolver/resolver.h" +#include "src/core/util/useful.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/test_util/port.h" #include "test/core/test_util/resolve_localhost_ip46.h" diff --git a/test/core/transport/timeout_encoding_test.cc b/test/core/transport/timeout_encoding_test.cc index 420fd930fee..0f03dfa7b3f 100644 --- a/test/core/transport/timeout_encoding_test.cc +++ b/test/core/transport/timeout_encoding_test.cc @@ -24,8 +24,8 @@ #include "absl/strings/string_view.h" #include "gtest/gtest.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/time.h" +#include "src/core/util/useful.h" namespace grpc_core { namespace { diff --git a/test/core/tsi/alts/frame_protector/frame_handler_test.cc b/test/core/tsi/alts/frame_protector/frame_handler_test.cc index 7563d5542e4..b5ddb31b9b6 100644 --- a/test/core/tsi/alts/frame_protector/frame_handler_test.cc +++ b/test/core/tsi/alts/frame_protector/frame_handler_test.cc @@ -29,8 +29,8 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" +#include "src/core/util/useful.h" #include "test/core/tsi/alts/crypt/gsec_test_util.h" const size_t kFrameHandlerTestBufferSize = 1024; diff --git a/test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc b/test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc index 47e1e115e1e..1b9bbe894dd 100644 --- a/test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc +++ b/test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc @@ -47,7 +47,6 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/thd.h" @@ -56,6 +55,7 @@ #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/security_connector/alts/alts_security_connector.h" #include "src/core/lib/slice/slice_string_helpers.h" +#include "src/core/util/useful.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/test_util/fake_udp_and_tcp_server.h" #include "test/core/test_util/port.h" diff --git a/test/core/tsi/transport_security_test.cc b/test/core/tsi/transport_security_test.cc index 277b435c57d..b541ab12f3f 100644 --- a/test/core/tsi/transport_security_test.cc +++ b/test/core/tsi/transport_security_test.cc @@ -31,11 +31,11 @@ #include #include -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/tsi/fake_transport_security.h" #include "src/core/tsi/ssl_transport_security.h" +#include "src/core/util/string.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" typedef struct { diff --git a/test/core/xds/xds_bootstrap_test.cc b/test/core/xds/xds_bootstrap_test.cc index 1145be71343..295da0298fb 100644 --- a/test/core/xds/xds_bootstrap_test.cc +++ b/test/core/xds/xds_bootstrap_test.cc @@ -36,7 +36,6 @@ #include #include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/validation_errors.h" @@ -47,6 +46,7 @@ #include "src/core/lib/security/certificate_provider/certificate_provider_factory.h" #include "src/core/lib/security/credentials/channel_creds_registry.h" #include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h" +#include "src/core/util/tmpfile.h" #include "src/core/xds/grpc/certificate_provider_store.h" #include "src/core/xds/grpc/xds_bootstrap_grpc.h" #include "test/core/test_util/scoped_env_var.h" diff --git a/test/core/xds/xds_certificate_provider_test.cc b/test/core/xds/xds_certificate_provider_test.cc index caf950f74c4..a005b1d0f6c 100644 --- a/test/core/xds/xds_certificate_provider_test.cc +++ b/test/core/xds/xds_certificate_provider_test.cc @@ -25,10 +25,10 @@ #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/security/security_connector/ssl_utils.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" #include "test/core/test_util/tls_utils.h" diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 87e633d854f..10b0c80e066 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -31,8 +31,8 @@ #include #include -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/env.h" +#include "src/core/util/tmpfile.h" #include "src/cpp/client/secure_credentials.h" #include "test/cpp/util/tls_test_utils.h" diff --git a/test/cpp/common/channel_arguments_test.cc b/test/cpp/common/channel_arguments_test.cc index e25039829ac..a6c7167d25e 100644 --- a/test/cpp/common/channel_arguments_test.cc +++ b/test/cpp/common/channel_arguments_test.cc @@ -22,9 +22,9 @@ #include #include -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/socket_mutator.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" namespace grpc { diff --git a/test/cpp/end2end/tls_key_export_test.cc b/test/cpp/end2end/tls_key_export_test.cc index 09cbed9171b..ad08372f20f 100644 --- a/test/cpp/end2end/tls_key_export_test.cc +++ b/test/cpp/end2end/tls_key_export_test.cc @@ -31,7 +31,7 @@ #include #include -#include "src/core/lib/gpr/tmpfile.h" +#include "src/core/util/tmpfile.h" #include "src/cpp/client/secure_credentials.h" #include "src/proto/grpc/testing/echo.grpc.pb.h" #include "test/core/test_util/resolve_localhost_ip46.h" diff --git a/test/cpp/end2end/xds/xds_end2end_test.cc b/test/cpp/end2end/xds/xds_end2end_test.cc index 8e2d47e686e..ec603b06f06 100644 --- a/test/cpp/end2end/xds/xds_end2end_test.cc +++ b/test/cpp/end2end/xds/xds_end2end_test.cc @@ -63,9 +63,6 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/config_vars.h" #include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/time_precise.h" -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" @@ -80,6 +77,9 @@ #include "src/core/load_balancing/xds/xds_channel_args.h" #include "src/core/resolver/endpoint_addresses.h" #include "src/core/resolver/fake/fake_resolver.h" +#include "src/core/util/string.h" +#include "src/core/util/time_precise.h" +#include "src/core/util/tmpfile.h" #include "src/core/xds/grpc/xds_listener.h" #include "src/core/xds/xds_client/xds_api.h" #include "src/core/xds/xds_client/xds_channel_args.h" diff --git a/test/cpp/end2end/xds/xds_end2end_test_lib.cc b/test/cpp/end2end/xds/xds_end2end_test_lib.cc index 2301e0d3fd3..efccd9e0fb6 100644 --- a/test/cpp/end2end/xds/xds_end2end_test_lib.cc +++ b/test/cpp/end2end/xds/xds_end2end_test_lib.cc @@ -37,9 +37,9 @@ #include #include "src/core/ext/filters/http/server/http_server_filter.h" -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/env.h" #include "src/core/server/server.h" +#include "src/core/util/tmpfile.h" #include "src/core/xds/grpc/xds_client_grpc.h" #include "src/core/xds/xds_client/xds_channel_args.h" #include "src/proto/grpc/testing/xds/v3/router.grpc.pb.h" diff --git a/test/cpp/end2end/xds/xds_utils.cc b/test/cpp/end2end/xds/xds_utils.cc index 897300b230d..f70ca9b9ccd 100644 --- a/test/cpp/end2end/xds/xds_utils.cc +++ b/test/cpp/end2end/xds/xds_utils.cc @@ -34,9 +34,9 @@ #include #include "src/core/ext/filters/http/server/http_server_filter.h" -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/env.h" #include "src/core/server/server.h" +#include "src/core/util/tmpfile.h" #include "src/core/xds/grpc/xds_client_grpc.h" #include "src/core/xds/xds_client/xds_channel_args.h" #include "src/cpp/client/secure_credentials.h" diff --git a/test/cpp/ext/csm/mesh_id_test.cc b/test/cpp/ext/csm/mesh_id_test.cc index 437d57c52e6..7d0b8ba8c21 100644 --- a/test/cpp/ext/csm/mesh_id_test.cc +++ b/test/cpp/ext/csm/mesh_id_test.cc @@ -20,8 +20,8 @@ #include -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/env.h" +#include "src/core/util/tmpfile.h" #include "src/cpp/ext/csm/metadata_exchange.h" #include "test/core/test_util/test_config.h" diff --git a/test/cpp/ext/csm/metadata_exchange_test.cc b/test/cpp/ext/csm/metadata_exchange_test.cc index aeaad05117d..3f5d8af74b7 100644 --- a/test/cpp/ext/csm/metadata_exchange_test.cc +++ b/test/cpp/ext/csm/metadata_exchange_test.cc @@ -31,8 +31,8 @@ #include "src/core/lib/channel/call_tracer.h" #include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/env.h" +#include "src/core/util/tmpfile.h" #include "src/cpp/ext/csm/csm_observability.h" #include "src/cpp/ext/otel/otel_plugin.h" #include "test/core/test_util/test_config.h" diff --git a/test/cpp/ext/gcp/observability_config_test.cc b/test/cpp/ext/gcp/observability_config_test.cc index 73ffe386bff..0a1f91abc38 100644 --- a/test/cpp/ext/gcp/observability_config_test.cc +++ b/test/cpp/ext/gcp/observability_config_test.cc @@ -22,9 +22,9 @@ #include #include "src/core/lib/config/core_configuration.h" -#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gprpp/env.h" #include "src/core/lib/json/json_reader.h" +#include "src/core/util/tmpfile.h" #include "test/core/test_util/test_config.h" namespace grpc { diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index 866f4f67129..7d5a9dad71c 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -28,8 +28,8 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" +#include "src/core/util/string.h" #include "test/core/test_util/test_config.h" #include "test/cpp/interop/client_helper.h" #include "test/cpp/interop/interop_client.h" diff --git a/test/cpp/interop/grpclb_fallback_test.cc b/test/cpp/interop/grpclb_fallback_test.cc index 331885e8c0f..594c5b6b39b 100644 --- a/test/cpp/interop/grpclb_fallback_test.cc +++ b/test/cpp/interop/grpclb_fallback_test.cc @@ -43,10 +43,10 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/socket_mutator.h" +#include "src/core/util/string.h" #include "src/proto/grpc/testing/empty.pb.h" #include "src/proto/grpc/testing/messages.pb.h" #include "src/proto/grpc/testing/test.grpc.pb.h" diff --git a/test/cpp/interop/http2_client.cc b/test/cpp/interop/http2_client.cc index 89477f3cd51..62c728d4c78 100644 --- a/test/cpp/interop/http2_client.cc +++ b/test/cpp/interop/http2_client.cc @@ -29,9 +29,9 @@ #include #include -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" +#include "src/core/util/string.h" +#include "src/core/util/useful.h" #include "src/proto/grpc/testing/messages.pb.h" #include "src/proto/grpc/testing/test.grpc.pb.h" #include "test/cpp/util/create_test_channel.h" diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index 26c51b9869a..32f005598ec 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -35,9 +35,9 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/sync.h" +#include "src/core/util/string.h" #include "src/proto/grpc/testing/empty.pb.h" #include "src/proto/grpc/testing/messages.pb.h" #include "src/proto/grpc/testing/test.grpc.pb.h" diff --git a/test/cpp/interop/interop_test.cc b/test/cpp/interop/interop_test.cc index b1e9deaf78e..d8eaf556601 100644 --- a/test/cpp/interop/interop_test.cc +++ b/test/cpp/interop/interop_test.cc @@ -34,9 +34,9 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/iomgr/socket_utils_posix.h" +#include "src/core/util/string.h" #include "test/core/test_util/port.h" #include "test/cpp/util/test_config.h" diff --git a/test/cpp/interop/observability_client.cc b/test/cpp/interop/observability_client.cc index 0fe08d242dc..5e39495ae68 100644 --- a/test/cpp/interop/observability_client.cc +++ b/test/cpp/interop/observability_client.cc @@ -32,8 +32,8 @@ #include #include -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" +#include "src/core/util/string.h" #include "test/core/test_util/test_config.h" #include "test/cpp/interop/client_helper.h" #include "test/cpp/interop/interop_client.h" diff --git a/test/cpp/interop/xds_federation_client.cc b/test/cpp/interop/xds_federation_client.cc index 3de9b2b5f68..4efc58f9d8d 100644 --- a/test/cpp/interop/xds_federation_client.cc +++ b/test/cpp/interop/xds_federation_client.cc @@ -27,7 +27,7 @@ #include #include -#include "src/core/lib/gpr/string.h" +#include "src/core/util/string.h" #include "test/core/test_util/test_config.h" #include "test/cpp/interop/client_helper.h" #include "test/cpp/interop/interop_client.h" diff --git a/test/cpp/microbenchmarks/bm_closure.cc b/test/cpp/microbenchmarks/bm_closure.cc index 923bdb871ca..1622cc2fc93 100644 --- a/test/cpp/microbenchmarks/bm_closure.cc +++ b/test/cpp/microbenchmarks/bm_closure.cc @@ -24,10 +24,10 @@ #include -#include "src/core/lib/gpr/spinlock.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/exec_ctx.h" +#include "src/core/util/spinlock.h" #include "test/core/test_util/test_config.h" #include "test/cpp/microbenchmarks/helpers.h" #include "test/cpp/util/test_config.h" diff --git a/test/cpp/microbenchmarks/bm_thread_pool.cc b/test/cpp/microbenchmarks/bm_thread_pool.cc index 0514a948019..323c5267c56 100644 --- a/test/cpp/microbenchmarks/bm_thread_pool.cc +++ b/test/cpp/microbenchmarks/bm_thread_pool.cc @@ -27,9 +27,9 @@ #include "src/core/lib/event_engine/common_closures.h" #include "src/core/lib/event_engine/thread_pool/thread_pool.h" -#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/notification.h" +#include "src/core/util/useful.h" #include "test/core/test_util/test_config.h" #include "test/cpp/microbenchmarks/helpers.h" #include "test/cpp/util/test_config.h" diff --git a/test/cpp/naming/address_sorting_test.cc b/test/cpp/naming/address_sorting_test.cc index b244057215b..0ce5a1d5150 100644 --- a/test/cpp/naming/address_sorting_test.cc +++ b/test/cpp/naming/address_sorting_test.cc @@ -37,7 +37,6 @@ #include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/config/config_vars.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/iomgr/combiner.h" @@ -48,6 +47,7 @@ #include "src/core/resolver/endpoint_addresses.h" #include "src/core/resolver/resolver.h" #include "src/core/resolver/resolver_registry.h" +#include "src/core/util/string.h" #include "test/core/test_util/port.h" #include "test/core/test_util/test_config.h" #include "test/cpp/util/subprocess.h" diff --git a/test/cpp/naming/cancel_ares_query_test.cc b/test/cpp/naming/cancel_ares_query_test.cc index b62cd8b1b71..29b5a19d65c 100644 --- a/test/cpp/naming/cancel_ares_query_test.cc +++ b/test/cpp/naming/cancel_ares_query_test.cc @@ -43,7 +43,6 @@ #include "src/core/lib/event_engine/ares_resolver.h" #include "src/core/lib/event_engine/default_event_engine.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/thd.h" @@ -54,6 +53,7 @@ #include "src/core/resolver/dns/c_ares/grpc_ares_wrapper.h" #include "src/core/resolver/resolver.h" #include "src/core/resolver/resolver_registry.h" +#include "src/core/util/string.h" #include "test/core/end2end/cq_verifier.h" #include "test/core/test_util/cmdline.h" #include "test/core/test_util/fake_udp_and_tcp_server.h" diff --git a/test/cpp/naming/resolver_component_test.cc b/test/cpp/naming/resolver_component_test.cc index 6f0e3678a91..78909d9eb17 100644 --- a/test/cpp/naming/resolver_component_test.cc +++ b/test/cpp/naming/resolver_component_test.cc @@ -48,7 +48,6 @@ #include "src/core/lib/event_engine/ares_resolver.h" #include "src/core/lib/event_engine/default_event_engine.h" #include "src/core/lib/experiments/experiments.h" -#include "src/core/lib/gpr/string.h" #include "src/core/lib/gprpp/crash.h" #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/orphanable.h" @@ -62,6 +61,7 @@ #include "src/core/resolver/endpoint_addresses.h" #include "src/core/resolver/resolver.h" #include "src/core/resolver/resolver_registry.h" +#include "src/core/util/string.h" #include "test/core/test_util/fake_udp_and_tcp_server.h" #include "test/core/test_util/port.h" #include "test/core/test_util/socket_use_after_close_detector.h" diff --git a/test/cpp/util/subprocess.cc b/test/cpp/util/subprocess.cc index 2f0c9cd03b2..05017fc1b7d 100644 --- a/test/cpp/util/subprocess.cc +++ b/test/cpp/util/subprocess.cc @@ -20,7 +20,7 @@ #include -#include "src/core/lib/gpr/subprocess.h" +#include "src/core/util/subprocess.h" namespace grpc { diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 649e1eb576a..3f4a53208c2 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -2260,38 +2260,6 @@ src/core/lib/experiments/config.cc \ src/core/lib/experiments/config.h \ src/core/lib/experiments/experiments.cc \ src/core/lib/experiments/experiments.h \ -src/core/lib/gpr/alloc.cc \ -src/core/lib/gpr/alloc.h \ -src/core/lib/gpr/android/log.cc \ -src/core/lib/gpr/atm.cc \ -src/core/lib/gpr/iphone/cpu.cc \ -src/core/lib/gpr/linux/cpu.cc \ -src/core/lib/gpr/linux/log.cc \ -src/core/lib/gpr/log.cc \ -src/core/lib/gpr/msys/tmpfile.cc \ -src/core/lib/gpr/posix/cpu.cc \ -src/core/lib/gpr/posix/log.cc \ -src/core/lib/gpr/posix/string.cc \ -src/core/lib/gpr/posix/sync.cc \ -src/core/lib/gpr/posix/time.cc \ -src/core/lib/gpr/posix/tmpfile.cc \ -src/core/lib/gpr/spinlock.h \ -src/core/lib/gpr/string.cc \ -src/core/lib/gpr/string.h \ -src/core/lib/gpr/sync.cc \ -src/core/lib/gpr/sync_abseil.cc \ -src/core/lib/gpr/time.cc \ -src/core/lib/gpr/time_precise.cc \ -src/core/lib/gpr/time_precise.h \ -src/core/lib/gpr/tmpfile.h \ -src/core/lib/gpr/useful.h \ -src/core/lib/gpr/windows/cpu.cc \ -src/core/lib/gpr/windows/log.cc \ -src/core/lib/gpr/windows/string.cc \ -src/core/lib/gpr/windows/string_util.cc \ -src/core/lib/gpr/windows/sync.cc \ -src/core/lib/gpr/windows/time.cc \ -src/core/lib/gpr/windows/tmpfile.cc \ src/core/lib/gprpp/atomic_utils.h \ src/core/lib/gprpp/bitset.h \ src/core/lib/gprpp/chunked_vector.h \ @@ -2957,6 +2925,38 @@ src/core/tsi/transport_security.h \ src/core/tsi/transport_security_grpc.cc \ src/core/tsi/transport_security_grpc.h \ src/core/tsi/transport_security_interface.h \ +src/core/util/alloc.cc \ +src/core/util/alloc.h \ +src/core/util/android/log.cc \ +src/core/util/atm.cc \ +src/core/util/iphone/cpu.cc \ +src/core/util/linux/cpu.cc \ +src/core/util/linux/log.cc \ +src/core/util/log.cc \ +src/core/util/msys/tmpfile.cc \ +src/core/util/posix/cpu.cc \ +src/core/util/posix/log.cc \ +src/core/util/posix/string.cc \ +src/core/util/posix/sync.cc \ +src/core/util/posix/time.cc \ +src/core/util/posix/tmpfile.cc \ +src/core/util/spinlock.h \ +src/core/util/string.cc \ +src/core/util/string.h \ +src/core/util/sync.cc \ +src/core/util/sync_abseil.cc \ +src/core/util/time.cc \ +src/core/util/time_precise.cc \ +src/core/util/time_precise.h \ +src/core/util/tmpfile.h \ +src/core/util/useful.h \ +src/core/util/windows/cpu.cc \ +src/core/util/windows/log.cc \ +src/core/util/windows/string.cc \ +src/core/util/windows/string_util.cc \ +src/core/util/windows/sync.cc \ +src/core/util/windows/time.cc \ +src/core/util/windows/tmpfile.cc \ src/core/xds/grpc/certificate_provider_store.cc \ src/core/xds/grpc/certificate_provider_store.h \ src/core/xds/grpc/file_watcher_certificate_provider_factory.cc \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index d3a4f44a588..72b1676eeaf 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -2032,39 +2032,6 @@ src/core/lib/experiments/config.cc \ src/core/lib/experiments/config.h \ src/core/lib/experiments/experiments.cc \ src/core/lib/experiments/experiments.h \ -src/core/lib/gpr/README.md \ -src/core/lib/gpr/alloc.cc \ -src/core/lib/gpr/alloc.h \ -src/core/lib/gpr/android/log.cc \ -src/core/lib/gpr/atm.cc \ -src/core/lib/gpr/iphone/cpu.cc \ -src/core/lib/gpr/linux/cpu.cc \ -src/core/lib/gpr/linux/log.cc \ -src/core/lib/gpr/log.cc \ -src/core/lib/gpr/msys/tmpfile.cc \ -src/core/lib/gpr/posix/cpu.cc \ -src/core/lib/gpr/posix/log.cc \ -src/core/lib/gpr/posix/string.cc \ -src/core/lib/gpr/posix/sync.cc \ -src/core/lib/gpr/posix/time.cc \ -src/core/lib/gpr/posix/tmpfile.cc \ -src/core/lib/gpr/spinlock.h \ -src/core/lib/gpr/string.cc \ -src/core/lib/gpr/string.h \ -src/core/lib/gpr/sync.cc \ -src/core/lib/gpr/sync_abseil.cc \ -src/core/lib/gpr/time.cc \ -src/core/lib/gpr/time_precise.cc \ -src/core/lib/gpr/time_precise.h \ -src/core/lib/gpr/tmpfile.h \ -src/core/lib/gpr/useful.h \ -src/core/lib/gpr/windows/cpu.cc \ -src/core/lib/gpr/windows/log.cc \ -src/core/lib/gpr/windows/string.cc \ -src/core/lib/gpr/windows/string_util.cc \ -src/core/lib/gpr/windows/sync.cc \ -src/core/lib/gpr/windows/time.cc \ -src/core/lib/gpr/windows/tmpfile.cc \ src/core/lib/gprpp/README.md \ src/core/lib/gprpp/atomic_utils.h \ src/core/lib/gprpp/bitset.h \ @@ -2739,6 +2706,39 @@ src/core/tsi/transport_security.h \ src/core/tsi/transport_security_grpc.cc \ src/core/tsi/transport_security_grpc.h \ src/core/tsi/transport_security_interface.h \ +src/core/util/README.md \ +src/core/util/alloc.cc \ +src/core/util/alloc.h \ +src/core/util/android/log.cc \ +src/core/util/atm.cc \ +src/core/util/iphone/cpu.cc \ +src/core/util/linux/cpu.cc \ +src/core/util/linux/log.cc \ +src/core/util/log.cc \ +src/core/util/msys/tmpfile.cc \ +src/core/util/posix/cpu.cc \ +src/core/util/posix/log.cc \ +src/core/util/posix/string.cc \ +src/core/util/posix/sync.cc \ +src/core/util/posix/time.cc \ +src/core/util/posix/tmpfile.cc \ +src/core/util/spinlock.h \ +src/core/util/string.cc \ +src/core/util/string.h \ +src/core/util/sync.cc \ +src/core/util/sync_abseil.cc \ +src/core/util/time.cc \ +src/core/util/time_precise.cc \ +src/core/util/time_precise.h \ +src/core/util/tmpfile.h \ +src/core/util/useful.h \ +src/core/util/windows/cpu.cc \ +src/core/util/windows/log.cc \ +src/core/util/windows/string.cc \ +src/core/util/windows/string_util.cc \ +src/core/util/windows/sync.cc \ +src/core/util/windows/time.cc \ +src/core/util/windows/tmpfile.cc \ src/core/xds/grpc/certificate_provider_store.cc \ src/core/xds/grpc/certificate_provider_store.h \ src/core/xds/grpc/file_watcher_certificate_provider_factory.cc \ diff --git a/tools/run_tests/sanity/check_absl_mutex.sh b/tools/run_tests/sanity/check_absl_mutex.sh index a2f8812e0a8..e4b5cb27d9d 100755 --- a/tools/run_tests/sanity/check_absl_mutex.sh +++ b/tools/run_tests/sanity/check_absl_mutex.sh @@ -29,7 +29,7 @@ find . \( \( -name "*.cc" \) -or \( -name "*.h" \) \) \ -or \( -wholename "./test/*" \) \) \ -a -not -wholename "./include/grpcpp/impl/sync.h" \ -a -not -wholename "./src/core/lib/gprpp/sync.h" \ - -a -not -wholename "./src/core/lib/gpr/sync_abseil.cc" \ + -a -not -wholename "./src/core/util/sync_abseil.cc" \ -print0 |\ xargs -0 grep -n "absl::Mutex" | \ diff - /dev/null From f2735861c0ff5fd8ea1728e5df46474f57687918 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Wed, 15 May 2024 16:31:52 -0700 Subject: [PATCH 8/9] [Test] Install g++ before gen_upb_api (#36628) This is to address the following error error thrown when running protobuf-at-head. This is because Bazel needs a C++ compiler to run `tools/codegen/core/gen_upb_api.sh`. ``` Auto-Configuration Error: Cannot find gcc or CC (clang); either correct your path or set the CC environment variable ``` This is not ideal as installing `build-essential` package takes time but let's fix it first and get this installed in the CI image later. Closes #36628 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36628 from veblush:p-fix-at-head 01ac20f057362c51141312ba202fd20bf629a414 PiperOrigin-RevId: 634114867 --- tools/internal_ci/linux/grpc_build_submodule_at_head.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/internal_ci/linux/grpc_build_submodule_at_head.sh b/tools/internal_ci/linux/grpc_build_submodule_at_head.sh index 8450499c272..8beedb1c5b3 100755 --- a/tools/internal_ci/linux/grpc_build_submodule_at_head.sh +++ b/tools/internal_ci/linux/grpc_build_submodule_at_head.sh @@ -74,6 +74,8 @@ then # update upb rm -rf third_party/upb/upb cp -r third_party/protobuf/upb third_party/upb + # generate upb gen source codes + export CC=gcc tools/codegen/core/gen_upb_api.sh # update utf8_range rm -rf third_party/utf8_range From 3ca738907c9b8b1ff20951f9f9425e72f417722f Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 15 May 2024 20:11:53 -0700 Subject: [PATCH 9/9] [experiments] Remove pending_queue_cap experiment (#36632) Closes #36632 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36632 from ctiller:transport-refs-5 de23da2a541ba223ab4d3bf95df81f8e7eb4581e PiperOrigin-RevId: 634177606 --- bazel/experiments.bzl | 1 - src/core/lib/experiments/experiments.cc | 30 ----------------------- src/core/lib/experiments/experiments.h | 11 --------- src/core/lib/experiments/experiments.yaml | 11 --------- 4 files changed, 53 deletions(-) diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index 0bd711b6641..013e8ae208a 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -31,7 +31,6 @@ EXPERIMENT_ENABLES = { "monitoring_experiment": "monitoring_experiment", "multiping": "multiping", "peer_state_based_framing": "peer_state_based_framing", - "pending_queue_cap": "pending_queue_cap", "pick_first_new": "pick_first_new", "promise_based_client_call": "event_engine_client,event_engine_listener,promise_based_client_call", "chaotic_good": "chaotic_good,event_engine_client,event_engine_listener,promise_based_client_call", diff --git a/src/core/lib/experiments/experiments.cc b/src/core/lib/experiments/experiments.cc index 4bf01759fc2..a8996e8e124 100644 --- a/src/core/lib/experiments/experiments.cc +++ b/src/core/lib/experiments/experiments.cc @@ -70,14 +70,6 @@ const char* const description_peer_state_based_framing = "on the peer's memory pressure which is reflected in its max http2 frame " "size."; const char* const additional_constraints_peer_state_based_framing = "{}"; -const char* const description_pending_queue_cap = - "In the sync & async apis (but not the callback api), cap the number of " - "received but unrequested requests in the server for each call type. A " - "received message is one that was read from the wire on the server. A " - "requested message is one explicitly requested by the application using " - "grpc_server_request_call or grpc_server_request_registered_call (or their " - "wrappers in the C++ API)."; -const char* const additional_constraints_pending_queue_cap = "{}"; const char* const description_pick_first_new = "New pick_first impl with memory reduction."; const char* const additional_constraints_pick_first_new = "{}"; @@ -171,8 +163,6 @@ const ExperimentMetadata g_experiment_metadata[] = { nullptr, 0, false, true}, {"peer_state_based_framing", description_peer_state_based_framing, additional_constraints_peer_state_based_framing, nullptr, 0, false, true}, - {"pending_queue_cap", description_pending_queue_cap, - additional_constraints_pending_queue_cap, nullptr, 0, true, true}, {"pick_first_new", description_pick_first_new, additional_constraints_pick_first_new, nullptr, 0, true, true}, {"promise_based_client_call", description_promise_based_client_call, @@ -262,14 +252,6 @@ const char* const description_peer_state_based_framing = "on the peer's memory pressure which is reflected in its max http2 frame " "size."; const char* const additional_constraints_peer_state_based_framing = "{}"; -const char* const description_pending_queue_cap = - "In the sync & async apis (but not the callback api), cap the number of " - "received but unrequested requests in the server for each call type. A " - "received message is one that was read from the wire on the server. A " - "requested message is one explicitly requested by the application using " - "grpc_server_request_call or grpc_server_request_registered_call (or their " - "wrappers in the C++ API)."; -const char* const additional_constraints_pending_queue_cap = "{}"; const char* const description_pick_first_new = "New pick_first impl with memory reduction."; const char* const additional_constraints_pick_first_new = "{}"; @@ -363,8 +345,6 @@ const ExperimentMetadata g_experiment_metadata[] = { nullptr, 0, false, true}, {"peer_state_based_framing", description_peer_state_based_framing, additional_constraints_peer_state_based_framing, nullptr, 0, false, true}, - {"pending_queue_cap", description_pending_queue_cap, - additional_constraints_pending_queue_cap, nullptr, 0, true, true}, {"pick_first_new", description_pick_first_new, additional_constraints_pick_first_new, nullptr, 0, true, true}, {"promise_based_client_call", description_promise_based_client_call, @@ -454,14 +434,6 @@ const char* const description_peer_state_based_framing = "on the peer's memory pressure which is reflected in its max http2 frame " "size."; const char* const additional_constraints_peer_state_based_framing = "{}"; -const char* const description_pending_queue_cap = - "In the sync & async apis (but not the callback api), cap the number of " - "received but unrequested requests in the server for each call type. A " - "received message is one that was read from the wire on the server. A " - "requested message is one explicitly requested by the application using " - "grpc_server_request_call or grpc_server_request_registered_call (or their " - "wrappers in the C++ API)."; -const char* const additional_constraints_pending_queue_cap = "{}"; const char* const description_pick_first_new = "New pick_first impl with memory reduction."; const char* const additional_constraints_pick_first_new = "{}"; @@ -555,8 +527,6 @@ const ExperimentMetadata g_experiment_metadata[] = { nullptr, 0, false, true}, {"peer_state_based_framing", description_peer_state_based_framing, additional_constraints_peer_state_based_framing, nullptr, 0, false, true}, - {"pending_queue_cap", description_pending_queue_cap, - additional_constraints_pending_queue_cap, nullptr, 0, true, true}, {"pick_first_new", description_pick_first_new, additional_constraints_pick_first_new, nullptr, 0, true, true}, {"promise_based_client_call", description_promise_based_client_call, diff --git a/src/core/lib/experiments/experiments.h b/src/core/lib/experiments/experiments.h index 16220be2591..db7c9664bcd 100644 --- a/src/core/lib/experiments/experiments.h +++ b/src/core/lib/experiments/experiments.h @@ -74,8 +74,6 @@ inline bool IsKeepaliveServerFixEnabled() { return false; } inline bool IsMonitoringExperimentEnabled() { return true; } inline bool IsMultipingEnabled() { return false; } inline bool IsPeerStateBasedFramingEnabled() { return false; } -#define GRPC_EXPERIMENT_IS_INCLUDED_PENDING_QUEUE_CAP -inline bool IsPendingQueueCapEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_PICK_FIRST_NEW inline bool IsPickFirstNewEnabled() { return true; } inline bool IsPromiseBasedClientCallEnabled() { return false; } @@ -113,8 +111,6 @@ inline bool IsKeepaliveServerFixEnabled() { return false; } inline bool IsMonitoringExperimentEnabled() { return true; } inline bool IsMultipingEnabled() { return false; } inline bool IsPeerStateBasedFramingEnabled() { return false; } -#define GRPC_EXPERIMENT_IS_INCLUDED_PENDING_QUEUE_CAP -inline bool IsPendingQueueCapEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_PICK_FIRST_NEW inline bool IsPickFirstNewEnabled() { return true; } inline bool IsPromiseBasedClientCallEnabled() { return false; } @@ -152,8 +148,6 @@ inline bool IsKeepaliveServerFixEnabled() { return false; } inline bool IsMonitoringExperimentEnabled() { return true; } inline bool IsMultipingEnabled() { return false; } inline bool IsPeerStateBasedFramingEnabled() { return false; } -#define GRPC_EXPERIMENT_IS_INCLUDED_PENDING_QUEUE_CAP -inline bool IsPendingQueueCapEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_PICK_FIRST_NEW inline bool IsPickFirstNewEnabled() { return true; } inline bool IsPromiseBasedClientCallEnabled() { return false; } @@ -189,7 +183,6 @@ enum ExperimentIds { kExperimentIdMonitoringExperiment, kExperimentIdMultiping, kExperimentIdPeerStateBasedFraming, - kExperimentIdPendingQueueCap, kExperimentIdPickFirstNew, kExperimentIdPromiseBasedClientCall, kExperimentIdChaoticGood, @@ -261,10 +254,6 @@ inline bool IsMultipingEnabled() { inline bool IsPeerStateBasedFramingEnabled() { return IsExperimentEnabled(kExperimentIdPeerStateBasedFraming); } -#define GRPC_EXPERIMENT_IS_INCLUDED_PENDING_QUEUE_CAP -inline bool IsPendingQueueCapEnabled() { - return IsExperimentEnabled(kExperimentIdPendingQueueCap); -} #define GRPC_EXPERIMENT_IS_INCLUDED_PICK_FIRST_NEW inline bool IsPickFirstNewEnabled() { return IsExperimentEnabled(kExperimentIdPickFirstNew); diff --git a/src/core/lib/experiments/experiments.yaml b/src/core/lib/experiments/experiments.yaml index 0e00f5c4d68..4d1a27e4d3c 100644 --- a/src/core/lib/experiments/experiments.yaml +++ b/src/core/lib/experiments/experiments.yaml @@ -139,17 +139,6 @@ expiry: 2024/08/01 owner: vigneshbabu@google.com test_tags: ["flow_control_test"] -- name: pending_queue_cap - description: - In the sync & async apis (but not the callback api), cap the number of - received but unrequested requests in the server for each call type. - A received message is one that was read from the wire on the server. - A requested message is one explicitly requested by the application using - grpc_server_request_call or grpc_server_request_registered_call (or their - wrappers in the C++ API). - expiry: 2024/05/05 - owner: ctiller@google.com - test_tags: [] - name: pick_first_new description: New pick_first impl with memory reduction. expiry: 2024/07/30