[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36405)

[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT
Replacing GPR_ASSERT with absl CHECK

These changes have been made using string replacement and regex.

Will not be replacing all instances of CHECK with CHECK_EQ , CHECK_NE etc because there are too many callsites. Only ones which are doable using very simple regex with least chance of failure will be replaced.

Given that we have 5000+ instances of GPR_ASSERT to edit, Doing it manually is too much work for both the author and reviewer.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #36405

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36405 from tanvi-jagtap:tjagtap_microbenchmarks_01 0dcec5d852
PiperOrigin-RevId: 626522246
pull/36415/head
Tanvi Jagtap 10 months ago committed by Copybara-Service
parent e9d1397fe1
commit dc848c3e05
  1. 4
      test/cpp/microbenchmarks/bm_chttp2_hpack.cc
  2. 2
      test/cpp/microbenchmarks/bm_chttp2_transport.cc
  3. 4
      test/cpp/microbenchmarks/bm_event_engine_run.cc
  4. 4
      test/cpp/microbenchmarks/bm_thread_pool.cc

@ -365,7 +365,7 @@ static void BM_HpackParserParseHeader(benchmark::State& state) {
auto error =
p.Parse(slices[i], i == slices.size() - 1, absl::BitGenRef(bitgen),
/*call_tracer=*/nullptr);
CHECK(error.ok());
CHECK_OK(error);
}
};
parse_vec(init_slices);
@ -445,7 +445,7 @@ class FromEncoderFixture {
}
// Remove the HTTP header.
CHECK(!out.empty());
CHECK(GRPC_SLICE_LENGTH(out[0]) > 9);
CHECK_GT(GRPC_SLICE_LENGTH(out[0]), 9);
out[0] = grpc_slice_sub_no_ref(out[0], 9, GRPC_SLICE_LENGTH(out[0]));
return out;
}

@ -395,7 +395,7 @@ static void BM_TransportEmptyOp(benchmark::State& state) {
gpr_event_init(stream_cancel_done);
std::unique_ptr<TestClosure> stream_cancel_closure =
MakeTestClosure([&](grpc_error_handle error) {
CHECK(error.ok());
CHECK_OK(error);
gpr_event_set(stream_cancel_done, reinterpret_cast<void*>(1));
});
op.on_complete = stream_cancel_closure.get();

@ -181,7 +181,7 @@ void FanOutCallback(std::shared_ptr<EventEngine> engine,
signal.Notify();
return;
}
GPR_DEBUG_ASSERT(local_cnt < params.limit);
DCHECK_LT(local_cnt, params.limit);
if (params.depth == processing_layer) return;
for (int i = 0; i < params.fanout; i++) {
engine->Run([engine, params, processing_layer, &count, &signal]() {
@ -244,7 +244,7 @@ void BM_EventEngine_Closure_FanOut(benchmark::State& state) {
}));
}
for (auto _ : state) {
GPR_DEBUG_ASSERT(count.load(std::memory_order_relaxed) == 0);
DCHECK_EQ(count.load(std::memory_order_relaxed), 0);
engine->Run(closures[params.depth + 1]);
do {
signal->WaitForNotification();

@ -156,7 +156,7 @@ void FanOutCallback(std::shared_ptr<ThreadPool> pool,
signal.Notify();
return;
}
GPR_DEBUG_ASSERT(local_cnt < params.limit);
DCHECK_LT(local_cnt, params.limit);
if (params.depth == processing_layer) return;
for (int i = 0; i < params.fanout; i++) {
pool->Run([pool, params, processing_layer, &count, &signal]() {
@ -222,7 +222,7 @@ void BM_ThreadPool_Closure_FanOut(benchmark::State& state) {
}));
}
for (auto _ : state) {
GPR_DEBUG_ASSERT(count.load(std::memory_order_relaxed) == 0);
DCHECK_EQ(count.load(std::memory_order_relaxed), 0);
pool->Run(closures[params.depth + 1]);
do {
signal->WaitForNotification();

Loading…
Cancel
Save