aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/executor.cc
diff options
context:
space:
mode:
authorGravatar Yash Tibrewal <yashkt@google.com>2017-11-21 16:52:06 -0800
committerGravatar Yash Tibrewal <yashkt@google.com>2017-11-21 16:52:06 -0800
commit7486144de0577e3e9453feec328741180d1f1bfa (patch)
tree23eb0c5490c5a0a6057407a05f62efac1181389b /src/core/lib/iomgr/executor.cc
parentd48981221542a5bd760b64e5af379adb0e846bba (diff)
parentd88421a995bf473202ecf0650eb8339a3cea3e93 (diff)
Merge master
Diffstat (limited to 'src/core/lib/iomgr/executor.cc')
-rw-r--r--src/core/lib/iomgr/executor.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/core/lib/iomgr/executor.cc b/src/core/lib/iomgr/executor.cc
index 12f336cb37..d2fb772765 100644
--- a/src/core/lib/iomgr/executor.cc
+++ b/src/core/lib/iomgr/executor.cc
@@ -51,8 +51,7 @@ static gpr_spinlock g_adding_thread_lock = GPR_SPINLOCK_STATIC_INITIALIZER;
GPR_TLS_DECL(g_this_thread_state);
-static grpc_tracer_flag executor_trace =
- GRPC_TRACER_INITIALIZER(false, "executor");
+grpc_core::TraceFlag executor_trace(false, "executor");
static void executor_thread(void* arg);
@@ -63,7 +62,7 @@ static size_t run_closures(grpc_closure_list list) {
while (c != nullptr) {
grpc_closure* next = c->next_data.next;
grpc_error* error = c->error_data.error;
- if (GRPC_TRACER_ON(executor_trace)) {
+ if (executor_trace.enabled()) {
#ifndef NDEBUG
gpr_log(GPR_DEBUG, "EXECUTOR: run %p [created by %s:%d]", c,
c->file_created, c->line_created);
@@ -134,7 +133,6 @@ void grpc_executor_set_threading(bool threading) {
}
void grpc_executor_init() {
- grpc_register_tracer(&executor_trace);
gpr_atm_no_barrier_store(&g_cur_threads, 0);
grpc_executor_set_threading(true);
}
@@ -149,7 +147,7 @@ static void executor_thread(void* arg) {
size_t subtract_depth = 0;
for (;;) {
- if (GRPC_TRACER_ON(executor_trace)) {
+ if (executor_trace.enabled()) {
gpr_log(GPR_DEBUG, "EXECUTOR[%d]: step (sub_depth=%" PRIdPTR ")",
(int)(ts - g_thread_state), subtract_depth);
}
@@ -160,7 +158,7 @@ static void executor_thread(void* arg) {
gpr_cv_wait(&ts->cv, &ts->mu, gpr_inf_future(GPR_CLOCK_REALTIME));
}
if (ts->shutdown) {
- if (GRPC_TRACER_ON(executor_trace)) {
+ if (executor_trace.enabled()) {
gpr_log(GPR_DEBUG, "EXECUTOR[%d]: shutdown",
(int)(ts - g_thread_state));
}
@@ -171,7 +169,7 @@ static void executor_thread(void* arg) {
grpc_closure_list exec = ts->elems;
ts->elems = GRPC_CLOSURE_LIST_INIT;
gpr_mu_unlock(&ts->mu);
- if (GRPC_TRACER_ON(executor_trace)) {
+ if (executor_trace.enabled()) {
gpr_log(GPR_DEBUG, "EXECUTOR[%d]: execute", (int)(ts - g_thread_state));
}
@@ -192,7 +190,7 @@ static void executor_push(grpc_closure* closure, grpc_error* error,
retry_push = false;
size_t cur_thread_count = (size_t)gpr_atm_no_barrier_load(&g_cur_threads);
if (cur_thread_count == 0) {
- if (GRPC_TRACER_ON(executor_trace)) {
+ if (executor_trace.enabled()) {
#ifndef NDEBUG
gpr_log(GPR_DEBUG, "EXECUTOR: schedule %p (created %s:%d) inline",
closure, closure->file_created, closure->line_created);
@@ -215,7 +213,7 @@ static void executor_push(grpc_closure* closure, grpc_error* error,
bool try_new_thread;
for (;;) {
- if (GRPC_TRACER_ON(executor_trace)) {
+ if (executor_trace.enabled()) {
#ifndef NDEBUG
gpr_log(
GPR_DEBUG,