aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2018-11-13 09:21:42 -0800
committerGravatar GitHub <noreply@github.com>2018-11-13 09:21:42 -0800
commitf50811442116df92e9af3c77e786401eee7d5c06 (patch)
treed14efdab1a191fa2c55ab1cb0a80ced93a2cdfc8 /src/core/lib
parent3580c148296cc8395df0c126f3c6b0c6e7ad8a20 (diff)
parent6873456fd935c1f4c01e89ef329b60a54ab60919 (diff)
Merge pull request #17199 from grpc/revert-17185-fix-deadstrip
Revert "Fix timer manager debug code"
Diffstat (limited to 'src/core/lib')
-rw-r--r--src/core/lib/gpr/sync_posix.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/core/lib/gpr/sync_posix.cc b/src/core/lib/gpr/sync_posix.cc
index dc6392a819..69bd609485 100644
--- a/src/core/lib/gpr/sync_posix.cc
+++ b/src/core/lib/gpr/sync_posix.cc
@@ -30,13 +30,11 @@
// For debug of the timer manager crash only.
// TODO (mxyan): remove after bug is fixed.
#ifdef GRPC_DEBUG_TIMER_MANAGER
-void GRPCDebugTimerManagerLogStats(int64_t timer_manager_init_count,
- int64_t timer_manager_shutdown_count,
- int64_t fork_count, int64_t timer_wait_err,
- int64_t timer_cv_value,
- int64_t timer_mu_value,
- int64_t abstime_sec_value,
- int64_t abstime_nsec_value);
+void (*g_grpc_debug_timer_manager_stats)(
+ int64_t timer_manager_init_count, int64_t timer_manager_shutdown_count,
+ int64_t fork_count, int64_t timer_wait_err, int64_t timer_cv_value,
+ int64_t timer_mu_value, int64_t abstime_sec_value,
+ int64_t abstime_nsec_value) = nullptr;
int64_t g_timer_manager_init_count = 0;
int64_t g_timer_manager_shutdown_count = 0;
int64_t g_fork_count = 0;
@@ -121,13 +119,15 @@ int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline) {
// For debug of the timer manager crash only.
// TODO (mxyan): remove after bug is fixed.
if (GPR_UNLIKELY(!(err == 0 || err == ETIMEDOUT || err == EAGAIN))) {
- g_timer_wait_err = err;
- g_timer_cv_value = (int64_t)cv;
- g_timer_mu_value = (int64_t)mu;
- GRPCDebugTimerManagerLogStats(
- g_timer_manager_init_count, g_timer_manager_shutdown_count,
- g_fork_count, g_timer_wait_err, g_timer_cv_value, g_timer_mu_value,
- g_abstime_sec_value, g_abstime_nsec_value);
+ if (g_grpc_debug_timer_manager_stats) {
+ g_timer_wait_err = err;
+ g_timer_cv_value = (int64_t)cv;
+ g_timer_mu_value = (int64_t)mu;
+ g_grpc_debug_timer_manager_stats(
+ g_timer_manager_init_count, g_timer_manager_shutdown_count,
+ g_fork_count, g_timer_wait_err, g_timer_cv_value, g_timer_mu_value,
+ g_abstime_sec_value, g_abstime_nsec_value);
+ }
}
#endif
GPR_ASSERT(err == 0 || err == ETIMEDOUT || err == EAGAIN);