From 42bd720fee5fb916a3e7ec6697d856bc0b8fcf70 Mon Sep 17 00:00:00 2001 From: Tanvi Jagtap <139093547+tanvi-jagtap@users.noreply.github.com> Date: Fri, 16 Aug 2024 09:54:39 -0700 Subject: [PATCH] [Gpr_To_Absl_Logging] Fix use of GRPC_TRACE_FLAG_ENABLED in gen code (#37514) [Gpr_To_Absl_Logging] Fix use of GRPC_TRACE_FLAG_ENABLED in gen code Closes #37514 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37514 from tanvi-jagtap:fix_gen_code_GRPC_TRACE_FLAG_ENABLED 096004c6d7935dce4aae77019c78d6947f3525ce PiperOrigin-RevId: 663762507 --- src/core/BUILD | 1 + src/core/lib/promise/detail/join_state.h | 88 +- src/core/lib/promise/detail/seq_state.h | 2457 ++++++++++------------ tools/codegen/core/gen_join.py | 2 +- tools/codegen/core/gen_seq.py | 16 +- 5 files changed, 1151 insertions(+), 1413 deletions(-) diff --git a/src/core/BUILD b/src/core/BUILD index d5a6c51183d..a8e9a54020e 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -954,6 +954,7 @@ grpc_cc_library( grpc_cc_library( name = "seq", + external_deps = ["absl/log:log"], language = "c++", public_hdrs = [ "lib/promise/seq.h", diff --git a/src/core/lib/promise/detail/join_state.h b/src/core/lib/promise/detail/join_state.h index d6ce8782bfa..403ec38b067 100644 --- a/src/core/lib/promise/detail/join_state.h +++ b/src/core/lib/promise/detail/join_state.h @@ -103,7 +103,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 1/2 already ready"; } @@ -125,7 +125,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 2/2 already ready"; } @@ -216,7 +216,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 1/3 already ready"; } @@ -238,7 +238,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 2/3 already ready"; } @@ -260,7 +260,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 3/3 already ready"; } @@ -367,7 +367,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 1/4 already ready"; } @@ -389,7 +389,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 2/4 already ready"; } @@ -411,7 +411,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 3/4 already ready"; } @@ -433,7 +433,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 4/4 already ready"; } @@ -555,7 +555,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 1/5 already ready"; } @@ -577,7 +577,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 2/5 already ready"; } @@ -599,7 +599,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 3/5 already ready"; } @@ -621,7 +621,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 4/5 already ready"; } @@ -643,7 +643,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 5/5 already ready"; } @@ -780,7 +780,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 1/6 already ready"; } @@ -802,7 +802,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 2/6 already ready"; } @@ -824,7 +824,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 3/6 already ready"; } @@ -846,7 +846,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 4/6 already ready"; } @@ -868,7 +868,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 5/6 already ready"; } @@ -890,7 +890,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 6/6 already ready"; } @@ -1042,7 +1042,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 1/7 already ready"; } @@ -1064,7 +1064,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 2/7 already ready"; } @@ -1086,7 +1086,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 3/7 already ready"; } @@ -1108,7 +1108,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 4/7 already ready"; } @@ -1130,7 +1130,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 5/7 already ready"; } @@ -1152,7 +1152,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 6/7 already ready"; } @@ -1174,7 +1174,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 7/7 already ready"; } @@ -1341,7 +1341,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 1/8 already ready"; } @@ -1363,7 +1363,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 2/8 already ready"; } @@ -1385,7 +1385,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 3/8 already ready"; } @@ -1407,7 +1407,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 4/8 already ready"; } @@ -1429,7 +1429,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 5/8 already ready"; } @@ -1451,7 +1451,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 6/8 already ready"; } @@ -1473,7 +1473,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 7/8 already ready"; } @@ -1495,7 +1495,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 8/8 already ready"; } @@ -1677,7 +1677,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 1/9 already ready"; } @@ -1699,7 +1699,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 2/9 already ready"; } @@ -1721,7 +1721,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 3/9 already ready"; } @@ -1743,7 +1743,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 4/9 already ready"; } @@ -1765,7 +1765,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 5/9 already ready"; } @@ -1787,7 +1787,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 6/9 already ready"; } @@ -1809,7 +1809,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 7/9 already ready"; } @@ -1831,7 +1831,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 8/9 already ready"; } @@ -1853,7 +1853,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint 9/9 already ready"; } diff --git a/src/core/lib/promise/detail/seq_state.h b/src/core/lib/promise/detail/seq_state.h index b2b635f98bc..245b8ac26f6 100644 --- a/src/core/lib/promise/detail/seq_state.h +++ b/src/core/lib/promise/detail/seq_state.h @@ -138,24 +138,21 @@ struct SeqState { GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Poll PollOnce() { switch (state) { case State::kState0: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 1/2"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/2"; auto result = prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 1/2 gets " - << (p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/2 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { return PromiseResultTraits0::template ReturnValue( @@ -171,16 +168,14 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState1: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 2/2"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/2"; auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 2/2 gets " - << (result.ready() ? "ready" : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/2 gets " + << (result.ready() ? "ready" : "pending"); auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p)); @@ -271,24 +266,21 @@ struct SeqState { GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Poll PollOnce() { switch (state) { case State::kState0: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 1/3"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/3"; auto result = prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 1/3 gets " - << (p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/3 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { return PromiseResultTraits0::template ReturnValue( @@ -303,24 +295,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 2/3"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/3"; auto result = prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 2/3 gets " - << (p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/3 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { return PromiseResultTraits1::template ReturnValue( @@ -336,16 +325,14 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState2: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 3/3"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/3"; auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 3/3 gets " - << (result.ready() ? "ready" : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/3 gets " + << (result.ready() ? "ready" : "pending"); auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p)); @@ -460,24 +447,21 @@ struct SeqState { GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Poll PollOnce() { switch (state) { case State::kState0: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 1/4"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/4"; auto result = prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 1/4 gets " - << (p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/4 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { return PromiseResultTraits0::template ReturnValue( @@ -492,24 +476,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 2/4"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/4"; auto result = prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 2/4 gets " - << (p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/4 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { return PromiseResultTraits1::template ReturnValue( @@ -524,24 +505,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 3/4"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/4"; auto result = prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 3/4 gets " - << (p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/4 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { return PromiseResultTraits2::template ReturnValue( @@ -557,16 +535,14 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState3: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 4/4"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/4"; auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 4/4 gets " - << (result.ready() ? "ready" : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/4 gets " + << (result.ready() ? "ready" : "pending"); auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p)); @@ -703,24 +679,21 @@ struct SeqState { GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Poll PollOnce() { switch (state) { case State::kState0: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 1/5"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/5"; auto result = prior.prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 1/5 gets " - << (p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/5 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { return PromiseResultTraits0::template ReturnValue( @@ -735,24 +708,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 2/5"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/5"; auto result = prior.prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 2/5 gets " - << (p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/5 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { return PromiseResultTraits1::template ReturnValue( @@ -767,24 +737,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 3/5"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/5"; auto result = prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 3/5 gets " - << (p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/5 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { return PromiseResultTraits2::template ReturnValue( @@ -799,24 +766,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 4/5"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/5"; auto result = prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 4/5 gets " - << (p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/5 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { return PromiseResultTraits3::template ReturnValue( @@ -832,16 +796,14 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState4: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 5/5"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/5"; auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 5/5 gets " - << (result.ready() ? "ready" : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/5 gets " + << (result.ready() ? "ready" : "pending"); auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p)); @@ -1009,24 +971,21 @@ struct SeqState { GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Poll PollOnce() { switch (state) { case State::kState0: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 1/6"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/6"; auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 1/6 gets " - << (p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/6 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { return PromiseResultTraits0::template ReturnValue( @@ -1042,24 +1001,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 2/6"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/6"; auto result = prior.prior.prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 2/6 gets " - << (p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/6 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { return PromiseResultTraits1::template ReturnValue( @@ -1074,24 +1030,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 3/6"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/6"; auto result = prior.prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 3/6 gets " - << (p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/6 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { return PromiseResultTraits2::template ReturnValue( @@ -1106,24 +1059,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 4/6"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/6"; auto result = prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 4/6 gets " - << (p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/6 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { return PromiseResultTraits3::template ReturnValue( @@ -1138,24 +1088,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 5/6"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/6"; auto result = prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 5/6 gets " - << (p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/6 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { return PromiseResultTraits4::template ReturnValue( @@ -1171,16 +1118,14 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState5: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 6/6"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/6"; auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 6/6 gets " - << (result.ready() ? "ready" : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/6 gets " + << (result.ready() ? "ready" : "pending"); auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p)); @@ -1375,24 +1320,21 @@ struct SeqState { GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Poll PollOnce() { switch (state) { case State::kState0: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 1/7"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/7"; auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 1/7 gets " - << (p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/7 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { return PromiseResultTraits0::template ReturnValue( @@ -1408,24 +1350,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 2/7"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/7"; auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 2/7 gets " - << (p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/7 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { return PromiseResultTraits1::template ReturnValue( @@ -1441,24 +1380,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 3/7"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/7"; auto result = prior.prior.prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 3/7 gets " - << (p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/7 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { return PromiseResultTraits2::template ReturnValue( @@ -1473,24 +1409,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 4/7"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/7"; auto result = prior.prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 4/7 gets " - << (p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/7 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { return PromiseResultTraits3::template ReturnValue( @@ -1505,24 +1438,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 5/7"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/7"; auto result = prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 5/7 gets " - << (p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/7 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { return PromiseResultTraits4::template ReturnValue( @@ -1537,24 +1467,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 6/7"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/7"; auto result = prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 6/7 gets " - << (p != nullptr - ? (PromiseResultTraits5::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits5::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/7 gets " + << (p != nullptr + ? (PromiseResultTraits5::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits5::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits5::IsOk(*p)) { return PromiseResultTraits5::template ReturnValue( @@ -1570,16 +1497,14 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState6: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 7/7"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 7/7"; auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 7/7 gets " - << (result.ready() ? "ready" : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 7/7 gets " + << (result.ready() ? "ready" : "pending"); auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p)); @@ -1802,25 +1727,22 @@ struct SeqState { GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Poll PollOnce() { switch (state) { case State::kState0: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 1/8"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/8"; auto result = prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 1/8 gets " - << (p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/8 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { return PromiseResultTraits0::template ReturnValue( @@ -1837,24 +1759,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 2/8"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/8"; auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 2/8 gets " - << (p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/8 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { return PromiseResultTraits1::template ReturnValue( @@ -1870,24 +1789,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 3/8"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/8"; auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 3/8 gets " - << (p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/8 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { return PromiseResultTraits2::template ReturnValue( @@ -1903,24 +1819,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 4/8"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/8"; auto result = prior.prior.prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 4/8 gets " - << (p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/8 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { return PromiseResultTraits3::template ReturnValue( @@ -1935,24 +1848,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 5/8"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/8"; auto result = prior.prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 5/8 gets " - << (p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/8 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { return PromiseResultTraits4::template ReturnValue( @@ -1967,24 +1877,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 6/8"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/8"; auto result = prior.prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 6/8 gets " - << (p != nullptr - ? (PromiseResultTraits5::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits5::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/8 gets " + << (p != nullptr + ? (PromiseResultTraits5::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits5::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits5::IsOk(*p)) { return PromiseResultTraits5::template ReturnValue( @@ -1999,24 +1906,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState6: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 7/8"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 7/8"; auto result = prior.current_promise(); PromiseResult6* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 7/8 gets " - << (p != nullptr - ? (PromiseResultTraits6::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits6::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 7/8 gets " + << (p != nullptr + ? (PromiseResultTraits6::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits6::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits6::IsOk(*p)) { return PromiseResultTraits6::template ReturnValue( @@ -2032,16 +1936,14 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState7: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 8/8"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 8/8"; auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 8/8 gets " - << (result.ready() ? "ready" : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 8/8 gets " + << (result.ready() ? "ready" : "pending"); auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p)); @@ -2291,25 +2193,22 @@ struct SeqState { GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Poll PollOnce() { switch (state) { case State::kState0: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 1/9"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/9"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 1/9 gets " - << (p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/9 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { return PromiseResultTraits0::template ReturnValue( @@ -2327,25 +2226,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 2/9"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/9"; auto result = prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 2/9 gets " - << (p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/9 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { return PromiseResultTraits1::template ReturnValue( @@ -2362,24 +2258,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 3/9"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/9"; auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 3/9 gets " - << (p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/9 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { return PromiseResultTraits2::template ReturnValue( @@ -2395,24 +2288,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 4/9"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/9"; auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 4/9 gets " - << (p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/9 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { return PromiseResultTraits3::template ReturnValue( @@ -2428,24 +2318,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 5/9"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/9"; auto result = prior.prior.prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 5/9 gets " - << (p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/9 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { return PromiseResultTraits4::template ReturnValue( @@ -2460,24 +2347,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 6/9"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/9"; auto result = prior.prior.prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 6/9 gets " - << (p != nullptr - ? (PromiseResultTraits5::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits5::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/9 gets " + << (p != nullptr + ? (PromiseResultTraits5::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits5::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits5::IsOk(*p)) { return PromiseResultTraits5::template ReturnValue( @@ -2492,24 +2376,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState6: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 7/9"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 7/9"; auto result = prior.prior.current_promise(); PromiseResult6* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 7/9 gets " - << (p != nullptr - ? (PromiseResultTraits6::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits6::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 7/9 gets " + << (p != nullptr + ? (PromiseResultTraits6::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits6::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits6::IsOk(*p)) { return PromiseResultTraits6::template ReturnValue( @@ -2524,24 +2405,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState7: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 8/9"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 8/9"; auto result = prior.current_promise(); PromiseResult7* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 8/9 gets " - << (p != nullptr - ? (PromiseResultTraits7::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits7::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 8/9 gets " + << (p != nullptr + ? (PromiseResultTraits7::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits7::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits7::IsOk(*p)) { return PromiseResultTraits7::template ReturnValue( @@ -2557,16 +2435,14 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState8: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 9/9"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 9/9"; auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 9/9 gets " - << (result.ready() ? "ready" : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 9/9 gets " + << (result.ready() ? "ready" : "pending"); auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p)); @@ -2851,25 +2727,22 @@ struct SeqState { GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Poll PollOnce() { switch (state) { case State::kState0: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 1/10"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/10"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .current_promise(); PromiseResult0* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 1/10 gets " - << (p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/10 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { return PromiseResultTraits0::template ReturnValue( @@ -2889,25 +2762,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 2/10"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/10"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 2/10 gets " - << (p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/10 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { return PromiseResultTraits1::template ReturnValue( @@ -2925,25 +2795,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 3/10"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/10"; auto result = prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 3/10 gets " - << (p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/10 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { return PromiseResultTraits2::template ReturnValue( @@ -2960,24 +2827,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 4/10"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/10"; auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 4/10 gets " - << (p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/10 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { return PromiseResultTraits3::template ReturnValue( @@ -2993,24 +2857,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 5/10"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/10"; auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 5/10 gets " - << (p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/10 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { return PromiseResultTraits4::template ReturnValue( @@ -3026,24 +2887,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 6/10"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/10"; auto result = prior.prior.prior.prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 6/10 gets " - << (p != nullptr - ? (PromiseResultTraits5::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits5::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/10 gets " + << (p != nullptr + ? (PromiseResultTraits5::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits5::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits5::IsOk(*p)) { return PromiseResultTraits5::template ReturnValue( @@ -3058,24 +2916,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState6: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 7/10"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 7/10"; auto result = prior.prior.prior.current_promise(); PromiseResult6* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 7/10 gets " - << (p != nullptr - ? (PromiseResultTraits6::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits6::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 7/10 gets " + << (p != nullptr + ? (PromiseResultTraits6::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits6::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits6::IsOk(*p)) { return PromiseResultTraits6::template ReturnValue( @@ -3090,24 +2945,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState7: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 8/10"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 8/10"; auto result = prior.prior.current_promise(); PromiseResult7* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 8/10 gets " - << (p != nullptr - ? (PromiseResultTraits7::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits7::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 8/10 gets " + << (p != nullptr + ? (PromiseResultTraits7::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits7::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits7::IsOk(*p)) { return PromiseResultTraits7::template ReturnValue( @@ -3122,24 +2974,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState8: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 9/10"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 9/10"; auto result = prior.current_promise(); PromiseResult8* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 9/10 gets " - << (p != nullptr - ? (PromiseResultTraits8::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits8::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 9/10 gets " + << (p != nullptr + ? (PromiseResultTraits8::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits8::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits8::IsOk(*p)) { return PromiseResultTraits8::template ReturnValue( @@ -3155,16 +3004,14 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState9: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 10/10"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 10/10"; auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 10/10 gets " - << (result.ready() ? "ready" : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 10/10 gets " + << (result.ready() ? "ready" : "pending"); auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p)); @@ -3480,25 +3327,22 @@ struct SeqState { GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Poll PollOnce() { switch (state) { case State::kState0: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 1/11"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/11"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 1/11 gets " - << (p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/11 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { return PromiseResultTraits0::template ReturnValue( @@ -3519,25 +3363,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 2/11"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/11"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .current_promise(); PromiseResult1* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 2/11 gets " - << (p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/11 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { return PromiseResultTraits1::template ReturnValue( @@ -3557,25 +3398,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 3/11"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/11"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 3/11 gets " - << (p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/11 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { return PromiseResultTraits2::template ReturnValue( @@ -3593,25 +3431,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 4/11"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/11"; auto result = prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 4/11 gets " - << (p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/11 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { return PromiseResultTraits3::template ReturnValue( @@ -3628,24 +3463,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 5/11"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/11"; auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 5/11 gets " - << (p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/11 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { return PromiseResultTraits4::template ReturnValue( @@ -3661,24 +3493,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 6/11"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/11"; auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 6/11 gets " - << (p != nullptr - ? (PromiseResultTraits5::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits5::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/11 gets " + << (p != nullptr + ? (PromiseResultTraits5::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits5::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits5::IsOk(*p)) { return PromiseResultTraits5::template ReturnValue( @@ -3694,24 +3523,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState6: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 7/11"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 7/11"; auto result = prior.prior.prior.prior.current_promise(); PromiseResult6* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 7/11 gets " - << (p != nullptr - ? (PromiseResultTraits6::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits6::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 7/11 gets " + << (p != nullptr + ? (PromiseResultTraits6::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits6::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits6::IsOk(*p)) { return PromiseResultTraits6::template ReturnValue( @@ -3726,24 +3552,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState7: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 8/11"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 8/11"; auto result = prior.prior.prior.current_promise(); PromiseResult7* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 8/11 gets " - << (p != nullptr - ? (PromiseResultTraits7::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits7::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 8/11 gets " + << (p != nullptr + ? (PromiseResultTraits7::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits7::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits7::IsOk(*p)) { return PromiseResultTraits7::template ReturnValue( @@ -3758,24 +3581,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState8: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 9/11"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 9/11"; auto result = prior.prior.current_promise(); PromiseResult8* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 9/11 gets " - << (p != nullptr - ? (PromiseResultTraits8::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits8::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 9/11 gets " + << (p != nullptr + ? (PromiseResultTraits8::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits8::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits8::IsOk(*p)) { return PromiseResultTraits8::template ReturnValue( @@ -3790,24 +3610,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState9: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 10/11"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 10/11"; auto result = prior.current_promise(); PromiseResult9* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 10/11 gets " - << (p != nullptr - ? (PromiseResultTraits9::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits9::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 10/11 gets " + << (p != nullptr + ? (PromiseResultTraits9::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits9::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits9::IsOk(*p)) { return PromiseResultTraits9::template ReturnValue( @@ -3823,16 +3640,14 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState10: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 11/11"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 11/11"; auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 11/11 gets " - << (result.ready() ? "ready" : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 11/11 gets " + << (result.ready() ? "ready" : "pending"); auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p)); @@ -4179,25 +3994,22 @@ struct SeqState { GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Poll PollOnce() { switch (state) { case State::kState0: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 1/12"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/12"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 1/12 gets " - << (p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/12 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { return PromiseResultTraits0::template ReturnValue( @@ -4218,25 +4030,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 2/12"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/12"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 2/12 gets " - << (p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/12 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { return PromiseResultTraits1::template ReturnValue( @@ -4257,25 +4066,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 3/12"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/12"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .current_promise(); PromiseResult2* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 3/12 gets " - << (p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/12 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { return PromiseResultTraits2::template ReturnValue( @@ -4295,25 +4101,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 4/12"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/12"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult3* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 4/12 gets " - << (p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/12 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { return PromiseResultTraits3::template ReturnValue( @@ -4331,25 +4134,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 5/12"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/12"; auto result = prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 5/12 gets " - << (p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/12 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { return PromiseResultTraits4::template ReturnValue( @@ -4366,24 +4166,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 6/12"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/12"; auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 6/12 gets " - << (p != nullptr - ? (PromiseResultTraits5::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits5::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/12 gets " + << (p != nullptr + ? (PromiseResultTraits5::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits5::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits5::IsOk(*p)) { return PromiseResultTraits5::template ReturnValue( @@ -4399,24 +4196,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState6: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 7/12"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 7/12"; auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult6* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 7/12 gets " - << (p != nullptr - ? (PromiseResultTraits6::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits6::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 7/12 gets " + << (p != nullptr + ? (PromiseResultTraits6::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits6::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits6::IsOk(*p)) { return PromiseResultTraits6::template ReturnValue( @@ -4432,24 +4226,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState7: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 8/12"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 8/12"; auto result = prior.prior.prior.prior.current_promise(); PromiseResult7* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 8/12 gets " - << (p != nullptr - ? (PromiseResultTraits7::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits7::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 8/12 gets " + << (p != nullptr + ? (PromiseResultTraits7::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits7::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits7::IsOk(*p)) { return PromiseResultTraits7::template ReturnValue( @@ -4464,24 +4255,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState8: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 9/12"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 9/12"; auto result = prior.prior.prior.current_promise(); PromiseResult8* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 9/12 gets " - << (p != nullptr - ? (PromiseResultTraits8::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits8::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 9/12 gets " + << (p != nullptr + ? (PromiseResultTraits8::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits8::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits8::IsOk(*p)) { return PromiseResultTraits8::template ReturnValue( @@ -4496,24 +4284,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState9: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 10/12"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 10/12"; auto result = prior.prior.current_promise(); PromiseResult9* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 10/12 gets " - << (p != nullptr - ? (PromiseResultTraits9::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits9::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 10/12 gets " + << (p != nullptr + ? (PromiseResultTraits9::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits9::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits9::IsOk(*p)) { return PromiseResultTraits9::template ReturnValue( @@ -4528,24 +4313,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState10: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 11/12"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 11/12"; auto result = prior.current_promise(); PromiseResult10* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 11/12 gets " - << (p != nullptr - ? (PromiseResultTraits10::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits10::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 11/12 gets " + << (p != nullptr + ? (PromiseResultTraits10::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits10::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits10::IsOk(*p)) { return PromiseResultTraits10::template ReturnValue( @@ -4561,16 +4344,14 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState11: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 12/12"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 12/12"; auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 12/12 gets " - << (result.ready() ? "ready" : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 12/12 gets " + << (result.ready() ? "ready" : "pending"); auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p)); @@ -4950,25 +4731,22 @@ struct SeqState { GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION Poll PollOnce() { switch (state) { case State::kState0: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 1/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 1/13"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .prior.prior.prior.current_promise(); PromiseResult0* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 1/13 gets " - << (p != nullptr - ? (PromiseResultTraits0::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits0::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 1/13 gets " + << (p != nullptr + ? (PromiseResultTraits0::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits0::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits0::IsOk(*p)) { return PromiseResultTraits0::template ReturnValue( @@ -4989,25 +4767,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState1: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 2/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 2/13"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .prior.prior.current_promise(); PromiseResult1* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 2/13 gets " - << (p != nullptr - ? (PromiseResultTraits1::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits1::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 2/13 gets " + << (p != nullptr + ? (PromiseResultTraits1::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits1::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits1::IsOk(*p)) { return PromiseResultTraits1::template ReturnValue( @@ -5028,25 +4803,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState2: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 3/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 3/13"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .prior.current_promise(); PromiseResult2* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 3/13 gets " - << (p != nullptr - ? (PromiseResultTraits2::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits2::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 3/13 gets " + << (p != nullptr + ? (PromiseResultTraits2::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits2::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits2::IsOk(*p)) { return PromiseResultTraits2::template ReturnValue( @@ -5067,25 +4839,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState3: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 4/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 4/13"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.prior .current_promise(); PromiseResult3* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 4/13 gets " - << (p != nullptr - ? (PromiseResultTraits3::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits3::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 4/13 gets " + << (p != nullptr + ? (PromiseResultTraits3::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits3::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits3::IsOk(*p)) { return PromiseResultTraits3::template ReturnValue( @@ -5105,25 +4874,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState4: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 5/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 5/13"; auto result = prior.prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult4* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 5/13 gets " - << (p != nullptr - ? (PromiseResultTraits4::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits4::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 5/13 gets " + << (p != nullptr + ? (PromiseResultTraits4::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits4::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits4::IsOk(*p)) { return PromiseResultTraits4::template ReturnValue( @@ -5141,25 +4907,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState5: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 6/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 6/13"; auto result = prior.prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult5* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 6/13 gets " - << (p != nullptr - ? (PromiseResultTraits5::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits5::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 6/13 gets " + << (p != nullptr + ? (PromiseResultTraits5::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits5::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits5::IsOk(*p)) { return PromiseResultTraits5::template ReturnValue( @@ -5176,24 +4939,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState6: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 7/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 7/13"; auto result = prior.prior.prior.prior.prior.prior.current_promise(); PromiseResult6* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 7/13 gets " - << (p != nullptr - ? (PromiseResultTraits6::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits6::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 7/13 gets " + << (p != nullptr + ? (PromiseResultTraits6::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits6::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits6::IsOk(*p)) { return PromiseResultTraits6::template ReturnValue( @@ -5209,24 +4969,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState7: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 8/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 8/13"; auto result = prior.prior.prior.prior.prior.current_promise(); PromiseResult7* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 8/13 gets " - << (p != nullptr - ? (PromiseResultTraits7::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits7::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 8/13 gets " + << (p != nullptr + ? (PromiseResultTraits7::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits7::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits7::IsOk(*p)) { return PromiseResultTraits7::template ReturnValue( @@ -5242,24 +4999,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState8: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 9/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 9/13"; auto result = prior.prior.prior.prior.current_promise(); PromiseResult8* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 9/13 gets " - << (p != nullptr - ? (PromiseResultTraits8::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits8::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 9/13 gets " + << (p != nullptr + ? (PromiseResultTraits8::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits8::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits8::IsOk(*p)) { return PromiseResultTraits8::template ReturnValue( @@ -5274,24 +5028,21 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState9: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 10/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 10/13"; auto result = prior.prior.prior.current_promise(); PromiseResult9* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 10/13 gets " - << (p != nullptr - ? (PromiseResultTraits9::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits9::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 10/13 gets " + << (p != nullptr + ? (PromiseResultTraits9::IsOk(*p) + ? "ready" + : absl::StrCat("early-error:", + PromiseResultTraits9::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits9::IsOk(*p)) { return PromiseResultTraits9::template ReturnValue( @@ -5306,24 +5057,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState10: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 11/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 11/13"; auto result = prior.prior.current_promise(); PromiseResult10* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 11/13 gets " - << (p != nullptr - ? (PromiseResultTraits10::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits10::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 11/13 gets " + << (p != nullptr + ? (PromiseResultTraits10::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits10::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits10::IsOk(*p)) { return PromiseResultTraits10::template ReturnValue( @@ -5338,24 +5087,22 @@ struct SeqState { } ABSL_FALLTHROUGH_INTENDED; case State::kState11: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 12/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 12/13"; auto result = prior.current_promise(); PromiseResult11* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 12/13 gets " - << (p != nullptr - ? (PromiseResultTraits11::IsOk(*p) - ? "ready" - : absl::StrCat( - "early-error:", - PromiseResultTraits11::ErrorString(*p)) - .c_str()) - : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 12/13 gets " + << (p != nullptr + ? (PromiseResultTraits11::IsOk(*p) + ? "ready" + : absl::StrCat( + "early-error:", + PromiseResultTraits11::ErrorString(*p)) + .c_str()) + : "pending"); if (p == nullptr) return Pending{}; if (!PromiseResultTraits11::IsOk(*p)) { return PromiseResultTraits11::template ReturnValue( @@ -5371,16 +5118,14 @@ struct SeqState { ABSL_FALLTHROUGH_INTENDED; default: case State::kState12: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: begin poll step 13/13"; - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: begin poll step 13/13"; auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) - << "seq[" << this << "]: poll step 13/13 gets " - << (result.ready() ? "ready" : "pending"); - } + GRPC_TRACE_VLOG(promise_primitives, 2) + .AtLocation(whence.file(), whence.line()) + << "seq[" << this << "]: poll step 13/13 gets " + << (result.ready() ? "ready" : "pending"); auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p)); diff --git a/tools/codegen/core/gen_join.py b/tools/codegen/core/gen_join.py index d0bd3434a07..cd90390ae3c 100755 --- a/tools/codegen/core/gen_join.py +++ b/tools/codegen/core/gen_join.py @@ -79,7 +79,7 @@ struct JoinState { return Traits::template EarlyReturn(std::move(*p)); } } - } else if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { + } else { GRPC_TRACE_VLOG(promise_primitives, 2) << "join[" << this << "]: joint ${i+1}/${n} already ready"; } % endfor diff --git a/tools/codegen/core/gen_seq.py b/tools/codegen/core/gen_seq.py index f537fd63f9c..a33072270f3 100755 --- a/tools/codegen/core/gen_seq.py +++ b/tools/codegen/core/gen_seq.py @@ -133,21 +133,17 @@ tail${i}: switch (state) { % for i in range(0,n-1): case State::kState${i}: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) + GRPC_TRACE_VLOG(promise_primitives, 2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step ${i+1}/${n}"; - } auto result = ${"prior."*(n-1-i)}current_promise(); PromiseResult${i}* p = result.value_if_ready(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) + GRPC_TRACE_VLOG(promise_primitives, 2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step ${i+1}/${n} gets " << (p != nullptr ? (PromiseResultTraits${i}::IsOk(*p) ? "ready" : absl::StrCat("early-error:", PromiseResultTraits${i}::ErrorString(*p)).c_str()) : "pending"); - } if (p == nullptr) return Pending{}; if (!PromiseResultTraits${i}::IsOk(*p)) { return PromiseResultTraits${i}::template ReturnValue(std::move(*p)); @@ -162,16 +158,12 @@ tail${i}: % endfor default: case State::kState${n-1}: { - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) + GRPC_TRACE_VLOG(promise_primitives, 2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: begin poll step ${n}/${n}"; - } auto result = current_promise(); - if (GRPC_TRACE_FLAG_ENABLED(promise_primitives)) { - VLOG(2).AtLocation(whence.file(), whence.line()) + GRPC_TRACE_VLOG(promise_primitives, 2).AtLocation(whence.file(), whence.line()) << "seq[" << this << "]: poll step ${n}/${n} gets " << (result.ready()? "ready" : "pending"); - } auto* p = result.value_if_ready(); if (p == nullptr) return Pending{}; return Result(std::move(*p));