aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-11-14 18:11:22 -0800
committerGravatar Yash Tibrewal <yashkt@google.com>2017-11-14 18:11:22 -0800
commit6c26b16fe06b1cc75b4dac372f4f51f6b7d1bfc0 (patch)
tree5d9b7bbdcf125bfc103b67778349ea075b049bb4 /test/cpp
parent75122c23578e24417dcf64081c737571a9fc2dbc (diff)
Move ExecCtx to grpc_core namespace. Make exec_ctx a private static in ExecCtx and some minor changes
Diffstat (limited to 'test/cpp')
-rw-r--r--test/cpp/end2end/client_lb_end2end_test.cc2
-rw-r--r--test/cpp/end2end/grpclb_end2end_test.cc2
-rw-r--r--test/cpp/grpclb/grpclb_test.cc2
-rw-r--r--test/cpp/microbenchmarks/bm_call_create.cc8
-rw-r--r--test/cpp/microbenchmarks/bm_chttp2_hpack.cc22
-rw-r--r--test/cpp/microbenchmarks/bm_chttp2_transport.cc12
-rw-r--r--test/cpp/microbenchmarks/bm_closure.cc66
-rw-r--r--test/cpp/microbenchmarks/bm_cq.cc6
-rw-r--r--test/cpp/microbenchmarks/bm_cq_multiple_threads.cc2
-rw-r--r--test/cpp/microbenchmarks/bm_error.cc6
-rw-r--r--test/cpp/microbenchmarks/bm_fullstack_trickle.cc2
-rw-r--r--test/cpp/microbenchmarks/bm_metadata.cc26
-rw-r--r--test/cpp/microbenchmarks/bm_pollset.cc12
-rw-r--r--test/cpp/microbenchmarks/fullstack_fixtures.h2
-rw-r--r--test/cpp/naming/resolver_component_test.cc8
-rw-r--r--test/cpp/performance/writes_per_rpc_test.cc2
16 files changed, 90 insertions, 90 deletions
diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc
index 4cf39eab48..d428985034 100644
--- a/test/cpp/end2end/client_lb_end2end_test.cc
+++ b/test/cpp/end2end/client_lb_end2end_test.cc
@@ -112,7 +112,7 @@ class ClientLbEnd2endTest : public ::testing::Test {
}
void SetNextResolution(const std::vector<int>& ports) {
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_lb_addresses* addresses = grpc_lb_addresses_create(ports.size(), NULL);
for (size_t i = 0; i < ports.size(); ++i) {
char* lb_uri_str;
diff --git a/test/cpp/end2end/grpclb_end2end_test.cc b/test/cpp/end2end/grpclb_end2end_test.cc
index 962d5a7e68..c5c53b8b8a 100644
--- a/test/cpp/end2end/grpclb_end2end_test.cc
+++ b/test/cpp/end2end/grpclb_end2end_test.cc
@@ -451,7 +451,7 @@ class GrpclbEnd2endTest : public ::testing::Test {
};
void SetNextResolution(const std::vector<AddressData>& address_data) {
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_lb_addresses* addresses =
grpc_lb_addresses_create(address_data.size(), nullptr);
for (size_t i = 0; i < address_data.size(); ++i) {
diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc
index 6f6dd3c4df..31103d9696 100644
--- a/test/cpp/grpclb/grpclb_test.cc
+++ b/test/cpp/grpclb/grpclb_test.cc
@@ -558,7 +558,7 @@ static void perform_request(client_fixture* cf) {
#define BALANCERS_NAME "lb.name"
static void setup_client(const server_fixture* lb_server,
const server_fixture* backends, client_fixture* cf) {
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
char* expected_target_names = NULL;
const char* backends_name = lb_server->servers_hostport;
diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc
index 47b984bc28..bb76a2e762 100644
--- a/test/cpp/microbenchmarks/bm_call_create.cc
+++ b/test/cpp/microbenchmarks/bm_call_create.cc
@@ -521,7 +521,7 @@ static void BM_IsolatedFilter(benchmark::State& state) {
label << " #has_dummy_filter";
}
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
size_t channel_size = grpc_channel_stack_size(
filters.size() == 0 ? NULL : &filters[0], filters.size());
grpc_channel_stack* channel_stack =
@@ -534,7 +534,7 @@ static void BM_IsolatedFilter(benchmark::State& state) {
? &dummy_transport::dummy_transport
: nullptr,
"CHANNEL", channel_stack)));
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
grpc_call_stack* call_stack =
static_cast<grpc_call_stack*>(gpr_zalloc(channel_stack->call_stack_size));
grpc_millis deadline = GRPC_MILLIS_INF_FUTURE;
@@ -558,7 +558,7 @@ static void BM_IsolatedFilter(benchmark::State& state) {
typename TestOp::Op op(&test_op_data, call_stack);
grpc_call_stack_destroy(call_stack, &final_info, NULL);
op.Finish();
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
// recreate arena every 64k iterations to avoid oom
if (0 == (state.iterations() & 0xffff)) {
gpr_arena_destroy(call_args.arena);
@@ -691,7 +691,7 @@ class IsolatedCallFixture : public TrackCounters {
GPR_ASSERT(grpc_channel_stack_builder_append_filter(
builder, &isolated_call_filter::isolated_call_filter, NULL, NULL));
{
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
channel_ = grpc_channel_create_with_builder(builder, GRPC_CLIENT_CHANNEL);
}
cq_ = grpc_completion_queue_create_for_next(NULL);
diff --git a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
index f822f095a7..d4f78e60b7 100644
--- a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
+++ b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc
@@ -50,12 +50,12 @@ static grpc_slice MakeSlice(std::vector<uint8_t> bytes) {
static void BM_HpackEncoderInitDestroy(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_chttp2_hpack_compressor c;
while (state.KeepRunning()) {
grpc_chttp2_hpack_compressor_init(&c);
grpc_chttp2_hpack_compressor_destroy(&c);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
track_counters.Finish(state);
@@ -64,8 +64,8 @@ BENCHMARK(BM_HpackEncoderInitDestroy);
static void BM_HpackEncoderEncodeDeadline(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
- grpc_millis saved_now = ExecCtx::Get()->Now();
+ grpc_core::ExecCtx _local_exec_ctx;
+ grpc_millis saved_now = grpc_core::ExecCtx::Get()->Now();
grpc_metadata_batch b;
grpc_metadata_batch_init(&b);
@@ -87,7 +87,7 @@ static void BM_HpackEncoderEncodeDeadline(benchmark::State& state) {
};
grpc_chttp2_encode_header(&c, NULL, 0, &b, &hopt, &outbuf);
grpc_slice_buffer_reset_and_unref_internal(&outbuf);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
grpc_metadata_batch_destroy(&b);
grpc_chttp2_hpack_compressor_destroy(&c);
@@ -108,7 +108,7 @@ BENCHMARK(BM_HpackEncoderEncodeDeadline);
template <class Fixture>
static void BM_HpackEncoderEncodeHeader(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
static bool logged_representative_output = false;
grpc_metadata_batch b;
@@ -144,7 +144,7 @@ static void BM_HpackEncoderEncodeHeader(benchmark::State& state) {
}
}
grpc_slice_buffer_reset_and_unref_internal(&outbuf);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
grpc_metadata_batch_destroy(&b);
grpc_chttp2_hpack_compressor_destroy(&c);
@@ -425,12 +425,12 @@ BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
static void BM_HpackParserInitDestroy(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_chttp2_hpack_parser p;
while (state.KeepRunning()) {
grpc_chttp2_hpack_parser_init(&p);
grpc_chttp2_hpack_parser_destroy(&p);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
track_counters.Finish(state);
@@ -444,7 +444,7 @@ static void UnrefHeader(void* user_data, grpc_mdelem md) {
template <class Fixture, void (*OnHeader)(void*, grpc_mdelem)>
static void BM_HpackParserParseHeader(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
std::vector<grpc_slice> init_slices = Fixture::GetInitSlices();
std::vector<grpc_slice> benchmark_slices = Fixture::GetBenchmarkSlices();
grpc_chttp2_hpack_parser p;
@@ -458,7 +458,7 @@ static void BM_HpackParserParseHeader(benchmark::State& state) {
for (auto slice : benchmark_slices) {
GPR_ASSERT(GRPC_ERROR_NONE == grpc_chttp2_hpack_parser_parse(&p, slice));
}
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
for (auto slice : init_slices) grpc_slice_unref(slice);
for (auto slice : benchmark_slices) grpc_slice_unref(slice);
diff --git a/test/cpp/microbenchmarks/bm_chttp2_transport.cc b/test/cpp/microbenchmarks/bm_chttp2_transport.cc
index f6e4c2bcc4..caccde0cd9 100644
--- a/test/cpp/microbenchmarks/bm_chttp2_transport.cc
+++ b/test/cpp/microbenchmarks/bm_chttp2_transport.cc
@@ -136,7 +136,7 @@ class Fixture {
FlushExecCtx();
}
- void FlushExecCtx() { ExecCtx::Get()->Flush(); }
+ void FlushExecCtx() { grpc_core::ExecCtx::Get()->Flush(); }
~Fixture() { grpc_transport_destroy(t_); }
@@ -257,7 +257,7 @@ class Stream {
static void BM_StreamCreateDestroy(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
Fixture f(grpc::ChannelArguments(), true);
Stream s(&f);
grpc_transport_stream_op_batch op;
@@ -303,7 +303,7 @@ class RepresentativeClientInitialMetadata {
template <class Metadata>
static void BM_StreamCreateSendInitialMetadataDestroy(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
Fixture f(grpc::ChannelArguments(), true);
Stream s(&f);
grpc_transport_stream_op_batch op;
@@ -354,7 +354,7 @@ BENCHMARK_TEMPLATE(BM_StreamCreateSendInitialMetadataDestroy,
static void BM_TransportEmptyOp(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
Fixture f(grpc::ChannelArguments(), true);
Stream s(&f);
s.Init(state);
@@ -387,7 +387,7 @@ std::vector<std::unique_ptr<gpr_event>> done_events;
static void BM_TransportStreamSend(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
Fixture f(grpc::ChannelArguments(), true);
auto s = std::unique_ptr<Stream>(new Stream(&f));
s->Init(state);
@@ -517,7 +517,7 @@ static grpc_slice CreateIncomingDataSlice(size_t length, size_t frame_size) {
static void BM_TransportStreamRecv(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
Fixture f(grpc::ChannelArguments(), true);
Stream s(&f);
s.Init(state);
diff --git a/test/cpp/microbenchmarks/bm_closure.cc b/test/cpp/microbenchmarks/bm_closure.cc
index ce8a054515..64925fd3f9 100644
--- a/test/cpp/microbenchmarks/bm_closure.cc
+++ b/test/cpp/microbenchmarks/bm_closure.cc
@@ -34,7 +34,7 @@ auto& force_library_initialization = Library::get();
static void BM_NoOpExecCtx(benchmark::State& state) {
TrackCounters track_counters;
while (state.KeepRunning()) {
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
}
track_counters.Finish(state);
}
@@ -42,9 +42,9 @@ BENCHMARK(BM_NoOpExecCtx);
static void BM_WellFlushed(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
track_counters.Finish(state);
@@ -68,7 +68,7 @@ static void BM_ClosureInitAgainstCombiner(benchmark::State& state) {
TrackCounters track_counters;
grpc_combiner* combiner = grpc_combiner_create();
grpc_closure c;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
benchmark::DoNotOptimize(GRPC_CLOSURE_INIT(
&c, DoNothing, NULL, grpc_combiner_scheduler(combiner)));
@@ -83,10 +83,10 @@ static void BM_ClosureRunOnExecCtx(benchmark::State& state) {
TrackCounters track_counters;
grpc_closure c;
GRPC_CLOSURE_INIT(&c, DoNothing, NULL, grpc_schedule_on_exec_ctx);
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_CLOSURE_RUN(&c, GRPC_ERROR_NONE);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
track_counters.Finish(state);
@@ -95,7 +95,7 @@ BENCHMARK(BM_ClosureRunOnExecCtx);
static void BM_ClosureCreateAndRun(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_CLOSURE_RUN(
GRPC_CLOSURE_CREATE(DoNothing, NULL, grpc_schedule_on_exec_ctx),
@@ -108,7 +108,7 @@ BENCHMARK(BM_ClosureCreateAndRun);
static void BM_ClosureInitAndRun(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_closure c;
while (state.KeepRunning()) {
GRPC_CLOSURE_RUN(
@@ -124,10 +124,10 @@ static void BM_ClosureSchedOnExecCtx(benchmark::State& state) {
TrackCounters track_counters;
grpc_closure c;
GRPC_CLOSURE_INIT(&c, DoNothing, NULL, grpc_schedule_on_exec_ctx);
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&c, GRPC_ERROR_NONE);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
track_counters.Finish(state);
@@ -140,11 +140,11 @@ static void BM_ClosureSched2OnExecCtx(benchmark::State& state) {
grpc_closure c2;
GRPC_CLOSURE_INIT(&c1, DoNothing, NULL, grpc_schedule_on_exec_ctx);
GRPC_CLOSURE_INIT(&c2, DoNothing, NULL, grpc_schedule_on_exec_ctx);
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&c1, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c2, GRPC_ERROR_NONE);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
track_counters.Finish(state);
@@ -159,12 +159,12 @@ static void BM_ClosureSched3OnExecCtx(benchmark::State& state) {
GRPC_CLOSURE_INIT(&c1, DoNothing, NULL, grpc_schedule_on_exec_ctx);
GRPC_CLOSURE_INIT(&c2, DoNothing, NULL, grpc_schedule_on_exec_ctx);
GRPC_CLOSURE_INIT(&c3, DoNothing, NULL, grpc_schedule_on_exec_ctx);
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&c1, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c2, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c3, GRPC_ERROR_NONE);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
track_counters.Finish(state);
@@ -176,7 +176,7 @@ static void BM_AcquireMutex(benchmark::State& state) {
// for comparison with the combiner stuff below
gpr_mu mu;
gpr_mu_init(&mu);
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
gpr_mu_lock(&mu);
DoNothing(NULL, GRPC_ERROR_NONE);
@@ -192,7 +192,7 @@ static void BM_TryAcquireMutex(benchmark::State& state) {
// for comparison with the combiner stuff below
gpr_mu mu;
gpr_mu_init(&mu);
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
if (gpr_mu_trylock(&mu)) {
DoNothing(NULL, GRPC_ERROR_NONE);
@@ -210,7 +210,7 @@ static void BM_AcquireSpinlock(benchmark::State& state) {
TrackCounters track_counters;
// for comparison with the combiner stuff below
gpr_spinlock mu = GPR_SPINLOCK_INITIALIZER;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
gpr_spinlock_lock(&mu);
DoNothing(NULL, GRPC_ERROR_NONE);
@@ -225,7 +225,7 @@ static void BM_TryAcquireSpinlock(benchmark::State& state) {
TrackCounters track_counters;
// for comparison with the combiner stuff below
gpr_spinlock mu = GPR_SPINLOCK_INITIALIZER;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
if (gpr_spinlock_trylock(&mu)) {
DoNothing(NULL, GRPC_ERROR_NONE);
@@ -244,10 +244,10 @@ static void BM_ClosureSchedOnCombiner(benchmark::State& state) {
grpc_combiner* combiner = grpc_combiner_create();
grpc_closure c;
GRPC_CLOSURE_INIT(&c, DoNothing, NULL, grpc_combiner_scheduler(combiner));
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&c, GRPC_ERROR_NONE);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
GRPC_COMBINER_UNREF(combiner, "finished");
@@ -262,11 +262,11 @@ static void BM_ClosureSched2OnCombiner(benchmark::State& state) {
grpc_closure c2;
GRPC_CLOSURE_INIT(&c1, DoNothing, NULL, grpc_combiner_scheduler(combiner));
GRPC_CLOSURE_INIT(&c2, DoNothing, NULL, grpc_combiner_scheduler(combiner));
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&c1, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c2, GRPC_ERROR_NONE);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
GRPC_COMBINER_UNREF(combiner, "finished");
@@ -283,12 +283,12 @@ static void BM_ClosureSched3OnCombiner(benchmark::State& state) {
GRPC_CLOSURE_INIT(&c1, DoNothing, NULL, grpc_combiner_scheduler(combiner));
GRPC_CLOSURE_INIT(&c2, DoNothing, NULL, grpc_combiner_scheduler(combiner));
GRPC_CLOSURE_INIT(&c3, DoNothing, NULL, grpc_combiner_scheduler(combiner));
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&c1, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c2, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c3, GRPC_ERROR_NONE);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
GRPC_COMBINER_UNREF(combiner, "finished");
@@ -304,11 +304,11 @@ static void BM_ClosureSched2OnTwoCombiners(benchmark::State& state) {
grpc_closure c2;
GRPC_CLOSURE_INIT(&c1, DoNothing, NULL, grpc_combiner_scheduler(combiner1));
GRPC_CLOSURE_INIT(&c2, DoNothing, NULL, grpc_combiner_scheduler(combiner2));
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&c1, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c2, GRPC_ERROR_NONE);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
GRPC_COMBINER_UNREF(combiner1, "finished");
GRPC_COMBINER_UNREF(combiner2, "finished");
@@ -329,13 +329,13 @@ static void BM_ClosureSched4OnTwoCombiners(benchmark::State& state) {
GRPC_CLOSURE_INIT(&c2, DoNothing, NULL, grpc_combiner_scheduler(combiner2));
GRPC_CLOSURE_INIT(&c3, DoNothing, NULL, grpc_combiner_scheduler(combiner1));
GRPC_CLOSURE_INIT(&c4, DoNothing, NULL, grpc_combiner_scheduler(combiner2));
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_CLOSURE_SCHED(&c1, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c2, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c3, GRPC_ERROR_NONE);
GRPC_CLOSURE_SCHED(&c4, GRPC_ERROR_NONE);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
GRPC_COMBINER_UNREF(combiner1, "finished");
GRPC_COMBINER_UNREF(combiner2, "finished");
@@ -375,7 +375,7 @@ class Rescheduler {
static void BM_ClosureReschedOnExecCtx(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
Rescheduler r(state, grpc_schedule_on_exec_ctx);
r.ScheduleFirst();
@@ -385,11 +385,11 @@ BENCHMARK(BM_ClosureReschedOnExecCtx);
static void BM_ClosureReschedOnCombiner(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_combiner* combiner = grpc_combiner_create();
Rescheduler r(state, grpc_combiner_scheduler(combiner));
r.ScheduleFirst();
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
GRPC_COMBINER_UNREF(combiner, "finished");
track_counters.Finish(state);
@@ -398,11 +398,11 @@ BENCHMARK(BM_ClosureReschedOnCombiner);
static void BM_ClosureReschedOnCombinerFinally(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_combiner* combiner = grpc_combiner_create();
Rescheduler r(state, grpc_combiner_finally_scheduler(combiner));
r.ScheduleFirstAgainstDifferentScheduler(grpc_combiner_scheduler(combiner));
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
GRPC_COMBINER_UNREF(combiner, "finished");
track_counters.Finish(state);
diff --git a/test/cpp/microbenchmarks/bm_cq.cc b/test/cpp/microbenchmarks/bm_cq.cc
index 9fb603213a..85248ef91a 100644
--- a/test/cpp/microbenchmarks/bm_cq.cc
+++ b/test/cpp/microbenchmarks/bm_cq.cc
@@ -80,7 +80,7 @@ static void BM_Pass1Cpp(benchmark::State& state) {
while (state.KeepRunning()) {
grpc_cq_completion completion;
DummyTag dummy_tag;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
GPR_ASSERT(grpc_cq_begin_op(c_cq, &dummy_tag));
grpc_cq_end_op(c_cq, &dummy_tag, GRPC_ERROR_NONE, DoneWithCompletionOnStack,
NULL, &completion);
@@ -100,7 +100,7 @@ static void BM_Pass1Core(benchmark::State& state) {
gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
while (state.KeepRunning()) {
grpc_cq_completion completion;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
GPR_ASSERT(grpc_cq_begin_op(cq, NULL));
grpc_cq_end_op(cq, NULL, GRPC_ERROR_NONE, DoneWithCompletionOnStack, NULL,
&completion);
@@ -119,7 +119,7 @@ static void BM_Pluck1Core(benchmark::State& state) {
gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
while (state.KeepRunning()) {
grpc_cq_completion completion;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
GPR_ASSERT(grpc_cq_begin_op(cq, NULL));
grpc_cq_end_op(cq, NULL, GRPC_ERROR_NONE, DoneWithCompletionOnStack, NULL,
&completion);
diff --git a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
index 0cd9a2c361..aeeba0963f 100644
--- a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
+++ b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
@@ -76,7 +76,7 @@ static grpc_error* pollset_work(grpc_pollset* ps, grpc_pollset_worker** worker,
GPR_ASSERT(grpc_cq_begin_op(g_cq, g_tag));
grpc_cq_end_op(g_cq, g_tag, GRPC_ERROR_NONE, cq_done_cb, NULL,
(grpc_cq_completion*)gpr_malloc(sizeof(grpc_cq_completion)));
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
gpr_mu_lock(&ps->mu);
return GRPC_ERROR_NONE;
}
diff --git a/test/cpp/microbenchmarks/bm_error.cc b/test/cpp/microbenchmarks/bm_error.cc
index 8dc98ab923..d6dba1d82f 100644
--- a/test/cpp/microbenchmarks/bm_error.cc
+++ b/test/cpp/microbenchmarks/bm_error.cc
@@ -246,7 +246,7 @@ template <class Fixture>
static void BM_ErrorGetStatus(benchmark::State& state) {
TrackCounters track_counters;
Fixture fixture;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
grpc_status_code status;
grpc_slice slice;
@@ -261,7 +261,7 @@ template <class Fixture>
static void BM_ErrorGetStatusCode(benchmark::State& state) {
TrackCounters track_counters;
Fixture fixture;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
grpc_status_code status;
grpc_error_get_status(fixture.error(), fixture.deadline(), &status, NULL,
@@ -275,7 +275,7 @@ template <class Fixture>
static void BM_ErrorHttpError(benchmark::State& state) {
TrackCounters track_counters;
Fixture fixture;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
grpc_http2_error_code error;
grpc_error_get_status(fixture.error(), fixture.deadline(), NULL, NULL,
diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc
index 191c93c58d..7b04909ee1 100644
--- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc
+++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc
@@ -177,7 +177,7 @@ class TrickledCHTTP2 : public EndpointPairFixture {
}
void Step(bool update_stats) {
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
inc_time();
size_t client_backlog =
grpc_trickle_endpoint_trickle(endpoint_pair_.client);
diff --git a/test/cpp/microbenchmarks/bm_metadata.cc b/test/cpp/microbenchmarks/bm_metadata.cc
index 07fcf6af99..3a00db7a13 100644
--- a/test/cpp/microbenchmarks/bm_metadata.cc
+++ b/test/cpp/microbenchmarks/bm_metadata.cc
@@ -90,7 +90,7 @@ static void BM_MetadataFromNonInternedSlices(benchmark::State& state) {
TrackCounters track_counters;
gpr_slice k = grpc_slice_from_static_string("key");
gpr_slice v = grpc_slice_from_static_string("value");
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_MDELEM_UNREF(grpc_mdelem_create(k, v, NULL));
}
@@ -103,7 +103,7 @@ static void BM_MetadataFromInternedSlices(benchmark::State& state) {
TrackCounters track_counters;
gpr_slice k = grpc_slice_intern(grpc_slice_from_static_string("key"));
gpr_slice v = grpc_slice_intern(grpc_slice_from_static_string("value"));
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_MDELEM_UNREF(grpc_mdelem_create(k, v, NULL));
}
@@ -119,7 +119,7 @@ static void BM_MetadataFromInternedSlicesAlreadyInIndex(
TrackCounters track_counters;
gpr_slice k = grpc_slice_intern(grpc_slice_from_static_string("key"));
gpr_slice v = grpc_slice_intern(grpc_slice_from_static_string("value"));
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_mdelem seed = grpc_mdelem_create(k, v, NULL);
while (state.KeepRunning()) {
GRPC_MDELEM_UNREF(grpc_mdelem_create(k, v, NULL));
@@ -136,7 +136,7 @@ static void BM_MetadataFromInternedKey(benchmark::State& state) {
TrackCounters track_counters;
gpr_slice k = grpc_slice_intern(grpc_slice_from_static_string("key"));
gpr_slice v = grpc_slice_from_static_string("value");
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_MDELEM_UNREF(grpc_mdelem_create(k, v, NULL));
}
@@ -152,7 +152,7 @@ static void BM_MetadataFromNonInternedSlicesWithBackingStore(
gpr_slice k = grpc_slice_from_static_string("key");
gpr_slice v = grpc_slice_from_static_string("value");
char backing_store[sizeof(grpc_mdelem_data)];
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_MDELEM_UNREF(grpc_mdelem_create(
k, v, reinterpret_cast<grpc_mdelem_data*>(backing_store)));
@@ -168,7 +168,7 @@ static void BM_MetadataFromInternedSlicesWithBackingStore(
gpr_slice k = grpc_slice_intern(grpc_slice_from_static_string("key"));
gpr_slice v = grpc_slice_intern(grpc_slice_from_static_string("value"));
char backing_store[sizeof(grpc_mdelem_data)];
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_MDELEM_UNREF(grpc_mdelem_create(
k, v, reinterpret_cast<grpc_mdelem_data*>(backing_store)));
@@ -186,7 +186,7 @@ static void BM_MetadataFromInternedKeyWithBackingStore(
gpr_slice k = grpc_slice_intern(grpc_slice_from_static_string("key"));
gpr_slice v = grpc_slice_from_static_string("value");
char backing_store[sizeof(grpc_mdelem_data)];
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_MDELEM_UNREF(grpc_mdelem_create(
k, v, reinterpret_cast<grpc_mdelem_data*>(backing_store)));
@@ -201,7 +201,7 @@ static void BM_MetadataFromStaticMetadataStrings(benchmark::State& state) {
TrackCounters track_counters;
gpr_slice k = GRPC_MDSTR_STATUS;
gpr_slice v = GRPC_MDSTR_200;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_MDELEM_UNREF(grpc_mdelem_create(k, v, NULL));
}
@@ -216,7 +216,7 @@ static void BM_MetadataFromStaticMetadataStringsNotIndexed(
TrackCounters track_counters;
gpr_slice k = GRPC_MDSTR_STATUS;
gpr_slice v = GRPC_MDSTR_GZIP;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
while (state.KeepRunning()) {
GRPC_MDELEM_UNREF(grpc_mdelem_create(k, v, NULL));
}
@@ -229,7 +229,7 @@ BENCHMARK(BM_MetadataFromStaticMetadataStringsNotIndexed);
static void BM_MetadataRefUnrefExternal(benchmark::State& state) {
TrackCounters track_counters;
char backing_store[sizeof(grpc_mdelem_data)];
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_mdelem el = grpc_mdelem_create(
grpc_slice_from_static_string("a"), grpc_slice_from_static_string("b"),
reinterpret_cast<grpc_mdelem_data*>(backing_store));
@@ -245,7 +245,7 @@ BENCHMARK(BM_MetadataRefUnrefExternal);
static void BM_MetadataRefUnrefInterned(benchmark::State& state) {
TrackCounters track_counters;
char backing_store[sizeof(grpc_mdelem_data)];
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
gpr_slice k = grpc_slice_intern(grpc_slice_from_static_string("key"));
gpr_slice v = grpc_slice_intern(grpc_slice_from_static_string("value"));
grpc_mdelem el = grpc_mdelem_create(
@@ -263,7 +263,7 @@ BENCHMARK(BM_MetadataRefUnrefInterned);
static void BM_MetadataRefUnrefAllocated(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_mdelem el = grpc_mdelem_create(grpc_slice_from_static_string("a"),
grpc_slice_from_static_string("b"), NULL);
while (state.KeepRunning()) {
@@ -277,7 +277,7 @@ BENCHMARK(BM_MetadataRefUnrefAllocated);
static void BM_MetadataRefUnrefStatic(benchmark::State& state) {
TrackCounters track_counters;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_mdelem el = grpc_mdelem_create(GRPC_MDSTR_STATUS, GRPC_MDSTR_200, NULL);
while (state.KeepRunning()) {
GRPC_MDELEM_UNREF(GRPC_MDELEM_REF(el));
diff --git a/test/cpp/microbenchmarks/bm_pollset.cc b/test/cpp/microbenchmarks/bm_pollset.cc
index 7ddca45eca..59ee937fe4 100644
--- a/test/cpp/microbenchmarks/bm_pollset.cc
+++ b/test/cpp/microbenchmarks/bm_pollset.cc
@@ -50,7 +50,7 @@ static void BM_CreateDestroyPollset(benchmark::State& state) {
size_t ps_sz = grpc_pollset_size();
grpc_pollset* ps = static_cast<grpc_pollset*>(gpr_malloc(ps_sz));
gpr_mu* mu;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_closure shutdown_ps_closure;
GRPC_CLOSURE_INIT(&shutdown_ps_closure, shutdown_ps, ps,
grpc_schedule_on_exec_ctx);
@@ -60,7 +60,7 @@ static void BM_CreateDestroyPollset(benchmark::State& state) {
gpr_mu_lock(mu);
grpc_pollset_shutdown(ps, &shutdown_ps_closure);
gpr_mu_unlock(mu);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
gpr_free(ps);
@@ -114,7 +114,7 @@ static void BM_PollEmptyPollset(benchmark::State& state) {
grpc_pollset* ps = static_cast<grpc_pollset*>(gpr_zalloc(ps_sz));
gpr_mu* mu;
grpc_pollset_init(ps, &mu);
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
gpr_mu_lock(mu);
while (state.KeepRunning()) {
GRPC_ERROR_UNREF(grpc_pollset_work(ps, NULL, 0));
@@ -136,14 +136,14 @@ static void BM_PollAddFd(benchmark::State& state) {
grpc_pollset* ps = static_cast<grpc_pollset*>(gpr_zalloc(ps_sz));
gpr_mu* mu;
grpc_pollset_init(ps, &mu);
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_wakeup_fd wakeup_fd;
GPR_ASSERT(
GRPC_LOG_IF_ERROR("wakeup_fd_init", grpc_wakeup_fd_init(&wakeup_fd)));
grpc_fd* fd = grpc_fd_create(wakeup_fd.read_fd, "xxx");
while (state.KeepRunning()) {
grpc_pollset_add_fd(ps, fd);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
}
grpc_fd_orphan(fd, NULL, NULL, false /* already_closed */, "xxx");
grpc_closure shutdown_ps_closure;
@@ -218,7 +218,7 @@ static void BM_SingleThreadPollOneFd(benchmark::State& state) {
grpc_pollset* ps = static_cast<grpc_pollset*>(gpr_zalloc(ps_sz));
gpr_mu* mu;
grpc_pollset_init(ps, &mu);
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
grpc_wakeup_fd wakeup_fd;
GRPC_ERROR_UNREF(grpc_wakeup_fd_init(&wakeup_fd));
grpc_fd* wakeup = grpc_fd_create(wakeup_fd.read_fd, "wakeup_read");
diff --git a/test/cpp/microbenchmarks/fullstack_fixtures.h b/test/cpp/microbenchmarks/fullstack_fixtures.h
index 075064eca7..4efcafa8e1 100644
--- a/test/cpp/microbenchmarks/fullstack_fixtures.h
+++ b/test/cpp/microbenchmarks/fullstack_fixtures.h
@@ -166,7 +166,7 @@ class EndpointPairFixture : public BaseFixture {
fixture_configuration.ApplyCommonServerBuilderConfig(&b);
server_ = b.BuildAndStart();
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
/* add server endpoint to server_
* */
diff --git a/test/cpp/naming/resolver_component_test.cc b/test/cpp/naming/resolver_component_test.cc
index 8ba8be0ea4..ca8c26092a 100644
--- a/test/cpp/naming/resolver_component_test.cc
+++ b/test/cpp/naming/resolver_component_test.cc
@@ -171,7 +171,7 @@ void ArgsFinish(ArgsStruct* args) {
grpc_pollset_shutdown(args->pollset, &DoNothing_cb);
// exec_ctx needs to be flushed before calling grpc_pollset_destroy()
grpc_channel_args_destroy(args->channel_args);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
grpc_pollset_destroy(args->pollset);
gpr_free(args->pollset);
GRPC_COMBINER_UNREF(args->lock, NULL);
@@ -195,7 +195,7 @@ void PollPollsetUntilRequestDone(ArgsStruct* args) {
time_left.tv_sec, time_left.tv_nsec);
GPR_ASSERT(gpr_time_cmp(time_left, gpr_time_0(GPR_TIMESPAN)) >= 0);
grpc_pollset_worker* worker = NULL;
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
gpr_mu_lock(args->mu);
GRPC_LOG_IF_ERROR("pollset_work",
grpc_pollset_work(args->pollset, &worker,
@@ -274,7 +274,7 @@ void CheckResolverResultLocked(void* argsp, grpc_error* err) {
}
TEST(ResolverComponentTest, TestResolvesRelevantRecords) {
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
ArgsStruct args;
ArgsInit(&args);
args.expected_addrs = ParseExpectedAddrs(FLAGS_expected_addrs);
@@ -294,7 +294,7 @@ TEST(ResolverComponentTest, TestResolvesRelevantRecords) {
(void*)&args, grpc_combiner_scheduler(args.lock));
grpc_resolver_next_locked(resolver, &args.channel_args,
&on_resolver_result_changed);
- ExecCtx::Get()->Flush();
+ grpc_core::ExecCtx::Get()->Flush();
PollPollsetUntilRequestDone(&args);
GRPC_RESOLVER_UNREF(resolver, NULL);
ArgsFinish(&args);
diff --git a/test/cpp/performance/writes_per_rpc_test.cc b/test/cpp/performance/writes_per_rpc_test.cc
index b9514e6306..ae658ff87c 100644
--- a/test/cpp/performance/writes_per_rpc_test.cc
+++ b/test/cpp/performance/writes_per_rpc_test.cc
@@ -82,7 +82,7 @@ class EndpointPairFixture {
ApplyCommonServerBuilderConfig(&b);
server_ = b.BuildAndStart();
- ExecCtx _local_exec_ctx;
+ grpc_core::ExecCtx _local_exec_ctx;
/* add server endpoint to server_ */
{